Example #1
0
        //主动下置命令

        private void btSend_Click(object sender, EventArgs e)
        {
            if (this.IOTreeView.SelectedNode == null)
            {
                FrmDialog.ShowDialog(this, "请在IO树中选择设备节点");
                return;
            }
            if (this.IOTreeView.SelectedNode is IoDeviceTreeNode)
            {
                IoDeviceTreeNode        deviceNode            = this.IOTreeView.SelectedNode as IoDeviceTreeNode;
                IoCommunicationTreeNode communicationTreeNode = this.IOTreeView.SelectedNode.Parent as IoCommunicationTreeNode;
                IoServerTreeNode        serverNode            = this.IOTreeView.SelectedNode.Parent.Parent as IoServerTreeNode;
                if (serverNode.ClientEndPoint == null)
                {
                    FrmDialog.ShowDialog(this, "采集站终端未上线");
                    return;
                }
                SendCommandForm sendCommandForm = new SendCommandForm();
                sendCommandForm.InitCommand(serverNode.Server, communicationTreeNode.Communication, deviceNode.Device);
                if (sendCommandForm.ShowDialog(this) == DialogResult.OK)
                {
                }
            }
            else
            {
                FrmDialog.ShowDialog(this, "请在IO树中选择设备节点");
                return;
            }
        }
Example #2
0
 private void pictureBoxRemadeThen_MouseClick(object sender, MouseEventArgs e)
 {
     switch (this.comboBoxThen.Text)
     {
     case "Отправить команду":
         using (var win = new SendCommandForm(Form.itemList, _deviceThen, _stateThen))
         {
             var result = win.ShowDialog();
             if (result == DialogResult.OK)
             {
                 _deviceThen = win.comboBoxItems.Text;
                 _stateThen  = win.comboBoxState.Text;
             }
         }
         break;
     }
 }
Example #3
0
 private void comboBoxThen_SelectedIndexChanged(object sender, EventArgs e)
 {
     switch (this.comboBoxThen.Text)
     {
     case "Отправить команду":
         using (var win = new SendCommandForm(Form.itemList))
         {
             var result = win.ShowDialog();
             if (result == DialogResult.OK)
             {
                 _deviceThen = win.comboBoxItems.Text;
                 _stateThen  = win.comboBoxState.Text;
             }
         }
         //new SendCommandForm(Form.itemList).Show();
         //winReceivesCom.Show();
         break;
     }
 }