Beispiel #1
0
 private void PPV_ARDUINO_DATA_IN_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
 {
     if (PPV_ARDUINO_IN.IsOpen)
     {
         PPV_LCD_DATA_IN.Invoke((MethodInvoker) delegate
         {
             PPV_LCD_DATA_IN.Text = PPV_ARDUINO_IN.ReadLine();
             MemCopy = PPV_LCD_DATA_IN.Text;
         });
     }
     PPV_ARDUINO_DATA_IN.RunWorkerAsync();
 }
Beispiel #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     if (COM_PORT_RAILER == 99)
     {
         PPVLM_Rail1.Text = "Configure COM Port";
     }
     else
     {
         PPVLM_Rail1.Text       = "Last Measurement: ";
         lastResultRail.Visible = true;
         lastResultRail.Text    = "0.00 V";
         PPV_ARDUINO_DATA_IN.RunWorkerAsync();
     }
 }
Beispiel #3
0
 private void EEPROM_WRITE_CHANGES_Click(object sender, EventArgs e)
 {
     COM_PORT_RAILER        = int.Parse(COM_PORT_RAIL.Text);
     PPVLM_Rail1.Text       = "Last Measurement: ";
     lastResultRail.Visible = true;
     lastResultRail.Text    = "0.00 V";
     PPV_SELECTIVE_LCD();
     try
     {
         PPV_ARDUINO_IN.Close();
         PPV_ARDUINO_IN.PortName = "COM" + COM_PORT_RAILER;
         PPV_ARDUINO_IN.Open();
         PPV_ARDUINO_DATA_IN.RunWorkerAsync();
     } catch (Exception ex)
     {
         MessageBox.Show("Cannot open the port. It may be busy or inactive. The following error has occured: \n" + ex, "ArduMeter went berserk", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }