Ejemplo n.º 1
0
 public void SerialPortDetectLoop()
 {
     if (!AlreadyLooking)
     {
         AlreadyLooking = true;
         while (OnPage)
         {
             List <string> Detected = PlatformSpecificSerialManager.Scan();
             if (Detected.Count < KnownDevices.Count)
             {
                 foreach (string x in KnownDevices)
                 {
                     if (!Detected.Contains(x))
                     {
                         RemovedPort(x);
                     }
                 }
             }
             if (Detected.Count != KnownDevices.Count)
             {
                 foreach (string x in Detected)
                 {
                     if (!KnownDevices.Contains(x))
                     {
                         NewPort(x);
                     }
                 }
             }
         }
         AlreadyLooking = false;
     }
 }
Ejemplo n.º 2
0
        private void SendButton_Clicked(object sender, EventArgs e)
        {
            string ToSend = SendEditor.Text;

            SendEditor.Text = "";
            PlatformSpecificSerialManager.Write(ToSend);
        }
Ejemplo n.º 3
0
        public AnalysisPage()
        {
            InitializeComponent();
            Title = "Analysis";
            List <string> coms = PlatformSpecificSerialManager.Scan();

            PlatformSpecificSerialManager.Load(coms[0]);
            scope = new SNPScope(new SerialComInterface(PlatformSpecificSerialManager));
        }
Ejemplo n.º 4
0
 private void OpenPortButton_Clicked(object sender, System.EventArgs e)
 {
     if (SerialDevicePicker.SelectedItem != null)
     {
         if (PlatformSpecificSerialManager.IsOpen)
         {
             PlatformSpecificSerialManager.Close();
         }
         PlatformSpecificSerialManager.Load((string)SerialDevicePicker.SelectedItem);
         PlatformSpecificSerialManager.SetBaud(Convert.ToInt32((string)BaudRatePicker.SelectedItem));
         PlatformSpecificSerialManager.SetData(Convert.ToInt32((string)DataBitsPicker.SelectedItem));
         PlatformSpecificSerialManager.SetParity((string)ParityPicker.SelectedItem);
         PlatformSpecificSerialManager.SetStop(Convert.ToDouble((string)StopBitsPicker.SelectedItem));
         SendEditor.Text      = "";
         ReadInEditor.Text    = "";
         SendEditor.IsEnabled = true;
         SendButton.IsEnabled = true;
     }
 }