private void LDDSonoff_Click(object sender, EventArgs e) { string currentName = ""; string RelatedPort = ""; // string DeviceType = ""; string PortData = ""; string PortBind = ""; string BoardNumber = this.BoardNumber; DataBus.DataSend.CDataSend dataSend; dataSend = new DataBus.DataSend.CDataSend(); Library.Common.ButtonCheck comp = (Library.Common.ButtonCheck)sender; currentName = "Dechp_" + comp.Name; dataPT.GetBoardSendPortByNameBdnum(currentName, BoardNumber, ref RelatedPort, ref PortData, ref PortBind); dataSend.SendControlData(this.DeviceRun.currentState, RelatedPort, PortBind, this.BoardNumber); }
private void sendButtonClick(object sender, EventArgs e) { Type t = sender.GetType(); Library.SendButton tb = (Library.SendButton)sender; DataBus.DataAccess.CData_PointTable dataPT = new DataBus.DataAccess.CData_PointTable(); DataBus.DataSend.CDataSend dataSend; dataSend = new DataBus.DataSend.CDataSend(); string RelatedPort = ""; string PortData = ""; string PortBind = ""; string DeviceType = ""; PropertyInfo m_BoardNumber = t.GetProperty("BoardNumber"); PropertyInfo m_RelatedPort = t.GetProperty("RelatedPort"); PropertyInfo m_PortData = t.GetProperty("PortData"); PropertyInfo m_PortBind = t.GetProperty("PortBind"); PropertyInfo m_DeviceName = t.GetProperty("DeviceName"); PropertyInfo m_DeviceType = t.GetProperty("RelatedDeviceType"); string currentName = "Denchp_" + t.Name.ToString(); dataPT.GetBoardPortByNameBdnum(currentName, BoardNumber, ref RelatedPort, ref DeviceType); dataPT.GetBoardSendPortByNameBdnum(currentName, BoardNumber, ref RelatedPort, ref PortData, ref PortBind); bool isSuccess = dataSend.SendControlData(tb.sendData.Text, RelatedPort, PortBind, this.BoardNumber); if (isSuccess == true) { System.Windows.Forms.MessageBox.Show("Success!"); } else { System.Windows.Forms.MessageBox.Show("Failed!"); } m_BoardNumber.SetValue(tb, BoardNumber, null); m_RelatedPort.SetValue(tb, RelatedPort, null); //m_DeviceType.SetValue(tb, currentType, null); m_DeviceName.SetValue(tb, currentName, null); m_PortData.SetValue(tb, PortData, null); m_PortBind.SetValue(tb, PortBind, null); }
public SendButton() { InitializeComponent(); dataSend = new DataBus.DataSend.CDataSend(); dataPT = new DataBus.DataAccess.CData_PointTable(); timertest = new Timer(); timertest.Interval = 50000; timertest.Tick += new EventHandler(Timer_Tick); timertest.Enabled = true; if (LicenseManager.UsageMode == LicenseUsageMode.Designtime) { timertest.Stop(); } else { timertest.Start(); } }
public ButtonCheckFun() { InitializeComponent(); dataSend = new DataBus.DataSend.CDataSend(); rtdm = new DataBus.DataAccess.CData_ControlDataManager(); //设置Style支持透明背景色并且双缓冲 this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.Selectable, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.UserPaint, true); this.BackColor = Color.Transparent; this.Cursor = Cursors.Hand; this.Size = new Size(87, 27); timertest = new Timer(); timertest.Interval = 5000; //五分钟判断一次状态 timertest.Tick += new EventHandler(Timer_Tick); timertest.Enabled = true; }
public CommunicationOnOff() { InitializeComponent(); dataSend = new DataBus.DataSend.CDataSend(); }