Ejemplo n.º 1
0
        private void InitUI()
        {
            Form F = this.FindForm();

            WiseFilterWheel.ReadProfile();

            foreach (var w in WiseFilterWheel.wheels)
            {
                for (int i = 0; i < w._nPositions; i++)
                {
                    ComboBox cb;

                    cb = (ComboBox)F.Controls.Find(string.Format("comboBox{0}{1}", w._nPositions, i), true)[0];
                    if (w._positions[i].filterName == string.Empty)
                    {
                        cb.Text = string.Empty;
                    }
                    else
                    {
                        Filter f = WiseFilterWheel._filterInventory[WiseFilterWheel.filterSizeToIndex[w._filterSize]].Find((x) => x.Name == w._positions[i].filterName);
                        cb.Text = (f == null) ? "<??>" : string.Format("{0}: {1}", f.Name, f.Description);
                    }
                    foreach (Filter f in WiseFilterWheel._filterInventory[WiseFilterWheel.filterSizeToIndex[w._filterSize]])
                    {
                        cb.Items.Add(string.Format("{0}: {1}", f.Name, f.Description));
                    }

                    TextBox tb;
                    tb         = (TextBox)F.Controls.Find(string.Format("textBoxWheel{0}RFID{1}", w._nPositions, i), true)[0];
                    tb.Text    = w._positions[i].tag ?? string.Empty;
                    tb.Enabled = checkBoxEditableRFIDs.Checked;
                }
            }

            string[] existingPorts = System.IO.Ports.SerialPort.GetPortNames();
            comboBoxPort.Items.AddRange(existingPorts);

            string port = WiseFilterWheel.Instance.arduino.SerialPortName;

            if (!String.IsNullOrEmpty(port))
            {
                foreach (var p in existingPorts)
                {
                    if (p == port)
                    {
                        comboBoxPort.Text = port;
                        break;
                    }
                }
            }
            else
            {
                comboBoxPort.Text = "";
            }

            labelOpModeValue.Text = WiseSite.OperationalMode.ToString();

            UpdateEditability();
        }
Ejemplo n.º 2
0
        public FilterWheelSetupDialogForm()
        {
            wisefilterwheel.init();

            WiseFilterWheel.ReadProfile();
            InitializeComponent();
            InitUI();
        }