ソースを参照

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

Hcsy 7 年 前
コミット
ebfc71237e

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

@@ -83,6 +83,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.bi_inman = new System.Windows.Forms.Label();
             this.pib_inman = new System.Windows.Forms.Label();
+            this.PackMidBox = new System.Windows.Forms.Button();
             this.DCCheck = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.GridPrcode = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
             this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -148,7 +149,6 @@
             this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.PackMidBox = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).BeginInit();
@@ -482,7 +482,7 @@
             // AttachInfo
             // 
             this.AttachInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AttachInfo.Location = new System.Drawing.Point(388, 80);
+            this.AttachInfo.Location = new System.Drawing.Point(388, 48);
             this.AttachInfo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.AttachInfo.Name = "AttachInfo";
             this.AttachInfo.Size = new System.Drawing.Size(64, 26);
@@ -628,6 +628,19 @@
             this.pib_inman.Size = new System.Drawing.Size(0, 20);
             this.pib_inman.TabIndex = 101;
             // 
+            // PackMidBox
+            // 
+            this.PackMidBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PackMidBox.Location = new System.Drawing.Point(388, 80);
+            this.PackMidBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PackMidBox.Name = "PackMidBox";
+            this.PackMidBox.Size = new System.Drawing.Size(64, 26);
+            this.PackMidBox.TabIndex = 102;
+            this.PackMidBox.Text = "封中盒";
+            this.PackMidBox.UseVisualStyleBackColor = true;
+            this.PackMidBox.Visible = false;
+            this.PackMidBox.Click += new System.EventHandler(this.PackMidBox_Click);
+            // 
             // DCCheck
             // 
             this.DCCheck.ID = null;
@@ -1271,6 +1284,7 @@
             // 
             // OutBoxNum
             // 
+            this.OutBoxNum.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.OutBoxNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OutBoxNum.Items.AddRange(new object[] {
             "新增"});
@@ -1279,7 +1293,6 @@
             this.OutBoxNum.Name = "OutBoxNum";
             this.OutBoxNum.Size = new System.Drawing.Size(72, 25);
             this.OutBoxNum.TabIndex = 91;
-            this.OutBoxNum.Text = "新增";
             this.OutBoxNum.SelectedIndexChanged += new System.EventHandler(this.OutBoxNum_SelectedIndexChanged);
             this.OutBoxNum.Click += new System.EventHandler(this.OutBoxNum_Click);
             // 
@@ -1346,18 +1359,6 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // PackMidBox
-            // 
-            this.PackMidBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PackMidBox.Location = new System.Drawing.Point(388, 48);
-            this.PackMidBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.PackMidBox.Name = "PackMidBox";
-            this.PackMidBox.Size = new System.Drawing.Size(64, 26);
-            this.PackMidBox.TabIndex = 102;
-            this.PackMidBox.Text = "封中盒";
-            this.PackMidBox.UseVisualStyleBackColor = true;
-            this.PackMidBox.Click += new System.EventHandler(this.PackMidBox_Click);
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

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

@@ -187,7 +187,6 @@ namespace UAS_LabelMachine
                     return;
                 }
                 CollectInputData();
-                Input.SelectAll();
             }
         }
 
@@ -207,6 +206,7 @@ namespace UAS_LabelMachine
             if (SplitData.Length < 6)
             {
                 MessageBox.Show("数据格式错误,无法解析", "提示");
+                Input.SelectAll();
                 return;
             }
             for (int i = 0; i < SplitData.Length; i++)
@@ -242,16 +242,19 @@ namespace UAS_LabelMachine
             if (!CheckDateCode(Data["DATECODE"]))
             {
                 MessageBox.Show("物料" + Data["PRCODE"] + "【DateCode】超出校验日期");
+                Input.SelectAll();
                 return;
             }
             if (Data["PRCODE"] != CurrentPrCode)
             {
                 MessageBox.Show("当前采集【物料编号】不对应,请重新采集", "提示");
+                Input.SelectAll();
                 return;
             }
             if (Data["BRAND"] != CurrentBrand)
             {
                 MessageBox.Show("当前采集【品牌】不对应,请重新采集", "提示");
+                Input.SelectAll();
                 return;
             }
             int CodeCount = 0;
@@ -263,6 +266,7 @@ namespace UAS_LabelMachine
                 if (int.Parse(Data["QTY"]) % 1000 != 0 || int.Parse(Data["QTY"]) / 1000 % int.Parse(CurrentZXBZ) != 0)
                 {
                     MessageBox.Show("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分", "提示");
+                    Input.SelectAll();
                     return;
                 }
                 CodeCount = int.Parse(Data["QTY"]) / 1000 / int.Parse(CurrentZXBZ);
@@ -273,6 +277,7 @@ namespace UAS_LabelMachine
                 if (int.Parse(Data["QTY"]) % int.Parse(CurrentZXBZ) != 0)
                 {
                     MessageBox.Show("采集【数量】无法按照最小包装数拆分", "提示");
+                    Input.SelectAll();
                     return;
                 }
                 CodeCount = int.Parse(Data["QTY"]) / int.Parse(CurrentZXBZ);
@@ -305,9 +310,16 @@ namespace UAS_LabelMachine
             if (CollectQty + CollectNum > int.Parse(CurrentPrCount))
             {
                 MessageBox.Show("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount, "提示");
+                Input.SelectAll();
                 return;
             }
             List<string> CustBarCode = new List<string>();
+            if (!(Radix > 0))
+            {
+                string close = MessageBox.Show(this.ParentForm, "未维护条码规则,是否继续生成", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (close.ToString() != "Yes")
+                    return;
+            }
             for (int i = 0; i < CodeCount; i++)
             {
                 if (Radix > 0)
@@ -378,6 +390,7 @@ namespace UAS_LabelMachine
                     }
                 }
             }
+            Input.Clear();
             OutBoxNum_Click(new object(), new EventArgs());
         }
 
@@ -530,6 +543,7 @@ namespace UAS_LabelMachine
         {
             if (e.KeyCode == Keys.Enter)
             {
+                Input.Clear();
                 sql.Clear();
                 sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
@@ -538,6 +552,7 @@ namespace UAS_LabelMachine
                     pi_cardcode.Text = dt.Rows[0]["pi_cardcode"].ToString();
                     pi_date.Text = dt.Rows[0]["pi_date"].ToString();
                     PI_ID = dt.Rows[0]["pi_id"].ToString();
+                    OutBoxNum_Click(new object(), new EventArgs());
                     LoadPrcodeData();
                     LoadGridData(sender, e);
                     //获取条码规则
@@ -809,6 +824,7 @@ namespace UAS_LabelMachine
         {
             if (MidLabelCombox.Text != "")
             {
+                PackMidBox_Click(sender, e);
                 thread = new Thread(MidBoxLabelPrint);
                 stw = new SetLoadingWindow(thread, "正在打印中盒");
                 BaseUtil.SetFormCenter(stw);
@@ -990,6 +1006,8 @@ namespace UAS_LabelMachine
                     dh.BatchInsert("delete from prodiobarcode where pib_id=:pib_id", new string[] { "pib_id" }, DeleteID.ToArray());
                     LogManager.DoCommandLog(pi_inoutno.Text, User.UserCode, "删除明细", "删除明细成功");
                     MessageBox.Show("删除成功", "提示");
+                    Input.Clear();
+                    LoadPrcodeData();
                     LoadGridData(sender, e);
                 }
             }
@@ -1274,7 +1292,7 @@ namespace UAS_LabelMachine
                 io = new ItemObject(pib_outboxcode2, pib_outboxcode2);
                 OutBoxNum.Items.Add(io);
             }
-            if (OutBoxNum.Text == "新增")
+            if (OutBoxNum.Text == "新增" || OutBoxNum.Text == "")
                 OutBoxNum.SelectedIndex = OutBoxNum.Items.Count - 1;
         }
 
@@ -1545,7 +1563,6 @@ namespace UAS_LabelMachine
                     dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + MaxNum + "'", "rmn_nrcode='" + pi_cardcode.Text + "' and rmn_prefix='" + Prefix + "'");
                 }
                 LoadGridData(sender, e);
-                MidLabelPrint.PerformClick();
             }
         }
 

+ 0 - 2
UAS_AutoPass/AutoAnalysisXml.cs

@@ -218,7 +218,6 @@ namespace UAS_AutoPass
             List<string> badcode = new List<string>();
             //获取采集项目的结果
             List<string> badlocation = new List<string>();
-            int code_or_location = 0;
             while (myReader.Read())
             {
                 if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "test" && myReader.IsStartElement())
@@ -532,7 +531,6 @@ namespace UAS_AutoPass
                 List<string> badcode = new List<string>();
                 //获取采集项目的结果
                 List<string> badlocation = new List<string>();
-                int code_or_location = 0;
                 while (myReader.Read())
                 {
                     if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "test" && myReader.IsStartElement())

+ 0 - 2
UAS_AutoPass/AutoPassDataCollect.cs

@@ -10,8 +10,6 @@ namespace UAS_AutoPass
     {
         MESHelper helper;
 
-        DataHelper dh;
-
         List<string> Data = new List<string>();
         //Queue<string> que = new Queue<string>();
         /// <summary>

+ 0 - 2
UAS_AutoPass/Form2.cs

@@ -10,8 +10,6 @@ namespace UAS_AutoPass
     {
         int state;
 
-        private DoWorkEventArgs e;
-
         public Tip()
         {
             InitializeComponent();

+ 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);
         }
     }
 }

+ 88 - 6
UAS_DeviceMonitor/Main.Designer.cs

@@ -133,12 +133,17 @@ 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 = new DevExpress.XtraEditors.ComboBoxEdit();
+            this.ComboxDeviceStatusLC = new DevExpress.XtraEditors.ComboBoxEdit();
+            this.CheckEditDeviceStatusEnable = new DevExpress.XtraEditors.CheckEdit();
+            this.ComboxDeviceStatusLC_label = new DevExpress.XtraEditors.LabelControl();
+            this.ComboxDeviceStatusWC_label = new DevExpress.XtraEditors.LabelControl();
             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.components);
-            this.CommonTipController = new System.Windows.Forms.ToolTip(this.components);
+            this.CommonTipController = new DevExpress.Utils.ToolTipController(this.components);
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -165,6 +170,9 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPolling)).BeginInit();
             this.PageDeviceStatus.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.ComboxDeviceStatusWC.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ComboxDeviceStatusLC.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckEditDeviceStatusEnable.Properties)).BeginInit();
             this.PageWorkCenterStatus.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridWorkCenterStatus)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewWorkCenterStatus)).BeginInit();
@@ -1190,6 +1198,11 @@ namespace UAS_DeviceMonitor
             // 
             // PageDeviceStatus
             // 
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusWC);
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusLC);
+            this.PageDeviceStatus.Controls.Add(this.CheckEditDeviceStatusEnable);
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusLC_label);
+            this.PageDeviceStatus.Controls.Add(this.ComboxDeviceStatusWC_label);
             this.PageDeviceStatus.Controls.Add(this.PanelDeviceStatus);
             this.PageDeviceStatus.Name = "PageDeviceStatus";
             this.PageDeviceStatus.PageVisible = false;
@@ -1197,12 +1210,72 @@ namespace UAS_DeviceMonitor
             this.PageDeviceStatus.Text = "xtraTabPage1";
             this.PageDeviceStatus.VisibleChanged += new System.EventHandler(this.PageDeviceStatus_VisibleChanged);
             // 
+            // ComboxDeviceStatusWC
+            // 
+            this.ComboxDeviceStatusWC.Location = new System.Drawing.Point(50, 7);
+            this.ComboxDeviceStatusWC.MenuManager = this.RibbonNav;
+            this.ComboxDeviceStatusWC.Name = "ComboxDeviceStatusWC";
+            this.ComboxDeviceStatusWC.Properties.Appearance.Font = new System.Drawing.Font("黑体", 11F);
+            this.ComboxDeviceStatusWC.Properties.Appearance.Options.UseFont = true;
+            this.ComboxDeviceStatusWC.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.ComboxDeviceStatusWC.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
+            this.ComboxDeviceStatusWC.Size = new System.Drawing.Size(100, 22);
+            this.ComboxDeviceStatusWC.TabIndex = 0;
+            this.ComboxDeviceStatusWC.SelectedIndexChanged += new System.EventHandler(this.ComboxDeviceStatusWC_SelectedIndexChanged);
+            // 
+            // ComboxDeviceStatusLC
+            // 
+            this.ComboxDeviceStatusLC.Location = new System.Drawing.Point(202, 7);
+            this.ComboxDeviceStatusLC.MenuManager = this.RibbonNav;
+            this.ComboxDeviceStatusLC.Name = "ComboxDeviceStatusLC";
+            this.ComboxDeviceStatusLC.Properties.Appearance.Font = new System.Drawing.Font("黑体", 11F);
+            this.ComboxDeviceStatusLC.Properties.Appearance.Options.UseFont = true;
+            this.ComboxDeviceStatusLC.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.ComboxDeviceStatusLC.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
+            this.ComboxDeviceStatusLC.Size = new System.Drawing.Size(100, 22);
+            this.ComboxDeviceStatusLC.TabIndex = 0;
+            this.ComboxDeviceStatusLC.SelectedIndexChanged += new System.EventHandler(this.ComboxDeviceStatusLC_SelectedIndexChanged);
+            // 
+            // CheckEditDeviceStatusEnable
+            // 
+            this.CheckEditDeviceStatusEnable.Location = new System.Drawing.Point(321, 9);
+            this.CheckEditDeviceStatusEnable.MenuManager = this.RibbonNav;
+            this.CheckEditDeviceStatusEnable.Name = "CheckEditDeviceStatusEnable";
+            this.CheckEditDeviceStatusEnable.Properties.Appearance.Font = new System.Drawing.Font("黑体", 10F);
+            this.CheckEditDeviceStatusEnable.Properties.Appearance.Options.UseFont = true;
+            this.CheckEditDeviceStatusEnable.Properties.Caption = "只显示已启用设备";
+            this.CheckEditDeviceStatusEnable.Size = new System.Drawing.Size(142, 19);
+            this.CheckEditDeviceStatusEnable.TabIndex = 5;
+            this.CheckEditDeviceStatusEnable.CheckedChanged += new System.EventHandler(this.CheckEditDeviceStatusEnable_CheckedChanged);
+            // 
+            // 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(162, 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 = "线别";
+            // 
+            // 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 = "车间";
+            // 
             // 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
@@ -1247,7 +1320,7 @@ namespace UAS_DeviceMonitor
             // 
             // CommonTipController
             // 
-            this.CommonTipController.ShowAlways = true;
+            this.CommonTipController.AutoPopDelay = 10000;
             // 
             // Main
             // 
@@ -1292,6 +1365,10 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPolling)).EndInit();
             this.PageDeviceStatus.ResumeLayout(false);
+            this.PageDeviceStatus.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.ComboxDeviceStatusWC.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ComboxDeviceStatusLC.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.CheckEditDeviceStatusEnable.Properties)).EndInit();
             this.PageWorkCenterStatus.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridWorkCenterStatus)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewWorkCenterStatus)).EndInit();
@@ -1405,6 +1482,11 @@ namespace UAS_DeviceMonitor
         private AutoDataGridControl GridWorkCenterStatus;
         private GridViewWithSerialNum GridViewWorkCenterStatus;
         private XtraScrollableControl PanelDeviceStatus;
-        private System.Windows.Forms.ToolTip CommonTipController;
+        private DevExpress.Utils.ToolTipController CommonTipController;
+        private LabelControl ComboxDeviceStatusWC_label;
+        private LabelControl ComboxDeviceStatusLC_label;
+        private CheckEdit CheckEditDeviceStatusEnable;
+        private ComboBoxEdit ComboxDeviceStatusLC;
+        private ComboBoxEdit ComboxDeviceStatusWC;
     }
 }

+ 145 - 40
UAS_DeviceMonitor/Main.cs

@@ -13,6 +13,7 @@ using System.Threading;
 using UAS_DeviceMonitor.CustomerControl.PictureEditWithText;
 using System.Windows.Forms;
 using DevExpress.XtraEditors.Controls;
+using DevExpress.XtraEditors;
 
 namespace UAS_DeviceMonitor
 {
@@ -20,6 +21,8 @@ namespace UAS_DeviceMonitor
     {
 
         StringBuilder sql = new StringBuilder();
+
+        StringBuilder DeviceStatusQuerySQL = new StringBuilder();
         DataHelper dh;
         ModeBusTCPServer mbt = new ModeBusTCPServer();
         List<string> SQL = new List<string>();
@@ -328,7 +331,7 @@ namespace UAS_DeviceMonitor
                     //更新轮询日志状态
                     sql.Clear();
                     sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+" + SendCommandByteSize);
-                    sql.Append(",dpg_receivedatasize=nvl(dpg_receivedatasize,0)+" + ReceiveCommandByteSize);
+                    sql.Append(",dpg_receivedatasize=nvl(dpg_receivedatasize,0)+" + ReceiveCommandByteSize + ",dpg_count=nvl(dpg_count,0)+1 ");
                     sql.Append(" where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
                     SQL.Add(sql.ToString());
                     dh.ExecuteSQLTran(SQL.ToArray());
@@ -342,8 +345,9 @@ namespace UAS_DeviceMonitor
                     SQL.Add(sql.ToString());
                     //更新轮询日志状态
                     sql.Clear();
-                    sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+" + SendCommandByteSize);
-                    sql.Append(" where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
+                    sql.Append("update DEVICEPOLLINGLOG set dpg_status='Running',dpg_senddatasize=nvl(dpg_senddatasize,0)+");
+                    sql.Append(SendCommandByteSize + ",dpg_count=nvl(dpg_count,0)+1 ");
+                    sql.Append("where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + Decode + "')");
                     SQL.Add(sql.ToString());
                     dh.ExecuteSQLTran(SQL.ToArray());
                 }
@@ -418,59 +422,159 @@ 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");
-                //界面重新展示时如过数量不一致则重新绘制
-                if (PanelDeviceStatus.Controls.Count != dt.Rows.Count)
+                DeviceStatusQuerySQL.Clear();
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG on dpc_decode=de_code order by de_code");
+                PaintDeviceStatusControl(DeviceStatusQuerySQL.ToString());
+                //填充筛选条件,车间和线体
+                DataTable dt = (DataTable)dh.ExecuteSql("select wc_code,wc_name from workcenter", "select");
+                BaseUtil.FillComBoxEditWidthDataTable(ComboxDeviceStatusWC, "wc_name", "wc_code", dt, true);
+            }
+        }
+
+        private void CheckEditDeviceStatusEnable_CheckedChanged(object sender, EventArgs e)
+        {
+            DeviceStatusQuerySQL.Clear();
+            if (CheckEditDeviceStatusEnable.Checked)
+            {
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG ");
+                DeviceStatusQuerySQL.Append("on dpc_decode=de_code where nvl(dpc_enable,0)<>0 order by de_code");
+            }
+            else
+            {
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG ");
+                DeviceStatusQuerySQL.Append("on dpc_decode=de_code order by de_code");
+            }
+            PaintDeviceStatusControl(DeviceStatusQuerySQL.ToString());
+        }
+
+        private void ComboxDeviceStatusWC_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            DeviceStatusQuerySQL.Clear();
+            string WC = BaseUtil.GetComboxEditValue(ComboxDeviceStatusWC);
+            if (CheckEditDeviceStatusEnable.Checked)
+            {
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG ");
+                DeviceStatusQuerySQL.Append("on dpc_decode=de_code where nvl(dpc_enable,0)<>0 and de_wccode='" + WC + "' order by de_code");
+            }
+            else
+            {
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join DEVICEPOLLINGCONFIG ");
+                DeviceStatusQuerySQL.Append("on dpc_decode=de_code where de_wccode='" + WC + "' order by de_code");
+            }
+            PaintDeviceStatusControl(DeviceStatusQuerySQL.ToString());
+            sql.Clear();
+            if (WC == "全部")
+                sql.Append("select li_code,li_name from line");
+            else
+                sql.Append("select li_code,li_name from line where li_wccode='" + WC + "'");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+            BaseUtil.FillComBoxEditWidthDataTable(ComboxDeviceStatusLC, "li_code", "li_name", dt, true);
+        }
+
+        private void ComboxDeviceStatusLC_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            DeviceStatusQuerySQL.Clear();
+            string WC = BaseUtil.GetComboxEditValue(ComboxDeviceStatusWC);
+            string LC = BaseUtil.GetComboxEditValue(ComboxDeviceStatusLC);
+            if (CheckEditDeviceStatusEnable.Checked)
+            {
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join ");
+                DeviceStatusQuerySQL.Append("DEVICEPOLLINGCONFIG on dpc_decode=de_code where nvl(dpc_enable,0)<>0");
+                if (WC != "全部")
+                    DeviceStatusQuerySQL.Append(" and de_wccode='" + WC + "' ");
+                if (LC != "全部")
+                    DeviceStatusQuerySQL.Append(" and de_linecode='"+LC+"' ");
+                DeviceStatusQuerySQL.Append(" order by de_code");
+            }
+            else
+            {
+                DeviceStatusQuerySQL.Append("select distinct de_code,de_name,dpc_status,dpc_id from device left join ");
+                DeviceStatusQuerySQL.Append("DEVICEPOLLINGCONFIG on dpc_decode=de_code ");
+                if (WC != "全部")
+                    DeviceStatusQuerySQL.Append(" where de_wccode='" + WC + "' ");
+                if (LC != "全部")
+                    DeviceStatusQuerySQL.Append(" and de_linecode='" + LC + "' ");
+                DeviceStatusQuerySQL.Append("order by de_code");
+            }
+            PaintDeviceStatusControl(DeviceStatusQuerySQL.ToString());
+        }
+
+        private void PaintDeviceStatusControl(string SQL)
+        {
+            DataTable dt = (DataTable)dh.ExecuteSql(SQL, "select");
+            //界面重新展示时如过数量不一致则重新绘制
+            if (PanelDeviceStatus.Controls.Count != dt.Rows.Count)
+            {
+                PanelDeviceStatus.Controls.Clear();
+                int CountPerRow = PanelDeviceStatus.Width / 110;
+                int RightPadding = PanelDeviceStatus.Width % 110;
+                int Count = dt.Rows.Count;
+                int RowCount = Count % CountPerRow == 0 ? Count / CountPerRow : Count / CountPerRow + 1;
+                int LastRowCount = 0;
+                for (int i = 0; i < PanelDeviceStatus.Controls.Count; i++)
+                {
+                    PanelDeviceStatus.Controls[i].Dispose();
+                }
+                for (int j = 0; j < RowCount; j++)
                 {
-                    int CountPerRow = PanelDeviceStatus.Width / 110;
-                    int RightPadding = PanelDeviceStatus.Width % 110;
-                    int Count = dt.Rows.Count;
-                    int RowCount = Count % CountPerRow == 0 ? Count / CountPerRow : Count / CountPerRow + 1;
-                    int LastRowCount = 0;
-                    for (int i = 0; i < PanelDeviceStatus.Controls.Count; i++)
+                    //如果是最后一行则循环尾数
+                    if (j == RowCount - 1)
                     {
-                        PanelDeviceStatus.Controls[i].Dispose();
+                        LastRowCount = Count % CountPerRow;
                     }
-                    for (int j = 0; j < RowCount; j++)
+                    for (int i = 0; i < (j == RowCount - 1 ? LastRowCount : CountPerRow); i++)
                     {
-                        //如果是最后一行则循环尾数
-                        if (j == RowCount - 1)
+                        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;
+                        pic.Anchor = AnchorStyles.Top;
+                        pic.Picedit.Name = dt.Rows[j * CountPerRow + i]["de_code"].ToString();
+                        pic.Picedit.MouseHover += Pic_MouseHover;
+                        pic.Picedit.Properties.SizeMode = PictureSizeMode.Squeeze;
+                        if (dt.Rows[j * CountPerRow + i]["dpc_status"].ToString() != "Running")
                         {
-                            LastRowCount = Count % CountPerRow;
+                            pic.Picedit.Image = Properties.Resources.network_offline;
                         }
-                        for (int i = 0; i < (j == RowCount - 1 ? LastRowCount : CountPerRow); i++)
+                        else
                         {
-                            PictureEditWithText pic = new PictureEditWithText();
-                            pic.Name = dt.Rows[j * CountPerRow + i]["de_code"].ToString() + i + j;
-                            pic.Anchor = AnchorStyles.Left;
-                            pic.Anchor = AnchorStyles.Top;
-                            pic.Picedit.Properties.SizeMode = PictureSizeMode.Squeeze;
-                            if (dt.Rows[j * CountPerRow + i]["dpc_status"].ToString() != "Running")
-                            {
-                                CommonTipController.SetToolTip(pic.Picedit, "离线");
-                                pic.Picedit.Image = Properties.Resources.network_offline;
-                            }
-                            else
-                            {
-                                CommonTipController.SetToolTip(pic.Picedit, "在线");
-                                pic.Picedit.Image = Properties.Resources.net_connected;
-                            }
-                            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);
-                            PanelDeviceStatus.Controls.Add(pic);
+                            pic.Picedit.Image = Properties.Resources.net_connected;
                         }
+                        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 * 150);
+                        PanelDeviceStatus.Controls.Add(pic);
                     }
-                    BaseUtil.CleanMemory();
-                    TimerDeviceStatus.Start();
                 }
+                BaseUtil.CleanMemory();
+                TimerDeviceStatus.Start();
+            }
+        }
+
+        private void Pic_MouseHover(object sender, EventArgs e)
+        {
+            PictureEdit pic = sender as PictureEdit;
+            DataTable dt = (DataTable)dh.ExecuteSql("select * from DEVICEPOLLINGLOG where dpg_id=(select max(dpg_id) from DEVICEPOLLINGLOG where dpg_decode='" + pic.Name + "')", "select");
+            if (dt.Rows.Count > 0)
+            {
+                sql.Clear();
+                sql.Append("开始时间" + dt.Rows[0]["dpg_starttime"].ToString() + "\n");
+                sql.Append("发送数据大小" + dt.Rows[0]["dpg_senddatasize"].ToString() + "字节\n");
+                sql.Append("接收数据大小" + dt.Rows[0]["dpg_receivedatasize"].ToString() + "字节\n");
+                sql.Append("轮询次数" + dt.Rows[0]["dpg_count"].ToString() + "次\n");
+                CommonTipController.ShowHint(sql.ToString(), pic.Name);
+            }
+            else
+            {
+                CommonTipController.ShowHint("暂无信息", pic.Name);
             }
         }
 
         //重新展示设备图像界面
         private void ShowDeviceStatus()
         {
-            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(DeviceStatusQuerySQL.ToString(), "select");
             int CountPerRow = PanelDeviceStatus.Width / 110;
             int RightPadding = PanelDeviceStatus.Width % 110;
             int Count = dt.Rows.Count;
@@ -496,6 +600,7 @@ namespace UAS_DeviceMonitor
                     }
                 }
             }
+            BaseUtil.CleanMemory();
         }
 
         //刷新界面

+ 1 - 1
UAS_DeviceMonitor/Main.resx

@@ -474,7 +474,7 @@
     <value>17, 17</value>
   </metadata>
   <metadata name="CommonTipController.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>178, 17</value>
+    <value>362, 17</value>
   </metadata>
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 54 - 0
UAS_DeviceMonitor/PublicMethod/BaseUtil.cs

@@ -6,12 +6,14 @@ using System.Runtime.InteropServices;
 using System.Text;
 using System.Windows.Forms;
 using UAS_DeviceMonitor.DataOperate;
+using DevExpress.Utils;
 
 namespace UAS_DeviceMonitor.PublicMethod
 {
     class BaseUtil
     {
 
+
         [DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")]
         public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize);
 
@@ -40,6 +42,26 @@ namespace UAS_DeviceMonitor.PublicMethod
             combo.SelectedIndex = 0;
         }
 
+        public static void FillComBoxEditWidthDataTable(ComboBoxEdit combo, string TextField, string ValueField, DataTable dt, bool AddAll)
+        {
+            combo.Properties.Items.Clear();
+            if (AddAll)
+            {
+                ComboBoxData item = new ComboBoxData();
+                item.Value = "全部";
+                item.Text = "全部";
+                combo.Properties.Items.Add(item);
+            }
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                ComboBoxData item = new ComboBoxData();
+                item.Value = dt.Rows[i][ValueField].ToString();
+                item.Text = dt.Rows[i][TextField].ToString();
+                combo.Properties.Items.Add(item);
+            }
+            combo.SelectedIndex = 0;
+        }
+
         public static DataTable ToDataTable(DataRow[] rows)
         {
             if (rows == null || rows.Length == 0) return new DataTable();
@@ -111,5 +133,37 @@ namespace UAS_DeviceMonitor.PublicMethod
                 SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
             }
         }
+
+        private static ToolTipControllerShowEventArgs args;
+
+        public static ToolTipController MyToolTipClt { get; private set; }
+
+        public static void NewToolTip(Control ctl, string title, string content, int showTime, ToolTipType toolTipType, ToolTipLocation tipLocation, bool isAutoHide, ToolTipIconType tipIconType, ImageList imgList, int imgIndex)
+        {
+            try
+            {
+                MyToolTipClt = new ToolTipController();
+                args = MyToolTipClt.CreateShowArgs();
+                content = (string.IsNullOrEmpty(content) ? "???" : content);
+                title = string.IsNullOrEmpty(title) ? "温馨提示" : title;
+                MyToolTipClt.ImageList = imgList;
+                MyToolTipClt.ImageIndex = (imgList == null ? 0 : imgIndex);
+                args.AutoHide = isAutoHide;
+                MyToolTipClt.ShowBeak = true;
+                MyToolTipClt.ShowShadow = true;
+                MyToolTipClt.Rounded = true;
+                MyToolTipClt.AutoPopDelay = (showTime == 0 ? 2000 : showTime);
+                MyToolTipClt.SetToolTip(ctl, content);
+                MyToolTipClt.SetTitle(ctl, title);
+                MyToolTipClt.SetToolTipIconType(ctl, tipIconType);
+                MyToolTipClt.Active = true;
+                MyToolTipClt.HideHint();
+                MyToolTipClt.ShowHint(content, title, ctl, tipLocation);
+            }
+            catch (Exception)
+            {
+
+            }
+        }
     }
 }

+ 1 - 2
UAS_XmlAnalysor/DataHelper.cs

@@ -14,7 +14,6 @@ namespace UAS_XmlAnalysor
         public static string DBConnectionString;
         public static OracleConnection connection = null;
         OracleCommand command = null;
-        int ReconnectTime = 0;
         /// <summary>
         /// 执行构造函数的时候打开数据库的链接
         /// </summary>
@@ -29,7 +28,7 @@ namespace UAS_XmlAnalysor
                     connection = new OracleConnection(DBConnectionString);
                 connection.Open();
             }
-            catch (Exception e) {/* LogManager.DoLog(e.Message);*/ }
+            catch (Exception ) {/* LogManager.DoLog(e.Message);*/ }
         }
 
         /// <summary>

+ 0 - 1
UAS_XmlAnalysor/Form1.cs

@@ -53,7 +53,6 @@ namespace UAS_XmlAnalysor
         /// 缓存的文件夹
         /// </summary>
         public static string CachePathFolder = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/";
-        private string oErrMessage;
 
         public Form1()
         {

+ 0 - 2
UAS_XmlAnalysor/Form2.cs

@@ -10,8 +10,6 @@ namespace UAS_XmlAnalysor
     {
         int state;
 
-        private DoWorkEventArgs e;
-
         public Tip()
         {
             InitializeComponent();