| | |
| | | using HMI.Core.Util; |
| | | using HMI.Simple.Util; |
| | | using log4net; |
| | | using ModBusTcp; |
| | | using Panuon.WPF.UI; |
| | | using Plugin.DataBoard; |
| | | using Plugin.TestResult_WPF; |
| | |
| | | ProductModelHelper.GetModelBySNR("cc123", out string model, out string msg); |
| | | LangUtil.Load(); |
| | | InitializeComponent(); |
| | | RebuildDb(); |
| | | //RebuildDb(); |
| | | |
| | | ModBusTcpController controller = new ModBusTcpController("127.0.0.1", 502); |
| | | if (controller.Start(out msg)) { |
| | | bool res; |
| | | int? target; |
| | | |
| | | controller.WriteBool("1", true, out msg); |
| | | controller.ReadDOBool("1", out res, out msg); |
| | | Console.WriteLine(res); |
| | | controller.ReadDOInt("1", out target, out msg); |
| | | Console.WriteLine(target); |
| | | controller.WriteInt("1", 1, out msg); |
| | | controller.ReadDOInt("1", out target, out msg); |
| | | Console.WriteLine(target); |
| | | Console.WriteLine(target); |
| | | } |
| | | |
| | | |
| | | //page.Children.Add(new UserControl1()); |
| | | } |
| | | |
| | |
| | | |
| | | private void Button_Click(object sender, RoutedEventArgs e) |
| | | { |
| | | Task.Run(() => |
| | | { |
| | | for (int j = 0; j < 1000; j++) |
| | | { |
| | | string status = (j % 2 == 0) ? "Passed" : "Failed"; |
| | | string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995"; |
| | | tsExecution.AddTestData(0, $"ConnectivityCANRec,2,3,4,{d},6,{status}"); |
| | | Thread.Sleep(5); |
| | | } |
| | | }); |
| | | //Task.Run(() => |
| | | //{ |
| | | // for (int j = 0; j < 1000; j++) |
| | | // { |
| | | // string status = (j % 2 == 0) ? "Passed" : "Failed"; |
| | | // string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995"; |
| | | // tsExecution.AddTestData(0, $"ConnectivityCANRec,2,3,4,{d},6,{status}"); |
| | | // Thread.Sleep(5); |
| | | // } |
| | | //}); |
| | | |
| | | Task.Run(() => |
| | | { |
| | | for (int j = 0; j < 1000; j++) |
| | | { |
| | | string status = (j % 2 == 0) ? "Passed" : "Failed"; |
| | | string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995"; |
| | | tsExecution.AddTestData(1, $"ConnectivityCANRec,2,3,4,{d},6,{status}"); |
| | | Thread.Sleep(5); |
| | | } |
| | | }); |
| | | //Task.Run(() => |
| | | //{ |
| | | // for (int j = 0; j < 1000; j++) |
| | | // { |
| | | // string status = (j % 2 == 0) ? "Passed" : "Failed"; |
| | | // string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995"; |
| | | // tsExecution.AddTestData(1, $"ConnectivityCANRec,2,3,4,{d},6,{status}"); |
| | | // Thread.Sleep(5); |
| | | // } |
| | | //}); |
| | | |
| | | Task.Run(() => |
| | | { |
| | | for (int j = 0; j < 1000; j++) |
| | | { |
| | | string status = (j % 2 == 0) ? "Passed" : "Failed"; |
| | | string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995"; |
| | | tsExecution.AddTestData(2, $"ConnectivityCANRec,2,3,4,{d},6,{status}"); |
| | | Thread.Sleep(5); |
| | | } |
| | | }); |
| | | //Task.Run(() => |
| | | //{ |
| | | // for (int j = 0; j < 1000; j++) |
| | | // { |
| | | // string status = (j % 2 == 0) ? "Passed" : "Failed"; |
| | | // string d = (j % 2 == 0) ? "9" : "9999999999999999999999999999999999999999999999999999999999999999995"; |
| | | // tsExecution.AddTestData(2, $"ConnectivityCANRec,2,3,4,{d},6,{status}"); |
| | | // Thread.Sleep(5); |
| | | // } |
| | | //}); |
| | | |
| | | //Task.Run(() => |
| | | //{ |