Beispiel #1
0
        private void DigitalBrightScroll_Scroll(object sender, EventArgs e)
        {
            TrackBar    current = sender as TrackBar;
            FirmataMode mode    = DigitalComboBox.SelectedItem as FirmataMode;

            mode.Bright = (byte)current.Value;
            firmata.SendDigitalBright((byte)current.Value);
        }
Beispiel #2
0
        private void AnalogSpeedScroll_Scroll(object sender, EventArgs e)
        {
            TrackBar    current = sender as TrackBar;
            FirmataMode mode    = AnalogComboBox.SelectedItem as FirmataMode;

            mode.Speed = (byte)current.Value;
            firmata.SendAnalogSpeed((Byte)current.Value);
        }
Beispiel #3
0
        private void AnalogComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            FirmataMode AnalogMode = AnalogComboBox.SelectedItem as FirmataMode;

            UpdateAnalogButtons(AnalogMode);

            firmata.SendAnalogMode((byte)AnalogMode.ModeNumber);
            firmata.SendAnalogSpeed((byte)AnalogMode.Speed);
            firmata.SendAnalogBright((byte)AnalogMode.Bright);
            firmata.SendAnalogColor(AnalogCustomPrincipal.BackColor);

            if (AnalogMode.Name == "Musical")
            {
                cscore.Listen(true);
                SoundSpectrumTimer.Start();
            }
        }
Beispiel #4
0
        private void UpdateDigitalButtons(FirmataMode mode)
        {
            if (mode.moreMode == FirmataMode.MoreMode.none)
            {
                DigitalMoreButton.Enabled = false;
            }
            else
            {
                DigitalMoreButton.Enabled = true;
            }

            if (mode.UseColor)
            {
                DigitalCustomPrincipal.Enabled       = true;
                DigitalLastGroupCustomColors.Enabled = true;
            }
            else
            {
                DigitalCustomPrincipal.Enabled       = false;
                DigitalLastGroupCustomColors.Enabled = false;
            }

            if (mode.UseSpeed)
            {
                DigitalSpeedScroll.Enabled = true;
            }
            else
            {
                DigitalSpeedScroll.Enabled = false;
            }

            if (mode.UseBright)
            {
                DigitalBrightScroll.Enabled = true;
            }
            else
            {
                DigitalBrightScroll.Enabled = false;
            }

            //update values
            DigitalSpeedScroll.Value  = mode.Speed;
            DigitalBrightScroll.Value = mode.Bright;
        }
Beispiel #5
0
        private void UpdateAnalogButtons(FirmataMode mode)
        {
            if (mode.moreMode == FirmataMode.MoreMode.none)
            {
                AnalogMoreButton.Enabled = false;
            }
            else
            {
                AnalogMoreButton.Enabled = true;
            }

            if (mode.UseColor)
            {
                AnalogCustomPrincipal.Enabled       = true;
                AnalogLastGroupCustomColors.Enabled = true;
            }
            else
            {
                AnalogCustomPrincipal.Enabled       = false;
                AnalogLastGroupCustomColors.Enabled = false;
            }

            if (mode.UseSpeed)
            {
                AnalogSpeedScroll.Enabled = true;
            }
            else
            {
                AnalogSpeedScroll.Enabled = false;
            }

            if (mode.UseBright)
            {
                AnalogBrightScroll.Enabled = true;
            }
            else
            {
                AnalogBrightScroll.Enabled = false;
            }

            //update values
            AnalogSpeedScroll.Value  = mode.Speed;
            AnalogBrightScroll.Value = mode.Bright;
        }