Ge mingyu 1 year ago
parent
commit
879b96ad9e

+ 41 - 22
SIMDP/SIMDP.Project/RWS/PLC1.cs

@@ -20,7 +20,8 @@ namespace SIMDP.Project
     {
     {
         #region 设备空间
         #region 设备空间
 
 
-        private string plcname = "小压溃PLC";
+        // private string plcname = "小压溃PLC";//PLC1
+        private string plcname = "PLC1";
 
 
         private const string lshelfWorkStaion = "YK1001";
         private const string lshelfWorkStaion = "YK1001";
 
 
@@ -34,10 +35,10 @@ namespace SIMDP.Project
         private int fixedScannerPort = 0;
         private int fixedScannerPort = 0;
 
 
         //当前呼叫状态、L工装盘号和WMS信息状态
         //当前呼叫状态、L工装盘号和WMS信息状态
-        private const string redis_largeLoading = "{plcname}LargeLoading";
-        private const string redis_largeBlanking = "{plcname}LargeBlanking";
-        private const string redis_smallLoading = "{plcname}SmallLoading";
-        private const string redis_lshelfBlanking = "{plcname}LShelfBlanking";
+        private const string redis_largeLoading = "PLC1LargeLoading";
+        private const string redis_largeBlanking = "PLC1LargeBlanking";
+        private const string redis_smallLoading = "PLC1SmallLoading";
+        private const string redis_lshelfBlanking = "PLC1LShelfBlanking";
 
 
         private const string lbl_lshelfbarcode = "lbl_lshelfbarcodel1";//当前盘号
         private const string lbl_lshelfbarcode = "lbl_lshelfbarcodel1";//当前盘号
         private const string lbl_serialnum = "lbl_serialnum1";//流水
         private const string lbl_serialnum = "lbl_serialnum1";//流水
@@ -52,13 +53,6 @@ namespace SIMDP.Project
         private const string lbl_sensorstateLUP = "lbl_sensorstateL11";
         private const string lbl_sensorstateLUP = "lbl_sensorstateL11";
         private const string lbl_sensorstateLDOWN = "lbl_sensorstateL12";
         private const string lbl_sensorstateLDOWN = "lbl_sensorstateL12";
 
 
-        //记录actionTimer()执行次数,到达阈值后触发一次自动呼叫逻辑
-        private int actionCount = 0;
-
-        private const int threshold = 5;
-
-        private bool pcHeartBeat = false;
-
         public PLC1()
         public PLC1()
         {
         {
             List<MoUserParameter> listUsr = BLLFactory<BlUserParameter>.Instance.GetAll();
             List<MoUserParameter> listUsr = BLLFactory<BlUserParameter>.Instance.GetAll();
@@ -68,6 +62,16 @@ namespace SIMDP.Project
             bool flag = BLLFactory<BlPlcInfo>.Instance.GetScannerParams("Scanner_XYK", out fixedScannerIp, out fixedScannerPort);
             bool flag = BLLFactory<BlPlcInfo>.Instance.GetScannerParams("Scanner_XYK", out fixedScannerIp, out fixedScannerPort);
             if (!flag) BLLFactory<BlSystemNotice>.Instance.PublishSysMessage("通信配置", 2, "当前扫码枪参数未配置,无法通信");
             if (!flag) BLLFactory<BlSystemNotice>.Instance.PublishSysMessage("通信配置", 2, "当前扫码枪参数未配置,无法通信");
         }
         }
+       
+
+        //记录actionTimer()执行次数,到达阈值后触发一次自动呼叫逻辑
+        private int actionCount = 0;
+
+        private const int threshold = 5;
+
+        private bool pcHeartBeat = false;
+
+       
 
 
         public override void actionTimer()
         public override void actionTimer()
         {
         {
@@ -146,7 +150,12 @@ namespace SIMDP.Project
             }
             }
 
 
             //lshelf loading
             //lshelf loading
-            if (bvalue5) redis.SetString(redis_lshelfBlanking, "");
+            if (bvalue5)
+            {
+                //0210 清空WMS发送记录
+                redis.SetString(redis_wmsmsg, $"");
+                redis.SetString(redis_lshelfBlanking, "");
+            }
 
 
             //shelf blanking
             //shelf blanking
             if (bvalue6)
             if (bvalue6)
@@ -241,9 +250,10 @@ namespace SIMDP.Project
             {
             {
                 string lShelfBarcode = redis.GetString(lbl_lshelfbarcode);
                 string lShelfBarcode = redis.GetString(lbl_lshelfbarcode);
                 if (string.IsNullOrEmpty(lShelfBarcode)) lShelfBarcode = GenRandomLShelfBarcode();
                 if (string.IsNullOrEmpty(lShelfBarcode)) lShelfBarcode = GenRandomLShelfBarcode();
-                Write("L型工装下料请求处理结果", 0);
+                redis.SetString(lbl_lshelfbarcode, lShelfBarcode);
 
 
                 //1 读取并记录流水号
                 //1 读取并记录流水号
+                Write("L型工装下料请求处理结果", 0);
                 Read("L工装下料流水号一", out short serialnum1);
                 Read("L工装下料流水号一", out short serialnum1);
                 redis.SetString(lbl_serialnum, serialnum1.ToString());
                 redis.SetString(lbl_serialnum, serialnum1.ToString());
                 if (serialnum1 == 0)
                 if (serialnum1 == 0)
@@ -262,13 +272,23 @@ namespace SIMDP.Project
                     return;
                     return;
                 }
                 }
 
 
-                //3 WMS入库
-                if (string.IsNullOrEmpty(redis.GetString(redis_wmsmsg)) || !redis.GetString(redis_wmsmsg).StartsWith("True;" + serialnum1.ToString()))
+
+                //230210
+                //4 AGV转运请求转发MES,先叫一次,看看库存录入没
+                int iwhileCountMES = 0;
+                bool bCallMES = ExternalInterface.LShelfTransfer(lshelfWorkStaion, lShelfBarcode, out string emptyBarcode, out string sMESReturn);
+
+                LogHelper.log.Debug("呼叫MES转运AGV结果:" + sMESReturn);
+                if (sMESReturn.Contains("库存主表"))
                 {
                 {
+                    //3 WMS物料信息录入
+                    //if (string.IsNullOrEmpty(redis.GetString(redis_wmsmsg)))//|| !redis.GetString(redis_wmsmsg).StartsWith("True;" + serialnum1.ToString()))
+                    //{
                     WMS_inpara inPara = new WMS_inpara();
                     WMS_inpara inPara = new WMS_inpara();
                     inPara.MATCH_RESULT = true;
                     inPara.MATCH_RESULT = true;
                     inPara.STOCK_BARCODE = lShelfBarcode;
                     inPara.STOCK_BARCODE = lShelfBarcode;
-                    inPara.RELATION_CODE = requirecode1;
+
+                    inPara.RELATION_CODE = requirecode1.Trim();
                     inPara.CELL_CODE = workStaion;
                     inPara.CELL_CODE = workStaion;
                     inPara.LS_GOODS_INFO = new List<GOODS_INFO>();
                     inPara.LS_GOODS_INFO = new List<GOODS_INFO>();
                     GOODS_INFO good1 = new GOODS_INFO();
                     GOODS_INFO good1 = new GOODS_INFO();
@@ -277,9 +297,10 @@ namespace SIMDP.Project
                     inPara.LS_GOODS_INFO.Add(good1);
                     inPara.LS_GOODS_INFO.Add(good1);
 
 
                     bool bSendWMS = ExternalInterface.GenWMSStorage(inPara, out string sWMSReturn);
                     bool bSendWMS = ExternalInterface.GenWMSStorage(inPara, out string sWMSReturn);
-                   while (sWMSReturn.Contains("已经有库存"))
+                    while (sWMSReturn.Contains("已经有库存"))
                     {
                     {
-                        inPara.STOCK_BARCODE = GenRandomLShelfBarcode();
+                        lShelfBarcode= GenRandomLShelfBarcode();
+                        inPara.STOCK_BARCODE = lShelfBarcode;
                         bSendWMS = ExternalInterface.GenWMSStorage(inPara, out sWMSReturn);
                         bSendWMS = ExternalInterface.GenWMSStorage(inPara, out sWMSReturn);
                         if (bSendWMS) break;
                         if (bSendWMS) break;
                     }
                     }
@@ -293,11 +314,9 @@ namespace SIMDP.Project
                         Write("上位机报警", 3);
                         Write("上位机报警", 3);
                         return;
                         return;
                     }
                     }
+                    // }
                 }
                 }
 
 
-                //4 物料入库请求转发MES
-                int iwhileCountMES = 0;
-                bool bCallMES = ExternalInterface.LShelfTransfer(lshelfWorkStaion, lShelfBarcode, out string emptyBarcode, out string sMESReturn);
                 while (iwhileCountMES < 3 && !bCallMES)
                 while (iwhileCountMES < 3 && !bCallMES)
                 {
                 {
                     bCallMES = ExternalInterface.LShelfTransfer(lshelfWorkStaion, lShelfBarcode, out emptyBarcode, out sMESReturn);
                     bCallMES = ExternalInterface.LShelfTransfer(lshelfWorkStaion, lShelfBarcode, out emptyBarcode, out sMESReturn);

+ 19 - 16
SIMDP/SIMDP.View/FormCopulerRequest.Designer.cs

@@ -80,7 +80,7 @@ namespace SIMDP
             this.label_PageInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label_PageInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label_PageInfo.Location = new System.Drawing.Point(6, 289);
             this.label_PageInfo.Location = new System.Drawing.Point(6, 289);
             this.label_PageInfo.Name = "label_PageInfo";
             this.label_PageInfo.Name = "label_PageInfo";
-            this.label_PageInfo.Size = new System.Drawing.Size(75, 14);
+            this.label_PageInfo.Size = new System.Drawing.Size(92, 18);
             this.label_PageInfo.TabIndex = 8;
             this.label_PageInfo.TabIndex = 8;
             this.label_PageInfo.Text = "共 {0} 条记录";
             this.label_PageInfo.Text = "共 {0} 条记录";
             // 
             // 
@@ -178,7 +178,7 @@ namespace SIMDP
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.dateEditStart.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             this.dateEditStart.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.dateEditStart.Size = new System.Drawing.Size(101, 22);
+            this.dateEditStart.Size = new System.Drawing.Size(101, 26);
             this.dateEditStart.TabIndex = 15;
             this.dateEditStart.TabIndex = 15;
             this.dateEditStart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             this.dateEditStart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             // 
             // 
@@ -193,25 +193,25 @@ namespace SIMDP
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.dateEditEnd.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             this.dateEditEnd.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.dateEditEnd.Size = new System.Drawing.Size(101, 22);
+            this.dateEditEnd.Size = new System.Drawing.Size(101, 26);
             this.dateEditEnd.TabIndex = 17;
             this.dateEditEnd.TabIndex = 17;
             this.dateEditEnd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             this.dateEditEnd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             // 
             // 
             // labelControl1
             // labelControl1
             // 
             // 
             this.labelControl1.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl1.Anchor = System.Windows.Forms.AnchorStyles.Right;
-            this.labelControl1.Location = new System.Drawing.Point(212, 8);
+            this.labelControl1.Location = new System.Drawing.Point(197, 6);
             this.labelControl1.Name = "labelControl1";
             this.labelControl1.Name = "labelControl1";
-            this.labelControl1.Size = new System.Drawing.Size(60, 14);
+            this.labelControl1.Size = new System.Drawing.Size(75, 18);
             this.labelControl1.TabIndex = 18;
             this.labelControl1.TabIndex = 18;
             this.labelControl1.Text = "结束日期:";
             this.labelControl1.Text = "结束日期:";
             // 
             // 
             // labelControl4
             // labelControl4
             // 
             // 
             this.labelControl4.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl4.Anchor = System.Windows.Forms.AnchorStyles.Right;
-            this.labelControl4.Location = new System.Drawing.Point(21, 8);
+            this.labelControl4.Location = new System.Drawing.Point(6, 6);
             this.labelControl4.Name = "labelControl4";
             this.labelControl4.Name = "labelControl4";
-            this.labelControl4.Size = new System.Drawing.Size(60, 14);
+            this.labelControl4.Size = new System.Drawing.Size(75, 18);
             this.labelControl4.TabIndex = 16;
             this.labelControl4.TabIndex = 16;
             this.labelControl4.Text = "起始日期:";
             this.labelControl4.Text = "起始日期:";
             // 
             // 
@@ -219,12 +219,15 @@ namespace SIMDP
             // 
             // 
             this.chk_Refresh.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.chk_Refresh.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.chk_Refresh.AutoSize = true;
             this.chk_Refresh.AutoSize = true;
-            this.chk_Refresh.Location = new System.Drawing.Point(1230, 6);
+            this.chk_Refresh.Checked = true;
+            this.chk_Refresh.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.chk_Refresh.Location = new System.Drawing.Point(1214, 4);
             this.chk_Refresh.Name = "chk_Refresh";
             this.chk_Refresh.Name = "chk_Refresh";
-            this.chk_Refresh.Size = new System.Drawing.Size(74, 18);
+            this.chk_Refresh.Size = new System.Drawing.Size(90, 22);
             this.chk_Refresh.TabIndex = 22;
             this.chk_Refresh.TabIndex = 22;
             this.chk_Refresh.Text = "自动刷新";
             this.chk_Refresh.Text = "自动刷新";
             this.chk_Refresh.UseVisualStyleBackColor = true;
             this.chk_Refresh.UseVisualStyleBackColor = true;
+            this.chk_Refresh.CheckedChanged += new System.EventHandler(this.chk_Refresh_CheckedChanged);
             // 
             // 
             // btn_Add
             // btn_Add
             // 
             // 
@@ -240,9 +243,9 @@ namespace SIMDP
             // labelControl2
             // labelControl2
             // 
             // 
             this.labelControl2.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl2.Anchor = System.Windows.Forms.AnchorStyles.Right;
-            this.labelControl2.Location = new System.Drawing.Point(415, 8);
+            this.labelControl2.Location = new System.Drawing.Point(403, 6);
             this.labelControl2.Name = "labelControl2";
             this.labelControl2.Name = "labelControl2";
-            this.labelControl2.Size = new System.Drawing.Size(48, 14);
+            this.labelControl2.Size = new System.Drawing.Size(60, 18);
             this.labelControl2.TabIndex = 26;
             this.labelControl2.TabIndex = 26;
             this.labelControl2.Text = "备注名:";
             this.labelControl2.Text = "备注名:";
             // 
             // 
@@ -251,16 +254,16 @@ namespace SIMDP
             this.txt_remark.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.txt_remark.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.txt_remark.Location = new System.Drawing.Point(469, 5);
             this.txt_remark.Location = new System.Drawing.Point(469, 5);
             this.txt_remark.Name = "txt_remark";
             this.txt_remark.Name = "txt_remark";
-            this.txt_remark.Size = new System.Drawing.Size(101, 20);
+            this.txt_remark.Size = new System.Drawing.Size(101, 24);
             this.txt_remark.TabIndex = 27;
             this.txt_remark.TabIndex = 27;
             this.txt_remark.EditValueChanged += new System.EventHandler(this.txt_remark_EditValueChanged);
             this.txt_remark.EditValueChanged += new System.EventHandler(this.txt_remark_EditValueChanged);
             // 
             // 
             // labelControl3
             // labelControl3
             // 
             // 
             this.labelControl3.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl3.Anchor = System.Windows.Forms.AnchorStyles.Right;
-            this.labelControl3.Location = new System.Drawing.Point(606, 8);
+            this.labelControl3.Location = new System.Drawing.Point(594, 6);
             this.labelControl3.Name = "labelControl3";
             this.labelControl3.Name = "labelControl3";
-            this.labelControl3.Size = new System.Drawing.Size(48, 14);
+            this.labelControl3.Size = new System.Drawing.Size(60, 18);
             this.labelControl3.TabIndex = 26;
             this.labelControl3.TabIndex = 26;
             this.labelControl3.Text = "物料码:";
             this.labelControl3.Text = "物料码:";
             // 
             // 
@@ -269,7 +272,7 @@ namespace SIMDP
             this.txt_MrlCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.txt_MrlCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
             this.txt_MrlCode.Location = new System.Drawing.Point(660, 5);
             this.txt_MrlCode.Location = new System.Drawing.Point(660, 5);
             this.txt_MrlCode.Name = "txt_MrlCode";
             this.txt_MrlCode.Name = "txt_MrlCode";
-            this.txt_MrlCode.Size = new System.Drawing.Size(101, 20);
+            this.txt_MrlCode.Size = new System.Drawing.Size(101, 24);
             this.txt_MrlCode.TabIndex = 27;
             this.txt_MrlCode.TabIndex = 27;
             this.txt_MrlCode.EditValueChanged += new System.EventHandler(this.txt_MrlCode_EditValueChanged);
             this.txt_MrlCode.EditValueChanged += new System.EventHandler(this.txt_MrlCode_EditValueChanged);
             // 
             // 
@@ -442,7 +445,7 @@ namespace SIMDP
             // 
             // 
             // FormCopulerRequest
             // FormCopulerRequest
             // 
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1313, 316);
             this.ClientSize = new System.Drawing.Size(1313, 316);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.panel1);

+ 5 - 0
SIMDP/SIMDP.View/FormCopulerRequest.cs

@@ -173,5 +173,10 @@ namespace SIMDP
                 return;
                 return;
             }
             }
         }
         }
+
+        private void chk_Refresh_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
     }
     }
 }
 }

+ 11 - 11
SIMDP/SIMDP.View/FormProductTask.Designer.cs

@@ -88,7 +88,7 @@ namespace SIMDP
             this.label_PageInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label_PageInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label_PageInfo.Location = new System.Drawing.Point(6, 709);
             this.label_PageInfo.Location = new System.Drawing.Point(6, 709);
             this.label_PageInfo.Name = "label_PageInfo";
             this.label_PageInfo.Name = "label_PageInfo";
-            this.label_PageInfo.Size = new System.Drawing.Size(75, 14);
+            this.label_PageInfo.Size = new System.Drawing.Size(92, 18);
             this.label_PageInfo.TabIndex = 8;
             this.label_PageInfo.TabIndex = 8;
             this.label_PageInfo.Text = "共 {0} 条记录";
             this.label_PageInfo.Text = "共 {0} 条记录";
             // 
             // 
@@ -539,7 +539,7 @@ namespace SIMDP
             this.lookUp_Line.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat;
             this.lookUp_Line.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat;
             this.lookUp_Line.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             this.lookUp_Line.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.lookUp_Line.Size = new System.Drawing.Size(113, 22);
+            this.lookUp_Line.Size = new System.Drawing.Size(113, 26);
             this.lookUp_Line.TabIndex = 14;
             this.lookUp_Line.TabIndex = 14;
             this.lookUp_Line.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             this.lookUp_Line.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             // 
             // 
@@ -555,7 +555,7 @@ namespace SIMDP
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.dateEditStart.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             this.dateEditStart.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.dateEditStart.Size = new System.Drawing.Size(113, 22);
+            this.dateEditStart.Size = new System.Drawing.Size(113, 26);
             this.dateEditStart.TabIndex = 1;
             this.dateEditStart.TabIndex = 1;
             this.dateEditStart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             this.dateEditStart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             // 
             // 
@@ -571,7 +571,7 @@ namespace SIMDP
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.dateEditEnd.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             this.dateEditEnd.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.dateEditEnd.Size = new System.Drawing.Size(113, 22);
+            this.dateEditEnd.Size = new System.Drawing.Size(113, 26);
             this.dateEditEnd.TabIndex = 5;
             this.dateEditEnd.TabIndex = 5;
             this.dateEditEnd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             this.dateEditEnd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Enter_KeyDown);
             // 
             // 
@@ -580,9 +580,9 @@ namespace SIMDP
             this.labelControl6.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl6.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl6.Appearance.Options.UseTextOptions = true;
             this.labelControl6.Appearance.Options.UseTextOptions = true;
             this.labelControl6.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
             this.labelControl6.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
-            this.labelControl6.Location = new System.Drawing.Point(176, 8);
+            this.labelControl6.Location = new System.Drawing.Point(176, 6);
             this.labelControl6.Name = "labelControl6";
             this.labelControl6.Name = "labelControl6";
-            this.labelControl6.Size = new System.Drawing.Size(60, 14);
+            this.labelControl6.Size = new System.Drawing.Size(75, 18);
             this.labelControl6.TabIndex = 21;
             this.labelControl6.TabIndex = 21;
             this.labelControl6.Text = "截止日期:";
             this.labelControl6.Text = "截止日期:";
             // 
             // 
@@ -591,9 +591,9 @@ namespace SIMDP
             this.labelControl5.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl5.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl5.Appearance.Options.UseTextOptions = true;
             this.labelControl5.Appearance.Options.UseTextOptions = true;
             this.labelControl5.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
             this.labelControl5.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
-            this.labelControl5.Location = new System.Drawing.Point(3, 8);
+            this.labelControl5.Location = new System.Drawing.Point(3, 6);
             this.labelControl5.Name = "labelControl5";
             this.labelControl5.Name = "labelControl5";
-            this.labelControl5.Size = new System.Drawing.Size(60, 14);
+            this.labelControl5.Size = new System.Drawing.Size(75, 18);
             this.labelControl5.TabIndex = 21;
             this.labelControl5.TabIndex = 21;
             this.labelControl5.Text = "起始日期:";
             this.labelControl5.Text = "起始日期:";
             // 
             // 
@@ -602,9 +602,9 @@ namespace SIMDP
             this.labelControl7.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl7.Anchor = System.Windows.Forms.AnchorStyles.Right;
             this.labelControl7.Appearance.Options.UseTextOptions = true;
             this.labelControl7.Appearance.Options.UseTextOptions = true;
             this.labelControl7.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
             this.labelControl7.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
-            this.labelControl7.Location = new System.Drawing.Point(361, 8);
+            this.labelControl7.Location = new System.Drawing.Point(352, 6);
             this.labelControl7.Name = "labelControl7";
             this.labelControl7.Name = "labelControl7";
-            this.labelControl7.Size = new System.Drawing.Size(36, 14);
+            this.labelControl7.Size = new System.Drawing.Size(45, 18);
             this.labelControl7.TabIndex = 21;
             this.labelControl7.TabIndex = 21;
             this.labelControl7.Text = "工位:";
             this.labelControl7.Text = "工位:";
             // 
             // 
@@ -665,7 +665,7 @@ namespace SIMDP
             // 
             // 
             // FormProductTask
             // FormProductTask
             // 
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1364, 736);
             this.ClientSize = new System.Drawing.Size(1364, 736);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.panel1);

+ 3 - 0
SIMDP/SIMDP.View/FormProductTask.cs

@@ -262,6 +262,7 @@ namespace SIMDP
             try
             try
             {
             {
                 MoProductTask model = this.gridviewTask.GetFocusedRow() as MoProductTask;
                 MoProductTask model = this.gridviewTask.GetFocusedRow() as MoProductTask;
+                if (model == null) return;
                 if (DevExpress.XtraEditors.XtraMessageBox.Show($"手动呼叫AGV:\n可能会影响自动呼叫顺序,是否继续?\n 工单:{model.WorkCode}," +
                 if (DevExpress.XtraEditors.XtraMessageBox.Show($"手动呼叫AGV:\n可能会影响自动呼叫顺序,是否继续?\n 工单:{model.WorkCode}," +
                     $"工位:{SysEnvironment.GetStationName(model.Line)},盘号:{model.LargeBarcode}",
                     $"工位:{SysEnvironment.GetStationName(model.Line)},盘号:{model.LargeBarcode}",
                     "大托盘上料", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                     "大托盘上料", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
@@ -319,6 +320,7 @@ namespace SIMDP
             try
             try
             {
             {
                 MoProductTask model = this.gridviewTask.GetFocusedRow() as MoProductTask;
                 MoProductTask model = this.gridviewTask.GetFocusedRow() as MoProductTask;
+                if (model == null) return;
                 if (DevExpress.XtraEditors.XtraMessageBox.Show($"手动呼叫AGV:\n可能会影响自动呼叫顺序,是否继续?\n 工单:{model.WorkCode}," +
                 if (DevExpress.XtraEditors.XtraMessageBox.Show($"手动呼叫AGV:\n可能会影响自动呼叫顺序,是否继续?\n 工单:{model.WorkCode}," +
                     $"工位:{SysEnvironment.GetStationName(model.Line)},盘号:{model.SmallBarcode}",
                     $"工位:{SysEnvironment.GetStationName(model.Line)},盘号:{model.SmallBarcode}",
                     "小托盘上料", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                     "小托盘上料", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
@@ -345,6 +347,7 @@ namespace SIMDP
         private void btn_LargeBlank_Click(object sender, EventArgs e)
         private void btn_LargeBlank_Click(object sender, EventArgs e)
         {
         {
             MoProductTask selectRow = this.gridviewTask.GetFocusedRow() as MoProductTask;
             MoProductTask selectRow = this.gridviewTask.GetFocusedRow() as MoProductTask;
+            if (selectRow == null) return;
             FormEditLargeBlank editTask = new FormEditLargeBlank(selectRow);
             FormEditLargeBlank editTask = new FormEditLargeBlank(selectRow);
 
 
             editTask.ShowDialog();
             editTask.ShowDialog();