Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            imageList1.Images.Add(SystemIcons.Information);
            imageList1.Images.Add(SystemIcons.Warning);
            imageList1.Images.Add(SystemIcons.Error);

            checkBoxShowMessages.ImageIndex = 0;
            checkBoxShowWarnings.ImageIndex = 1;
            checkBoxShowErrors.ImageIndex   = 2;

            //dataGridView1.AutoGenerateColumns = false;
            //dataGridView1.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "Name", HeaderText = "Variable" });
            //dataGridView1.Columns.Add(new DataGridViewTextBoxColumn() { DataPropertyName = "Value", HeaderText = "Value" });
            dataGridView1.DataSource = variableList;

            LoadEventDescriptors();

            se.Variables = variables;

            UpdatePortList();

            var ports = SerialPortInfo.GetSerialPorts();

            foreach (var p in ports)
            {
                if (p.ToString() == Settings.Default.Port)
                {
                    comboBoxPort.Text = p.ToString();
                }
            }

            checkBoxRun_CheckedChanged(null, null);
        }
Esempio n. 2
0
 private void optionsToolStripMenuItem_DropDownOpening(object sender, EventArgs e)
 {
     comboBoxPorts.Items.Clear();
     comboBoxPorts.Items.AddRange(SerialPortInfo.GetSerialPorts());
     if (comboBoxPorts.SelectedIndex < 0 || comboBoxPorts.Text == "")
     {
         comboBoxPorts.SelectedIndex = 0;
     }
 }
        private void MainForm_Load(object sender, EventArgs e)
        {
            comPortsComboBox.Items.AddRange(SerialPortInfo.GetSerialPorts());
            try
            {
                comPortsComboBox.SelectedIndex = 0;
            } catch (ArgumentOutOfRangeException) { }
            powerComboBox.SelectedIndex   = 0;
            channelComboBox.SelectedIndex = 0;
            var pane = zedGraphControl.GraphPane;

            pane.Title.IsVisible       = false;
            pane.XAxis.Title.IsVisible = false;
            pane.YAxis.Title.IsVisible = false;
            pane.Fill             = new Fill(Color.Transparent);
            pane.Border.IsVisible = false;
            pane.Chart.Fill       = new Fill(Color.Black);
        }
 private void SerialPortsComboBoxDropDown(object sender, EventArgs e)
 {
     serialPortsComboBox.Items.Clear();
     serialPortsComboBox.Items.AddRange(SerialPortInfo.GetSerialPorts());
 }
Esempio n. 5
0
 private void comboBoxPort_DropDown(object sender, EventArgs e)
 {
     comboBoxPort.Items.Clear();
     comboBoxPort.Items.AddRange(SerialPortInfo.GetSerialPorts());
 }
Esempio n. 6
0
 void UpdatePortList()
 {
     comboBoxPort.Items.Clear();
     comboBoxPort.Items.AddRange(SerialPortInfo.GetSerialPorts());
 }