Browse Source

添加是否NG选项

章政 7 years ago
parent
commit
aca0d346f2
2 changed files with 12 additions and 12 deletions
  1. 10 9
      PLCDataReader/Main.Designer.cs
  2. 2 3
      PLCDataReader/Main.cs

+ 10 - 9
PLCDataReader/Main.Designer.cs

@@ -111,6 +111,7 @@ namespace UAS_PLCDataReader
             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_ifng = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_type = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_typename = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_dataindex = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -239,7 +240,6 @@ namespace UAS_PLCDataReader
             this.CommonTipController = new DevExpress.Utils.ToolTipController(this.components);
             this.TimerUpdateDevice = new System.Windows.Forms.Timer(this.components);
             this.TimerUpdateSQL = new System.Windows.Forms.Timer(this.components);
-            this.dc_ifng = new DevExpress.XtraGrid.Columns.GridColumn();
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -1096,6 +1096,15 @@ namespace UAS_PLCDataReader
             this.dc_name.VisibleIndex = 2;
             this.dc_name.Width = 61;
             // 
+            // dc_ifng
+            // 
+            this.dc_ifng.Caption = "是否NG";
+            this.dc_ifng.ColumnEdit = this.CheckEditCommandSet;
+            this.dc_ifng.FieldName = "DC_IFNG";
+            this.dc_ifng.Name = "dc_ifng";
+            this.dc_ifng.Visible = true;
+            this.dc_ifng.VisibleIndex = 4;
+            // 
             // dc_type
             // 
             this.dc_type.Caption = "指令值";
@@ -2390,14 +2399,6 @@ namespace UAS_PLCDataReader
             this.TimerUpdateSQL.Interval = 5000;
             this.TimerUpdateSQL.Tick += new System.EventHandler(this.TimerUpdateSQL_Tick);
             // 
-            // dc_ifng
-            // 
-            this.dc_ifng.Caption = "是否NG";
-            this.dc_ifng.FieldName = "DC_IFNG";
-            this.dc_ifng.Name = "dc_ifng";
-            this.dc_ifng.Visible = true;
-            this.dc_ifng.VisibleIndex = 4;
-            // 
             // Main
             // 
             this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;

+ 2 - 3
PLCDataReader/Main.cs

@@ -191,7 +191,7 @@ namespace UAS_PLCDataReader
             ButtonDeleteCommandSet.Grid = GridPollingSetting;
 
             //指令设置界面
-            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_name,dc_type,case when dc_type='INQTY' then '投入' when dc_type='NGQTY' then '不良' when dc_type='OUTQTY' then '产出' when dc_type='TEMPERATURE' then '温度' when dc_type='PARAM1' then '参数1' when dc_type='PARAM2' then '参数2' when dc_type='PARAM3' then '参数3' when dc_type='PARAM4' then '参数4' when dc_type='PARAM5' then '参数5' when dc_type='PARAM6' then '参数6' when dc_type='PARAM7' then '参数7' when dc_type='PARAM8' then '参数8' when dc_type='PARAM9' then '参数9' when dc_type='PARAM10' then '参数10' when dc_type='PARAM3' then '参数3'  end dc_typename,dc_value,dc_dataindex,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date from devicecommand left join devicebrand on db_code=dc_debrand ".ToUpper();
+            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_ifng,dc_name,dc_type,case when dc_type='INQTY' then '投入' when dc_type='NGQTY' then '不良' when dc_type='OUTQTY' then '产出' when dc_type='TEMPERATURE' then '温度' when dc_type='PARAM1' then '参数1' when dc_type='PARAM2' then '参数2' when dc_type='PARAM3' then '参数3' when dc_type='PARAM4' then '参数4' when dc_type='PARAM5' then '参数5' when dc_type='PARAM6' then '参数6' when dc_type='PARAM7' then '参数7' when dc_type='PARAM8' then '参数8' when dc_type='PARAM9' then '参数9' when dc_type='PARAM10' then '参数10' when dc_type='PARAM3' then '参数3'  end dc_typename,dc_value,dc_dataindex,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date from devicecommand left join devicebrand on db_code=dc_debrand ".ToUpper();
             GridCommandSetting.TableName = "devicecommand";
             GridCommandSetting.ID = "dc_id";
             GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding,dc_man,dc_date,dc_dataindex,dc_type) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate,:dc_dataindex,:dc_type)";
@@ -410,7 +410,7 @@ namespace UAS_PLCDataReader
         /// <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,dc_man,dc_date,dc_dataindex,dc_type) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate,:dc_dataindex,:dc_type)";
+            GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding,dc_man,dc_date,dc_dataindex,dc_type,dc_ifng) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate,:dc_dataindex,:dc_type,:dc_ifng)";
             ButtonSaveCommand.DoSaveAfterHandler(true);
             sql.Clear();
             sql.Append("update devicecommand set dc_man='" + User.UserName + "',dc_date=sysdate where dc_id=:dc_id");
@@ -430,7 +430,6 @@ namespace UAS_PLCDataReader
         {
             if (PageCommandSet.PageVisible)
             {
-
                 DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select * from devicebrand", "select");
                 BaseUtil.FillComBoxEditWidthDataTable(Brand, "db_name", "db_code", dt);
                 GridCommandSetting.Condition = " where dc_debrand='" + BaseUtil.GetComboxEditValue(Brand) + "' order by dc_code,dc_dataindex";