Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 years ago
parent
commit
3e1a3add65

+ 1 - 1
UAS-MES/App.config

@@ -44,7 +44,7 @@
   <applicationSettings>
     <UAS_MES.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES.Properties.Settings>
   </applicationSettings>

+ 5 - 3
UAS-MES/CustomControl/TextBoxWithIcon/SourceStepCount.Designer.cs

@@ -39,8 +39,9 @@
             this.Count.Dock = System.Windows.Forms.DockStyle.Fill;
             this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Count.Location = new System.Drawing.Point(0, 0);
+            this.Count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.Count.Name = "Count";
-            this.Count.Size = new System.Drawing.Size(0, 27);
+            this.Count.Size = new System.Drawing.Size(0, 21);
             this.Count.TabIndex = 0;
             // 
             // CountRefresh
@@ -49,11 +50,12 @@
             // 
             // SourceStepCount
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.Count);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "SourceStepCount";
-            this.Size = new System.Drawing.Size(118, 28);
+            this.Size = new System.Drawing.Size(88, 22);
             this.Load += new System.EventHandler(this.SourceStepCount_Load);
             this.ResumeLayout(false);
             this.PerformLayout();

+ 3 - 3
UAS-MES/CustomControl/TextBoxWithIcon/SourceStepCount.cs

@@ -86,7 +86,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         public void Start()
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
             SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='"+User.UserCode+"' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
@@ -100,8 +100,8 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         private void CountRefresh_Tick(object sender, EventArgs e)
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
-            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "'and mp_inman='" + User.UserCode + "' ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
+            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
         }

+ 1 - 1
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -37,7 +37,7 @@ namespace UAS_MES.OQC
         {
             if (CheckStep())
             {
-                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "upper(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
+                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "ms_sncode='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {
                     if (temp.Rows[0]["ms_ifrework"].ToString() != "0")

+ 1 - 1
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -69,7 +69,7 @@ namespace UAS_MES.OQC
         {
             if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
             {
-                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "upper(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
+                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "ms_sncode='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {
                     if (temp.Rows[0]["ms_ifrework"].ToString() != "0")

+ 2 - 2
UAS-MES/Properties/Settings.Designer.cs

@@ -110,8 +110,8 @@ namespace UAS_MES.Properties {
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180." +
-            "218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230" +
+            ".200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 1 - 1
UAS-MES/Properties/Settings.settings

@@ -24,7 +24,7 @@
       <Value Profile="(Default)" />
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
     </Setting>
     <Setting Name="FTPAddress" Type="System.String" Scope="User">
       <Value Profile="(Default)">\\172.16.11.99\ShareTest</Value>

+ 0 - 1
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -258,7 +258,6 @@
             this.GetGridOnly.TabIndex = 82;
             this.GetGridOnly.Text = "仅获取表格";
             this.GetGridOnly.UseVisualStyleBackColor = true;
-            this.GetGridOnly.Visible = false;
             // 
             // dataGridViewCheckBoxColumn1
             // 

+ 12 - 8
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -389,9 +389,10 @@ namespace UAS_LabelMachine
                 StringBuilder ParamLog = new StringBuilder();
                 for (int i = 0; i < PIBID.Length; i++)
                 {
-                    for (int k = 0; k < Attach.Rows.Count; k++)
+                    for (int j = 0; j < SingleReport.Parameters.Count; j++)
                     {
-                        for (int j = 0; j < SingleReport.Parameters.Count; j++)
+                        SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
+                        for (int k = 0; k < Attach.Rows.Count; k++)
                         {
                             if (Attach.Rows[k][0].ToString() == SingleReport.Parameters[j].Name)
                             {
@@ -603,9 +604,10 @@ namespace UAS_LabelMachine
                         //勾选了并且未打印
                         if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString().ToLower() == "true" && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString().ToLower() != "true")
                         {
-                            for (int k = 0; k < Attach.Rows.Count; k++)
+                            for (int j = 0; j < SingleReport.Parameters.Count; j++)
                             {
-                                for (int j = 0; j < SingleReport.Parameters.Count; j++)
+                                SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
+                                for (int k = 0; k < Attach.Rows.Count; k++)
                                 {
                                     if (Attach.Rows[k][0].ToString() == SingleReport.Parameters[j].Name)
                                     {
@@ -877,9 +879,10 @@ namespace UAS_LabelMachine
         {
             if (EnablePrint)
             {
-                for (int i = 0; i < Attach.Rows.Count; i++)
+                for (int j = 0; j < MidReport.Parameters.Count; j++)
                 {
-                    for (int j = 0; j < MidReport.Parameters.Count; j++)
+                    MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
+                    for (int i = 0; i < Attach.Rows.Count; i++)
                     {
                         if (Attach.Rows[i][0].ToString() == MidReport.Parameters[j].Name)
                         {
@@ -908,9 +911,10 @@ namespace UAS_LabelMachine
         {
             if (EnablePrint)
             {
-                for (int i = 0; i < Attach.Rows.Count; i++)
+                for (int j = 0; j < OutReport.Parameters.Count; j++)
                 {
-                    for (int j = 0; j < OutReport.Parameters.Count; j++)
+                    OutReport.SetParameterValue(OutReport.Parameters[j].Name, "");
+                    for (int i = 0; i < Attach.Rows.Count; i++)
                     {
                         if (Attach.Rows[i][0].ToString() == OutReport.Parameters[j].Name)
                         {

+ 3 - 2
UAS_DeviceMonitor/DataOperate/DataHelper.cs

@@ -61,7 +61,7 @@ namespace UAS_DeviceMonitor.DataOperate
             {
                 ad.Fill(dt);
             }
-            catch (Exception e) 
+            catch (Exception e)
             {
                 LogManager.DoLog(e.StackTrace + e.Message);
                 connection = new OracleConnection(DBConnectionString);
@@ -1101,7 +1101,8 @@ namespace UAS_DeviceMonitor.DataOperate
 
         public void Dispose()
         {
-
+            command.Dispose();
+            connection.Dispose();
         }
     }
 }

+ 38 - 7
UAS_DeviceMonitor/Entity/Polling.cs

@@ -2,12 +2,13 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using UAS_DeviceMonitor.DataOperate;
 
 namespace UAS_DeviceMonitor.Entity
 {
     class Polling
     {
-        private string code;
+        private string sendRadix;
 
         private string deviceCode;
 
@@ -21,6 +22,10 @@ namespace UAS_DeviceMonitor.Entity
 
         private bool enable;
 
+        private DataHelper dh;
+
+        private string commandCode;
+
         public string DeviceCode
         {
             get
@@ -86,29 +91,55 @@ namespace UAS_DeviceMonitor.Entity
             }
         }
 
-        public string Code
+        public int Id
         {
             get
             {
-                return code;
+                return id;
             }
 
             set
             {
-                code = value;
+                id = value;
             }
         }
 
-        public int Id
+        public DataHelper Dh
         {
             get
             {
-                return id;
+                return dh;
             }
 
             set
             {
-                id = value;
+                dh = value;
+            }
+        }
+
+        public string SendRadix
+        {
+            get
+            {
+                return sendRadix;
+            }
+
+            set
+            {
+                sendRadix = value;
+            }
+        }
+
+        public string CommandCode
+        {
+            get
+            {
+                return commandCode;
+            }
+
+            set
+            {
+                commandCode = value;
             }
         }
     }

+ 104 - 150
UAS_DeviceMonitor/Main.Designer.cs

@@ -65,7 +65,7 @@ namespace UAS_DeviceMonitor
             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();
+            this.ButtonNewCommand = new UAS_DeviceMonitor.CustomerControl.Button.ButtonAddRow();
             this.ButtonSaveCommand = new UAS_DeviceMonitor.CustomerControl.Button.ButtonSaveGrid();
             this.GridCommandSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewCommandSet = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
@@ -74,7 +74,10 @@ namespace UAS_DeviceMonitor
             this.dc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_code = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_name = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.dc_command = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.dc_value = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.dc_sendcoding = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.CommandSetRepositoryItemComboBox1 = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
+            this.dc_receivecoding = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PageDeviceNetSetting = new DevExpress.XtraTab.XtraTabPage();
             this.ButtonDeleteNetConfig = new UAS_DeviceMonitor.CustomerControl.Button.ButtonDeleteRow();
             this.ButtonAddNetConfig = new UAS_DeviceMonitor.CustomerControl.Button.ButtonAddRow();
@@ -82,6 +85,7 @@ namespace UAS_DeviceMonitor
             this.GridDeviceNetSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewDeviceNetSetting = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
             this.NetSettingCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.dpc_enableCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dnc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dnc_decode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dnc_getway = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -99,20 +103,15 @@ namespace UAS_DeviceMonitor
             this.GridPollingSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewPollSetting = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
             this.PollSettingCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.dpc_enableCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dpc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_decode = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.dpc_plcode = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.dpc_interval = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.dpc_dccode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PollSettingItemSearchLookUpEdit = new DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit();
             this.PollSettingItemSearchLookUpEditView = new DevExpress.XtraGrid.Views.Grid.GridView();
-            this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
             this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
             this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
-            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.dpc_function = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_enable = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_status = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -133,8 +132,6 @@ namespace UAS_DeviceMonitor
             this.pl_dccode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_remark = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PageDeviceStatus = new DevExpress.XtraTab.XtraTabPage();
-            this.GridDeviceStatus = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
-            this.GridViewDeviceStatus = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
             this.PageWorkCenterStatus = new DevExpress.XtraTab.XtraTabPage();
             this.GridWorkCenterStatus = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewWorkCenterStatus = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
@@ -149,22 +146,20 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridCommandSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewCommandSet)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckEditCommandSet)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CommandSetRepositoryItemComboBox1)).BeginInit();
             this.PageDeviceNetSetting.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceNetSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceNetSetting)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).BeginInit();
             this.PagePollingSetting.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEdit)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEditView)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollingSetItemLookUpEdit)).BeginInit();
             this.PagePolling.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPolling)).BeginInit();
-            this.PageDeviceStatus.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.GridDeviceStatus)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceStatus)).BeginInit();
             this.PageWorkCenterStatus.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridWorkCenterStatus)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewWorkCenterStatus)).BeginInit();
@@ -274,7 +269,6 @@ namespace UAS_DeviceMonitor
             this.RibDeviceInf.ItemLinks.Add(this.ButtonCommandSet, true);
             this.RibDeviceInf.ItemLinks.Add(this.ButtonDeviceList);
             this.RibDeviceInf.ItemLinks.Add(this.ButtonDeviceNetSetting);
-            this.RibDeviceInf.ItemLinks.Add(this.ButtionPolling);
             this.RibDeviceInf.ItemLinks.Add(this.ButtonPollingSetting);
             this.RibDeviceInf.Name = "RibDeviceInf";
             this.RibDeviceInf.ShowCaptionButton = false;
@@ -496,12 +490,12 @@ namespace UAS_DeviceMonitor
             // ButtonNewCommand
             // 
             this.ButtonNewCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonNewCommand.Grid = null;
             this.ButtonNewCommand.Location = new System.Drawing.Point(886, 551);
             this.ButtonNewCommand.Name = "ButtonNewCommand";
             this.ButtonNewCommand.Size = new System.Drawing.Size(64, 23);
             this.ButtonNewCommand.TabIndex = 3;
             this.ButtonNewCommand.Text = "新增";
-            this.ButtonNewCommand.Click += new System.EventHandler(this.ButtonNewCommand_Click);
             // 
             // ButtonSaveCommand
             // 
@@ -529,7 +523,8 @@ namespace UAS_DeviceMonitor
             this.GridCommandSetting.MenuManager = this.RibbonNav;
             this.GridCommandSetting.Name = "GridCommandSetting";
             this.GridCommandSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
-            this.CheckEditCommandSet});
+            this.CheckEditCommandSet,
+            this.CommandSetRepositoryItemComboBox1});
             this.GridCommandSetting.RowCount = 0;
             this.GridCommandSetting.Size = new System.Drawing.Size(1027, 517);
             this.GridCommandSetting.TabIndex = 1;
@@ -544,7 +539,9 @@ namespace UAS_DeviceMonitor
             this.dc_id,
             this.dc_code,
             this.dc_name,
-            this.dc_command});
+            this.dc_value,
+            this.dc_sendcoding,
+            this.dc_receivecoding});
             this.GridViewCommandSet.GridControl = this.GridCommandSetting;
             this.GridViewCommandSet.IndicatorWidth = 30;
             this.GridViewCommandSet.Name = "GridViewCommandSet";
@@ -560,6 +557,7 @@ namespace UAS_DeviceMonitor
             this.CommandSetCheckedColumn.Tag = "0";
             this.CommandSetCheckedColumn.Visible = true;
             this.CommandSetCheckedColumn.VisibleIndex = 0;
+            this.CommandSetCheckedColumn.Width = 60;
             // 
             // CheckEditCommandSet
             // 
@@ -579,7 +577,7 @@ namespace UAS_DeviceMonitor
             this.dc_code.Name = "dc_code";
             this.dc_code.Visible = true;
             this.dc_code.VisibleIndex = 1;
-            this.dc_code.Width = 118;
+            this.dc_code.Width = 95;
             // 
             // dc_name
             // 
@@ -588,16 +586,43 @@ namespace UAS_DeviceMonitor
             this.dc_name.Name = "dc_name";
             this.dc_name.Visible = true;
             this.dc_name.VisibleIndex = 2;
-            this.dc_name.Width = 123;
+            this.dc_name.Width = 99;
+            // 
+            // dc_value
             // 
-            // dc_command
+            this.dc_value.Caption = "发送指令";
+            this.dc_value.FieldName = "DC_VALUE";
+            this.dc_value.Name = "dc_value";
+            this.dc_value.Visible = true;
+            this.dc_value.VisibleIndex = 3;
+            this.dc_value.Width = 291;
             // 
-            this.dc_command.Caption = "发送指令";
-            this.dc_command.FieldName = "DC_COMMAND";
-            this.dc_command.Name = "dc_command";
-            this.dc_command.Visible = true;
-            this.dc_command.VisibleIndex = 3;
-            this.dc_command.Width = 768;
+            // dc_sendcoding
+            // 
+            this.dc_sendcoding.Caption = "发送编码";
+            this.dc_sendcoding.ColumnEdit = this.CommandSetRepositoryItemComboBox1;
+            this.dc_sendcoding.FieldName = "DC_SENDCODING";
+            this.dc_sendcoding.Name = "dc_sendcoding";
+            this.dc_sendcoding.Visible = true;
+            this.dc_sendcoding.VisibleIndex = 4;
+            this.dc_sendcoding.Width = 219;
+            // 
+            // CommandSetRepositoryItemComboBox1
+            // 
+            this.CommandSetRepositoryItemComboBox1.AutoHeight = false;
+            this.CommandSetRepositoryItemComboBox1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.CommandSetRepositoryItemComboBox1.Name = "CommandSetRepositoryItemComboBox1";
+            // 
+            // dc_receivecoding
+            // 
+            this.dc_receivecoding.Caption = "接收编码";
+            this.dc_receivecoding.ColumnEdit = this.CommandSetRepositoryItemComboBox1;
+            this.dc_receivecoding.FieldName = "DC_RECEIVECODING";
+            this.dc_receivecoding.Name = "dc_receivecoding";
+            this.dc_receivecoding.Visible = true;
+            this.dc_receivecoding.VisibleIndex = 5;
+            this.dc_receivecoding.Width = 231;
             // 
             // PageDeviceNetSetting
             // 
@@ -691,6 +716,15 @@ namespace UAS_DeviceMonitor
             this.NetSettingCheckedColumn.Visible = true;
             this.NetSettingCheckedColumn.VisibleIndex = 0;
             // 
+            // dpc_enableCheckEdit
+            // 
+            this.dpc_enableCheckEdit.AutoHeight = false;
+            this.dpc_enableCheckEdit.Name = "dpc_enableCheckEdit";
+            this.dpc_enableCheckEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
+            this.dpc_enableCheckEdit.NullText = "0";
+            this.dpc_enableCheckEdit.ValueChecked = "-1";
+            this.dpc_enableCheckEdit.ValueUnchecked = "0";
+            // 
             // dnc_id
             // 
             this.dnc_id.Caption = "ID";
@@ -848,8 +882,6 @@ namespace UAS_DeviceMonitor
             this.PollSettingCheckedColumn,
             this.dpc_id,
             this.dpc_decode,
-            this.dpc_plcode,
-            this.dpc_plname,
             this.dpc_interval,
             this.dpc_dccode,
             this.dpc_function,
@@ -876,14 +908,6 @@ namespace UAS_DeviceMonitor
             this.PollSettingCheckedColumn.Visible = true;
             this.PollSettingCheckedColumn.VisibleIndex = 0;
             // 
-            // dpc_enableCheckEdit
-            // 
-            this.dpc_enableCheckEdit.AutoHeight = false;
-            this.dpc_enableCheckEdit.Name = "dpc_enableCheckEdit";
-            this.dpc_enableCheckEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
-            this.dpc_enableCheckEdit.ValueChecked = "-1";
-            this.dpc_enableCheckEdit.ValueUnchecked = "0";
-            // 
             // dpc_id
             // 
             this.dpc_id.Caption = "ID";
@@ -899,15 +923,24 @@ namespace UAS_DeviceMonitor
             this.dpc_decode.VisibleIndex = 1;
             this.dpc_decode.Width = 90;
             // 
-            // dpc_plcode
+            // dpc_interval
             // 
-            this.dpc_plcode.Caption = "业务编号";
-            this.dpc_plcode.ColumnEdit = this.PollSettingItemSearchLookUpEdit;
-            this.dpc_plcode.FieldName = "DPC_PLCODE";
-            this.dpc_plcode.Name = "dpc_plcode";
-            this.dpc_plcode.Visible = true;
-            this.dpc_plcode.VisibleIndex = 2;
-            this.dpc_plcode.Width = 90;
+            this.dpc_interval.Caption = "轮询间隔";
+            this.dpc_interval.FieldName = "DPC_INTERVAL";
+            this.dpc_interval.Name = "dpc_interval";
+            this.dpc_interval.Visible = true;
+            this.dpc_interval.VisibleIndex = 2;
+            this.dpc_interval.Width = 90;
+            // 
+            // dpc_dccode
+            // 
+            this.dpc_dccode.Caption = "指令编号";
+            this.dpc_dccode.ColumnEdit = this.PollSettingItemSearchLookUpEdit;
+            this.dpc_dccode.FieldName = "DPC_DCCODE";
+            this.dpc_dccode.Name = "dpc_dccode";
+            this.dpc_dccode.Visible = true;
+            this.dpc_dccode.VisibleIndex = 3;
+            this.dpc_dccode.Width = 90;
             // 
             // PollSettingItemSearchLookUpEdit
             // 
@@ -921,82 +954,37 @@ namespace UAS_DeviceMonitor
             // PollSettingItemSearchLookUpEditView
             // 
             this.PollSettingItemSearchLookUpEditView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
-            this.gridColumn1,
-            this.gridColumn2,
-            this.gridColumn3,
             this.gridColumn4,
+            this.gridColumn2,
             this.gridColumn5});
             this.PollSettingItemSearchLookUpEditView.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
             this.PollSettingItemSearchLookUpEditView.Name = "PollSettingItemSearchLookUpEditView";
             this.PollSettingItemSearchLookUpEditView.OptionsSelection.EnableAppearanceFocusedCell = false;
             this.PollSettingItemSearchLookUpEditView.OptionsView.ShowGroupPanel = false;
             // 
-            // gridColumn1
+            // gridColumn4
             // 
-            this.gridColumn1.Caption = "业务编号";
-            this.gridColumn1.FieldName = "PL_CODE";
-            this.gridColumn1.Name = "gridColumn1";
-            this.gridColumn1.Visible = true;
-            this.gridColumn1.VisibleIndex = 0;
+            this.gridColumn4.Caption = "指令编号";
+            this.gridColumn4.FieldName = "DC_CODE";
+            this.gridColumn4.Name = "gridColumn4";
+            this.gridColumn4.Visible = true;
+            this.gridColumn4.VisibleIndex = 0;
             // 
             // gridColumn2
             // 
-            this.gridColumn2.Caption = "业务名称";
-            this.gridColumn2.FieldName = "PL_NAME";
+            this.gridColumn2.Caption = "指令名称";
+            this.gridColumn2.FieldName = "DC_NAME";
             this.gridColumn2.Name = "gridColumn2";
             this.gridColumn2.Visible = true;
             this.gridColumn2.VisibleIndex = 1;
             // 
-            // gridColumn3
-            // 
-            this.gridColumn3.Caption = "业务类型";
-            this.gridColumn3.FieldName = "PL_TYPE";
-            this.gridColumn3.Name = "gridColumn3";
-            this.gridColumn3.Visible = true;
-            this.gridColumn3.VisibleIndex = 2;
-            // 
-            // gridColumn4
-            // 
-            this.gridColumn4.Caption = "指令编号";
-            this.gridColumn4.FieldName = "PL_DCCODE";
-            this.gridColumn4.Name = "gridColumn4";
-            this.gridColumn4.Visible = true;
-            this.gridColumn4.VisibleIndex = 3;
-            // 
             // gridColumn5
             // 
             this.gridColumn5.Caption = "备注";
-            this.gridColumn5.FieldName = "PL_REMARK";
+            this.gridColumn5.FieldName = "DC_REMARK";
             this.gridColumn5.Name = "gridColumn5";
             this.gridColumn5.Visible = true;
-            this.gridColumn5.VisibleIndex = 4;
-            // 
-            // dpc_plname
-            // 
-            this.dpc_plname.Caption = "业务名称";
-            this.dpc_plname.FieldName = "DPC_PLNAME";
-            this.dpc_plname.Name = "dpc_plname";
-            this.dpc_plname.Visible = true;
-            this.dpc_plname.VisibleIndex = 3;
-            this.dpc_plname.Width = 90;
-            // 
-            // dpc_interval
-            // 
-            this.dpc_interval.Caption = "轮询间隔";
-            this.dpc_interval.FieldName = "DPC_INTERVAL";
-            this.dpc_interval.Name = "dpc_interval";
-            this.dpc_interval.Visible = true;
-            this.dpc_interval.VisibleIndex = 4;
-            this.dpc_interval.Width = 90;
-            // 
-            // dpc_dccode
-            // 
-            this.dpc_dccode.Caption = "指令编号";
-            this.dpc_dccode.FieldName = "DPC_DCCODE";
-            this.dpc_dccode.Name = "dpc_dccode";
-            this.dpc_dccode.Visible = true;
-            this.dpc_dccode.VisibleIndex = 5;
-            this.dpc_dccode.Width = 90;
+            this.gridColumn5.VisibleIndex = 2;
             // 
             // dpc_function
             // 
@@ -1004,7 +992,7 @@ namespace UAS_DeviceMonitor
             this.dpc_function.FieldName = "DPC_FUNCTION";
             this.dpc_function.Name = "dpc_function";
             this.dpc_function.Visible = true;
-            this.dpc_function.VisibleIndex = 6;
+            this.dpc_function.VisibleIndex = 4;
             this.dpc_function.Width = 90;
             // 
             // dpc_enable
@@ -1014,7 +1002,7 @@ namespace UAS_DeviceMonitor
             this.dpc_enable.FieldName = "DPC_ENABLE";
             this.dpc_enable.Name = "dpc_enable";
             this.dpc_enable.Visible = true;
-            this.dpc_enable.VisibleIndex = 7;
+            this.dpc_enable.VisibleIndex = 5;
             this.dpc_enable.Width = 90;
             // 
             // dpc_status
@@ -1023,7 +1011,7 @@ namespace UAS_DeviceMonitor
             this.dpc_status.FieldName = "DPC_STATUS";
             this.dpc_status.Name = "dpc_status";
             this.dpc_status.Visible = true;
-            this.dpc_status.VisibleIndex = 8;
+            this.dpc_status.VisibleIndex = 6;
             this.dpc_status.Width = 90;
             // 
             // dpc_remark
@@ -1032,7 +1020,7 @@ namespace UAS_DeviceMonitor
             this.dpc_remark.FieldName = "DPC_REMARK";
             this.dpc_remark.Name = "dpc_remark";
             this.dpc_remark.Visible = true;
-            this.dpc_remark.VisibleIndex = 9;
+            this.dpc_remark.VisibleIndex = 7;
             this.dpc_remark.Width = 87;
             // 
             // POLLSETTINGSTATUSCOLUMN
@@ -1042,7 +1030,7 @@ namespace UAS_DeviceMonitor
             this.POLLSETTINGSTATUSCOLUMN.Name = "POLLSETTINGSTATUSCOLUMN";
             this.POLLSETTINGSTATUSCOLUMN.OptionsColumn.ReadOnly = true;
             this.POLLSETTINGSTATUSCOLUMN.Visible = true;
-            this.POLLSETTINGSTATUSCOLUMN.VisibleIndex = 10;
+            this.POLLSETTINGSTATUSCOLUMN.VisibleIndex = 8;
             this.POLLSETTINGSTATUSCOLUMN.Width = 98;
             // 
             // PollingSetItemLookUpEdit
@@ -1118,7 +1106,6 @@ namespace UAS_DeviceMonitor
             this.GridPolling.TableName = null;
             this.GridPolling.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.GridViewPolling});
-            this.GridPolling.VisibleChanged += new System.EventHandler(this.GridPolling_VisibleChanged);
             // 
             // GridViewPolling
             // 
@@ -1195,39 +1182,11 @@ namespace UAS_DeviceMonitor
             // 
             // PageDeviceStatus
             // 
-            this.PageDeviceStatus.Controls.Add(this.GridDeviceStatus);
             this.PageDeviceStatus.Name = "PageDeviceStatus";
             this.PageDeviceStatus.PageVisible = false;
             this.PageDeviceStatus.Size = new System.Drawing.Size(1027, 577);
             this.PageDeviceStatus.Text = "xtraTabPage1";
             // 
-            // GridDeviceStatus
-            // 
-            this.GridDeviceStatus.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.GridDeviceStatus.Condition = null;
-            this.GridDeviceStatus.GetDataSQL = null;
-            this.GridDeviceStatus.ID = null;
-            this.GridDeviceStatus.InsertSQL = null;
-            this.GridDeviceStatus.Location = new System.Drawing.Point(3, 0);
-            this.GridDeviceStatus.MainView = this.GridViewDeviceStatus;
-            this.GridDeviceStatus.MenuManager = this.RibbonNav;
-            this.GridDeviceStatus.Name = "GridDeviceStatus";
-            this.GridDeviceStatus.RowCount = 0;
-            this.GridDeviceStatus.Size = new System.Drawing.Size(1024, 577);
-            this.GridDeviceStatus.TabIndex = 0;
-            this.GridDeviceStatus.TableName = null;
-            this.GridDeviceStatus.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
-            this.GridViewDeviceStatus});
-            // 
-            // GridViewDeviceStatus
-            // 
-            this.GridViewDeviceStatus.GridControl = this.GridDeviceStatus;
-            this.GridViewDeviceStatus.IndicatorWidth = 30;
-            this.GridViewDeviceStatus.Name = "GridViewDeviceStatus";
-            this.GridViewDeviceStatus.OptionsView.ShowGroupPanel = false;
-            // 
             // PageWorkCenterStatus
             // 
             this.PageWorkCenterStatus.Controls.Add(this.GridWorkCenterStatus);
@@ -1290,22 +1249,20 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridCommandSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewCommandSet)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckEditCommandSet)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CommandSetRepositoryItemComboBox1)).EndInit();
             this.PageDeviceNetSetting.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceNetSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceNetSetting)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).EndInit();
             this.PagePollingSetting.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEdit)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEditView)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollingSetItemLookUpEdit)).EndInit();
             this.PagePolling.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPolling)).EndInit();
-            this.PageDeviceStatus.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.GridDeviceStatus)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceStatus)).EndInit();
             this.PageWorkCenterStatus.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridWorkCenterStatus)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewWorkCenterStatus)).EndInit();
@@ -1348,7 +1305,7 @@ namespace UAS_DeviceMonitor
         private DevExpress.XtraGrid.Columns.GridColumn dc_id;
         private DevExpress.XtraGrid.Columns.GridColumn dc_code;
         private DevExpress.XtraGrid.Columns.GridColumn dc_name;
-        private DevExpress.XtraGrid.Columns.GridColumn dc_command;
+        private DevExpress.XtraGrid.Columns.GridColumn dc_value;
         private AutoDataGridControl GridPolling;
         private AutoDataGridControl GridPollingSetting;
         private DevExpress.XtraGrid.Columns.GridColumn pl_id;
@@ -1359,8 +1316,6 @@ namespace UAS_DeviceMonitor
         private DevExpress.XtraGrid.Columns.GridColumn pl_remark;
         private DevExpress.XtraGrid.Columns.GridColumn dpc_id;
         private DevExpress.XtraGrid.Columns.GridColumn dpc_decode;
-        private DevExpress.XtraGrid.Columns.GridColumn dpc_plcode;
-        private DevExpress.XtraGrid.Columns.GridColumn dpc_plname;
         private DevExpress.XtraGrid.Columns.GridColumn dpc_interval;
         private DevExpress.XtraGrid.Columns.GridColumn dpc_dccode;
         private DevExpress.XtraGrid.Columns.GridColumn dpc_function;
@@ -1369,7 +1324,7 @@ namespace UAS_DeviceMonitor
         private DevExpress.XtraGrid.Columns.GridColumn dpc_remark;
         private DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit dpc_enableCheckEdit;
         private CustomerControl.Button.ButtonSaveGrid ButtonSaveCommand;
-        private SimpleButton ButtonNewCommand;
+        private CustomerControl.Button.ButtonAddRow ButtonNewCommand;
         private GridViewWithSerialNum GridViewDeviceList;
         private GridViewWithSerialNum GridViewCommandSet;
         private GridViewWithSerialNum GridViewPolling;
@@ -1393,9 +1348,6 @@ namespace UAS_DeviceMonitor
         private DevExpress.XtraGrid.Columns.GridColumn PollingCheckedColumn;
         private DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit PollSettingItemSearchLookUpEdit;
         private DevExpress.XtraGrid.Views.Grid.GridView PollSettingItemSearchLookUpEditView;
-        private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
-        private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
-        private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
         private DevExpress.XtraGrid.Columns.GridColumn gridColumn4;
         private DevExpress.XtraGrid.Columns.GridColumn gridColumn5;
         private DevExpress.XtraBars.BarButtonItem ButtonDeviceStatus;
@@ -1404,8 +1356,6 @@ namespace UAS_DeviceMonitor
         private GridViewWithSerialNum GridViewDeviceNetSetting;
         private DevExpress.XtraTab.XtraTabPage PageDeviceStatus;
         private DevExpress.XtraTab.XtraTabPage PageWorkCenterStatus;
-        private AutoDataGridControl GridDeviceStatus;
-        private GridViewWithSerialNum GridViewDeviceStatus;
         private AutoDataGridControl GridWorkCenterStatus;
         private GridViewWithSerialNum GridViewWorkCenterStatus;
         private DevExpress.XtraGrid.Columns.GridColumn dnc_id;
@@ -1420,5 +1370,9 @@ namespace UAS_DeviceMonitor
         private CustomerControl.Button.ButtonAddRow ButtonAddNetConfig;
         private CustomerControl.Button.ButtonSaveGrid ButtonSaveNetConfig;
         private DevExpress.XtraGrid.Columns.GridColumn NetSettingCheckedColumn;
+        private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
+        private DevExpress.XtraGrid.Columns.GridColumn dc_sendcoding;
+        private DevExpress.XtraGrid.Columns.GridColumn dc_receivecoding;
+        private DevExpress.XtraEditors.Repository.RepositoryItemComboBox CommandSetRepositoryItemComboBox1;
     }
 }

+ 82 - 55
UAS_DeviceMonitor/Main.cs

@@ -17,6 +17,7 @@ namespace UAS_DeviceMonitor
 
         StringBuilder sql = new StringBuilder();
         DataHelper dh;
+        ModeBusTCPServer mbt = new ModeBusTCPServer();
 
         #region 初始化代码
         public Main()
@@ -25,9 +26,39 @@ namespace UAS_DeviceMonitor
             SystemInf.dh = dh;
             InitializeComponent();
             dpc_enableCheckEdit.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
+            CommandSetRepositoryItemComboBox1.ParseEditValue += CommandSetRepositoryItemComboBox1_ParseEditValue;
             CheckEditCommandSet.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
             PollSettingItemSearchLookUpEdit.ParseEditValue += PollSettingItemSearchLookUpEdit_ParseEditValue;
             GridViewPollSetting.RowCellStyle += GridViewPollSetting_RowCellStyle;
+            #region 添加发送接收编码规则的静态值
+            ComboBoxData cbd = new ComboBoxData();
+            cbd.Text = "UTF-8";
+            cbd.Value = "UTF-8";
+            ComboBoxData cbd1 = new ComboBoxData();
+            cbd1.Text = "Hexadecimal";
+            cbd1.Value = "Hexadecimal";
+            ComboBoxData cbd2 = new ComboBoxData();
+            cbd2.Text = "ASCII";
+            cbd2.Value = "ASCII";
+            CommandSetRepositoryItemComboBox1.Items.Add(cbd);
+            CommandSetRepositoryItemComboBox1.Items.Add(cbd1);
+            CommandSetRepositoryItemComboBox1.Items.Add(cbd2);
+            #endregion
+        }
+
+        private void CommandSetRepositoryItemComboBox1_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
+        {
+            string val = "";
+            if (e.Value != null)
+            {
+                val = e.Value.ToString();
+            }
+            else
+            {
+                val = "FALSE";//默认为不选   
+            }
+            e.Value = val;
+            e.Handled = true;
         }
 
         private void PollSettingItemSearchLookUpEdit_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
@@ -41,30 +72,31 @@ 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();
             ToolPageControlDeviceList.Gridcontrol = GridDeviceList;
             //轮询业务
-            GridPolling.GetDataSQL = "select 0 CHECKEDCOLUMN,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;
+            //GridPolling.GetDataSQL = "select 0 CHECKEDCOLUMN,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 '' POLLSETTINGSTATUSCOLUMN,0 CHECKEDCOLUMN,DPC_ID,DPC_DECODE ,DPC_PLCODE ,DPC_PLNAME ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK FROM DEVICEPOLLINGCONFIG";
+            GridPollingSetting.GetDataSQL = "SELECT '' POLLSETTINGSTATUSCOLUMN,0 CHECKEDCOLUMN,DPC_ID,DPC_DECODE ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , nvl(DPC_ENABLE,0)DPC_ENABLE,DPC_STATUS ,DPC_REMARK FROM DEVICEPOLLINGCONFIG ORDER BY DPC_ID";
             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)";
+            GridPollingSetting.InsertSQL = "insert into DEVICEPOLLINGCONFIG(DPC_ID,DPC_DECODE ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK) values(DEVICEPOLLINGCONFIG_seq.nextval,:DPC_DECODE  ,: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 CHECKEDCOLUMN,dc_id,dc_code,dc_name,dc_command from devicecommand".ToUpper();
+            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_name,dc_value,dc_sendcoding,dc_receivecoding from devicecommand ".ToUpper();
             GridCommandSetting.TableName = "devicecommand";
             GridCommandSetting.ID = "dc_id";
-            GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_command) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_command)";
+            GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding)";
             ButtonSaveCommand.Grid = GridCommandSetting;
             ButtonDeleteCommand.Grid = GridCommandSetting;
+            ButtonNewCommand.Grid = GridCommandSetting;
 
             //设备联网配置界面
             GridDeviceNetSetting.GetDataSQL = "SELECT 0 CHECKEDCOLUMN,DNC_ID,DNC_DECODE,DNC_GATEWAY,DNC_UPPERIP,DNC_PORT,DNC_MAC,DNC_IP,DNC_TYPE FROM DEVICENETCONFIG order by DNC_ID";
@@ -142,18 +174,6 @@ namespace UAS_DeviceMonitor
         #endregion
 
         #region PageCommandSet业务代码(指令设置)
-        /// <summary>
-        /// 新增指令弹窗
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ButtonNewCommand_Click(object sender, EventArgs e)
-        {
-            FormNewCommand fncmd = new FormNewCommand(BaseUtil.GetComboxEditValue(Brand), Brand.Text);
-            fncmd.ShowDialog();
-            GridCommandSetting.RefreshData();
-        }
-
         /// <summary>
         /// 判断指令编号不能重复
         /// </summary>
@@ -161,6 +181,7 @@ namespace UAS_DeviceMonitor
         /// <param name="e"></param>
         private void ButtonSaveCommand_Click(object sender, EventArgs e)
         {
+            GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding)";
             ButtonSaveCommand.DoSave();
         }
 
@@ -175,28 +196,18 @@ namespace UAS_DeviceMonitor
             {
                 DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select * from devicebrand", "select");
                 BaseUtil.FillComBoxEditWidthDataTable(Brand, "db_name", "db_code", dt);
-                GridCommandSetting.Condition = " where dc_brand='" + BaseUtil.GetComboxEditValue(Brand) + "'";
+                GridCommandSetting.Condition = " where dc_debrand='" + BaseUtil.GetComboxEditValue(Brand) + "' order by dc_id";
             }
         }
 
         private void Brand_SelectedIndexChanged(object sender, EventArgs e)
         {
-            GridCommandSetting.Condition = " where dc_brand='" + BaseUtil.GetComboxEditValue(Brand) + "'";
+            GridCommandSetting.Condition = " where dc_debrand='" + BaseUtil.GetComboxEditValue(Brand) + "'";
             GridCommandSetting.RefreshData();
         }
 
         #endregion
 
-        #region PagePolling业务代码(轮询业务定义)
-        private void GridPolling_VisibleChanged(object sender, EventArgs e)
-        {
-            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
-
         #region PagePollingSetting业务代码(轮询配置)
 
         PollingTask pt = new PollingTask();
@@ -208,14 +219,17 @@ namespace UAS_DeviceMonitor
         private void ButtonStartPolling_Click(object sender, EventArgs e)
         {
             GridView grid = GridViewPollSetting;
+            mbt.Open();
             for (int i = 0; i < GridPollingSetting.RowCount; i++)
             {
                 Polling pl = new Polling();
                 pl.Id = int.Parse(GridViewPollSetting.GetRowCellValue(i, "DPC_ID").ToString());
                 pl.DeviceCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DECODE").ToString();
+                pl.CommandCode = GridViewPollSetting.GetRowCellValue(i, "DPC_DCCODE").ToString();
                 pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString());
+                pl.SendRadix = GridViewPollSetting.GetRowCellValue(i, "DPC_INTERVAL").ToString();
                 pl.Enable = GridViewPollSetting.GetRowCellValue(i, "DPC_ENABLE").ToString() != "0";
-                pl.Code = GridViewPollSetting.GetRowCellValue(i, "DPC_PLCODE").ToString();
+                pl.Dh = new DataHelper();
                 if (pl.Enable)
                 {
                     pt.AddTask(RunTask, pl);
@@ -270,9 +284,23 @@ namespace UAS_DeviceMonitor
         {
             PollingTimer timer = (PollingTimer)sender;
             Polling pl = (Polling)timer.Polling;
+            DataHelper dh = pl.Dh;
             string Decode = pl.DeviceCode;
-            string IP = dh.getFieldDataByCondition("DEVICENETCONFIG", "dnc_ip", "dnc_decode='"+ Decode + "'").ToString();
-            Console.WriteLine(IP);
+            string Dccode = pl.CommandCode;
+            DataTable dt = (DataTable)dh.ExecuteSql("select dnc_ip,dnc_port from DEVICENETCONFIG where dnc_decode='" + Decode + "'", "select");
+            DataTable dt1 = (DataTable)dh.ExecuteSql("select dc_sendcoding,dc_value from devicecommand where dc_code='" + Dccode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string IP = dt.Rows[0]["dnc_ip"].ToString() + ":" + dt.Rows[0]["dnc_port"].ToString();
+                string Coding = "";
+                string Command = "";
+                if (dt1.Rows.Count > 0)
+                {
+                    Coding = dt1.Rows[0]["dc_sendcoding"].ToString();
+                    Command = dt1.Rows[0]["dc_value"].ToString();
+                }
+                mbt.Send(IP, Coding, Command);
+            }
         }
 
         /// <summary>
@@ -313,25 +341,24 @@ namespace UAS_DeviceMonitor
                     pl.DeviceCode = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_DECODE").ToString();
                     pl.Interval = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_INTERVAL").ToString());
                     pl.Enable = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString() != "0";
-                    pl.Code = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_PLCODE").ToString();
                     if (pl.Enable)
                         pt.AddTask(RunTask, pl);
                     PollSettingPaintRowIndex.Add(e.RowHandle);
                 }
             }
-            //选择业务方案时带出指令编号
-            if (e.Column.FieldName == "DPC_PLCODE")
-            {
-                string pqf01 = e.Value.ToString();
-                DataTable dt = (DataTable)PollSettingItemSearchLookUpEdit.DataSource;
-                DataRow[] rows = dt.Select(string.Format("PL_CODE='{0}'", pqf01));
-                if (rows != null && rows.Length > 0)
-                {
-                    DataRow row = rows[0];
-                    GridViewPollSetting.SetRowCellValue(e.RowHandle, "DPC_DCCODE", row["PL_DCCODE"].ToString());
-                    GridViewPollSetting.SetRowCellValue(e.RowHandle, "DPC_PLNAME", row["PL_NAME"].ToString());
-                }
-            }
+            ////选择业务方案时带出指令编号
+            //if (e.Column.FieldName == "DPC_PLCODE")
+            //{
+            //    string pqf01 = e.Value.ToString();
+            //    DataTable dt = (DataTable)PollSettingItemSearchLookUpEdit.DataSource;
+            //    DataRow[] rows = dt.Select(string.Format("PL_CODE='{0}'", pqf01));
+            //    if (rows != null && rows.Length > 0)
+            //    {
+            //        DataRow row = rows[0];
+            //        GridViewPollSetting.SetRowCellValue(e.RowHandle, "DPC_DCCODE", row["PL_DCCODE"].ToString());
+            //        GridViewPollSetting.SetRowCellValue(e.RowHandle, "DPC_PLNAME", row["PL_NAME"].ToString());
+            //    }
+            //}
         }
 
         /// <summary>
@@ -343,10 +370,10 @@ namespace UAS_DeviceMonitor
         {
             if (PagePollingSetting.PageVisible)
             {
-                DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("SELECT PL_CODE,PL_NAME,PL_TYPE,PL_DCCODE,PL_REMARK FROM POLLING", "select");
+                DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("SELECT DC_CODE,DC_NAME,DC_REMARK FROM DEVICECOMMAND", "select");
                 PollSettingItemSearchLookUpEdit.DataSource = dt;
-                PollSettingItemSearchLookUpEdit.DisplayMember = "PL_CODE";
-                PollSettingItemSearchLookUpEdit.ValueMember = "PL_CODE";
+                PollSettingItemSearchLookUpEdit.DisplayMember = "DC_CODE";
+                PollSettingItemSearchLookUpEdit.ValueMember = "DC_CODE";
             }
         }
         #endregion

+ 68 - 78
UAS_DeviceMonitor/PublicMethod/ModeBusTCPServer.cs

@@ -70,12 +70,19 @@ namespace UAS_DeviceMonitor.PublicMethod
         {
             try
             {
+                IPHostEntry IpEntry = Dns.GetHostEntry(Dns.GetHostName());
+                for (int i = 0; i < IpEntry.AddressList.Length; i++)
+                {
+                    if (IpEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork)
+                        iP = IpEntry.AddressList[i].ToString();
+                }
+                Console.WriteLine(iP);
                 //定义一个套接字用于监听客户端发来的信息  包含3个参数(IP4寻址协议,流式连接,TCP协议)
                 socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                 //服务端发送信息 需要1个IP地址和端口号
                 IPAddress ipaddress = IPAddress.Parse(iP);
                 //将IP地址和端口号绑定到网络节点endpoint上 
-                IPEndPoint endpoint = new IPEndPoint(ipaddress, int.Parse(port));
+                IPEndPoint endpoint = new IPEndPoint(ipaddress, 8090);
                 //监听绑定的网络节点
                 socketWatch.Bind(endpoint);
                 //将套接字的监听队列长度限制为20
@@ -96,68 +103,66 @@ namespace UAS_DeviceMonitor.PublicMethod
             }
         }
 
-        //private void SEND_Click(object sender, EventArgs e)
-        //{
-        //    foreach (Socket item in list)
-        //    {
-        //        if (item != null)
-        //        {
-        //            if (item.RemoteEndPoint != null)
-        //            {
-        //                if (item.RemoteEndPoint.ToString() == SelectIP.Text)
-        //                {
-        //                    switch (Encodingbox.Text)
-        //                    {
-        //                        case "UTF-8":
-        //                            item.Send(Encoding.UTF8.GetBytes(SENDMESSAGE.Text));
-        //                            break;
-        //                        case "ASCII":
-        //                            byte[] array = Encoding.ASCII.GetBytes(SENDMESSAGE.Text.Trim());
-        //                            string str = null;
-        //                            for (int i = 0; i < array.Length; i++)
-        //                            {
-        //                                int asciicode = (int)(array[i]);
-        //                                str += Convert.ToString(asciicode) + " ";
-        //                            }
-        //                            item.Send(Encoding.ASCII.GetBytes(str));
-        //                            break;
-        //                        case "Hexadecimal":
-        //                            char[] values = SENDMESSAGE.Text.ToCharArray();
-        //                            string strH = null;
-        //                            foreach (char letter in values)
-        //                            {
-        //                                // Get the integral value of the character.
-        //                                int value = Convert.ToInt32(letter);
-        //                                // Convert the decimal value to a hexadecimal value in string form.
-        //                                string hexOutput = String.Format("{0:X}", value);
-        //                                strH += hexOutput + " ";
-        //                            }
-        //                            item.Send(Encoding.UTF8.GetBytes(strH));
-        //                            break;
-        //                    }                        
-        //                }
-        //            }
-        //            else
-        //            {   
-        //                int index = SelectIP.Items.IndexOf(item.RemoteEndPoint.ToString());
-        //                SelectIP.Items.RemoveAt(index);
-        //                if (SelectIP.Items.Count > 0)
-        //                {
-        //                    if (SelectIP.Text == "")
-        //                        SelectIP.Text = SelectIP.Items[0].ToString();
-        //                }
-        //                else
-        //                    SelectIP.Text = "";
-        //                if (list.Contains(item))
-        //                {
-        //                    list.Remove(item);
-        //                }
-        //                //关闭之前accept出来的和客户端进行通信的套接字 
-        //                item.Close();
-        //            }
-        //        }
-        //    }
-        //}
+        public void Send(string IPAddress, string EnCoding, string Command)
+        {
+            foreach (Socket item in list)
+            {
+                if (item != null)
+                {
+                    if (item.RemoteEndPoint != null)
+                    {
+                        if (item.RemoteEndPoint.ToString() == IPAddress)
+                        {
+                            switch (EnCoding)
+                            {
+                                case "UTF-8":
+                                    item.Send(Encoding.UTF8.GetBytes(Command));
+                                    break;
+                                case "ASCII":
+                                    byte[] array = Encoding.ASCII.GetBytes(Command);
+                                    string str = null;
+                                    for (int i = 0; i < array.Length; i++)
+                                    {
+                                        int asciicode = (int)(array[i]);
+                                        str += Convert.ToString(asciicode) + " ";
+                                    }
+                                    item.Send(Encoding.ASCII.GetBytes(str));
+                                    break;
+                                case "Hexadecimal":
+                                    char[] values = Command.ToCharArray();
+                                    string strH = null;
+                                    foreach (char letter in values)
+                                    {
+                                        // Get the integral value of the character.
+                                        int value = Convert.ToInt32(letter);
+                                        // Convert the decimal value to a hexadecimal value in string form.
+                                        string hexOutput = String.Format("{0:X}", value);
+                                        strH += hexOutput + " ";
+                                    }
+                                    item.Send(Encoding.UTF8.GetBytes(strH));
+                                    break;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        if (list.Count > 0)
+                        {
+                            if (IPAddress == "")
+                                IPAddress = list[0].RemoteEndPoint.ToString();
+                        }
+                        else
+                            IPAddress = "";
+                        if (list.Contains(item))
+                        {
+                            list.Remove(item);
+                        }
+                        //关闭之前accept出来的和客户端进行通信的套接字 
+                        item.Close();
+                    }
+                }
+            }
+        }
 
         private void WatchConnecting()
         {
@@ -184,9 +189,7 @@ namespace UAS_DeviceMonitor.PublicMethod
                 //客户端网络结点号  
                 string remoteEndPoint = connection.RemoteEndPoint.ToString();
                 //显示与客户端连接情况
-                //IPEndPoint netpoint = new IPEndPoint(clientIP,clientPort); 
                 IPEndPoint netpoint = connection.RemoteEndPoint as IPEndPoint;
-
                 //创建一个通信线程      
                 ParameterizedThreadStart pts = new ParameterizedThreadStart(recv);
                 Thread thread = new Thread(pts);
@@ -194,7 +197,6 @@ namespace UAS_DeviceMonitor.PublicMethod
                 thread.IsBackground = true;
                 //启动线程     
                 thread.Start(connection);
-
                 //创建一个通信线程
                 //ParameterizedThreadStart sed = new ParameterizedThreadStart(sends);
                 //Thread threadsed = new Thread(sed);
@@ -202,9 +204,7 @@ namespace UAS_DeviceMonitor.PublicMethod
                 //threadsed.IsBackground = true;
                 //启动线程
                 //threadsed.Start(connection);
-
                 list.Add(connection);
-
             }
         }
 
@@ -263,15 +263,5 @@ namespace UAS_DeviceMonitor.PublicMethod
             socketWatch.Close();
             isOpen = false;
         }
-
-        public void SendOrder(string Code)
-        {
-
-            switch (Code)
-            {
-                default:
-                    break;
-            }
-        }
     }
 }

+ 0 - 5
UAS_DeviceMonitor/PublicMethod/PollingTask.cs

@@ -41,11 +41,6 @@ namespace UAS_DeviceMonitor.PublicMethod
         public void AddTask(Action<object> action, object obj)
         {
             Task.Factory.StartNew(action, obj);
-            //Polling pl = (Polling)obj;
-            //if (!InTask.ContainsKey(pl.Code))
-            //{
-            //    InTask.Add(pl.Code, Task.Factory.StartNew(action, obj));
-            //}
         }
 
         /// 添加一系列任务

+ 2 - 0
UAS_DeviceMonitor/UAS_DeviceMonitor.csproj

@@ -35,6 +35,7 @@
     <Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="DevExpress.Printing.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="DevExpress.Sparkline.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.SpellChecker.v15.2.Core, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="DevExpress.Xpo.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
@@ -42,6 +43,7 @@
     <Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="DevExpress.XtraLayout.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="DevExpress.XtraPrinting.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraSpellChecker.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL" />
     <Reference Include="System" />
     <Reference Include="System.Configuration" />

+ 6 - 5
UAS_MES_NEW/CustomControl/TextBoxWithIcon/SourceStepCount.Designer.cs

@@ -28,9 +28,8 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             this.Count = new System.Windows.Forms.Label();
-            this.CountRefresh = new System.Windows.Forms.Timer(this.components);
+            this.CountRefresh = new System.Windows.Forms.Timer();
             this.SuspendLayout();
             // 
             // Count
@@ -39,8 +38,9 @@
             this.Count.Dock = System.Windows.Forms.DockStyle.Fill;
             this.Count.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Count.Location = new System.Drawing.Point(0, 0);
+            this.Count.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.Count.Name = "Count";
-            this.Count.Size = new System.Drawing.Size(0, 27);
+            this.Count.Size = new System.Drawing.Size(0, 21);
             this.Count.TabIndex = 0;
             // 
             // CountRefresh
@@ -49,11 +49,12 @@
             // 
             // SourceStepCount
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.Count);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "SourceStepCount";
-            this.Size = new System.Drawing.Size(118, 28);
+            this.Size = new System.Drawing.Size(88, 22);
             this.Load += new System.EventHandler(this.SourceStepCount_Load);
             this.ResumeLayout(false);
             this.PerformLayout();

+ 4 - 4
UAS_MES_NEW/CustomControl/TextBoxWithIcon/SourceStepCount.cs

@@ -86,8 +86,8 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
 
         public void Start()
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
-            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='"+User.UserCode+"' ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
+            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
             CountRefresh.Start();
@@ -100,8 +100,8 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
 
         private void CountRefresh_Tick(object sender, EventArgs e)
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where trunc(sysdate)=trunc(mp_indate) and ";
-            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "'and mp_inman='" + User.UserCode + "' ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
+            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
         }

+ 1 - 1
UAS_MES_NEW/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -37,7 +37,7 @@ namespace UAS_MES_NEW.OQC
         {
             if (CheckStep())
             {
-                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "upper(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
+                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {
                     if (temp.Rows[0]["ms_ifrework"].ToString() != "0")

+ 1 - 1
UAS_MES_NEW/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -69,7 +69,7 @@ namespace UAS_MES_NEW.OQC
         {
             if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
             {
-                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "upper(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
+                DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno" }, "(ms_sncode)='" + ms_sncode.Text.ToUpper() + "' order by ms_id desc");
                 if (temp.Rows.Count > 0)
                 {
                     if (temp.Rows[0]["ms_ifrework"].ToString() != "0")