Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Console.Write("Polling should start now");
            if (scada.Connected)
            {
                //TODO add stop polling code
            }
            else
            {
                SCADAIFace.TestDevice(scada);
            }

            if (scada.Connected)
            {
                button1.Text = "Stop Polling";
            }
            else
            {
                button1.Text = "Start Polling";
            }

            // start thread to update values on start
            // stop thread on stop
            Thread uthread = new Thread(new ThreadStart(this.updateListBox));

            uthread.Start();
        }
Exemplo n.º 2
0
        private void execute_button_clicked(object sender, EventArgs e)
        {
            string commandname = "unknown";

            //TODO get radio selection
            if (radioButton1.Checked)
            {
                commandname = radioButton1.Text;
            }
            else if (radioButton2.Checked)
            {
                commandname = radioButton2.Text;
            }
            else if (radioButton3.Checked)
            {
                commandname = radioButton3.Text;
            }
            else if (radioButton4.Checked)
            {
                commandname = radioButton4.Text;
            }
            else
            {
                Console.WriteLine("error - one command must be selected!");
                return;
            }

            // call DLL operate
            SCADAIFace.OperateDevice(_device_mrid, commandname, _command_index);
        }