Example #1
0
        public ControlDialog(ComHandler c)
        {
            InitializeComponent();

            comHandler = c;

            string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
            port_comboBox.Items.AddRange(theSerialPortNames);
            //port_comboBox.SelectedItem = theSerialPortNames[0];
            port_comboBox.SelectedItem = Properties.Settings.Default.ComPort;
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();

            comHandler  = new ComHandler();
            machineData = new MachineData();

            comHandler.onStatusRead         += new IntDelegate(comHandler_onStatusRead);
            comHandler.onCommunicationError += new SimpleDelegate(comHandler_onCommunicationError);

            statusTimer.Tick    += new EventHandler(statusTimer_Tick);
            statusTimer.Interval = 100;
            statusTimer.Start();

            exposureTimer.Tick += new EventHandler(exposureTimer_Tick);
        }
Example #3
0
        public Calibrator_Form(ComHandler h, MachineData m)
        {
            InitializeComponent();

            comHandler  = h;
            machineData = m;

            nuds = new NumericUpDown[40];

            for (int x = 0; x < 40; x++)
            {
                Button b = new Button();
                b.Size   = new Size(50, 20);
                b.Text   = "copy";
                b.Click += new EventHandler(copyClick);
                b.Tag    = x;

                if (x == 0)
                {
                    b.Visible = false;
                }

                NumericUpDown nud = new NumericUpDown();
                nud.Size    = new Size(60, 50);
                nud.Minimum = 8;
                nud.Maximum = 500;
                nud.Value   = machineData.delaySettings[x];

                nud.ValueChanged += new EventHandler(numericUpdown_ValueChanged);

                nuds[x] = nud;

                SplitContainer spl = new SplitContainer();
                spl.Size = new Size(150, 20);
                spl.Panel1.Controls.Add(b);

                spl.Panel2.Controls.Add(nud);

                flowLayoutPanel1.Controls.Add(spl);
            }

            startNumericUpdown.Value = machineData.stepperStartPos;
        }