Beispiel #1
0
 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);
         }
     }
 }
Beispiel #2
0
 /// <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);
     }
 }
Beispiel #3
0
 public void LoadTreeStatus()
 {
     Task.Run(() =>
     {
         try
         {
             MonitorFormManager.LoadProject(this.IoTreeStatus);
         }
         catch (Exception ex)
         {
             MonitorFormManager.DisplyException(ex);
         }
     });
 }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
        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);
                }
            }
        }