Skip to content

Commit 19d12b5

Browse files
authored
Revert "Add LED strip sliders" (#3548)
Revert "Add LED strip sliders (#3531)" This reverts commit 7bca5f9.
1 parent 7bca5f9 commit 19d12b5

File tree

7 files changed

+3
-186
lines changed

7 files changed

+3
-186
lines changed

locales/en/messages.json

+1-24
Original file line numberDiff line numberDiff line change
@@ -3670,29 +3670,6 @@
36703670
"ledStripVtxOverlay": {
36713671
"message": "VTX (uses vtx frequency to assign color)"
36723672
},
3673-
"ledStripBrightnessSliderTitle": {
3674-
"message": "Brightness",
3675-
"description": "Brightness of the LED Strip"
3676-
},
3677-
"ledStripBrightnessSliderHelp": {
3678-
"message": "Maximum brightness percent of the LEDs."
3679-
},
3680-
"ledStripRainbowDeltaSliderTitle": {
3681-
"message": "Delta",
3682-
"description": "LED Strip rainbow effect delta"
3683-
},
3684-
"ledStripRainbowDeltaSliderHelp": {
3685-
"message": "Hue difference between each LEDs.",
3686-
"description": "Hint on LED Strip tab for rainbow delta"
3687-
},
3688-
"ledStripRainbowFreqSliderTitle": {
3689-
"message": "Frequency",
3690-
"description": "LED Strip rainbow effect frequency"
3691-
},
3692-
"ledStripRainbowFreqSliderHelp": {
3693-
"message": "Frequency of the color change, in other terms the speed of the effect.",
3694-
"description": "Hint on LED Strip tab for rainbow frequency"
3695-
},
36963673
"ledStripFunctionSection": {
36973674
"message": "LED Functions"
36983675
},
@@ -3850,7 +3827,7 @@
38503827
},
38513828
"ledStripRainbowOverlay": {
38523829
"message": "Rainbow",
3853-
"description": "Label of rainbow effect switch on LED Strip tab"
3830+
"description": "Rainbow effect switch label on LED Strip tab"
38543831
},
38553832
"ledStripOverlayTitle": {
38563833
"message": "Overlay"

src/css/tabs/led_strip.less

-35
Original file line numberDiff line numberDiff line change
@@ -250,42 +250,7 @@
250250
background: var(--boxBackground);
251251
color: var(--defaultText);
252252
}
253-
.rainbowSlidersDiv {
254-
display: none;
255-
margin-top: 5px;
256-
.rainbowDeltaSlider, .rainbowFreqSlider {
257-
display: flex;
258-
align-items: center;
259-
input {
260-
width: 150px;
261-
margin-right: 5px;
262-
margin-top: 5px;
263-
}
264-
label {
265-
margin-right: 10px;
266-
margin-top: 5px;
267-
}
268-
}
269-
}
270-
}
271-
272-
.brightnessSliderDiv {
273-
margin-top: -15px;
274-
.brightnessSlider{
275-
display: flex;
276-
align-items: center;
277-
input {
278-
width: 150px;
279-
margin-right: 5px;
280-
margin-top: 5px;
281-
}
282-
label {
283-
margin-right: 10px;
284-
margin-top: 5px;
285-
}
286-
}
287253
}
288-
289254
.colorDefineSliders {
290255
display: inline-block;
291256
position: absolute;

src/js/fc.js

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const FC = {
127127
LED_COLORS: null,
128128
LED_MODE_COLORS: null,
129129
LED_STRIP: null,
130-
LED_CONFIG_VALUES: [],
131130
MISC: null, // DEPRECATED
132131
MIXER_CONFIG: null,
133132
MODE_RANGES: null,

src/js/msp/MSPCodes.js

-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ const MSPCodes = {
168168

169169
MSP_MULTIPLE_MSP: 230,
170170

171-
MSP_SET_LED_STRIP_CONFIG_VALUES:231,
172-
MSP_LED_STRIP_CONFIG_VALUES: 232,
173171
MSP_MODE_RANGES_EXTRA: 238,
174172
MSP_SET_ACC_TRIM: 239,
175173
MSP_ACC_TRIM: 240,

src/js/msp/MSPHelper.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -1298,15 +1298,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
12981298
case MSPCodes.MSP_SET_LED_STRIP_MODECOLOR:
12991299
console.log('Led strip mode colors saved');
13001300
break;
1301-
case MSPCodes.MSP_LED_STRIP_CONFIG_VALUES:
1302-
FC.LED_CONFIG_VALUES = {
1303-
brightness: data.readU8(),
1304-
rainbow_delta: data.readU8(),
1305-
rainbow_freq: data.readU16(),
1306-
};
1307-
break;
1308-
case MSPCodes.MSP_SET_LED_STRIP_CONFIG_VALUES:
1309-
break;
1301+
13101302
case MSPCodes.MSP_DATAFLASH_SUMMARY:
13111303
if (data.byteLength >= 13) {
13121304
flags = data.readU8();
@@ -2640,14 +2632,6 @@ MspHelper.prototype.sendLedStripModeColors = function(onCompleteCallback) {
26402632
}
26412633
};
26422634

2643-
MspHelper.prototype.sendLedStripConfigValues = function(onCompleteCallback) {
2644-
const buffer = [];
2645-
buffer.push8(FC.LED_CONFIG_VALUES.brightness);
2646-
buffer.push8(FC.LED_CONFIG_VALUES.rainbow_delta);
2647-
buffer.push16(FC.LED_CONFIG_VALUES.rainbow_freq);
2648-
MSP.send_message(MSPCodes.MSP_SET_LED_STRIP_CONFIG_VALUES, buffer, false, onCompleteCallback);
2649-
};
2650-
26512635
MspHelper.prototype.serialPortFunctionMaskToFunctions = function(functionMask) {
26522636
const self = this;
26532637
const functions = [];

src/js/tabs/led_strip.js

+1-84
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ led_strip.initialize = function (callback, scrollPosition) {
4141
}
4242

4343
function load_led_mode_colors() {
44-
MSP.send_message(MSPCodes.MSP_LED_STRIP_MODECOLOR, false, false, load_led_config_values);
45-
}
46-
47-
function load_led_config_values() {
48-
MSP.send_message(MSPCodes.MSP_LED_STRIP_CONFIG_VALUES, false, false, load_html);
44+
MSP.send_message(MSPCodes.MSP_LED_STRIP_MODECOLOR, false, false, load_html);
4945
}
5046

5147
function load_html() {
@@ -382,8 +378,6 @@ led_strip.initialize = function (callback, scrollPosition) {
382378
if (feature_o.is(':checked') !== newVal) {
383379
feature_o.prop('checked', newVal);
384380
feature_o.trigger('change');
385-
386-
$('.rainbowSlidersDiv').toggle($('.checkbox.rainbowOverlay').find('input').is(':checked')); //rainbow slider visibility
387381
}
388382
});
389383

@@ -510,11 +504,6 @@ led_strip.initialize = function (callback, scrollPosition) {
510504
}
511505
}
512506

513-
//Change Rainbow slider visibility
514-
if (that.is('.function-y')) {
515-
$('.rainbowSlidersDiv').toggle(that.is(':checked'));
516-
}
517-
518507
if ($('.ui-selected').length > 0) {
519508
TABS.led_strip.overlays.forEach(function(letter) {
520509
if ($(that).is(functionTag + letter)) {
@@ -566,78 +555,6 @@ led_strip.initialize = function (callback, scrollPosition) {
566555
$(this).addClass(`color-${led.color}`);
567556
});
568557

569-
//default slider values
570-
$('div.brightnessSlider input').first().prop('value', FC.LED_CONFIG_VALUES.brightness);
571-
$('div.brightnessSlider label').first().text($('div.brightnessSlider input').first().val());
572-
$('div.rainbowDeltaSlider input').first().prop('value', FC.LED_CONFIG_VALUES.rainbow_delta);
573-
$('div.rainbowDeltaSlider label').first().text($('div.rainbowDeltaSlider input').first().val());
574-
$('div.rainbowFreqSlider input').first().prop('value', FC.LED_CONFIG_VALUES.rainbow_freq);
575-
$('div.rainbowFreqSlider label').first().text($('div.rainbowFreqSlider input').first().val());
576-
577-
//Brightness slider
578-
let bufferingBrightness = [],
579-
buffer_delay_brightness = false;
580-
581-
$('div.brightnessSlider input').on('input', function () {
582-
const val = $(this).val();
583-
bufferingBrightness.push(val);
584-
585-
if (!buffer_delay_brightness) {
586-
buffer_delay_brightness = setTimeout(function () {
587-
FC.LED_CONFIG_VALUES.brightness = bufferingBrightness.pop();
588-
mspHelper.sendLedStripConfigValues();
589-
590-
bufferingBrightness = [];
591-
buffer_delay_brightness = false;
592-
}, 10);
593-
}
594-
595-
$('div.brightnessSlider label').first().text(val);
596-
});
597-
598-
//Rainbow Delta slider
599-
let bufferingRainbowDelta = [],
600-
buffer_delay_rainbow_delta = false;
601-
602-
$('div.rainbowDeltaSlider input').on('input', function () {
603-
const val = $(this).val();
604-
bufferingRainbowDelta.push(val);
605-
606-
if (!buffer_delay_rainbow_delta) {
607-
buffer_delay_rainbow_delta = setTimeout(function () {
608-
FC.LED_CONFIG_VALUES.rainbow_delta = bufferingRainbowDelta.pop();
609-
mspHelper.sendLedStripConfigValues();
610-
611-
bufferingRainbowDelta = [];
612-
buffer_delay_rainbow_delta = false;
613-
}, 10);
614-
}
615-
616-
$('div.rainbowDeltaSlider label').first().text(val);
617-
});
618-
619-
//Rainbow Frequency slider
620-
let bufferingRainbowFreq = [],
621-
buffer_delay_rainbow_freq = false;
622-
623-
$('div.rainbowFreqSlider input').on('input', function () {
624-
const val = $(this).val();
625-
bufferingRainbowFreq.push(val);
626-
627-
if (!buffer_delay_rainbow_freq) {
628-
buffer_delay_rainbow_freq = setTimeout(function () {
629-
FC.LED_CONFIG_VALUES.rainbow_freq = bufferingRainbowFreq.pop();
630-
mspHelper.sendLedStripConfigValues();
631-
632-
bufferingRainbowFreq = [];
633-
buffer_delay_rainbow_freq = false;
634-
}, 10);
635-
}
636-
637-
$('div.rainbowFreqSlider label').first().text(val);
638-
});
639-
640-
641558
$('a.save').on('click', function () {
642559
mspHelper.sendLedStripConfig(send_led_strip_colors);
643560

src/tabs/led_strip.html

-23
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,6 @@
8888
<div class="checkbox rainbowOverlay">
8989
<input type="checkbox" name="Rainbow" class="toggle function-y" />
9090
<label> <span i18n="ledStripRainbowOverlay"></span></label>
91-
<div class="rainbowSlidersDiv">
92-
<span i18n="ledStripRainbowDeltaSliderTitle"></span>
93-
<div class="rainbowDeltaSlider">
94-
<input type="range" min="0" max="359"/>
95-
<label></label>
96-
<div class="helpicon cf_tip" i18n_title="ledStripRainbowDeltaSliderHelp"></div>
97-
</div>
98-
<span i18n="ledStripRainbowFreqSliderTitle"></span>
99-
<div class="rainbowFreqSlider">
100-
<input type="range" min="1" max="360"/>
101-
<label></label>
102-
<div class="helpicon cf_tip" i18n_title="ledStripRainbowFreqSliderHelp"></div>
103-
</div>
104-
</div>
10591
</div>
10692
</div>
10793

@@ -200,15 +186,6 @@
200186
<button class="mode_color-6-7" i18n_title="colorGreen" i18n="ledStripModeColorsModeGPSLocked"></button>
201187
</div>
202188

203-
<div class="brightnessSliderDiv">
204-
<span i18n="ledStripBrightnessSliderTitle"></span>
205-
<div class="brightnessSlider">
206-
<input type="range" min="5" max="100"/>
207-
<label></label>
208-
<div class="helpicon cf_tip" i18n_title="ledStripBrightnessSliderHelp"></div>
209-
</div>
210-
</div>
211-
212189
<div class="section" i18n="ledStripWiring"></div>
213190
<div class="wiringMode">
214191
<button class="funcWire w100" i18n="ledStripWiringMode"></button>

0 commit comments

Comments
 (0)