private void btnOK_BtnClick(object sender, EventArgs e) { if (FrmDialog.ShowDialog(this, "保存后需要重新启动系统,是否要保存?", "保存提示", true, true, true, true) == DialogResult.OK) { try { TcpPackConfig.ReceiveBufferSize = int.Parse(ucReceiveBufferSize.InputText); TcpPackConfig.SendBufferSize = int.Parse(ucSendBufferSize.InputText); TcpPackConfig.ReceiveTimeout = int.Parse(ucReceiveTimeout.InputText); TcpPackConfig.SendTimeout = int.Parse(ucSendTimeout.InputText); TcpPackConfig.HeartBeat = tbHeart.Text; TcpPackConfig.HeadPack = tbHead.Text; TcpPackConfig.TailPack = tbTail.Text; TcpPackConfig.DelayTime = int.Parse(ucDelayTime.InputText); IOMonitorManager.Config.RemotePort = ucRemotePort.InputText; IOMonitorManager.Config.RemoteIP = tbIP.Text; IOMonitorManager.Config.WriteConfig(); this.DialogResult = DialogResult.OK; } catch (Exception ex) { MonitorFormManager.DisplyException(ex); } } }
/// <summary> /// 设置采集点的采集值 /// </summary> /// <returns></returns> public void SetIOValue(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION comm, Scada.Model.IO_DEVICE device) { try { ChangedBinds(server, comm, device.Copy()); } catch (Exception ex) { MonitorFormManager.DisplyException(ex); } }
public void LoadTreeStatus() { Task.Run(() => { try { MonitorFormManager.LoadProject(this.IoTreeStatus); } catch (Exception ex) { MonitorFormManager.DisplyException(ex); } }); }
private void listView_SelectedIndexChanged(object sender, EventArgs e) { if (listView.SelectedItems.Count < 0) { return; } try { IO_PARA para = listView.SelectedItems[0].Tag as IO_PARA; MonitorFormManager.SetIOPara(this.Server, this.Communication, this.Device, para); } catch (Exception ex) { MonitorFormManager.DisplyException(ex); } }
private void IoTreeStatus_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node is IoDeviceTreeNode) { try { IoDeviceTreeNode devNode = e.Node as IoDeviceTreeNode; this.mediator.IOMonitorForm.Device = devNode.Device; this.mediator.IOMonitorForm.Communication = devNode.Communication; this.mediator.IOMonitorForm.ChangedBinds(devNode.Server, devNode.Communication, devNode.Device); this.mediator.IOMonitorForm.SetIOValue(devNode.Server, devNode.Communication, devNode.Device); } catch (Exception ex) { MonitorFormManager.DisplyException(ex); } } }