莫海杰 1 mês atrás
pai
commit
2b8df84c48

BIN
Lib/SCADA.dll


+ 7 - 7
SCADA_DAQ/Customer/Machines/SampleMachine_ScanCompleted.cs

@@ -34,13 +34,13 @@ namespace SCADA_DAQ.Customer.Machines
             base.ScanCompleted(sender, e);
             if (BaseDevice.DeviceID.StartsWith("输送线"))
             {
-                //var op = new OperationBo { StartRow = 2, StartCol = 42, StartLayer = 5, ItemName = "标准_塑料管夹_THPG-342" };
-                //var opHex = op.OperToHex();
-                //var screen3 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏3");
-                //if(screen3.GetListenReg("400001") != null)
-                //{
-                //    screen3.GetListenReg("400001").WriteReg(opHex);
-                //}
+                var op = new OperationBo { StartRow = 2, StartCol = 42, StartLayer = 5, ItemName = "标准_塑料管夹_THPG-342" };
+                var opHex = op.OperToHex();
+                var screen3 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏3");
+  //             if (screen3.GetListenReg("400001") != null)
+  //             {
+  //                 screen3.GetListenReg("400001").WriteReg("标准_塑料管夹_THPG-342");
+  //             }
 
 
                 //var screen4 = MachineServer.GetInstance().GetMachine<SampleMachine>("显示屏4");

+ 2 - 2
SCADA_DAQ/Customer/Utils/Screen.cs

@@ -47,14 +47,14 @@ namespace SCADA_DAQ.Customer.Utils
             }
             return list4.ToArray();
         }
-        public static int[] OperToHex(this OperationBo operation)
+        public static string OperToHex(this OperationBo operation)
         {
             var rcl = RowColLayerFormat(operation);
             var rclHex = List2ToList4(ToHex(rcl));
             var itemNameHex = List2ToList4(ToHex(operation.ItemName));
             // 只针对显示屏34
             var strat = new string[] { "0000", "0000" };
-            return strat.Concat(rclHex).Concat(new string[]{ "0000" }).Concat(itemNameHex).Select(t=> Convert.ToInt32(t)).ToArray();
+            return string.Join("",strat.Concat(rclHex).Concat(new string[] { "0000" }).Concat(itemNameHex).Select(t => t).ToList<string>());
         }
     }
 }