Example #1
0
        public void ConnectRefreshButtonClick(object sender, RoutedEventArgs e)
        {
            //Open serial port
            if (this.GUI.ComPort.Text != null)
            {
                LEDStrahlerSerial.Open(this.GUI.ComPort.Text);
            }

            //Ping for devices
            LEDStrahlerSerial.PingRequest(out List <uint> UUIDs);

            //Setup new device list
            List <LEDStrahler> DeviceList = new List <LEDStrahler>();

            foreach (uint UUID in UUIDs)
            {
                DeviceList.Add(new LEDStrahler(UUID));
            }
            this.GUI.DeviceList = DeviceList;

            //Read all temperatures once
            foreach (LEDStrahler Strahler in this.GUI.DeviceList)
            {
                LEDStrahlerSerial.GetTemperature(Strahler);
            }

            this.GUI.DeviceGrid.IsEnabled = true;
        }
Example #2
0
 public void GetTemperatureButtonClick(object sender, RoutedEventArgs e)
 {
     foreach (LEDStrahler Strahler in this.GUI.DeviceList)
     {
         LEDStrahlerSerial.GetTemperature(Strahler);
     }
 }