瀏覽代碼

添加显示设备名称

章政 7 年之前
父節點
當前提交
744b3fea8d

+ 15 - 3
UAS_DeviceMonitor/CustomerControl/PictureEditWithText/PictureEditWithText.Designer.cs

@@ -30,6 +30,7 @@
         {
             this.UserPictureEdit = new DevExpress.XtraEditors.PictureEdit();
             this.UserLabelControl = new DevExpress.XtraEditors.LabelControl();
+            this.UserLabelControl1 = new DevExpress.XtraEditors.LabelControl();
             ((System.ComponentModel.ISupportInitialize)(this.UserPictureEdit.Properties)).BeginInit();
             this.SuspendLayout();
             // 
@@ -44,20 +45,30 @@
             // UserLabelControl
             // 
             this.UserLabelControl.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
-            this.UserLabelControl.Location = new System.Drawing.Point(17, 103);
+            this.UserLabelControl.Location = new System.Drawing.Point(11, 103);
             this.UserLabelControl.MaximumSize = new System.Drawing.Size(110, 0);
             this.UserLabelControl.Name = "UserLabelControl";
-            this.UserLabelControl.Size = new System.Drawing.Size(70, 0);
+            this.UserLabelControl.Size = new System.Drawing.Size(80, 0);
             this.UserLabelControl.TabIndex = 1;
             // 
+            // UserLabelControl1
+            // 
+            this.UserLabelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical;
+            this.UserLabelControl1.Location = new System.Drawing.Point(11, 124);
+            this.UserLabelControl1.MaximumSize = new System.Drawing.Size(110, 0);
+            this.UserLabelControl1.Name = "UserLabelControl1";
+            this.UserLabelControl1.Size = new System.Drawing.Size(80, 0);
+            this.UserLabelControl1.TabIndex = 2;
+            // 
             // PictureEditWithText
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.UserLabelControl1);
             this.Controls.Add(this.UserLabelControl);
             this.Controls.Add(this.UserPictureEdit);
             this.Name = "PictureEditWithText";
-            this.Size = new System.Drawing.Size(102, 129);
+            this.Size = new System.Drawing.Size(102, 146);
             this.Load += new System.EventHandler(this.PictureEditWithText_Load);
             ((System.ComponentModel.ISupportInitialize)(this.UserPictureEdit.Properties)).EndInit();
             this.ResumeLayout(false);
@@ -68,5 +79,6 @@
 
         private DevExpress.XtraEditors.PictureEdit UserPictureEdit;
         private DevExpress.XtraEditors.LabelControl UserLabelControl;
+        private DevExpress.XtraEditors.LabelControl UserLabelControl1;
     }
 }

+ 16 - 0
UAS_DeviceMonitor/CustomerControl/PictureEditWithText/PictureEditWithText.cs

@@ -39,6 +39,21 @@ namespace UAS_DeviceMonitor.CustomerControl.PictureEditWithText
             }
         }
 
+        public string DeviceName
+        {
+            get
+            {
+                return UserLabelControl1.Text;
+            }
+
+            set
+            {
+                UserLabelControl1.Text = value;
+            }
+        }
+
+        private string deviceName;
+
         public PictureEditWithText()
         {
             InitializeComponent();
@@ -47,6 +62,7 @@ namespace UAS_DeviceMonitor.CustomerControl.PictureEditWithText
         private void PictureEditWithText_Load(object sender, EventArgs e)
         {
             UserLabelControl.Location = new Point((Width - UserLabelControl.Width) / 2, UserLabelControl.Location.Y);
+            UserLabelControl1.Location = new Point((Width - UserLabelControl.Width) / 2, UserLabelControl1.Location.Y);
         }
     }
 }

+ 55 - 5
UAS_DeviceMonitor/Main.Designer.cs

@@ -33,6 +33,7 @@ namespace UAS_DeviceMonitor
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
             this.RibbonNav = new DevExpress.XtraBars.Ribbon.RibbonControl();
             this.ButtonDeviceList = new DevExpress.XtraBars.BarButtonItem();
@@ -132,12 +133,16 @@ 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.ComboxDeviceStatusWC_label = new DevExpress.XtraEditors.LabelControl();
+            this.ComboxDeviceStatusWC = new System.Windows.Forms.ComboBox();
             this.PanelDeviceStatus = new DevExpress.XtraEditors.XtraScrollableControl();
             this.PageWorkCenterStatus = new DevExpress.XtraTab.XtraTabPage();
             this.GridWorkCenterStatus = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewWorkCenterStatus = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
-            this.TimerDeviceStatus = new System.Windows.Forms.Timer();
-            this.CommonTipController = new DevExpress.Utils.ToolTipController();
+            this.TimerDeviceStatus = new System.Windows.Forms.Timer(this.components);
+            this.CommonTipController = new DevExpress.Utils.ToolTipController(this.components);
+            this.ComboxDeviceStatusLC_label = new DevExpress.XtraEditors.LabelControl();
+            this.ComboxDeviceStatusLC = new System.Windows.Forms.ComboBox();
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -1189,6 +1194,10 @@ namespace UAS_DeviceMonitor
             // 
             // PageDeviceStatus
             // 
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusLC_label);
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusLC);
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusWC_label);
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusWC);
             this.PageDeviceStatus.Controls.Add(this.PanelDeviceStatus);
             this.PageDeviceStatus.Name = "PageDeviceStatus";
             this.PageDeviceStatus.PageVisible = false;
@@ -1196,12 +1205,31 @@ namespace UAS_DeviceMonitor
             this.PageDeviceStatus.Text = "xtraTabPage1";
             this.PageDeviceStatus.VisibleChanged += new System.EventHandler(this.PageDeviceStatus_VisibleChanged);
             // 
+            // ComboxDeviceStatusWC_label
+            // 
+            this.ComboxDeviceStatusWC_label.Appearance.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.ComboxDeviceStatusWC_label.Location = new System.Drawing.Point(11, 10);
+            this.ComboxDeviceStatusWC_label.Name = "ComboxDeviceStatusWC_label";
+            this.ComboxDeviceStatusWC_label.Size = new System.Drawing.Size(32, 16);
+            this.ComboxDeviceStatusWC_label.TabIndex = 2;
+            this.ComboxDeviceStatusWC_label.Text = "车间";
+            // 
+            // ComboxDeviceStatusWC
+            // 
+            this.ComboxDeviceStatusWC.FormattingEnabled = true;
+            this.ComboxDeviceStatusWC.Location = new System.Drawing.Point(51, 7);
+            this.ComboxDeviceStatusWC.Name = "ComboxDeviceStatusWC";
+            this.ComboxDeviceStatusWC.Size = new System.Drawing.Size(121, 22);
+            this.ComboxDeviceStatusWC.TabIndex = 1;
+            // 
             // PanelDeviceStatus
             // 
-            this.PanelDeviceStatus.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.PanelDeviceStatus.Location = new System.Drawing.Point(0, 0);
+            this.PanelDeviceStatus.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.PanelDeviceStatus.Location = new System.Drawing.Point(0, 35);
             this.PanelDeviceStatus.Name = "PanelDeviceStatus";
-            this.PanelDeviceStatus.Size = new System.Drawing.Size(1027, 577);
+            this.PanelDeviceStatus.Size = new System.Drawing.Size(1027, 542);
             this.PanelDeviceStatus.TabIndex = 0;
             // 
             // PageWorkCenterStatus
@@ -1248,6 +1276,23 @@ namespace UAS_DeviceMonitor
             // 
             this.CommonTipController.AutoPopDelay = 10000;
             // 
+            // ComboxDeviceStatusLC_label
+            // 
+            this.ComboxDeviceStatusLC_label.Appearance.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.ComboxDeviceStatusLC_label.Location = new System.Drawing.Point(189, 10);
+            this.ComboxDeviceStatusLC_label.Name = "ComboxDeviceStatusLC_label";
+            this.ComboxDeviceStatusLC_label.Size = new System.Drawing.Size(32, 16);
+            this.ComboxDeviceStatusLC_label.TabIndex = 4;
+            this.ComboxDeviceStatusLC_label.Text = "线别";
+            // 
+            // ComboxDeviceStatusLC
+            // 
+            this.ComboxDeviceStatusLC.FormattingEnabled = true;
+            this.ComboxDeviceStatusLC.Location = new System.Drawing.Point(229, 7);
+            this.ComboxDeviceStatusLC.Name = "ComboxDeviceStatusLC";
+            this.ComboxDeviceStatusLC.Size = new System.Drawing.Size(121, 22);
+            this.ComboxDeviceStatusLC.TabIndex = 3;
+            // 
             // Main
             // 
             this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;
@@ -1291,6 +1336,7 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPolling)).EndInit();
             this.PageDeviceStatus.ResumeLayout(false);
+            this.PageDeviceStatus.PerformLayout();
             this.PageWorkCenterStatus.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridWorkCenterStatus)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewWorkCenterStatus)).EndInit();
@@ -1405,5 +1451,9 @@ namespace UAS_DeviceMonitor
         private GridViewWithSerialNum GridViewWorkCenterStatus;
         private XtraScrollableControl PanelDeviceStatus;
         private DevExpress.Utils.ToolTipController CommonTipController;
+        private LabelControl ComboxDeviceStatusWC_label;
+        private System.Windows.Forms.ComboBox ComboxDeviceStatusWC;
+        private LabelControl ComboxDeviceStatusLC_label;
+        private System.Windows.Forms.ComboBox ComboxDeviceStatusLC;
     }
 }

+ 3 - 2
UAS_DeviceMonitor/Main.cs

@@ -420,7 +420,7 @@ namespace UAS_DeviceMonitor
         {
             if (PageDeviceStatus.PageVisible)
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select distinct de_code,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG on dpc_decode=de_code order by de_code", "select");
+                DataTable dt = (DataTable)dh.ExecuteSql("select distinct de_code,de_name,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG on dpc_decode=de_code order by de_code", "select");
                 //界面重新展示时如过数量不一致则重新绘制
                 if (PanelDeviceStatus.Controls.Count != dt.Rows.Count)
                 {
@@ -443,6 +443,7 @@ namespace UAS_DeviceMonitor
                         for (int i = 0; i < (j == RowCount - 1 ? LastRowCount : CountPerRow); i++)
                         {
                             PictureEditWithText pic = new PictureEditWithText();
+                            pic.DeviceName = dt.Rows[j * CountPerRow + i]["de_name"].ToString();
                             pic.Picedit.ToolTipController = CommonTipController;
                             pic.Name = dt.Rows[j * CountPerRow + i]["de_code"].ToString() + i + j;
                             pic.Anchor = AnchorStyles.Left;
@@ -460,7 +461,7 @@ namespace UAS_DeviceMonitor
                             }
                             pic.Text = dt.Rows[j * CountPerRow + i]["de_code"].ToString();
                             pic.Picedit.BorderStyle = BorderStyles.HotFlat;
-                            pic.Location = new Point((10 + RightPadding) / 2 + 110 * i, 10 + j * 130);
+                            pic.Location = new Point((10 + RightPadding) / 2 + 110 * i, 10 + j * 150);
                             PanelDeviceStatus.Controls.Add(pic);
                         }
                     }