Ver código fonte

PLC新增参数,泽天对接条标记调整可以不出标

callm 3 anos atrás
pai
commit
4e280c9b51

+ 1 - 1
PLCDataReader/Main.cs

@@ -197,7 +197,7 @@ namespace UAS_PLCDataReader
             ButtonDeleteCommandSet.Grid = GridPollingSetting;
             ButtonDeleteCommandSet.Grid = GridPollingSetting;
 
 
             //指令设置界面
             //指令设置界面
-            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_ifng,dc_name,dc_type,case when dc_type='INQTY' then '投入' when dc_type='INGORE' then '忽略' when dc_type='NGQTY' then '不良' when dc_type='OUTQTY' then '产出' when dc_type='TEMPERATURE' then '温度' when dc_type='PARAM1' then '参数1' when dc_type='PARAM2' then '参数2' when dc_type='PARAM3' then '参数3' when dc_type='PARAM4' then '参数4' when dc_type='PARAM5' then '参数5' when dc_type='PARAM6' then '参数6' when dc_type='PARAM7' then '参数7' when dc_type='PARAM8' then '参数8' when dc_type='PARAM9' then '参数9' when dc_type='PARAM10' then '参数10' when dc_type='PARAM3' then '参数3'  end dc_typename,dc_value,dc_dataindex,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date,dc_address from devicecommand left join devicebrand on db_code=dc_debrand ".ToUpper();
+            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_ifng,dc_name,dc_type,case when dc_type='INQTY' then '投入' when dc_type='INGORE' then '忽略' when dc_type='NGQTY' then '不良' when dc_type='OUTQTY' then '产出' when dc_type='TEMPERATURE' then '温度' when dc_type='PARAM1' then '参数1' when dc_type='PARAM2' then '参数2' when dc_type='PARAM3' then '参数3' when dc_type='PARAM4' then '参数4' when dc_type='PARAM5' then '参数5' when dc_type='PARAM6' then '参数6' when dc_type='PARAM7' then '参数7' when dc_type='PARAM8' then '参数8' when dc_type='PARAM9' then '参数9' when dc_type='PARAM10' then '参数10' when dc_type='PARAM3' then '参数3' when dc_type='WAITTIME' then '待料时间' when dc_type='BREAKTIME' then '故障时长' when dc_type='MANSTOPTIME' then '人工停机时长' when dc_type='WORKTIME' then '正常工作时长' when dc_type='STARTTIME' then '开机时长'   end dc_typename,dc_value,dc_dataindex,dc_sendcoding,dc_receivecoding,db_name,dc_man,dc_date,dc_address from devicecommand left join devicebrand on db_code=dc_debrand ".ToUpper();
             GridCommandSetting.TableName = "devicecommand";
             GridCommandSetting.TableName = "devicecommand";
             GridCommandSetting.ID = "dc_id";
             GridCommandSetting.ID = "dc_id";
             GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding,dc_man,dc_date,dc_dataindex,dc_type,dc_address) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate,:dc_dataindex,:dc_type,:)";
             GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_value,dc_debrand,dc_sendcoding,dc_receivecoding,dc_man,dc_date,dc_dataindex,dc_type,dc_address) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_value,'" + BaseUtil.GetComboxEditValue(Brand) + "',:dc_sendcoding,:dc_receivecoding,'" + User.UserName + "',sysdate,:dc_dataindex,:dc_type,:)";

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

@@ -225,7 +225,7 @@ namespace UAS_LabelMachine
                 if (Input.Text == "")
                 if (Input.Text == "")
                 {
                 {
                     richTextAutoBottom1.AppendText("采集的数据不能为空\n");
                     richTextAutoBottom1.AppendText("采集的数据不能为空\n");
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes("ReadId1|,|NG|,|Y"));
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N")));
                     return;
                     return;
                 }
                 }
                 CollectInputData();
                 CollectInputData();
@@ -251,7 +251,7 @@ namespace UAS_LabelMachine
                 richTextAutoBottom1.AppendText("数据格式错误,无法解析\n");
                 richTextAutoBottom1.AppendText("数据格式错误,无法解析\n");
                 if (ConnectToMachine)
                 if (ConnectToMachine)
                 {
                 {
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes("ReadId1|,|NG|,|Y"));
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N")));
                 }
                 }
                 //Input.SelectAll();
                 //Input.SelectAll();
                 return;
                 return;
@@ -292,7 +292,7 @@ namespace UAS_LabelMachine
                     richTextAutoBottom1.AppendText("当前采集【物料编号" + Data["PRCODE"] + "】不对应,请重新采集\n");
                     richTextAutoBottom1.AppendText("当前采集【物料编号" + Data["PRCODE"] + "】不对应,请重新采集\n");
                     //Input.SelectAll();
                     //Input.SelectAll();
                     if (ConnectToMachine)
                     if (ConnectToMachine)
-                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                     return;
                     return;
                 }
                 }
                 else
                 else
@@ -315,7 +315,7 @@ namespace UAS_LabelMachine
                         richTextAutoBottom1.AppendText("当前采集【物料编号" + Data["PRCODE"] + "】没有需要采集的内容\n");
                         richTextAutoBottom1.AppendText("当前采集【物料编号" + Data["PRCODE"] + "】没有需要采集的内容\n");
                         //Input.SelectAll();
                         //Input.SelectAll();
                         if (ConnectToMachine)
                         if (ConnectToMachine)
-                            receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                            receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                         return;
                         return;
                     }
                     }
                 }
                 }
@@ -326,7 +326,7 @@ namespace UAS_LabelMachine
                 if (ConnectToMachine)
                 if (ConnectToMachine)
                 {
                 {
                     richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n");
                     richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n");
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                     return;
                     return;
                 }
                 }
                 else
                 else
@@ -341,7 +341,7 @@ namespace UAS_LabelMachine
                 if (ConnectToMachine)
                 if (ConnectToMachine)
                 {
                 {
                     richTextAutoBottom1.AppendText("当前采集【品牌" + Data["BRAND"] + "】不对应\n");
                     richTextAutoBottom1.AppendText("当前采集【品牌" + Data["BRAND"] + "】不对应\n");
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                     return;
                     return;
                 }
                 }
                 else
                 else
@@ -370,7 +370,7 @@ namespace UAS_LabelMachine
                     richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分\n");
                     richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分\n");
                     //Input.SelectAll();
                     //Input.SelectAll();
                     if (ConnectToMachine)
                     if (ConnectToMachine)
-                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                     return;
                     return;
                 }
                 }
                 CodeCount = int.Parse((double.Parse(Data["QTY"]) / 1000 / double.Parse(CurrentZXBZ)).ToString());
                 CodeCount = int.Parse((double.Parse(Data["QTY"]) / 1000 / double.Parse(CurrentZXBZ)).ToString());
@@ -382,7 +382,7 @@ namespace UAS_LabelMachine
                 {
                 {
                     richTextAutoBottom1.AppendText("采集【数量】无法按照最小包装数拆分\n");
                     richTextAutoBottom1.AppendText("采集【数量】无法按照最小包装数拆分\n");
                     if (ConnectToMachine)
                     if (ConnectToMachine)
-                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                     //Input.SelectAll();
                     //Input.SelectAll();
                     return;
                     return;
                 }
                 }
@@ -516,7 +516,7 @@ namespace UAS_LabelMachine
             {
             {
                 richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount + "\n");
                 richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount + "\n");
                 if (ConnectToMachine)
                 if (ConnectToMachine)
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
                 //Input.SelectAll();
                 //Input.SelectAll();
                 return;
                 return;
             }
             }
@@ -547,9 +547,9 @@ namespace UAS_LabelMachine
             }
             }
             sql.Clear();
             sql.Clear();
             sql.Append("insert into prodiobarcode(PIB_ID,PIB_PRODCODE,PIB_INDATE,PIB_INOUTNO,PIB_PIID,PIB_PDNO, PIB_PDID,PIB_PICLASS,");
             sql.Append("insert into prodiobarcode(PIB_ID,PIB_PRODCODE,PIB_INDATE,PIB_INOUTNO,PIB_PIID,PIB_PDNO, PIB_PDID,PIB_PICLASS,");
-            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO,pib_remark,pib_midcapatity,pib_custcode) ");
+            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO,pib_remark,pib_midcapatity,pib_custcode,pib_ismachine) ");
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
-            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "' ");
+            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "','" + (ConnectToMachine ? "Y" : "N") + "' ");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             int rowsnum = 0;
             int rowsnum = 0;
             try
             try
@@ -606,7 +606,7 @@ namespace UAS_LabelMachine
                 BaseUtil.SetFormCenter(stw);
                 BaseUtil.SetFormCenter(stw);
                 stw.ShowDialog();
                 stw.ShowDialog();
                 if (ConnectToMachine)
                 if (ConnectToMachine)
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|OK|,|Y")));
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|OK|,|" + (SingleLabelAutoPrint.Checked ? "Y" : "N"))));
             }
             }
             else
             else
             {
             {