Ejemplo n.º 1
0
        private async void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //start the state tracker

            KEL103StateTracker.NewKEL103StateAvailable += a => onNewState_refresh(a);

            KEL103StateTracker.Start();

            while (!KEL103StateTracker.IsInitComplete)
            {
                await Task.Delay(1);
            }

            var client = KEL103StateTracker.CheckoutClient();
            var mode   = await KEL103Command.GetSystemMode(client);

            KEL103StateTracker.CheckinClient();

            comboBox1.SelectedIndex = mode;
            comboBox2.SelectedIndex = 1;
            comboBox3.SelectedIndex = 0;

            foreach (Control c in Controls)
            {
                c.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private async void button2_Click(object sender, EventArgs e)
        {
            //switch load input on and off

            var client = KEL103StateTracker.CheckoutClient();

            await KEL103Command.SetLoadInputSwitchState(client, !kel103_states.Last().InputState);

            KEL103StateTracker.CheckinClient();
        }
Ejemplo n.º 3
0
        private async void button1_Click_1(object sender, EventArgs e)
        {
            //set mode button

            var selected_index = comboBox1.SelectedIndex;

            if (selected_index > -1)
            {
                var client = KEL103StateTracker.CheckoutClient();
                await KEL103Command.SetSystemMode(client, selected_index);

                KEL103StateTracker.CheckinClient();
            }
        }