Exemple #1
0
        // Update list of output devices
        private void UpdateDevices()
        {
            listboxDevices.Items.Clear();
            _devices = PpmGenerator.GetDevices().OrderBy(x => x.FriendlyName).ToList();

            foreach (var device in _devices)
            {
                listboxDevices.Items.Add($"{device.FriendlyName} - {device.State}");
            }
        }
Exemple #2
0
        // Start PPM Generator
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (_isPlaying)
            {
                return;
            }

            if (listboxDevices.SelectedIndex == -1)
            {
                MessageBox.Show("Please, select the output device", "PPM Control", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            _generator = new PpmGenerator(CHANNELS_COUNT, StandartProfiles.FlySky, _devices[listboxDevices.SelectedIndex]);
            _generator.SetValues(_channelValues);
            _generator.Start();
            SetPlaying(true);
        }
Exemple #3
0
        // Start PPM Generator
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (_isPlaying)
            {
                return;
            }

            if (listboxDevices.SelectedIndex == -1)
            {
                MessageBox.Show("Please, select the output device", "PPM Control", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            countdownLabel.Text = _countdownClock.ToString();
            startShutdownTimer();
            //     label5.Text = "Countdown ACTIVE!";
            _generator = new PpmGenerator(CHANNELS_COUNT, StandartProfiles.FlySky, _devices[listboxDevices.SelectedIndex]);
            _generator.SetValues(_channelValues);
            _generator.Start();
            SetPlaying(true);
        }