|
|
@@ -130,25 +130,25 @@ namespace UAS_MES.Make
|
|
|
pr_cartongw.Text = Weight + "±" + (MaxWeight - Weight);
|
|
|
else
|
|
|
pr_cartongw.Text = MinWeight + "-" + MaxWeight;
|
|
|
- if (pr_cartonunit.Text == "kg")
|
|
|
- {
|
|
|
- weight.Text = (float.Parse(weight.Text) / 1000).ToString();
|
|
|
- }
|
|
|
- double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
|
|
|
+ //if (pr_cartonunit.Text == "kg")
|
|
|
+ //{
|
|
|
+ // weight.Text = (float.Parse(weight.Text) / 1000).ToString();
|
|
|
+ //}
|
|
|
+ double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim());
|
|
|
//需要检查称重重量
|
|
|
if (PR_CHECKCARTONW != "0")
|
|
|
{
|
|
|
//称量合格或不合格都记录重量
|
|
|
if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格", outboxcode.Text, "");
|
|
|
- OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green,outboxcode);
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量不合格", outboxcode.Text, "");
|
|
|
- OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red,outboxcode);
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -169,7 +169,7 @@ namespace UAS_MES.Make
|
|
|
lsi.SubItems.Add(ActualWeight.ToString() + pr_cartonunit.Text);
|
|
|
lsi.SubItems.Add(System.DateTime.Now.ToString());
|
|
|
WeighRecord.Items.Add(lsi);
|
|
|
- OperateResult.AppendText(">>箱号" + outboxcode.Text + "称重完成\n", Color.Green,outboxcode);
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "称重完成\n", Color.Green);
|
|
|
dh.ExecuteSql("update package set pa_weight='" + weight.Text + "', pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
|
|
|
outboxcode.Clear();
|
|
|
}
|
|
|
@@ -191,7 +191,8 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
+ weight.Text = serialPort1.ReadLine();
|
|
|
+ //weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|