|
|
@@ -323,6 +323,7 @@ namespace UAS_LabelMachine
|
|
|
case "FrontendCheck":
|
|
|
//比对当前箱数量和容量
|
|
|
FrontCollect.Text = msg;
|
|
|
+ Console.WriteLine(System.DateTime.Now.ToString("1" + "yyyy-MM-dd hh:mm:ss fff"));
|
|
|
if (!FrontCheckFunction(msg, out ErrorMsg))
|
|
|
{
|
|
|
LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataDelete, adh);
|
|
|
@@ -331,6 +332,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ Console.WriteLine(System.DateTime.Now.ToString("2" + "yyyy-MM-dd hh:mm:ss fff"));
|
|
|
if (cu_print_checkdatecode.Checked)
|
|
|
{
|
|
|
string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
|
|
|
@@ -585,6 +587,7 @@ namespace UAS_LabelMachine
|
|
|
private bool FrontCheckFunction(string msg, out string ErrorMsg)
|
|
|
{
|
|
|
ErrorMsg = "";
|
|
|
+ Console.WriteLine(System.DateTime.Now.ToString("1" + "yyyy-MM-dd hh:mm:ss fff"));
|
|
|
//调用正则验证
|
|
|
RegexMatch("FrontCheck", msg, out ErrorMsg);
|
|
|
if (ErrorMsg != "")
|
|
|
@@ -890,6 +893,7 @@ namespace UAS_LabelMachine
|
|
|
if (SingleLabelCombox.Text != "")
|
|
|
{
|
|
|
SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
|
|
|
+ SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
SingleLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + SingleLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
}
|
|
|
sql.Clear();
|
|
|
@@ -915,6 +919,7 @@ namespace UAS_LabelMachine
|
|
|
if (MidLabelCombox.Text != "")
|
|
|
{
|
|
|
MidDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
|
|
|
+ MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
MidLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + MidLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
}
|
|
|
//缓存中盒参数
|
|
|
@@ -941,6 +946,7 @@ namespace UAS_LabelMachine
|
|
|
if (OutBoxCombox.Text != "")
|
|
|
{
|
|
|
OutBoxDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + OutBoxCombox.Text);
|
|
|
+ OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
}
|
|
|
//缓存外箱参数
|
|
|
@@ -1421,7 +1427,6 @@ namespace UAS_LabelMachine
|
|
|
MidDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
}
|
|
|
- MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
MidDoc.PrintDocument();
|
|
|
}
|
|
|
|
|
|
@@ -1511,7 +1516,6 @@ namespace UAS_LabelMachine
|
|
|
OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
}
|
|
|
- OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
OutBoxDoc.PrintDocument();
|
|
|
}
|
|
|
}
|
|
|
@@ -2031,7 +2035,7 @@ namespace UAS_LabelMachine
|
|
|
private void PLCStart_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
//查询前端检验的端口号
|
|
|
- DataTable dt = (DataTable)adh.ExecuteSql("select * from cominfo", "select");
|
|
|
+ DataTable dt = (DataTable)adh.ExecuteSql("select comtype,BaudRate,com,datawait,outtime from cominfo", "select");
|
|
|
DataRow[] dr = dt.Select("comtype='PLC1'");
|
|
|
if (dr.Length > 0)
|
|
|
{
|
|
|
@@ -2370,13 +2374,13 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
catch (Exception) { }
|
|
|
- int outboxcode1 = int.Parse(Process_midboxcode.Text == "" ? "1" : Process_midboxcode.Text);
|
|
|
- int outboxcode2 = int.Parse(Process_outboxcode.Text == "" ? "1" : Process_outboxcode.Text);
|
|
|
+ int outboxcode1 = Outbox1;
|
|
|
+ int outboxcode2 = Outbox2;
|
|
|
string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
|
|
|
//如果满容量获取过箱号就不再重复获取了
|
|
|
bool GetBarcode = false;
|
|
|
//获取当前的行号
|
|
|
- int CurrentRowNum = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
|
|
|
+ decimal CurrentRowNum = decimal.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
|
|
|
//超过中盒容量中盒号+1
|
|
|
if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
{
|
|
|
@@ -2600,7 +2604,7 @@ namespace UAS_LabelMachine
|
|
|
SingleDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
}
|
|
|
- SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
+ Console.WriteLine("8" + System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"));
|
|
|
SingleDoc.PrintDocument();
|
|
|
LogicHandler.UpdateRowPrinted(pib_id);
|
|
|
}
|
|
|
@@ -2646,5 +2650,17 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ int Outbox1;
|
|
|
+ int Outbox2;
|
|
|
+ private void Process_midboxcode_TextChanged(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ int.TryParse(Process_midboxcode.Text, out Outbox1);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Process_outboxcode_TextChanged(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ int.TryParse(Process_outboxcode.Text, out Outbox2);
|
|
|
+ }
|
|
|
}
|
|
|
}
|