Browse Source

完善基础控件

章政 7 years ago
parent
commit
00cbb58f9b

+ 7 - 3
UAS_DeviceMonitor/CustomerControl/Button/ButtonDeleteRow.cs

@@ -49,10 +49,14 @@ namespace UAS_DeviceMonitor.CustomerControl.Button
                 }
                 if (DeleteID.Count > 0)
                 {
-                    SystemInf.dh.DeleteDataByID(grid.TableName, grid.ID, DeleteID.ToArray());
-                    grid.RefreshData();
+                    DialogResult result = XtraMessageBox.Show("确认删除", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
+                    if (result.ToString() == "Yes")
+                    {
+                        SystemInf.dh.DeleteDataByID(grid.TableName, grid.ID, DeleteID.ToArray());
+                        grid.RefreshData();
+                    }
                 }
-                else XtraMessageBox.Show("请选择要删除的数据");
+                else XtraMessageBox.Show("请选择要删除的数据", "提示");
             }
         }
     }

+ 8 - 3
UAS_DeviceMonitor/CustomerControl/Button/ButtonSaveGrid.cs

@@ -30,11 +30,16 @@ namespace UAS_DeviceMonitor.CustomerControl.Button
 
         private void ButtonSaveGrid_Click(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)grid.DataSource;
-            if (dt != null)
+            DataTable dt = ((DataTable)grid.DataSource).GetChanges();
+            if (dt != null && dt.Rows.Count > 0)
             {
                 SystemInf.dh.SaveDataTable(dt, grid.TableName, grid.ID, grid.InsertSQL);
-                XtraMessageBox.Show("保存成功");
+                grid.RefreshData();
+                XtraMessageBox.Show("保存成功", "提示");
+            }
+            else
+            {
+                XtraMessageBox.Show("没有修改过的数据", "提示");
             }
         }
     }

+ 4 - 2
UAS_DeviceMonitor/DataOperate/DataHelper.cs

@@ -14,7 +14,6 @@ namespace UAS_DeviceMonitor.DataOperate
         public static string DBConnectionString;
         public static OracleConnection connection = null;
         OracleCommand command = null;
-        int ReconnectTime = 0;
         /// <summary>
         /// 执行构造函数的时候打开数据库的链接
         /// </summary>
@@ -809,7 +808,10 @@ namespace UAS_DeviceMonitor.DataOperate
             command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ArrayBindCount = names[1].Length;
-
+            if (names[1].Length == 0)
+            {
+                return;
+            }
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
             //将第一个数组的下标固定为0作为循环添加的参数的名称
             for (int i = 1; i <= names[0].Length; i++)

+ 0 - 32
UAS_DeviceMonitor/Entity/SystemInf.cs

@@ -5,30 +5,6 @@ namespace UAS_DeviceMonitor.Entity
 {
     class SystemInf
     {
-        /// <summary>
-        /// 连接字符串,用户登录的时候选择了数据库之后会使用该字符串作为连接字符串
-        /// </summary>
-        public static string ConnectionString;
-        /// <summary>
-        /// 用户登录的时间
-        /// </summary>
-        public static string LoginTime;
-        /// <summary>
-        /// 当前的连接数据库
-        /// </summary>
-        public static string CurrentDB;
-        /// <summary>
-        ///  配置文件默认的数据库
-        /// </summary>
-        public static string DefaultDB;
-        /// <summary>
-        /// 屏幕的宽度
-        /// </summary>
-        public static int ScreenWidth;
-        /// <summary>
-        /// 屏幕的高度
-        /// </summary>
-        public static int ScreenHeight;
         /// <summary>
         /// 当前岗位资源对应的Caller
         /// </summary>
@@ -50,14 +26,6 @@ namespace UAS_DeviceMonitor.Entity
         /// </summary>
         public static int HeadBarHeight = 0;
         /// <summary>
-        /// 当前程序进程ID
-        /// </summary>
-        public static int ProcessesID;
-        /// <summary>
-        /// 是否允许打印程序
-        /// </summary>
-        public static bool EnablePrint;
-        /// <summary>
         /// 缓存数据的文件夹
         /// </summary>
         public static string CacheFolder= Environment.GetEnvironmentVariable("windir").Substring(0, 1)+@":\UAS_MES\CacheFile\";

+ 138 - 16
UAS_DeviceMonitor/Main.Designer.cs

@@ -61,6 +61,7 @@ namespace UAS_DeviceMonitor
             this.de_address = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_wccode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PageCommandSet = new DevExpress.XtraTab.XtraTabPage();
+            this.ButtonDeleteCommand = new UAS_DeviceMonitor.CustomerControl.Button.ButtonDeleteRow();
             this.Brand_label = new DevExpress.XtraEditors.LabelControl();
             this.Brand = new DevExpress.XtraEditors.ComboBoxEdit();
             this.ButtonNewCommand = new DevExpress.XtraEditors.SimpleButton();
@@ -76,6 +77,11 @@ namespace UAS_DeviceMonitor
             this.PageDeviceKind = new DevExpress.XtraTab.XtraTabPage();
             this.PageDeviceStatus = new DevExpress.XtraTab.XtraTabPage();
             this.PagePollingSetting = new DevExpress.XtraTab.XtraTabPage();
+            this.ButtonDeleteCommandSet = new UAS_DeviceMonitor.CustomerControl.Button.ButtonDeleteRow();
+            this.ButtonNewCommandSet = new UAS_DeviceMonitor.CustomerControl.Button.ButtonAddRow();
+            this.ButtonSaveCommandSet = new UAS_DeviceMonitor.CustomerControl.Button.ButtonSaveGrid();
+            this.ButtonPausePolling = new DevExpress.XtraEditors.SimpleButton();
+            this.ButtonStartPolling = new DevExpress.XtraEditors.SimpleButton();
             this.GridPollingSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewPollSetting = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
             this.dpc_id = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -84,12 +90,16 @@ namespace UAS_DeviceMonitor
             this.dpc_plname = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_interval = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_dccode = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.PollingSetItemLookUpEdit = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
             this.dpc_function = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_enable = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_enableCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dpc_status = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_remark = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PagePolling = new DevExpress.XtraTab.XtraTabPage();
+            this.ButtonAddPolling = new UAS_DeviceMonitor.CustomerControl.Button.ButtonAddRow();
+            this.ButtonDeletePolling = new UAS_DeviceMonitor.CustomerControl.Button.ButtonDeleteRow();
+            this.ButtonSavePolling = new UAS_DeviceMonitor.CustomerControl.Button.ButtonSaveGrid();
             this.GridPolling = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewPolling = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
             this.pl_id = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -98,7 +108,6 @@ namespace UAS_DeviceMonitor
             this.pl_type = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_dccode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_remark = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.ButtonDeleteCommand = new UAS_DeviceMonitor.CustomerControl.Button.ButtonDeleteRow();
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -113,6 +122,7 @@ namespace UAS_DeviceMonitor
             this.PagePollingSetting.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PollingSetItemLookUpEdit)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).BeginInit();
             this.PagePolling.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).BeginInit();
@@ -396,6 +406,16 @@ namespace UAS_DeviceMonitor
             this.PageCommandSet.Text = "xtraTabPage1";
             this.PageCommandSet.VisibleChanged += new System.EventHandler(this.PageCommandSet_VisibleChanged);
             // 
+            // ButtonDeleteCommand
+            // 
+            this.ButtonDeleteCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonDeleteCommand.Grid = null;
+            this.ButtonDeleteCommand.Location = new System.Drawing.Point(816, 551);
+            this.ButtonDeleteCommand.Name = "ButtonDeleteCommand";
+            this.ButtonDeleteCommand.Size = new System.Drawing.Size(64, 23);
+            this.ButtonDeleteCommand.TabIndex = 6;
+            this.ButtonDeleteCommand.Text = "删除";
+            // 
             // Brand_label
             // 
             this.Brand_label.Appearance.Font = new System.Drawing.Font("微软雅黑", 12F);
@@ -537,11 +557,65 @@ namespace UAS_DeviceMonitor
             // 
             // PagePollingSetting
             // 
+            this.PagePollingSetting.Controls.Add(this.ButtonDeleteCommandSet);
+            this.PagePollingSetting.Controls.Add(this.ButtonNewCommandSet);
+            this.PagePollingSetting.Controls.Add(this.ButtonSaveCommandSet);
+            this.PagePollingSetting.Controls.Add(this.ButtonPausePolling);
+            this.PagePollingSetting.Controls.Add(this.ButtonStartPolling);
             this.PagePollingSetting.Controls.Add(this.GridPollingSetting);
             this.PagePollingSetting.Name = "PagePollingSetting";
             this.PagePollingSetting.PageVisible = false;
             this.PagePollingSetting.Size = new System.Drawing.Size(1027, 577);
             this.PagePollingSetting.Text = "xtraTabPage1";
+            this.PagePollingSetting.VisibleChanged += new System.EventHandler(this.PagePollingSetting_VisibleChanged);
+            // 
+            // ButtonDeleteCommandSet
+            // 
+            this.ButtonDeleteCommandSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonDeleteCommandSet.Grid = null;
+            this.ButtonDeleteCommandSet.Location = new System.Drawing.Point(816, 549);
+            this.ButtonDeleteCommandSet.Name = "ButtonDeleteCommandSet";
+            this.ButtonDeleteCommandSet.Size = new System.Drawing.Size(64, 23);
+            this.ButtonDeleteCommandSet.TabIndex = 9;
+            this.ButtonDeleteCommandSet.Text = "删除";
+            // 
+            // ButtonNewCommandSet
+            // 
+            this.ButtonNewCommandSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonNewCommandSet.Grid = null;
+            this.ButtonNewCommandSet.Location = new System.Drawing.Point(886, 549);
+            this.ButtonNewCommandSet.Name = "ButtonNewCommandSet";
+            this.ButtonNewCommandSet.Size = new System.Drawing.Size(64, 23);
+            this.ButtonNewCommandSet.TabIndex = 8;
+            this.ButtonNewCommandSet.Text = "新增";
+            // 
+            // ButtonSaveCommandSet
+            // 
+            this.ButtonSaveCommandSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonSaveCommandSet.Grid = null;
+            this.ButtonSaveCommandSet.Location = new System.Drawing.Point(956, 549);
+            this.ButtonSaveCommandSet.Name = "ButtonSaveCommandSet";
+            this.ButtonSaveCommandSet.Size = new System.Drawing.Size(64, 23);
+            this.ButtonSaveCommandSet.TabIndex = 7;
+            this.ButtonSaveCommandSet.Text = "保存";
+            // 
+            // ButtonPausePolling
+            // 
+            this.ButtonPausePolling.Location = new System.Drawing.Point(734, 549);
+            this.ButtonPausePolling.Name = "ButtonPausePolling";
+            this.ButtonPausePolling.Size = new System.Drawing.Size(75, 23);
+            this.ButtonPausePolling.TabIndex = 2;
+            this.ButtonPausePolling.Text = "暂停轮询";
+            this.ButtonPausePolling.Click += new System.EventHandler(this.ButtonPausePolling_Click);
+            // 
+            // ButtonStartPolling
+            // 
+            this.ButtonStartPolling.Location = new System.Drawing.Point(653, 549);
+            this.ButtonStartPolling.Name = "ButtonStartPolling";
+            this.ButtonStartPolling.Size = new System.Drawing.Size(75, 23);
+            this.ButtonStartPolling.TabIndex = 1;
+            this.ButtonStartPolling.Text = "开启轮询";
+            this.ButtonStartPolling.Click += new System.EventHandler(this.ButtonStartPolling_Click);
             // 
             // GridPollingSetting
             // 
@@ -557,9 +631,10 @@ namespace UAS_DeviceMonitor
             this.GridPollingSetting.MenuManager = this.RibbonNav;
             this.GridPollingSetting.Name = "GridPollingSetting";
             this.GridPollingSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
-            this.dpc_enableCheckEdit});
+            this.dpc_enableCheckEdit,
+            this.PollingSetItemLookUpEdit});
             this.GridPollingSetting.RowCount = 0;
-            this.GridPollingSetting.Size = new System.Drawing.Size(1027, 545);
+            this.GridPollingSetting.Size = new System.Drawing.Size(1027, 544);
             this.GridPollingSetting.TabIndex = 0;
             this.GridPollingSetting.TableName = null;
             this.GridPollingSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -624,11 +699,22 @@ namespace UAS_DeviceMonitor
             // dpc_dccode
             // 
             this.dpc_dccode.Caption = "指令编号";
+            this.dpc_dccode.ColumnEdit = this.PollingSetItemLookUpEdit;
             this.dpc_dccode.FieldName = "DPC_DCCODE";
             this.dpc_dccode.Name = "dpc_dccode";
             this.dpc_dccode.Visible = true;
             this.dpc_dccode.VisibleIndex = 4;
             // 
+            // PollingSetItemLookUpEdit
+            // 
+            this.PollingSetItemLookUpEdit.AutoHeight = false;
+            this.PollingSetItemLookUpEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.PollingSetItemLookUpEdit.Name = "PollingSetItemLookUpEdit";
+            this.PollingSetItemLookUpEdit.NullText = "";
+            this.PollingSetItemLookUpEdit.ShowFooter = false;
+            this.PollingSetItemLookUpEdit.ShowHeader = false;
+            // 
             // dpc_function
             // 
             this.dpc_function.Caption = "解析函数";
@@ -674,25 +760,60 @@ namespace UAS_DeviceMonitor
             // 
             // PagePolling
             // 
+            this.PagePolling.Controls.Add(this.ButtonAddPolling);
+            this.PagePolling.Controls.Add(this.ButtonDeletePolling);
+            this.PagePolling.Controls.Add(this.ButtonSavePolling);
             this.PagePolling.Controls.Add(this.GridPolling);
             this.PagePolling.Name = "PagePolling";
             this.PagePolling.PageVisible = false;
             this.PagePolling.Size = new System.Drawing.Size(1027, 577);
             this.PagePolling.Text = "xtraTabPage1";
             // 
+            // ButtonAddPolling
+            // 
+            this.ButtonAddPolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonAddPolling.Grid = null;
+            this.ButtonAddPolling.Location = new System.Drawing.Point(878, 551);
+            this.ButtonAddPolling.Name = "ButtonAddPolling";
+            this.ButtonAddPolling.Size = new System.Drawing.Size(64, 23);
+            this.ButtonAddPolling.TabIndex = 9;
+            this.ButtonAddPolling.Text = "新增";
+            // 
+            // ButtonDeletePolling
+            // 
+            this.ButtonDeletePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonDeletePolling.Grid = null;
+            this.ButtonDeletePolling.Location = new System.Drawing.Point(807, 551);
+            this.ButtonDeletePolling.Name = "ButtonDeletePolling";
+            this.ButtonDeletePolling.Size = new System.Drawing.Size(64, 23);
+            this.ButtonDeletePolling.TabIndex = 8;
+            this.ButtonDeletePolling.Text = "删除";
+            // 
+            // ButtonSavePolling
+            // 
+            this.ButtonSavePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonSavePolling.Grid = null;
+            this.ButtonSavePolling.Location = new System.Drawing.Point(949, 551);
+            this.ButtonSavePolling.Name = "ButtonSavePolling";
+            this.ButtonSavePolling.Size = new System.Drawing.Size(64, 23);
+            this.ButtonSavePolling.TabIndex = 7;
+            this.ButtonSavePolling.Text = "保存";
+            // 
             // GridPolling
             // 
+            this.GridPolling.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.GridPolling.Condition = null;
-            this.GridPolling.Dock = System.Windows.Forms.DockStyle.Fill;
             this.GridPolling.GetDataSQL = null;
             this.GridPolling.ID = null;
             this.GridPolling.InsertSQL = null;
-            this.GridPolling.Location = new System.Drawing.Point(0, 0);
+            this.GridPolling.Location = new System.Drawing.Point(3, -3);
             this.GridPolling.MainView = this.GridViewPolling;
             this.GridPolling.MenuManager = this.RibbonNav;
             this.GridPolling.Name = "GridPolling";
             this.GridPolling.RowCount = 0;
-            this.GridPolling.Size = new System.Drawing.Size(1027, 577);
+            this.GridPolling.Size = new System.Drawing.Size(1027, 549);
             this.GridPolling.TabIndex = 0;
             this.GridPolling.TableName = null;
             this.GridPolling.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -714,7 +835,7 @@ namespace UAS_DeviceMonitor
             // pl_id
             // 
             this.pl_id.Caption = "ID";
-            this.pl_id.FieldName = "pl_id";
+            this.pl_id.FieldName = "PL_ID";
             this.pl_id.Name = "pl_id";
             // 
             // pl_code
@@ -757,15 +878,6 @@ namespace UAS_DeviceMonitor
             this.pl_remark.Visible = true;
             this.pl_remark.VisibleIndex = 4;
             // 
-            // ButtonDeleteCommand
-            // 
-            this.ButtonDeleteCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-            this.ButtonDeleteCommand.Location = new System.Drawing.Point(816, 551);
-            this.ButtonDeleteCommand.Name = "ButtonDeleteCommand";
-            this.ButtonDeleteCommand.Size = new System.Drawing.Size(64, 23);
-            this.ButtonDeleteCommand.TabIndex = 6;
-            this.ButtonDeleteCommand.Text = "删除";
-            // 
             // Main
             // 
             this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;
@@ -796,6 +908,7 @@ namespace UAS_DeviceMonitor
             this.PagePollingSetting.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PollingSetItemLookUpEdit)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).EndInit();
             this.PagePolling.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).EndInit();
@@ -872,5 +985,14 @@ namespace UAS_DeviceMonitor
         private DevExpress.XtraGrid.Columns.GridColumn Choose;
         private DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit CheckEditCommandSet;
         private CustomerControl.Button.ButtonDeleteRow ButtonDeleteCommand;
+        private CustomerControl.Button.ButtonDeleteRow ButtonDeletePolling;
+        private CustomerControl.Button.ButtonSaveGrid ButtonSavePolling;
+        private CustomerControl.Button.ButtonAddRow ButtonAddPolling;
+        private SimpleButton ButtonPausePolling;
+        private SimpleButton ButtonStartPolling;
+        private CustomerControl.Button.ButtonDeleteRow ButtonDeleteCommandSet;
+        private CustomerControl.Button.ButtonAddRow ButtonNewCommandSet;
+        private CustomerControl.Button.ButtonSaveGrid ButtonSaveCommandSet;
+        private DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit PollingSetItemLookUpEdit;
     }
 }

+ 72 - 2
UAS_DeviceMonitor/Main.cs

@@ -6,6 +6,9 @@ using System.Text;
 using UAS_DeviceMonitor.Entity;
 using UAS_DeviceMonitor.Device.Command;
 using UAS_DeviceMonitor.PublicMethod;
+using DevExpress.XtraEditors;
+using DevExpress.XtraGrid;
+using DevExpress.XtraGrid.Views.Grid;
 
 namespace UAS_DeviceMonitor
 {
@@ -27,9 +30,23 @@ namespace UAS_DeviceMonitor
             //设备列表
             GridDeviceList.GetDataSQL = "select de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode,de_vendcode,de_vendname from device".ToUpper();
             PageControlDeviceList.Gridcontrol = GridDeviceList;
-
-            //轮询界面
+            //轮询业务
+            GridPolling.GetDataSQL = "select pl_id,pl_code,pl_name,pl_type,pl_dccode,pl_remark from polling".ToUpper();
+            GridPolling.ID = "pl_id";
+            GridPolling.TableName = "polling";
+            GridPolling.InsertSQL = "insert into polling(pl_id,pl_code,pl_name,pl_type,pl_dccode,pl_remark) values(polling_seq.nextval,:pl_code,:pl_name,:pl_type,:pl_dccode,:pl_remark)";
+            ButtonDeletePolling.Grid = GridPolling;
+            ButtonSavePolling.Grid = GridPolling;
+            ButtonAddPolling.Grid = GridPolling;
+            //轮询配置界面
             GridPollingSetting.GetDataSQL = "SELECT DPC_ID,DPC_DECODE ,DPC_PLCODE ,DPC_PLNAME ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK FROM DEVICEPOLLINGCONFIG";
+            GridPollingSetting.ID = "DPC_ID";
+            GridPollingSetting.TableName = "DEVICEPOLLINGCONFIG";
+            GridPollingSetting.InsertSQL = "insert into DEVICEPOLLINGCONFIG(DPC_ID,DPC_DECODE ,DPC_PLCODE ,DPC_PLNAME ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK) values(DEVICEPOLLINGCONFIG_seq.nextval,:DPC_DECODE ,:DPC_PLCODE ,:DPC_PLNAME ,:DPC_INTERVAL ,:DPC_DCCODE ,:DPC_FUNCTION , :DPC_ENABLE,:DPC_STATUS ,:DPC_REMARK)";
+            ButtonSaveCommandSet.Grid = GridPollingSetting;
+            ButtonNewCommandSet.Grid = GridPollingSetting;
+            ButtonDeleteCommandSet.Grid = GridPollingSetting;
+
             //指令设置界面
             GridCommandSetting.GetDataSQL = "select 0 CHOOSE,dc_id,dc_code,dc_name,dc_command from devicecommand".ToUpper();
             GridCommandSetting.TableName = "devicecommand";
@@ -39,6 +56,9 @@ namespace UAS_DeviceMonitor
             ButtonDeleteCommand.Grid = GridCommandSetting;
         }
 
+
+
+
         #region 界面通用事件
         /// <summary>
         /// 选项卡切换不同XPage
@@ -65,6 +85,32 @@ namespace UAS_DeviceMonitor
             }
         }
 
+        private void ItemComboBox_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
+        {
+            e.Value = e.Value.ToString(); e.Handled = true;
+        }
+
+        /// <summary>
+        /// Grid中的ComboBox的值设置
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ItemComboBox_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            ComboBoxEdit combox = sender as ComboBoxEdit;
+            //ComboBoxData combodata = (ComboBoxData)(combox).SelectedItem;
+            GridControl grid = combox.Parent as GridControl;
+
+            combox.EditValue = "TEST";
+
+            ////Console.WriteLine(combox.EditValue.GetType());
+            GridView myView = (grid.MainView as GridView);
+            myView.SetRowCellValue(myView.FocusedRowHandle, myView.FocusedColumn.Name, "123123");
+            combox.Text = "1231";
+            //DataTable dt = (DataTable)grid.DataSource;
+            //dt.Rows[myView.FocusedRowHandle][myView.FocusedColumn.Name.ToUpper()] = combodata.Value;
+        }
+
         /// <summary>
         /// 勾选Grid的CheckBox
         /// </summary>
@@ -134,6 +180,30 @@ namespace UAS_DeviceMonitor
             GridCommandSetting.Condition = " where dc_brand='" + BaseUtil.GetComboxEditValue(Brand) + "'";
             GridCommandSetting.RefreshData();
         }
+
+        #endregion
+
+        #region PagePollingSetting业务代码
+        private void ButtonStartPolling_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void ButtonPausePolling_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void PagePollingSetting_VisibleChanged(object sender, EventArgs e)
+        {
+            if (PagePollingSetting.PageVisible)
+            {
+                DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select dc_name,dc_code from devicecommand ", "select");
+                PollingSetItemLookUpEdit.DataSource = dt;
+                PollingSetItemLookUpEdit.DisplayMember = "DC_NAME";
+                PollingSetItemLookUpEdit.ValueMember = "DC_CODE";
+            }
+        }
         #endregion
     }
 }

+ 13 - 0
UAS_DeviceMonitor/PublicMethod/BaseUtil.cs

@@ -1,4 +1,5 @@
 using DevExpress.XtraEditors;
+using DevExpress.XtraEditors.Repository;
 using System.Data;
 using UAS_DeviceMonitor.DataOperate;
 
@@ -6,6 +7,18 @@ namespace UAS_DeviceMonitor.PublicMethod
 {
     class BaseUtil
     {
+        public static void FillComBoxEditWidthDataTable(RepositoryItemComboBox combo, string TextField, string ValueField, DataTable dt)
+        {
+            combo.Items.Clear();
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                ComboBoxData item = new ComboBoxData();
+                item.Value = dt.Rows[i][ValueField].ToString();
+                item.Text = dt.Rows[i][TextField].ToString();
+                combo.Items.Add(item);
+            }
+        }
+
         public static void FillComBoxEditWidthDataTable(ComboBoxEdit combo, string TextField, string ValueField, DataTable dt)
         {
             combo.Properties.Items.Clear();