private void startTraining(object sender, EventArgs e) { if (_inTraining) return; _inTraining = true; if (isSpecialist) { TCPController.Send(new NotifyPacket(NotifyPacket.Subject.StartTraining, client.NonNullId.ToString(), Settings.GetInstance().authToken)); _spController = new Specialist_Controller(); _spController.UpdatedList += UpdateGUI; } else { var port = getCOMPort(); if (port == null) { MessageBox.Show("No COM port found. Please connect your pc to a Kettler x7"); return; } _controller = new RH_Controller(new COM_Bike(port), true); //_controller = new RH_Controller(new STUB_Bike(), true); _controller.UpdatedList += UpdateGUI; } startTrainingButton.Enabled = false; _quitButton.Enabled = true; }
public RH_BIKE_GUI(IBike b) { _controller = new RH_Controller(b); _controller.UpdatedList += updateGUI; _writeToFile = false; InitializeComponent(); updateGraph(); }
public RH_BIKE_GUI(IBike b, string path) { _controller = new RH_Controller(b); _controller.UpdatedList += updateGUI; _writeToFile = true; InitializeComponent(); writeRealTime(path); updateGraph(); }