using EasyModbusClient; using IMCS.UControl; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace IMCS { public partial class Form_Main : Form { public Form_Main() { InitializeComponent(); this.Load += Form1_Load; } ControllerHelper controllerHelper = new ControllerHelper(); private void Form1_Load(object sender, EventArgs e) { Task.Factory.StartNew(() => { //controllerHelper.StartHttpServer(); }); System.Threading.Thread.Sleep(2000); this.timer1.Enabled = false; //this.userControl41.deviceStateDefaultList.Device_OnLine = true; //this.userControl41.deviceStateDefaultList.Device_ConnectionMes = true; //this.userControl41.deviceStateDefaultList.Device_Pan = DefaultList.EnumPlateNum.Plate_Zero; //this.userControl41.deviceStateDefaultList.Device_Name = "这里是一个测试"; //this.userControl41.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run; } private void timer1_Tick(object sender, EventArgs e) { try { if (!controllerHelper.GetDeviceCollectData()) { // this.timer1.Enabled = false; } } catch(Exception ex) { YG.Log.Instance.WriteLogAdd($"46-->>{ex.Message}"); } } } }