|
|
@@ -120,8 +120,6 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
}
|
|
|
//如果未打开串口设置为0
|
|
|
- if (pr_colorboxunit.Text == "kg")
|
|
|
- weight.Text = (float.Parse(weight.Text) / 1000).ToString();
|
|
|
double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
|
|
|
if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
|
|
|
{
|
|
|
@@ -171,6 +169,8 @@ namespace UAS_MES.Make
|
|
|
try
|
|
|
{
|
|
|
weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
|
|
|
+ if (pr_colorboxunit.Text == "kg")
|
|
|
+ weight.Text = (float.Parse(weight.Text) / 1000).ToString();
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|