mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 06:15:13 +03:00
cleaning up branch.
This commit is contained in:
parent
1228562073
commit
77a8162af2
5 changed files with 282 additions and 184 deletions
|
@ -1651,6 +1651,42 @@
|
|||
"ledStripEepromSaved": {
|
||||
"message": "EEPROM <span style=\"color: #ffbb00\">saved</span>"
|
||||
},
|
||||
"ledStripVtxOverlay": {
|
||||
"message": "VTX (uses vtx frequency to assign color)"
|
||||
},
|
||||
"ledStripFunctionSection": {
|
||||
"message": "LED Functions"
|
||||
},
|
||||
"ledStripFunctionTitle": {
|
||||
"message": "Function"
|
||||
},
|
||||
"ledStripColorModifierTitle": {
|
||||
"message": "Color modifier"
|
||||
},
|
||||
"ledStripThrottleFunction": {
|
||||
"message": "Throttle"
|
||||
},
|
||||
"ledStripVtxFunction": {
|
||||
"message": "Larson scanner"
|
||||
},
|
||||
"ledStripBlinkTitle": {
|
||||
"message": "Blink"
|
||||
},
|
||||
"ledStripBlinkAlwaysOverlay": {
|
||||
"message": "Blink always"
|
||||
},
|
||||
"ledStripBlinkLandingOverlay": {
|
||||
"message": "Blink on landing"
|
||||
},
|
||||
"ledStripOverlayTitle": {
|
||||
"message": "Overlay"
|
||||
},
|
||||
"ledStripWarningsOverlay": {
|
||||
"message": "Warnings"
|
||||
},
|
||||
"ledStripIndecatorOverlay": {
|
||||
"message": "Indicator (uses position on matrix)"
|
||||
},
|
||||
|
||||
"controlAxisRoll": {
|
||||
"message": "Roll"
|
||||
|
|
|
@ -825,7 +825,11 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
var ledDirectionLetters = ['n', 'e', 's', 'w', 'u', 'd']; // in LSB bit order
|
||||
var ledFunctionLetters = ['i', 'w', 'f', 'a', 't', 'r', 'c', 'g', 's', 'b', 'l']; // in LSB bit order
|
||||
var ledBaseFunctionLetters = ['c', 'f', 'a', 'l', 's', 'g', 'r']; // in LSB bit
|
||||
var ledOverlayLetters = ['t', 'o', 'b', 'v', 'i', 'w']; // in LSB bit
|
||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
var ledOverlayLetters = ['t', 'o', 'b', 'w', 'i', 'w']; // in LSB bit
|
||||
} else {
|
||||
var ledOverlayLetters = ['t', 'o', 'b', 'v', 'i', 'w']; // in LSB bit
|
||||
}
|
||||
|
||||
|
||||
var ledCount = data.byteLength / 7; // v1.4.0 and below incorrectly reported 4 bytes per led.
|
||||
|
@ -1658,7 +1662,11 @@ MspHelper.prototype.sendLedStripConfig = function(onCompleteCallback) {
|
|||
var ledDirectionLetters = ['n', 'e', 's', 'w', 'u', 'd']; // in LSB bit order
|
||||
var ledFunctionLetters = ['i', 'w', 'f', 'a', 't', 'r', 'c', 'g', 's', 'b', 'l']; // in LSB bit order
|
||||
var ledBaseFunctionLetters = ['c', 'f', 'a', 'l', 's', 'g', 'r']; // in LSB bit
|
||||
var ledOverlayLetters = ['t', 'o', 'b', 'v', 'i', 'w']; // in LSB bit
|
||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
var ledOverlayLetters = ['t', 'o', 'b', 'w', 'i', 'w']; // in LSB bit
|
||||
} else {
|
||||
var ledOverlayLetters = ['t', 'o', 'b', 'v', 'i', 'w']; // in LSB bit
|
||||
}
|
||||
|
||||
var buffer = [];
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
|
||||
.tab-led-strip .gPoint.function-s .overlay-s,
|
||||
.tab-led-strip .gPoint.function-w .overlay-w,
|
||||
.tab-led-strip .gPoint.function-v .overlay-v,
|
||||
.tab-led-strip .gPoint.function-i .overlay-i,
|
||||
.tab-led-strip .gPoint.function-t .overlay-t,
|
||||
.tab-led-strip .gPoint.function-o .overlay-o,
|
||||
|
@ -106,6 +107,12 @@
|
|||
margin-left: -9px;
|
||||
}
|
||||
|
||||
.tab-led-strip .gPoint.function-v .overlay-v {
|
||||
background-image: radial-gradient(1px at 8px 50% , black 0%, black 2px, rgba(0, 0, 0, 0.3) 3px, rgba(0, 0, 0, 0) 4px);
|
||||
margin-top: -6px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.tab-led-strip .gPoint.function-i .overlay-i {
|
||||
background-image: radial-gradient(1px at 8px 50% , yellow 0%, yellow 2px, rgba(0, 0, 0, 0.3) 3px, rgba(0, 0, 0, 0) 4px);
|
||||
margin-top: -30px;
|
||||
|
|
|
@ -54,11 +54,11 @@
|
|||
<button class="funcClear">Clear selected</button>
|
||||
<button class="funcClearAll">Clear ALL</button>
|
||||
|
||||
<div class="section">LED Functions</div>
|
||||
<div class="section" i18n="ledStripFunctionSection"></div>
|
||||
|
||||
|
||||
<div class="select">
|
||||
<span class="color_section">Function</span>
|
||||
<span class="color_section" i18n="ledStripFunctionTitle"></span>
|
||||
<select class="functionSelect">
|
||||
<option value="">None</option>
|
||||
<option value="function-c" class="">Color</option>
|
||||
|
@ -73,7 +73,7 @@
|
|||
|
||||
|
||||
<div class="modifiers">
|
||||
<span class="color_section">Color modifier</span>
|
||||
<span class="color_section" i18n="ledStripColorModifierTitle"></span>
|
||||
<div class="checkbox">
|
||||
<input type="checkbox" name="ThrottleHue" class="toggle function-t" />
|
||||
<label>
|
||||
|
@ -91,33 +91,41 @@
|
|||
<option value="10" class="">Aux7</option>
|
||||
<option value="11" class="">Aux8</option>
|
||||
</select>
|
||||
<span class="labelSelect">Throttle</span>
|
||||
<span class="labelSelect" i18n="ledStripThrottleFunction"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox extra_functions20">
|
||||
<input type="checkbox" name="LarsonScanner" class="toggle function-o" />
|
||||
<label> <span>Larson scanner</span></label>
|
||||
<label> <span i18n="ledStripVtxFunction"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="blinkers extra_functions20">
|
||||
<span class="color_section" i18n="ledStripBlinkTitle"></span>
|
||||
<div class="checkbox blinkOverlay">
|
||||
<input type="checkbox" name="blink" class="toggle function-b" />
|
||||
<label> <span>Blink always</span></label>
|
||||
<label> <span i18n="ledStripBlinkAlwaysOverlay"></span></label>
|
||||
</div>
|
||||
<div class="checkbox landingBlinkOverlay">
|
||||
<input type="checkbox" name="landingBlink" class="toggle function-n" />
|
||||
<label> <span i18n="ledStripBlinkLandingOverlay"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overlays">
|
||||
<span class="color_section">Overlay</span>
|
||||
<span class="color_section" i18n="ledStripOverlayTitle"></span>
|
||||
<div class="checkbox warningOverlay">
|
||||
<input type="checkbox" name="Warnings" class="toggle function-w" />
|
||||
<label> <span>Warnings</span></label>
|
||||
<label> <span i18n="ledStripWarningsOverlay"></span></label>
|
||||
</div>
|
||||
<div class="checkbox indicatorOverlay">
|
||||
<input type="checkbox" name="Indicator" class="toggle function-i" />
|
||||
<label> <span>Indicator (uses position on matrix)</span></label>
|
||||
<label> <span i18n="ledStripIndecatorOverlay"></span></label>
|
||||
</div>
|
||||
<div class="checkbox vtxOverlay">
|
||||
<input type="checkbox" name="Vtx" class="toggle function-v" />
|
||||
<label> <span>VTX (uses vtx frequency to assign color)</span></label>
|
||||
<label> <span i18n="ledStripVtxOverlay"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -73,10 +73,13 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
var theHTML = [];
|
||||
var theHTMLlength = 0;
|
||||
for (var i = 0; i < 256; i++) {
|
||||
if (semver.lte(CONFIG.apiVersion, "1.19.0"))
|
||||
if (semver.lte(CONFIG.apiVersion, "1.19.0")) {
|
||||
theHTML[theHTMLlength++] = ('<div class="gPoint"><div class="indicators"><span class="north"></span><span class="south"></span><span class="west"></span><span class="east"></span><span class="up">U</span><span class="down">D</span></div><span class="wire"></span><span class="overlay-t"> </span><span class="overlay-s"> </span><span class="overlay-w"> </span><span class="overlay-i"> </span><span class="overlay-color"> </span></div>');
|
||||
else
|
||||
} else if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
theHTML[theHTMLlength++] = ('<div class="gPoint"><div class="indicators"><span class="north"></span><span class="south"></span><span class="west"></span><span class="east"></span><span class="up">U</span><span class="down">D</span></div><span class="wire"></span><span class="overlay-t"> </span><span class="overlay-o"> </span><span class="overlay-b"> </span><span class="overlay-n"> </span><span class="overlay-w"> </span><span class="overlay-i"> </span><span class="overlay-color"> </span></div>');
|
||||
} else {
|
||||
theHTML[theHTMLlength++] = ('<div class="gPoint"><div class="indicators"><span class="north"></span><span class="south"></span><span class="west"></span><span class="east"></span><span class="up">U</span><span class="down">D</span></div><span class="wire"></span><span class="overlay-t"> </span><span class="overlay-o"> </span><span class="overlay-b"> </span><span class="overlay-n"> </span><span class="overlay-v"> </span><span class="overlay-i"> </span><span class="overlay-color"> </span></div>');
|
||||
}
|
||||
}
|
||||
$('.mainGrid').html(theHTML.join(''));
|
||||
|
||||
|
@ -102,6 +105,15 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
});
|
||||
}
|
||||
|
||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||
$('.vtxOverlay').hide();
|
||||
$('.landingBlinkOverlay').show();
|
||||
}
|
||||
else {
|
||||
$('.landingBlinkOverlay').css("visibility", "hidden");
|
||||
$('.vtxOverlay').show();
|
||||
}
|
||||
|
||||
// Clear button
|
||||
$('.funcClear').click(function() {
|
||||
$('.gPoint').each(function() {
|
||||
|
@ -471,6 +483,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
if (isWarningActive('function-' + f))
|
||||
p.addClass('function-' + letter);
|
||||
break;
|
||||
case 'v':
|
||||
if (areOverlaysActive('function-' + f))
|
||||
if (isVtxActive('function-' + f))
|
||||
p.addClass('function-' + letter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -782,6 +799,22 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
}
|
||||
|
||||
function isVtxActive(activeFunction) {
|
||||
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||
switch (activeFunction) {
|
||||
case "function-v":
|
||||
case "function-c":
|
||||
case "function-a":
|
||||
case "function-f":
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setOptionalGroupsVisibility() {
|
||||
|
||||
var activeFunction = $('select.functionSelect').val();
|
||||
|
@ -810,6 +843,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
$('.modifiers').hide();
|
||||
$('.blinkers').hide();
|
||||
$('.warningOverlay').hide();
|
||||
$('.vtxOverlay').hide();
|
||||
|
||||
if (areOverlaysActive(activeFunction))
|
||||
$('.overlays').show();
|
||||
|
@ -823,6 +857,9 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
if (isWarningActive(activeFunction))
|
||||
$('.warningOverlay').show();
|
||||
|
||||
if (isVtxActive(activeFunction))
|
||||
$('.vtxOverlay').show();
|
||||
|
||||
|
||||
|
||||
// set directions visibility
|
||||
|
@ -920,6 +957,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
if (letter == 'b' || letter == 'r' || letter == 'l' || letter == 'g') {
|
||||
unselectOverlay(letter, 'w');
|
||||
unselectOverlay(letter, 'v');
|
||||
unselectOverlay(letter, 't');
|
||||
unselectOverlay(letter, 's');
|
||||
}
|
||||
|
@ -933,6 +971,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
if (letter == 'l' || letter == 'g' || letter == 's') {
|
||||
unselectOverlay(letter, 'w');
|
||||
unselectOverlay(letter, 'v');
|
||||
unselectOverlay(letter, 't');
|
||||
unselectOverlay(letter, 'o');
|
||||
unselectOverlay(letter, 'b');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue