private void audioApplyBtn_Click(object sender, EventArgs e) { ZoneMode_t mode = zones[currentZoneID].Mode; mode.Name = Mode_t.Audio; msgOut.Command = Command_t.SetMode; msgOut.Zone = (ushort)zones[currentZoneID].ID; msgOut.Parameter0 = (ushort)divideNum.Value; msgOut.Parameter1 = (ushort)((ushort)mode.Name << 8 | 0); //mode.WipeColor.ToColor_t(ref msgOut.Color); SendData(); }
private void wipeApply_Click(object sender, EventArgs e) { ZoneMode_t mode = zones[currentZoneID].Mode as ZoneMode_t; mode.Name = Mode_t.Wipe; msgOut.Command = Command_t.SetMode; msgOut.Zone = (ushort)zones[currentZoneID].ID; msgOut.Parameter0 = (ushort)mode.WipeDelay; msgOut.Parameter1 = (ushort)((ushort)mode.Name << 8 | 0); mode.WipeColor.ToColor_t(ref msgOut.Color); SendData(); }
private void rainbowApplyBtn_Click(object sender, EventArgs e) { ZoneMode_t mode = zones[currentZoneID].Mode as ZoneMode_t; mode.Name = Mode_t.Rainbow; msgOut.Zone = (ushort)zones[currentZoneID].ID; msgOut.Command = Command_t.SetMode; msgOut.Parameter0 = (ushort)mode.RainbowDelay; msgOut.Parameter1 = (ushort)((ushort)mode.Name << 8 | (mode.RainbowCycle ? 1 : 0)); SendData(); }
private void applyMode2Btn_Click(object sender, EventArgs e) { ZoneMode_t mode = zones[currentZoneID].Mode as ZoneMode_t; mode.Name = Mode_t.Theaterchase; msgOut.Command = Command_t.SetMode; msgOut.Zone = (ushort)zones[currentZoneID].ID; msgOut.Parameter0 = (ushort)mode.TheaterChaseDelay; msgOut.Parameter1 = (ushort)((ushort)mode.Name << 8 | (mode.TheaterChaseRainbow ? 1:0)); mode.TheaterChaseColor.ToColor_t(ref msgOut.Color); SendData(); }
private void button3_Click(object sender, EventArgs e) { ZoneMode_t mode = zones[currentZoneID].Mode as ZoneMode_t; mode.Name = Mode_t.Static; msgOut.Command = Command_t.SetMode; msgOut.Zone = (ushort)zones[currentZoneID].ID; msgOut.Parameter0 = 0; msgOut.Parameter1 = (ushort)((ushort)mode.Name << 8); mode.StaticColor.ToColor_t(ref msgOut.Color); SendData(); }
private void Form1_Load(object sender, EventArgs e) { msgOut.Magic = Message_t.MESSAGE_MAGIC; //Thread communicateThread = new Thread(CommunicateTask); zones = new Zone_t[8]; for (int i = 0; i < 8; i++) { Zone_t zone = new Zone_t(); ZoneMode_t mode = new ZoneMode_t(); mode.Name = Mode_t.Theaterchase; mode.StaticColor = new ColorWheel_t(); mode.TheaterChaseColor = new ColorWheel_t(); mode.WipeColor = new ColorWheel_t(); zone.ID = i + 1; zone.Name = $"Zone {zone.ID}"; zone.Mode = mode; zones[i] = zone; RadioButton radio = new RadioButton(); radio.Name = $"zoneRadio{i + 1}"; radio.Text = zone.Name; radio.AutoSize = true; radio.CheckedChanged += ZoneChanged; radio.Tag = i; if (i == 0) { radio.Checked = true; } flowLayoutPanel1.Controls.Add(radio); } //GetArduinoPort(); //communicateThread.Start(); //modeCombo.SelectedIndex = 0; //rgbModeCombo.SelectedIndex = 0; }
private void staticColorWheel_HSLChanged(object sender, EventArgs e) { if (staticLiveCheck.Checked) { ZoneMode_t mode = zones[currentZoneID].Mode as ZoneMode_t; mode.Name = Mode_t.Static; msgOut.Command = Command_t.SetMode; msgOut.Zone = (ushort)zones[currentZoneID].ID; msgOut.Parameter0 = 0; msgOut.Parameter1 = (ushort)((ushort)mode.Name << 8); mode.StaticColor.ToColor_t(ref msgOut.Color); SendData(); Console.WriteLine(mode.StaticColor.ToString()); } }