private void InitializeDriverMode() { serverIP.Text = config.getServerIp(); string lidarIP = config.getLidarIp(); string lidarPort = config.getLidarPort(); lidar = new Lidar(config, lidarIP, int.Parse(lidarPort)); if (config.getControllerComName() != "כבוי") { SerialPortConnection(); } if (config.getGPSComName() != "כבוי") { gps = new GPS(config); gps.StartListening(GpsStatus); gpsStatusLabel.Text = gps.getStatus(); gpsStatusLabel.ForeColor = gps.isFix ? Color.DarkGreen : Color.Red; } else { activeAlert.Columns.RemoveAt(1); log.Columns.RemoveAt(2); } if (config.getInterntAdapter() != "כבוי") { new Thread(configServerConnection).Start(); } }
private void GpsStatus() { Invoke(new MethodInvoker(() => { if (config.getGPSComName() != "כבוי") { gpsStatusLabel.Text = gps.getStatus(); gpsStatusLabel.ForeColor = gps.isFix ? Color.DarkGreen : Color.Red; } else { gpsStatusLabel.Text = "כבוי"; gpsStatusLabel.ForeColor = Color.Black; } })); }