Browse Source

参数修改提交

callm 7 years ago
parent
commit
d111f54429
3 changed files with 77 additions and 32 deletions
  1. 35 21
      PLCDataReader/Main.Designer.cs
  2. 5 2
      PLCDataReader/Main.cs
  3. 37 9
      PLCDataReader/PublicMethod/LogicHandler.cs

+ 35 - 21
PLCDataReader/Main.Designer.cs

@@ -234,6 +234,7 @@ 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.ButtonRefreshDeviceData = new UAS_PLCDataReader.CustomerControl.Button.ButtonDeleteRow();
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -941,7 +942,7 @@ namespace UAS_PLCDataReader
             this.PageCommandSet.Controls.Add(this.GridCommandSetting);
             this.PageCommandSet.Name = "PageCommandSet";
             this.PageCommandSet.PageVisible = false;
-            this.PageCommandSet.Size = new System.Drawing.Size(1028, 572);
+            this.PageCommandSet.Size = new System.Drawing.Size(1028, 448);
             this.PageCommandSet.Text = "xtraTabPage1";
             this.PageCommandSet.VisibleChanged += new System.EventHandler(this.PageCommandSet_VisibleChanged);
             // 
@@ -1018,7 +1019,7 @@ namespace UAS_PLCDataReader
             this.CommandSetRepositoryItemComboBox1,
             this.repositoryItemDateEdit1});
             this.GridCommandSetting.RowCount = 0;
-            this.GridCommandSetting.Size = new System.Drawing.Size(1028, 541);
+            this.GridCommandSetting.Size = new System.Drawing.Size(1028, 417);
             this.GridCommandSetting.TabIndex = 1;
             this.GridCommandSetting.TableName = null;
             this.GridCommandSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1192,7 +1193,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceNetSetting.Controls.Add(this.GridDeviceNetSetting);
             this.PageDeviceNetSetting.Name = "PageDeviceNetSetting";
             this.PageDeviceNetSetting.PageVisible = false;
-            this.PageDeviceNetSetting.Size = new System.Drawing.Size(1028, 572);
+            this.PageDeviceNetSetting.Size = new System.Drawing.Size(1028, 448);
             // 
             // ButtonDeleteNetConfig
             // 
@@ -1241,7 +1242,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceNetSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit});
             this.GridDeviceNetSetting.RowCount = 0;
-            this.GridDeviceNetSetting.Size = new System.Drawing.Size(1025, 538);
+            this.GridDeviceNetSetting.Size = new System.Drawing.Size(1025, 414);
             this.GridDeviceNetSetting.TabIndex = 0;
             this.GridDeviceNetSetting.TableName = null;
             this.GridDeviceNetSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1351,7 +1352,7 @@ namespace UAS_PLCDataReader
             this.PagePollingSetting.Controls.Add(this.GridPollingSetting);
             this.PagePollingSetting.Name = "PagePollingSetting";
             this.PagePollingSetting.PageVisible = false;
-            this.PagePollingSetting.Size = new System.Drawing.Size(1028, 572);
+            this.PagePollingSetting.Size = new System.Drawing.Size(1028, 448);
             this.PagePollingSetting.Text = "xtraTabPage1";
             this.PagePollingSetting.VisibleChanged += new System.EventHandler(this.PagePollingSetting_VisibleChanged);
             // 
@@ -1426,7 +1427,7 @@ namespace UAS_PLCDataReader
             this.PollSettingItemSearchLookUpEdit,
             this.PollSettingDeviceSearchLookUpEdit});
             this.GridPollingSetting.RowCount = 0;
-            this.GridPollingSetting.Size = new System.Drawing.Size(1028, 538);
+            this.GridPollingSetting.Size = new System.Drawing.Size(1028, 414);
             this.GridPollingSetting.TabIndex = 0;
             this.GridPollingSetting.TableName = null;
             this.GridPollingSetting.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1648,14 +1649,14 @@ namespace UAS_PLCDataReader
             this.PagePolling.Controls.Add(this.GridPolling);
             this.PagePolling.Name = "PagePolling";
             this.PagePolling.PageVisible = false;
-            this.PagePolling.Size = new System.Drawing.Size(1028, 572);
+            this.PagePolling.Size = new System.Drawing.Size(1028, 448);
             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(879, 546);
+            this.ButtonAddPolling.Location = new System.Drawing.Point(879, 422);
             this.ButtonAddPolling.Name = "ButtonAddPolling";
             this.ButtonAddPolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonAddPolling.TabIndex = 9;
@@ -1665,7 +1666,7 @@ namespace UAS_PLCDataReader
             // 
             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(808, 546);
+            this.ButtonDeletePolling.Location = new System.Drawing.Point(808, 422);
             this.ButtonDeletePolling.Name = "ButtonDeletePolling";
             this.ButtonDeletePolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonDeletePolling.TabIndex = 8;
@@ -1676,7 +1677,7 @@ namespace UAS_PLCDataReader
             this.ButtonSavePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonSavePolling.Grid = null;
             this.ButtonSavePolling.HandlerOtherFirst = false;
-            this.ButtonSavePolling.Location = new System.Drawing.Point(950, 546);
+            this.ButtonSavePolling.Location = new System.Drawing.Point(950, 422);
             this.ButtonSavePolling.Name = "ButtonSavePolling";
             this.ButtonSavePolling.Size = new System.Drawing.Size(64, 23);
             this.ButtonSavePolling.TabIndex = 7;
@@ -1698,7 +1699,7 @@ namespace UAS_PLCDataReader
             this.GridPolling.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit});
             this.GridPolling.RowCount = 0;
-            this.GridPolling.Size = new System.Drawing.Size(1028, 544);
+            this.GridPolling.Size = new System.Drawing.Size(1028, 420);
             this.GridPolling.TabIndex = 0;
             this.GridPolling.TableName = null;
             this.GridPolling.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1791,7 +1792,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceStatus.Controls.Add(this.PanelDeviceStatus);
             this.PageDeviceStatus.Name = "PageDeviceStatus";
             this.PageDeviceStatus.PageVisible = false;
-            this.PageDeviceStatus.Size = new System.Drawing.Size(1028, 572);
+            this.PageDeviceStatus.Size = new System.Drawing.Size(1028, 448);
             this.PageDeviceStatus.Text = "xtraTabPage1";
             this.PageDeviceStatus.VisibleChanged += new System.EventHandler(this.PageDeviceStatus_VisibleChanged);
             // 
@@ -1906,7 +1907,7 @@ namespace UAS_PLCDataReader
             | System.Windows.Forms.AnchorStyles.Right)));
             this.PanelDeviceStatus.Location = new System.Drawing.Point(0, 35);
             this.PanelDeviceStatus.Name = "PanelDeviceStatus";
-            this.PanelDeviceStatus.Size = new System.Drawing.Size(1028, 537);
+            this.PanelDeviceStatus.Size = new System.Drawing.Size(1028, 413);
             this.PanelDeviceStatus.TabIndex = 0;
             // 
             // PageWorkCenterStatus
@@ -1914,7 +1915,7 @@ namespace UAS_PLCDataReader
             this.PageWorkCenterStatus.Controls.Add(this.GridWorkCenterStatus);
             this.PageWorkCenterStatus.Name = "PageWorkCenterStatus";
             this.PageWorkCenterStatus.PageVisible = false;
-            this.PageWorkCenterStatus.Size = new System.Drawing.Size(1028, 572);
+            this.PageWorkCenterStatus.Size = new System.Drawing.Size(1028, 448);
             this.PageWorkCenterStatus.Text = "车间全局监控";
             // 
             // GridWorkCenterStatus
@@ -1931,7 +1932,7 @@ namespace UAS_PLCDataReader
             this.GridWorkCenterStatus.MenuManager = this.RibbonNav;
             this.GridWorkCenterStatus.Name = "GridWorkCenterStatus";
             this.GridWorkCenterStatus.RowCount = 0;
-            this.GridWorkCenterStatus.Size = new System.Drawing.Size(1025, 569);
+            this.GridWorkCenterStatus.Size = new System.Drawing.Size(1025, 445);
             this.GridWorkCenterStatus.TabIndex = 0;
             this.GridWorkCenterStatus.TableName = null;
             this.GridWorkCenterStatus.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1952,7 +1953,7 @@ namespace UAS_PLCDataReader
             this.PageDeviceRunLog.Controls.Add(this.GridDeviceRunLog);
             this.PageDeviceRunLog.Name = "PageDeviceRunLog";
             this.PageDeviceRunLog.PageVisible = false;
-            this.PageDeviceRunLog.Size = new System.Drawing.Size(1028, 572);
+            this.PageDeviceRunLog.Size = new System.Drawing.Size(1028, 448);
             this.PageDeviceRunLog.Text = "设备运行日志";
             // 
             // ButtonSearchDeviceRunLog
@@ -1995,7 +1996,7 @@ namespace UAS_PLCDataReader
             this.GridDeviceRunLog.MenuManager = this.RibbonNav;
             this.GridDeviceRunLog.Name = "GridDeviceRunLog";
             this.GridDeviceRunLog.RowCount = 0;
-            this.GridDeviceRunLog.Size = new System.Drawing.Size(1029, 548);
+            this.GridDeviceRunLog.Size = new System.Drawing.Size(1029, 424);
             this.GridDeviceRunLog.TabIndex = 0;
             this.GridDeviceRunLog.TableName = null;
             this.GridDeviceRunLog.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -2101,7 +2102,7 @@ namespace UAS_PLCDataReader
             this.PageClientParam.Controls.Add(this.label1);
             this.PageClientParam.Name = "PageClientParam";
             this.PageClientParam.PageVisible = false;
-            this.PageClientParam.Size = new System.Drawing.Size(1028, 572);
+            this.PageClientParam.Size = new System.Drawing.Size(1028, 448);
             this.PageClientParam.VisibleChanged += new System.EventHandler(this.PageClientParam_VisibleChanged);
             // 
             // ButtonSaveClientParam
@@ -2132,10 +2133,11 @@ namespace UAS_PLCDataReader
             // 
             // PageDeviceData
             // 
+            this.PageDeviceData.Controls.Add(this.ButtonRefreshDeviceData);
             this.PageDeviceData.Controls.Add(this.GridDeviceData);
             this.PageDeviceData.Name = "PageDeviceData";
             this.PageDeviceData.PageVisible = false;
-            this.PageDeviceData.Size = new System.Drawing.Size(1028, 572);
+            this.PageDeviceData.Size = new System.Drawing.Size(1028, 448);
             // 
             // GridDeviceData
             // 
@@ -2146,12 +2148,12 @@ namespace UAS_PLCDataReader
             this.GridDeviceData.GetDataSQL = null;
             this.GridDeviceData.ID = null;
             this.GridDeviceData.InsertSQL = null;
-            this.GridDeviceData.Location = new System.Drawing.Point(0, 0);
+            this.GridDeviceData.Location = new System.Drawing.Point(0, 32);
             this.GridDeviceData.MainView = this.GridViewDeviceData;
             this.GridDeviceData.MenuManager = this.RibbonNav;
             this.GridDeviceData.Name = "GridDeviceData";
             this.GridDeviceData.RowCount = 0;
-            this.GridDeviceData.Size = new System.Drawing.Size(1028, 572);
+            this.GridDeviceData.Size = new System.Drawing.Size(1028, 416);
             this.GridDeviceData.TabIndex = 0;
             this.GridDeviceData.TableName = null;
             this.GridDeviceData.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -2324,6 +2326,17 @@ namespace UAS_PLCDataReader
             this.TimerUpdateSQL.Interval = 5000;
             this.TimerUpdateSQL.Tick += new System.EventHandler(this.TimerUpdateSQL_Tick);
             // 
+            // ButtonRefreshDeviceData
+            // 
+            this.ButtonRefreshDeviceData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.ButtonRefreshDeviceData.Grid = null;
+            this.ButtonRefreshDeviceData.Location = new System.Drawing.Point(948, 4);
+            this.ButtonRefreshDeviceData.Name = "ButtonRefreshDeviceData";
+            this.ButtonRefreshDeviceData.Size = new System.Drawing.Size(64, 23);
+            this.ButtonRefreshDeviceData.TabIndex = 7;
+            this.ButtonRefreshDeviceData.Text = "刷新";
+            this.ButtonRefreshDeviceData.Click += new System.EventHandler(this.ButtonRefreshDeviceData_Click);
+            // 
             // Main
             // 
             this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;
@@ -2606,5 +2619,6 @@ namespace UAS_PLCDataReader
         private DevExpress.XtraGrid.Columns.GridColumn dr_value8;
         private DevExpress.XtraGrid.Columns.GridColumn dr_value9;
         private DevExpress.XtraGrid.Columns.GridColumn dr_value10;
+        private CustomerControl.Button.ButtonDeleteRow ButtonRefreshDeviceData;
     }
 }

+ 5 - 2
PLCDataReader/Main.cs

@@ -198,7 +198,7 @@ namespace UAS_PLCDataReader
             ButtonAddNetConfig.Grid = GridDeviceNetSetting;
             ButtonSaveNetConfig.Grid = GridDeviceNetSetting;
 
-            GridDeviceData.GetDataSQL = "select dr_decode,dr_dename,case when dr_runstatus='disconnected' then '无法连接' when dr_runstatus='stopped' then '未运行' when dr_runstatus='running' then '运行中' when dr_runstatus='noanswer' then '无应答' end dr_runstatus,dr_qty,dr_okqty,de_item1||':'||dr_value1 dr_value1,de_item2||':'||dr_value2 dr_value2,de_item3||':'||dr_value3 dr_value3,de_item4||':'||dr_value4 dr_value4,de_item5||':'||dr_value5 dr_value5,de_item6||':'||dr_value6 dr_value6,de_item7||':'||dr_value7 dr_value7,de_item8||':'||dr_value8 dr_value8,de_item9||':'||dr_value9 dr_value9,de_item10||':'||dr_value10 dr_value10 from devicerunstatus left join device on dr_decode=de_code";
+            GridDeviceData.GetDataSQL = "select dr_decode,dr_dename,case when dr_runstatus='disconnected' then '无法连接' when dr_runstatus='stopped' then '未运行' when dr_runstatus='running' then '运行中' when dr_runstatus='noanswer' then '无应答' end dr_runstatus,dr_qty,dr_okqty,de_item1||':'||dr_value1 dr_value1,de_item2||':'||dr_value2 dr_value2,de_item3||':'||dr_value3 dr_value3,de_item4||':'||dr_value4 dr_value4,de_item5||':'||dr_value5 dr_value5,de_item6||':'||dr_value6 dr_value6,de_item7||':'||dr_value7 dr_value7,de_item8||':'||dr_value8 dr_value8,de_item9||':'||dr_value9 dr_value9,de_item10||':'||dr_value10 dr_value10 from devicerunstatus left join device on dr_decode=de_code order by dr_decode";
 
             GridDeviceRunLog.GetDataSQL = "SELECT * FROM DEVICERUNRECORD";
             GridDeviceRunLog.ID = "drr_id";
@@ -1005,6 +1005,9 @@ namespace UAS_PLCDataReader
             dh.ExecuteSql("update devicerunstatus set dr_runstatus='disconnected'", "update");
         }
 
-
+        private void ButtonRefreshDeviceData_Click(object sender, EventArgs e)
+        {
+            GridDeviceData.RefreshData();
+        }
     }
 }

+ 37 - 9
PLCDataReader/PublicMethod/LogicHandler.cs

@@ -180,12 +180,19 @@ namespace UAS_PLCDataReader.PublicMethod
         /// <param name="ItemData"></param>
         public static void UpdateDeviceData(string Decode, Dictionary<string, string> ItemData)
         {
-            string INQTY = "''";
-            string OUTQTY = "''";
-            string TEMPERATURE = "''";
-            string PARAM1 = "''";
-            string PARAM2 = "''";
-            string PARAM3 = "''";
+            string INQTY = "";
+            string OUTQTY = "";
+            string TEMPERATURE = "";
+            string PARAM1 = "";
+            string PARAM2 = "";
+            string PARAM3 = "";
+            string PARAM4 = "";
+            string PARAM5 = "";
+            string PARAM6 = "";
+            string PARAM7 = "";
+            string PARAM8 = "";
+            string PARAM9 = "";
+            string PARAM10 = "";
             if (ItemData == null)
                 return;
             foreach (var item in ItemData)
@@ -210,15 +217,36 @@ namespace UAS_PLCDataReader.PublicMethod
                     case "PARAM3":
                         PARAM3 = item.Value;
                         break;
+                    case "PARAM4":
+                        PARAM4 = item.Value;
+                        break;
+                    case "PARAM5":
+                        PARAM5 = item.Value;
+                        break;
+                    case "PARAM6":
+                        PARAM6 = item.Value;
+                        break;
+                    case "PARAM7":
+                        PARAM7 = item.Value;
+                        break;
+                    case "PARAM8":
+                        PARAM8 = item.Value;
+                        break;
+                    case "PARAM9":
+                        PARAM9 = item.Value;
+                        break;
+                    case "PARAM10":
+                        PARAM10 = item.Value;
+                        break;
                     default:
                         break;
                 }
             }
             StringBuilder sql = new StringBuilder();
             sql.Clear();
-            sql.Append("update DeviceRunstatus set dr_qty={0},dr_okqty={1},dr_TEMPERATURE={2},");
-            sql.Append("dr_value1={3},dr_value2={4},dr_value3={5},dr_updatedate=sysdate where dr_decode='" + Decode + "'");
-            Main.QueueUpdateDevice.Enqueue(string.Format(sql.ToString(), INQTY, OUTQTY, TEMPERATURE, PARAM1, PARAM2, PARAM3));
+            sql.Append("update DeviceRunstatus set dr_qty='" + INQTY + "',dr_okqty='" + OUTQTY + "',dr_TEMPERATURE='" + TEMPERATURE + "',");
+            sql.Append("dr_value1='" + PARAM1 + "',dr_value2='" + PARAM2 + "',dr_value3='" + PARAM3 + "',dr_value4='" + PARAM4 + "',dr_value5='" + PARAM5 + "',dr_value6='" + PARAM6 + "',dr_value7='" + PARAM7 + "',dr_value8='" + PARAM8 + "',dr_value9='" + PARAM9 + "',dr_value10='" + PARAM10 + "',dr_updatedate=sysdate where dr_decode='" + Decode + "'");
+            Main.QueueUpdateDevice.Enqueue(sql.ToString());
         }
 
         /// <summary>