public void buttonItem_ReadRTU_Click(object sender, EventArgs e) { if (TcpControl.Connected) { TcpControl.SendUItoServiceCommand("--rtu|"); } else { DevComponents.DotNetBar.MessageBoxEx.Show("与服务端通讯异常,无法重置信息!", "[提示]", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void buttonItem_SendMail_Click(object sender, EventArgs e) { if (TcpControl.Connected) { TcpControl.SendUItoServiceCommand("--mal|"); } else { DevComponents.DotNetBar.MessageBoxEx.Show("与服务端通讯异常,无法发送命令!", "[提示]", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void toolStripMenuItem_SetTime_Click(object sender, EventArgs e) { var com = from t in ExecServiceList.Lsm where t.SERVICETYPE == "COM" select t; if (com.Count() > 0) { if (TcpControl.Connected) { string command = "--com|tim"; bool b = TcpControl.SendUItoServiceCommand(command); if (!b) { DevComponents.DotNetBar.MessageBoxEx.Show("命令发送失败!", "[提示]", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { DevComponents.DotNetBar.MessageBoxEx.Show("与服务端通讯异常,无法重启各信道服务!", "[提示]", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
void ri_MouseDoubleClick(object sender, MouseEventArgs e) { string tag = (sender as DevComponents.DotNetBar.Controls.ReflectionImage).Tag.ToString(); var ser = from s in ExecServiceList.Lsm where (s.SERVICETYPE + s.SERVICEID) == tag select s; string SERVICETYPE = ser.First().SERVICETYPE; ser = from s in ExecServiceList.Lsm where s.SERVICETYPE == SERVICETYPE select s; OperateXML.serviceModel[] sers = ser.ToArray <OperateXML.serviceModel>(); string Index = ""; for (int i = 0; i < ser.Count(); i++) { if (sers[i].SERVICETYPE + sers[i].SERVICEID == tag) { Index += "0:"; } else { Index += "1:"; } } if (TcpControl.Connected && Index.Length > 0) { Index = Index.Substring(0, Index.Length - 1); string command = "--" + SERVICETYPE.ToLower() + "|" + Index; bool b = TcpControl.SendUItoServiceCommand(command); if (!b) { DevComponents.DotNetBar.MessageBoxEx.Show("命令发送失败!", "[提示]", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { DevComponents.DotNetBar.MessageBoxEx.Show("与服务端通讯异常,无法重启各信道服务!", "[提示]", MessageBoxButtons.OK, MessageBoxIcon.Information); } }