ソースを参照

彩盒称重和卡通箱称重重量维护为浮点数

shim 8 年 前
コミット
a626be11cd

+ 6 - 6
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -37,11 +37,11 @@ namespace UAS_MES.Make
         //箱内总数
         int pa_totalqty;
         //称量的标准重量
-        int Weight;
+        Double Weight;
         //最大重量
-        int MaxWeight;
+        Double MaxWeight;
         //最小重量
-        int MinWeight;
+        Double MinWeight;
         DataTable ListC = new DataTable();
 
         Thread InitPrint;
@@ -116,9 +116,9 @@ namespace UAS_MES.Make
                     string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
                     string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
                     string pa_pr_cartonunit = dt.Rows[0]["pr_cartonunit"].ToString();
-                    Weight = int.Parse(_weight == "" ? "0" : _weight);
-                    MaxWeight = int.Parse(_maxweight == "" ? "0" : _maxweight);
-                    MinWeight = int.Parse(_minweight == "" ? "0" : _minweight);
+                    Weight = double.Parse(_weight == "" ? "0" : _weight);
+                    MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                    MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
                     pa_totalqty = int.Parse(dt.Rows[0]["pa_totalqty"].ToString());
                     if (Weight - MinWeight == MaxWeight - Weight)
                         pr_cartongw.Text = Weight + "±" + (MaxWeight - Weight);

+ 6 - 6
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -27,11 +27,11 @@ namespace UAS_MES.Make
         Thread thread;
         SerialPort serialPort1 = new SerialPort();
         //称量的标准重量
-        int Weight;
+        Double Weight;
         //最大重量
-        int MaxWeight;
+        Double MaxWeight;
         //最小重量
-        int MinWeight;
+        Double MinWeight;
         //是否通过串口获取数据
         bool GetData = true;
 
@@ -87,9 +87,9 @@ namespace UAS_MES.Make
                     string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
                     string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
                     //赋值重量单位
-                    Weight = int.Parse(_weight == "" ? "0" : _weight);
-                    MaxWeight = int.Parse(_maxweight == "" ? "0" : _maxweight);
-                    MinWeight = int.Parse(_minweight == "" ? "0" : _minweight);
+                    Weight = double.Parse(_weight == "" ? "0" : _weight);
+                    MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                    MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
                     BaseUtil.SetFormValue(this.Controls, dt);
                     if (Weight - MinWeight == MaxWeight - Weight)
                         pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight);

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -192,7 +192,7 @@ namespace UAS_MES.Make
                         {
                             OperateResult.AppendText(">>" + code.Text + "\n", Color.Black);
                             //开始录入SN
-                            if (!dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "'"))
+                            if (ChangeResult.Checked||!dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "'"))
                             {
                                 //判断用户是否锁定输入SN长度,
                                 if (!checkLengthOrPre(SNLength_checkBox, SNLength, "长度", "SN"))