Exemplo n.º 1
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            if (!Program.PM3.IsRunning())
            {
                COMPortBox.Focus();

                if (COMPortBox.Items.Count == 0)
                {
                    COMPortBox_DropDown(null, null);
                }

                if (COMPortBox.Items.Count == 1)
                {
                    COMPortBox.SelectedIndex = 0;
                }
                if (!Program.PM3.IsRunning())
                {
                    return;
                }
            }

            Program.PM3.ClientProcess.StandardInput.WriteLine(commandComboBox.Text);
            if (commandComboBox.Items.IndexOf(commandComboBox.Text) < 0)
            {
                commandComboBox.Items.Add(commandComboBox.Text);
            }
        }
Exemplo n.º 2
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            if (!Program.PM3.IsRunning())
            {
                COMPortBox.Focus();
                return;
            }

            Program.PM3.ClientProcess.StandardInput.WriteLine(commandComboBox.Text);
            if (commandComboBox.Items.IndexOf(commandComboBox.Text) < 0)
            {
                commandComboBox.Items.Add(commandComboBox.Text);
            }
        }
Exemplo n.º 3
0
        private bool EnsurePM3isRunning()
        {
            if (!Program.PM3.IsRunning())
            {
                COMPortBox.Focus();

                if (COMPortBox.Items.Count == 0)
                {
                    COMPortBox_DropDown(null, null);
                }

                if (COMPortBox.Items.Count == 1)
                {
                    if (COMPortBox.SelectedIndex == 0)
                    {
                        COMPortBox.SelectedIndex = -1;
                    }
                    COMPortBox.SelectedIndex = 0;
                }
            }

            return(Program.PM3.IsRunning());
        }