Пример #1
0
        private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            List<SerialPortTuple> serialPorts = await GetAvailableSerialPorts();

            SerialPortComboBox.DisplayMemberPath = "Name";
            SerialPortComboBox.SelectedValuePath = "Id";
            SerialPortComboBox.ItemsSource = serialPorts;

            speakerImpl = new Speaker(media);
            joystick = new GenericJoystick();
            InitWebServer(serialPorts);

            Speak("Ready");
        }
Пример #2
0
 public ShortyTheRobot(ISpeaker speaker, IJoystickController joystick, int loopTimeMs)
 {
     this.speaker = speaker;
     this.joystick = joystick;
     this.loopTimeMs = loopTimeMs;
 }
Пример #3
0
        private void MainPage_Unloaded(object sender, RoutedEventArgs e)
        {
            if(httpServer != null)
                httpServer.Dispose();

            if (isWorkerRunning)
            {
                StopWorker();
            }
            joystick.Dispose();
            joystick = null;
        }