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
|
@ -1004,13 +1004,13 @@
|
||||||
},
|
},
|
||||||
"receiverHelpYawDeadband": {
|
"receiverHelpYawDeadband": {
|
||||||
"message": "These are values (in us) by how much RC input can be different before it's considered valid. For transmitters with jitter on outputs, this value can be increased if rc inputs twitch while idle. <strong>This setting is for Yaw only.</strong>"
|
"message": "These are values (in us) by how much RC input can be different before it's considered valid. For transmitters with jitter on outputs, this value can be increased if rc inputs twitch while idle. <strong>This setting is for Yaw only.</strong>"
|
||||||
},
|
},
|
||||||
"recevier3dDeadbandThrottle": {
|
"recevier3dDeadbandThrottle": {
|
||||||
"message": "3D Throttle Deadband"
|
"message": "3D Throttle Deadband"
|
||||||
},
|
},
|
||||||
"receiverHelp3dDeadbandThrottle": {
|
"receiverHelp3dDeadbandThrottle": {
|
||||||
"message": "These are values (in us). To widen the neutral zone increased the value. <strong>This setting is for 3D throttle only.</strong>"
|
"message": "These are values (in us). To widen the neutral zone increased the value. <strong>This setting is for 3D throttle only.</strong>"
|
||||||
},
|
},
|
||||||
"receiverChannelMap": {
|
"receiverChannelMap": {
|
||||||
"message": "Channel Map"
|
"message": "Channel Map"
|
||||||
},
|
},
|
||||||
|
@ -1370,7 +1370,7 @@
|
||||||
"message": "CLI reboot detected"
|
"message": "CLI reboot detected"
|
||||||
},
|
},
|
||||||
"cliSaveToFileBtn": {
|
"cliSaveToFileBtn": {
|
||||||
"message": "Save to File"
|
"message": "Save to File"
|
||||||
},
|
},
|
||||||
"loggingNote": {
|
"loggingNote": {
|
||||||
"message": "Data will be logged in this tab <span style=\"color: red\">only</span>, leaving the tab will <span style=\"color: red\">cancel</span> logging and application will return to its normal <strong>\"configurator\"</strong> state.<br /> You are free to select the global update period, data will be written into the log file every <strong>1</strong> second for performance reasons."
|
"message": "Data will be logged in this tab <span style=\"color: red\">only</span>, leaving the tab will <span style=\"color: red\">cancel</span> logging and application will return to its normal <strong>\"configurator\"</strong> state.<br /> You are free to select the global update period, data will be written into the log file every <strong>1</strong> second for performance reasons."
|
||||||
|
@ -1651,6 +1651,42 @@
|
||||||
"ledStripEepromSaved": {
|
"ledStripEepromSaved": {
|
||||||
"message": "EEPROM <span style=\"color: #ffbb00\">saved</span>"
|
"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": {
|
"controlAxisRoll": {
|
||||||
"message": "Roll"
|
"message": "Roll"
|
||||||
|
@ -1896,7 +1932,7 @@
|
||||||
"failsafeKillSwitchHelp": {
|
"failsafeKillSwitchHelp": {
|
||||||
"message": "Set this option to make the failsafe switch (Modes Tab) act as a direct kill switch, bypassing the selected failsafe procedure. <strong>Note:</strong> Arming is blocked with the failsafe kill switch in the ON position"
|
"message": "Set this option to make the failsafe switch (Modes Tab) act as a direct kill switch, bypassing the selected failsafe procedure. <strong>Note:</strong> Arming is blocked with the failsafe kill switch in the ON position"
|
||||||
},
|
},
|
||||||
|
|
||||||
"powerButtonSave": {
|
"powerButtonSave": {
|
||||||
"message": "Save"
|
"message": "Save"
|
||||||
},
|
},
|
||||||
|
@ -1926,7 +1962,7 @@
|
||||||
},
|
},
|
||||||
"powerAmperageValue": {
|
"powerAmperageValue": {
|
||||||
"message": "$1 A"
|
"message": "$1 A"
|
||||||
},
|
},
|
||||||
"powerVoltageId10": {
|
"powerVoltageId10": {
|
||||||
"message": "Battery"
|
"message": "Battery"
|
||||||
},
|
},
|
||||||
|
@ -1996,7 +2032,7 @@
|
||||||
"powerVoltageId85": {
|
"powerVoltageId85": {
|
||||||
"message": "Cell 6"
|
"message": "Cell 6"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
"powerVoltageScale": {
|
"powerVoltageScale": {
|
||||||
"message": "Scale"
|
"message": "Scale"
|
||||||
|
@ -2059,14 +2095,14 @@
|
||||||
"powerMahValue": {
|
"powerMahValue": {
|
||||||
"message": "$1 mAh"
|
"message": "$1 mAh"
|
||||||
},
|
},
|
||||||
|
|
||||||
"powerAmperageScale": {
|
"powerAmperageScale": {
|
||||||
"message": "Scale the output voltage to milliamps [1/10th mV/A]"
|
"message": "Scale the output voltage to milliamps [1/10th mV/A]"
|
||||||
},
|
},
|
||||||
"powerAmperageOffset": {
|
"powerAmperageOffset": {
|
||||||
"message": "Offset in millivolt steps"
|
"message": "Offset in millivolt steps"
|
||||||
},
|
},
|
||||||
|
|
||||||
"powerBatteryHead": {
|
"powerBatteryHead": {
|
||||||
"message": "Battery"
|
"message": "Battery"
|
||||||
},
|
},
|
||||||
|
@ -2091,7 +2127,7 @@
|
||||||
"powerBatteryCapacity": {
|
"powerBatteryCapacity": {
|
||||||
"message": "Capacity (mAh)"
|
"message": "Capacity (mAh)"
|
||||||
},
|
},
|
||||||
|
|
||||||
"osdSetupHead": {
|
"osdSetupHead": {
|
||||||
"message": "Info"
|
"message": "Info"
|
||||||
},
|
},
|
||||||
|
@ -2107,14 +2143,14 @@
|
||||||
"osdSetupCameraConnectedValueNo": {
|
"osdSetupCameraConnectedValueNo": {
|
||||||
"message": "No"
|
"message": "No"
|
||||||
},
|
},
|
||||||
|
|
||||||
"osdSetupResetText": {
|
"osdSetupResetText": {
|
||||||
"message": "Reset OSD to default"
|
"message": "Reset OSD to default"
|
||||||
},
|
},
|
||||||
"osdSetupButtonReset": {
|
"osdSetupButtonReset": {
|
||||||
"message": "Reset Settings"
|
"message": "Reset Settings"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
"mainHelpArmed": {
|
"mainHelpArmed": {
|
||||||
"message": "Motor Arming"
|
"message": "Motor Arming"
|
||||||
|
|
|
@ -825,7 +825,11 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
var ledDirectionLetters = ['n', 'e', 's', 'w', 'u', 'd']; // in LSB bit order
|
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 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 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.
|
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 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 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 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 = [];
|
var buffer = [];
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
.tab-led-strip .content_wrapper {
|
.tab-led-strip .content_wrapper {
|
||||||
position: relative !important;
|
position: relative !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-led-strip .help {
|
.tab-led-strip .help {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #ffcb18;
|
background-color: #ffcb18;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.tab-led-strip .section {
|
.tab-led-strip .section {
|
||||||
color: #565656;
|
color: #565656;
|
||||||
margin: 20px 0 5px 0;
|
margin: 20px 0 5px 0;
|
||||||
|
@ -90,6 +90,7 @@
|
||||||
|
|
||||||
.tab-led-strip .gPoint.function-s .overlay-s,
|
.tab-led-strip .gPoint.function-s .overlay-s,
|
||||||
.tab-led-strip .gPoint.function-w .overlay-w,
|
.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-i .overlay-i,
|
||||||
.tab-led-strip .gPoint.function-t .overlay-t,
|
.tab-led-strip .gPoint.function-t .overlay-t,
|
||||||
.tab-led-strip .gPoint.function-o .overlay-o,
|
.tab-led-strip .gPoint.function-o .overlay-o,
|
||||||
|
@ -106,6 +107,12 @@
|
||||||
margin-left: -9px;
|
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 {
|
.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);
|
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;
|
margin-top: -30px;
|
||||||
|
@ -433,4 +440,4 @@
|
||||||
|
|
||||||
.tab-led-strip .spacebottom {
|
.tab-led-strip .spacebottom {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,11 @@
|
||||||
<button class="funcClear">Clear selected</button>
|
<button class="funcClear">Clear selected</button>
|
||||||
<button class="funcClearAll">Clear ALL</button>
|
<button class="funcClearAll">Clear ALL</button>
|
||||||
|
|
||||||
<div class="section">LED Functions</div>
|
<div class="section" i18n="ledStripFunctionSection"></div>
|
||||||
|
|
||||||
|
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<span class="color_section">Function</span>
|
<span class="color_section" i18n="ledStripFunctionTitle"></span>
|
||||||
<select class="functionSelect">
|
<select class="functionSelect">
|
||||||
<option value="">None</option>
|
<option value="">None</option>
|
||||||
<option value="function-c" class="">Color</option>
|
<option value="function-c" class="">Color</option>
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="modifiers">
|
<div class="modifiers">
|
||||||
<span class="color_section">Color modifier</span>
|
<span class="color_section" i18n="ledStripColorModifierTitle"></span>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<input type="checkbox" name="ThrottleHue" class="toggle function-t" />
|
<input type="checkbox" name="ThrottleHue" class="toggle function-t" />
|
||||||
<label>
|
<label>
|
||||||
|
@ -91,33 +91,41 @@
|
||||||
<option value="10" class="">Aux7</option>
|
<option value="10" class="">Aux7</option>
|
||||||
<option value="11" class="">Aux8</option>
|
<option value="11" class="">Aux8</option>
|
||||||
</select>
|
</select>
|
||||||
<span class="labelSelect">Throttle</span>
|
<span class="labelSelect" i18n="ledStripThrottleFunction"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox extra_functions20">
|
<div class="checkbox extra_functions20">
|
||||||
<input type="checkbox" name="LarsonScanner" class="toggle function-o" />
|
<input type="checkbox" name="LarsonScanner" class="toggle function-o" />
|
||||||
<label> <span>Larson scanner</span></label>
|
<label> <span i18n="ledStripVtxFunction"></span></label>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="blinkers extra_functions20">
|
||||||
|
<span class="color_section" i18n="ledStripBlinkTitle"></span>
|
||||||
<div class="checkbox blinkOverlay">
|
<div class="checkbox blinkOverlay">
|
||||||
<input type="checkbox" name="blink" class="toggle function-b" />
|
<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>
|
</div>
|
||||||
|
|
||||||
<div class="overlays">
|
<div class="overlays">
|
||||||
<span class="color_section">Overlay</span>
|
<span class="color_section" i18n="ledStripOverlayTitle"></span>
|
||||||
<div class="checkbox warningOverlay">
|
<div class="checkbox warningOverlay">
|
||||||
<input type="checkbox" name="Warnings" class="toggle function-w" />
|
<input type="checkbox" name="Warnings" class="toggle function-w" />
|
||||||
<label> <span>Warnings</span></label>
|
<label> <span i18n="ledStripWarningsOverlay"></span></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox indicatorOverlay">
|
<div class="checkbox indicatorOverlay">
|
||||||
<input type="checkbox" name="Indicator" class="toggle function-i" />
|
<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>
|
||||||
<div class="checkbox vtxOverlay">
|
<div class="checkbox vtxOverlay">
|
||||||
<input type="checkbox" name="Vtx" class="toggle function-v" />
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -41,17 +41,17 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
else
|
else
|
||||||
load_html();
|
load_html();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function load_html() {
|
function load_html() {
|
||||||
$('#content').load("./tabs/led_strip.html", process_html);
|
$('#content').load("./tabs/led_strip.html", process_html);
|
||||||
}
|
}
|
||||||
|
|
||||||
load_led_config();
|
load_led_config();
|
||||||
|
|
||||||
|
|
||||||
function buildUsedWireNumbers() {
|
function buildUsedWireNumbers() {
|
||||||
var usedWireNumbers = [];
|
var usedWireNumbers = [];
|
||||||
|
@ -64,26 +64,29 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
usedWireNumbers.sort(function(a,b){return a - b});
|
usedWireNumbers.sort(function(a,b){return a - b});
|
||||||
return usedWireNumbers;
|
return usedWireNumbers;
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_html() {
|
function process_html() {
|
||||||
|
|
||||||
localize();
|
localize();
|
||||||
|
|
||||||
// Build Grid
|
// Build Grid
|
||||||
var theHTML = [];
|
var theHTML = [];
|
||||||
var theHTMLlength = 0;
|
var theHTMLlength = 0;
|
||||||
for (var i = 0; i < 256; i++) {
|
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>');
|
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>');
|
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(''));
|
$('.mainGrid').html(theHTML.join(''));
|
||||||
|
|
||||||
$('.tempOutput').click(function() {
|
$('.tempOutput').click(function() {
|
||||||
$(this).select();
|
$(this).select();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Aux channel drop-down
|
// Aux channel drop-down
|
||||||
if (semver.lte(CONFIG.apiVersion, "1.20.0")) {
|
if (semver.lte(CONFIG.apiVersion, "1.20.0")) {
|
||||||
$('.auxSelect').hide();
|
$('.auxSelect').hide();
|
||||||
|
@ -94,14 +97,23 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
var AuxMode = 7;
|
var AuxMode = 7;
|
||||||
var AuxDir = 0;
|
var AuxDir = 0;
|
||||||
|
|
||||||
$('.auxSelect').val(getModeColor(AuxMode, AuxDir));
|
$('.auxSelect').val(getModeColor(AuxMode, AuxDir));
|
||||||
|
|
||||||
$('.auxSelect').on('change', function() {
|
$('.auxSelect').on('change', function() {
|
||||||
setModeColor(AuxMode, AuxDir, $('.auxSelect').val());
|
setModeColor(AuxMode, AuxDir, $('.auxSelect').val());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
$('.vtxOverlay').hide();
|
||||||
|
$('.landingBlinkOverlay').show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.landingBlinkOverlay').css("visibility", "hidden");
|
||||||
|
$('.vtxOverlay').show();
|
||||||
|
}
|
||||||
|
|
||||||
// Clear button
|
// Clear button
|
||||||
$('.funcClear').click(function() {
|
$('.funcClear').click(function() {
|
||||||
$('.gPoint').each(function() {
|
$('.gPoint').each(function() {
|
||||||
|
@ -162,7 +174,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mode Color Buttons
|
// Mode Color Buttons
|
||||||
$('.mode_colors').on('click', 'button', function() {
|
$('.mode_colors').on('click', 'button', function() {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
@ -183,7 +195,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$(className).addClass('btnOn');
|
$(className).addClass('btnOn');
|
||||||
selectedColorIndex = colorIndex;
|
selectedColorIndex = colorIndex;
|
||||||
setColorSliders(colorIndex);
|
setColorSliders(colorIndex);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$(className).removeClass('btnOn');
|
$(className).removeClass('btnOn');
|
||||||
}
|
}
|
||||||
|
@ -197,15 +209,15 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if (! $(this).is($(that))) {
|
if (! $(this).is($(that))) {
|
||||||
if ($(this).is('.btnOn')) {
|
if ($(this).is('.btnOn')) {
|
||||||
$(this).removeClass('btnOn');
|
$(this).removeClass('btnOn');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Color sliders
|
// Color sliders
|
||||||
var ip = $('div.colorDefineSliders input');
|
var ip = $('div.colorDefineSliders input');
|
||||||
ip.eq(0).on("input change", function() { updateColors($(this).val(), 0); });
|
ip.eq(0).on("input change", function() { updateColors($(this).val(), 0); });
|
||||||
|
@ -219,12 +231,12 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('.colors').on('click', 'button', function(e) {
|
$('.colors').on('click', 'button', function(e) {
|
||||||
var that = this;
|
var that = this;
|
||||||
var colorButtons = $(this).parent().find('button');
|
var colorButtons = $(this).parent().find('button');
|
||||||
|
|
||||||
for (var colorIndex = 0; colorIndex < 16; colorIndex++) {
|
for (var colorIndex = 0; colorIndex < 16; colorIndex++) {
|
||||||
colorButtons.removeClass('btnOn');
|
colorButtons.removeClass('btnOn');
|
||||||
if (selectedModeColor == undefined)
|
if (selectedModeColor == undefined)
|
||||||
$('.ui-selected').removeClass('color-' + colorIndex);
|
$('.ui-selected').removeClass('color-' + colorIndex);
|
||||||
|
|
||||||
if ($(that).is('.color-' + colorIndex)) {
|
if ($(that).is('.color-' + colorIndex)) {
|
||||||
selectedColorIndex = colorIndex;
|
selectedColorIndex = colorIndex;
|
||||||
if (selectedModeColor == undefined)
|
if (selectedModeColor == undefined)
|
||||||
|
@ -234,7 +246,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
|
|
||||||
setColorSliders(selectedColorIndex);
|
setColorSliders(selectedColorIndex);
|
||||||
|
|
||||||
$(this).addClass('btnOn');
|
$(this).addClass('btnOn');
|
||||||
|
|
||||||
if (selectedModeColor) {
|
if (selectedModeColor) {
|
||||||
|
@ -243,28 +255,28 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
drawColorBoxesInColorLedPoints();
|
drawColorBoxesInColorLedPoints();
|
||||||
|
|
||||||
// refresh color buttons
|
// refresh color buttons
|
||||||
$('.colors').children().each(function() { setBackgroundColor($(this)); });
|
$('.colors').children().each(function() { setBackgroundColor($(this)); });
|
||||||
$('.overlay-color').each(function() { setBackgroundColor($(this)); });
|
$('.overlay-color').each(function() { setBackgroundColor($(this)); });
|
||||||
|
|
||||||
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
||||||
$('.special_colors').each(function() { setModeBackgroundColor($(this)); });
|
$('.special_colors').each(function() { setModeBackgroundColor($(this)); });
|
||||||
|
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.colors').on('dblclick', 'button', function(e) {
|
$('.colors').on('dblclick', 'button', function(e) {
|
||||||
|
|
||||||
var pp = $('.tab-led-strip').position();
|
var pp = $('.tab-led-strip').position();
|
||||||
var moveLeft = $('.tab-led-strip').position().left + ($('.colorDefineSliders').width() / 2);
|
var moveLeft = $('.tab-led-strip').position().left + ($('.colorDefineSliders').width() / 2);
|
||||||
var moveUp = $('.tab-led-strip').position().top + $('.colorDefineSliders').height() + 20;
|
var moveUp = $('.tab-led-strip').position().top + $('.colorDefineSliders').height() + 20;
|
||||||
|
|
||||||
$('.colorDefineSliders').css('left', e.pageX - e.offsetX - moveLeft);
|
$('.colorDefineSliders').css('left', e.pageX - e.offsetX - moveLeft);
|
||||||
$('.colorDefineSliders').css('top', e.pageY - e.offsetY - moveUp);
|
$('.colorDefineSliders').css('top', e.pageY - e.offsetY - moveUp);
|
||||||
$('.colorDefineSliders').show();
|
$('.colorDefineSliders').show();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.colorDefineSliders').on({
|
$('.colorDefineSliders').on({
|
||||||
mouseleave: function () {
|
mouseleave: function () {
|
||||||
$('.colorDefineSliders').hide();
|
$('.colorDefineSliders').hide();
|
||||||
|
@ -277,10 +289,10 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('.colorDefineSliders').hide();
|
$('.colorDefineSliders').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.funcWire').click(function() {
|
$('.funcWire').click(function() {
|
||||||
$(this).toggleClass('btnOn');
|
$(this).toggleClass('btnOn');
|
||||||
TABS.led_strip.wireMode = $(this).hasClass('btnOn');
|
TABS.led_strip.wireMode = $(this).hasClass('btnOn');
|
||||||
$('.mainGrid').toggleClass('gridWire');
|
$('.mainGrid').toggleClass('gridWire');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -309,16 +321,16 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
var that;
|
var that;
|
||||||
$('.ui-selected').each(function() {
|
$('.ui-selected').each(function() {
|
||||||
|
|
||||||
var usedWireNumbers = buildUsedWireNumbers();
|
var usedWireNumbers = buildUsedWireNumbers();
|
||||||
|
|
||||||
var nextWireNumber = 0;
|
var nextWireNumber = 0;
|
||||||
for (var nextWireNumber = 0; nextWireNumber < usedWireNumbers.length; nextWireNumber++) {
|
for (var nextWireNumber = 0; nextWireNumber < usedWireNumbers.length; nextWireNumber++) {
|
||||||
if (usedWireNumbers[nextWireNumber] != nextWireNumber) {
|
if (usedWireNumbers[nextWireNumber] != nextWireNumber) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TABS.led_strip.wireMode) {
|
if (TABS.led_strip.wireMode) {
|
||||||
if ($(this).find('.wire').html() == '' && nextWireNumber < LED_STRIP.length) {
|
if ($(this).find('.wire').html() == '' && nextWireNumber < LED_STRIP.length) {
|
||||||
$(this).find('.wire').html(nextWireNumber);
|
$(this).find('.wire').html(nextWireNumber);
|
||||||
|
@ -328,7 +340,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if ($(this).find('.wire').text() != '') {
|
if ($(this).find('.wire').text() != '') {
|
||||||
|
|
||||||
that = this;
|
that = this;
|
||||||
|
|
||||||
// Get function & overlays or current cell
|
// Get function & overlays or current cell
|
||||||
TABS.led_strip.directions.forEach(function(letter) {
|
TABS.led_strip.directions.forEach(function(letter) {
|
||||||
var className = '.dir-' + letter;
|
var className = '.dir-' + letter;
|
||||||
|
@ -336,14 +348,14 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
directionsInSelection.push(className);
|
directionsInSelection.push(className);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TABS.led_strip.baseFuncs.forEach(function(letter) {
|
TABS.led_strip.baseFuncs.forEach(function(letter) {
|
||||||
var className = '.function-' + letter;
|
var className = '.function-' + letter;
|
||||||
if ($(that).is(className)) {
|
if ($(that).is(className)) {
|
||||||
functionsInSelection.push(className);
|
functionsInSelection.push(className);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TABS.led_strip.overlays.forEach(function(letter) {
|
TABS.led_strip.overlays.forEach(function(letter) {
|
||||||
var className = '.function-' + letter;
|
var className = '.function-' + letter;
|
||||||
if ($(that).is(className)) {
|
if ($(that).is(className)) {
|
||||||
|
@ -362,47 +374,47 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('select.functionSelect').removeClass(className);
|
$('select.functionSelect').removeClass(className);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
selectedColorIndex = 0;
|
selectedColorIndex = 0;
|
||||||
|
|
||||||
if (uiSelectedLast) {
|
if (uiSelectedLast) {
|
||||||
|
|
||||||
// set active color
|
// set active color
|
||||||
for (var colorIndex = 0; colorIndex < 16; colorIndex++) {
|
for (var colorIndex = 0; colorIndex < 16; colorIndex++) {
|
||||||
var className = '.color-' + colorIndex;
|
var className = '.color-' + colorIndex;
|
||||||
if ($(uiSelectedLast).is(className)) {
|
if ($(uiSelectedLast).is(className)) {
|
||||||
$(className).addClass('btnOn');
|
$(className).addClass('btnOn');
|
||||||
selectedColorIndex = colorIndex;
|
selectedColorIndex = colorIndex;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$(className).removeClass('btnOn');
|
$(className).removeClass('btnOn');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set checkbox values
|
// set checkbox values
|
||||||
TABS.led_strip.overlays.forEach(function(letter) {
|
TABS.led_strip.overlays.forEach(function(letter) {
|
||||||
var feature_o = $('.checkbox').find('input.function-' + letter);
|
var feature_o = $('.checkbox').find('input.function-' + letter);
|
||||||
|
|
||||||
var newVal = ($(uiSelectedLast).is('.function-' + letter));
|
var newVal = ($(uiSelectedLast).is('.function-' + letter));
|
||||||
|
|
||||||
if (feature_o.is(':checked') != newVal) {
|
if (feature_o.is(':checked') != newVal) {
|
||||||
feature_o.prop('checked', newVal);
|
feature_o.prop('checked', newVal);
|
||||||
feature_o.change();
|
feature_o.change();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update active function in combobox
|
// Update active function in combobox
|
||||||
TABS.led_strip.baseFuncs.forEach(function(letter) {
|
TABS.led_strip.baseFuncs.forEach(function(letter) {
|
||||||
if ($(uiSelectedLast).is('.function-' + letter)) {
|
if ($(uiSelectedLast).is('.function-' + letter)) {
|
||||||
$('select.functionSelect').val("function-" + letter);
|
$('select.functionSelect').val("function-" + letter);
|
||||||
$('select.functionSelect').addClass("function-" + letter);
|
$('select.functionSelect').addClass("function-" + letter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
|
|
||||||
setColorSliders(selectedColorIndex);
|
setColorSliders(selectedColorIndex);
|
||||||
|
|
||||||
setOptionalGroupsVisibility();
|
setOptionalGroupsVisibility();
|
||||||
|
|
||||||
$('.directions button').removeClass('btnOn');
|
$('.directions button').removeClass('btnOn');
|
||||||
|
@ -425,7 +437,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('.modeSelect').on('change', function() {
|
$('.modeSelect').on('change', function() {
|
||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
var mode = Number($(that).val());
|
var mode = Number($(that).val());
|
||||||
$('.mode_colors').find('button').each(function() {
|
$('.mode_colors').find('button').each(function() {
|
||||||
for (var i = 0; i < 6; i++)
|
for (var i = 0; i < 6; i++)
|
||||||
|
@ -438,13 +450,13 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
||||||
});
|
});
|
||||||
|
|
||||||
function toggleSwitch(that, letter)
|
function toggleSwitch(that, letter)
|
||||||
{
|
{
|
||||||
if ($(that).is(':checked')) {
|
if ($(that).is(':checked')) {
|
||||||
$('.ui-selected').find('.wire').each(function() {
|
$('.ui-selected').find('.wire').each(function() {
|
||||||
if ($(this).text() != "") {
|
if ($(this).text() != "") {
|
||||||
|
|
||||||
var p = $(this).parent();
|
var p = $(this).parent();
|
||||||
|
|
||||||
TABS.led_strip.functions.forEach(function(f) {
|
TABS.led_strip.functions.forEach(function(f) {
|
||||||
|
@ -471,6 +483,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if (isWarningActive('function-' + f))
|
if (isWarningActive('function-' + f))
|
||||||
p.addClass('function-' + letter);
|
p.addClass('function-' + letter);
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
if (areOverlaysActive('function-' + f))
|
||||||
|
if (isVtxActive('function-' + f))
|
||||||
|
p.addClass('function-' + letter);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -481,21 +498,21 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
return $(that).is(':checked');
|
return $(that).is(':checked');
|
||||||
}
|
}
|
||||||
|
|
||||||
// UI: check-box toggle
|
// UI: check-box toggle
|
||||||
$('.checkbox').change(function(e) {
|
$('.checkbox').change(function(e) {
|
||||||
if (e.originalEvent) {
|
if (e.originalEvent) {
|
||||||
// user-triggered event
|
// user-triggered event
|
||||||
var that = $(this).find('input');
|
var that = $(this).find('input');
|
||||||
if ($('.ui-selected').length > 0) {
|
if ($('.ui-selected').length > 0) {
|
||||||
|
|
||||||
TABS.led_strip.overlays.forEach(function(letter) {
|
TABS.led_strip.overlays.forEach(function(letter) {
|
||||||
if ($(that).is('.function-' + letter)) {
|
if ($(that).is('.function-' + letter)) {
|
||||||
var ret = toggleSwitch(that, letter);
|
var ret = toggleSwitch(that, letter);
|
||||||
|
|
||||||
var cbn = $('.checkbox .function-n'); // blink on landing
|
var cbn = $('.checkbox .function-n'); // blink on landing
|
||||||
var cbb = $('.checkbox .function-b'); // blink
|
var cbb = $('.checkbox .function-b'); // blink
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (letter == 'b' && cbn.is(':checked')) {
|
if (letter == 'b' && cbn.is(':checked')) {
|
||||||
cbn.prop('checked', false);
|
cbn.prop('checked', false);
|
||||||
|
@ -505,11 +522,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
cbb.prop('checked', false);
|
cbb.prop('checked', false);
|
||||||
cbb.change();
|
cbb.change();
|
||||||
toggleSwitch(cbb, 'b');
|
toggleSwitch(cbb, 'b');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
clearModeColorSelection();
|
clearModeColorSelection();
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
setOptionalGroupsVisibility();
|
setOptionalGroupsVisibility();
|
||||||
|
@ -518,9 +535,9 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
// code-triggered event
|
// code-triggered event
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.mainGrid').disableSelection();
|
$('.mainGrid').disableSelection();
|
||||||
|
|
||||||
$('.gPoint').each(function(){
|
$('.gPoint').each(function(){
|
||||||
|
@ -530,48 +547,48 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if (col < 0) {
|
if (col < 0) {
|
||||||
col = 15;
|
col = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ledResult = findLed(col, row);
|
var ledResult = findLed(col, row);
|
||||||
if (!ledResult) {
|
if (!ledResult) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ledIndex = ledResult.index;
|
var ledIndex = ledResult.index;
|
||||||
var led = ledResult.led;
|
var led = ledResult.led;
|
||||||
|
|
||||||
if (led.functions[0] == 'c' && led.functions.length == 1 && led.directions.length == 0 && led.color == 0 && led.x == 0 && led.y == 0) {
|
if (led.functions[0] == 'c' && led.functions.length == 1 && led.directions.length == 0 && led.color == 0 && led.x == 0 && led.y == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).find('.wire').html(ledIndex);
|
$(this).find('.wire').html(ledIndex);
|
||||||
|
|
||||||
for (var modeIndex = 0; modeIndex < led.functions.length; modeIndex++) {
|
for (var modeIndex = 0; modeIndex < led.functions.length; modeIndex++) {
|
||||||
$(this).addClass('function-' + led.functions[modeIndex]);
|
$(this).addClass('function-' + led.functions[modeIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var directionIndex = 0; directionIndex < led.directions.length; directionIndex++) {
|
for (var directionIndex = 0; directionIndex < led.directions.length; directionIndex++) {
|
||||||
$(this).addClass('dir-' + led.directions[directionIndex]);
|
$(this).addClass('dir-' + led.directions[directionIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).addClass('color-' + led.color);
|
$(this).addClass('color-' + led.color);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('a.save').click(function () {
|
$('a.save').click(function () {
|
||||||
|
|
||||||
mspHelper.sendLedStripConfig(send_led_strip_colors);
|
mspHelper.sendLedStripConfig(send_led_strip_colors);
|
||||||
|
|
||||||
function send_led_strip_colors() {
|
function send_led_strip_colors() {
|
||||||
mspHelper.sendLedStripColors(send_led_strip_mode_colors);
|
mspHelper.sendLedStripColors(send_led_strip_mode_colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
function send_led_strip_mode_colors() {
|
function send_led_strip_mode_colors() {
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.19.0"))
|
if (semver.gte(CONFIG.apiVersion, "1.19.0"))
|
||||||
mspHelper.sendLedStripModeColors(save_to_eeprom);
|
mspHelper.sendLedStripModeColors(save_to_eeprom);
|
||||||
else
|
else
|
||||||
save_to_eeprom();
|
save_to_eeprom();
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_to_eeprom() {
|
function save_to_eeprom() {
|
||||||
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, function() {
|
MSP.send_message(MSPCodes.MSP_EEPROM_WRITE, false, false, function() {
|
||||||
GUI.log(chrome.i18n.getMessage('ledStripEepromSaved'));
|
GUI.log(chrome.i18n.getMessage('ledStripEepromSaved'));
|
||||||
|
@ -581,19 +598,19 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.colorDefineSliders').hide();
|
$('.colorDefineSliders').hide();
|
||||||
|
|
||||||
applyFunctionToSelectedLeds();
|
applyFunctionToSelectedLeds();
|
||||||
drawColorBoxesInColorLedPoints();
|
drawColorBoxesInColorLedPoints();
|
||||||
setOptionalGroupsVisibility();
|
setOptionalGroupsVisibility();
|
||||||
|
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -606,13 +623,13 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateBulkCmd() {
|
function updateBulkCmd() {
|
||||||
var ledStripLength = LED_STRIP.length;
|
var ledStripLength = LED_STRIP.length;
|
||||||
|
|
||||||
LED_STRIP = [];
|
LED_STRIP = [];
|
||||||
|
|
||||||
$('.gPoint').each(function(){
|
$('.gPoint').each(function(){
|
||||||
if ($(this).is('[class*="function"]')) {
|
if ($(this).is('[class*="function"]')) {
|
||||||
var gridNumber = ($(this).index() + 1);
|
var gridNumber = ($(this).index() + 1);
|
||||||
|
@ -625,7 +642,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
var directions = '';
|
var directions = '';
|
||||||
var colorIndex = 0;
|
var colorIndex = 0;
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
var match = $(this).attr("class").match(/(^|\s)color-([0-9]+)(\s|$)/);
|
var match = $(this).attr("class").match(/(^|\s)color-([0-9]+)(\s|$)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
colorIndex = match[2];
|
colorIndex = match[2];
|
||||||
|
@ -656,7 +673,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
functions: functions,
|
functions: functions,
|
||||||
color: colorIndex
|
color: colorIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
LED_STRIP[wireNumber] = led;
|
LED_STRIP[wireNumber] = led;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -668,28 +685,28 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
directions: '',
|
directions: '',
|
||||||
functions: ''
|
functions: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var i = 0; i < ledStripLength; i++) {
|
for (var i = 0; i < ledStripLength; i++) {
|
||||||
if (LED_STRIP[i]) {
|
if (LED_STRIP[i]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LED_STRIP[i] = defaultLed;
|
LED_STRIP[i] = defaultLed;
|
||||||
}
|
}
|
||||||
|
|
||||||
var usedWireNumbers = buildUsedWireNumbers();
|
var usedWireNumbers = buildUsedWireNumbers();
|
||||||
|
|
||||||
var remaining = LED_STRIP.length - usedWireNumbers.length;
|
var remaining = LED_STRIP.length - usedWireNumbers.length;
|
||||||
|
|
||||||
$('.wires-remaining div').html(remaining);
|
$('.wires-remaining div').html(remaining);
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh mode color buttons
|
// refresh mode color buttons
|
||||||
function setModeBackgroundColor(element) {
|
function setModeBackgroundColor(element) {
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.19.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.19.0")) {
|
||||||
element.find('[class*="mode_color"]').each(function() {
|
element.find('[class*="mode_color"]').each(function() {
|
||||||
var m = 0;
|
var m = 0;
|
||||||
var d = 0;
|
var d = 0;
|
||||||
|
|
||||||
var match = $(this).attr("class").match(/(^|\s)mode_color-([0-9]+)-([0-9]+)(\s|$)/);
|
var match = $(this).attr("class").match(/(^|\s)mode_color-([0-9]+)-([0-9]+)(\s|$)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
m = Number(match[2]);
|
m = Number(match[2]);
|
||||||
|
@ -699,11 +716,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBackgroundColor(element) {
|
function setBackgroundColor(element) {
|
||||||
if (element.is('[class*="color"]')) {
|
if (element.is('[class*="color"]')) {
|
||||||
var colorIndex = 0;
|
var colorIndex = 0;
|
||||||
|
|
||||||
var match = element.attr("class").match(/(^|\s)color-([0-9]+)(\s|$)/);
|
var match = element.attr("class").match(/(^|\s)color-([0-9]+)(\s|$)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
colorIndex = match[2];
|
colorIndex = match[2];
|
||||||
|
@ -714,8 +731,8 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
function areModifiersActive(activeFunction) {
|
function areModifiersActive(activeFunction) {
|
||||||
switch (activeFunction) {
|
switch (activeFunction) {
|
||||||
case "function-c":
|
case "function-c":
|
||||||
case "function-a":
|
case "function-a":
|
||||||
case "function-f":
|
case "function-f":
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
@ -726,8 +743,8 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
function areOverlaysActive(activeFunction) {
|
function areOverlaysActive(activeFunction) {
|
||||||
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
|
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
|
||||||
switch (activeFunction) {
|
switch (activeFunction) {
|
||||||
case "function-c":
|
case "function-c":
|
||||||
case "function-a":
|
case "function-a":
|
||||||
case "function-f":
|
case "function-f":
|
||||||
case "function-g":
|
case "function-g":
|
||||||
return true;
|
return true;
|
||||||
|
@ -735,13 +752,13 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (activeFunction) {
|
switch (activeFunction) {
|
||||||
case "":
|
case "":
|
||||||
case "function-c":
|
case "function-c":
|
||||||
case "function-a":
|
case "function-a":
|
||||||
case "function-f":
|
case "function-f":
|
||||||
case "function-s":
|
case "function-s":
|
||||||
case "function-l":
|
case "function-l":
|
||||||
case "function-r":
|
case "function-r":
|
||||||
case "function-o":
|
case "function-o":
|
||||||
case "function-g":
|
case "function-g":
|
||||||
return true;
|
return true;
|
||||||
|
@ -754,8 +771,8 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
function areBlinkersActive(activeFunction) {
|
function areBlinkersActive(activeFunction) {
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
|
||||||
switch (activeFunction) {
|
switch (activeFunction) {
|
||||||
case "function-c":
|
case "function-c":
|
||||||
case "function-a":
|
case "function-a":
|
||||||
case "function-f":
|
case "function-f":
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
@ -766,7 +783,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
function isWarningActive(activeFunction) {
|
function isWarningActive(activeFunction) {
|
||||||
switch (activeFunction) {
|
switch (activeFunction) {
|
||||||
case "function-l":
|
case "function-l":
|
||||||
case "function-s":
|
case "function-s":
|
||||||
case "function-g":
|
case "function-g":
|
||||||
return false;
|
return false;
|
||||||
|
@ -776,26 +793,42 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
if (semver.lt(CONFIG.apiVersion, "1.20.0"))
|
if (semver.lt(CONFIG.apiVersion, "1.20.0"))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() {
|
function setOptionalGroupsVisibility() {
|
||||||
|
|
||||||
var activeFunction = $('select.functionSelect').val();
|
var activeFunction = $('select.functionSelect').val();
|
||||||
$('select.functionSelect').addClass(activeFunction);
|
$('select.functionSelect').addClass(activeFunction);
|
||||||
|
|
||||||
|
|
||||||
if (semver.lte(CONFIG.apiVersion, "1.18.0")) {
|
if (semver.lte(CONFIG.apiVersion, "1.18.0")) {
|
||||||
// <= 18
|
// <= 18
|
||||||
// Hide GPS (Func)
|
// Hide GPS (Func)
|
||||||
// Hide RSSI (O/L), Blink (Func)
|
// Hide RSSI (O/L), Blink (Func)
|
||||||
// Hide Battery, RSSI (Func), Larson (O/L), Blink (O/L), Landing (O/L)
|
// Hide Battery, RSSI (Func), Larson (O/L), Blink (O/L), Landing (O/L)
|
||||||
$(".extra_functions20").hide();
|
$(".extra_functions20").hide();
|
||||||
$(".mode_colors").hide();
|
$(".mode_colors").hide();
|
||||||
} else {
|
} else {
|
||||||
// >= 20
|
// >= 20
|
||||||
// Show GPS (Func)
|
// Show GPS (Func)
|
||||||
// Hide RSSI (O/L), Blink (Func)
|
// Hide RSSI (O/L), Blink (Func)
|
||||||
|
@ -803,14 +836,15 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$(".extra_functions20").show();
|
$(".extra_functions20").show();
|
||||||
$(".mode_colors").show();
|
$(".mode_colors").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// set color modifiers (check-boxes) visibility
|
// set color modifiers (check-boxes) visibility
|
||||||
$('.overlays').hide();
|
$('.overlays').hide();
|
||||||
$('.modifiers').hide();
|
$('.modifiers').hide();
|
||||||
$('.blinkers').hide();
|
$('.blinkers').hide();
|
||||||
$('.warningOverlay').hide();
|
$('.warningOverlay').hide();
|
||||||
|
$('.vtxOverlay').hide();
|
||||||
|
|
||||||
if (areOverlaysActive(activeFunction))
|
if (areOverlaysActive(activeFunction))
|
||||||
$('.overlays').show();
|
$('.overlays').show();
|
||||||
|
|
||||||
|
@ -822,8 +856,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
if (isWarningActive(activeFunction))
|
if (isWarningActive(activeFunction))
|
||||||
$('.warningOverlay').show();
|
$('.warningOverlay').show();
|
||||||
|
|
||||||
|
if (isVtxActive(activeFunction))
|
||||||
|
$('.vtxOverlay').show();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// set directions visibility
|
// set directions visibility
|
||||||
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
|
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
|
||||||
|
@ -832,21 +869,21 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('.indicatorOverlay').hide();
|
$('.indicatorOverlay').hide();
|
||||||
$('.directions').hide();
|
$('.directions').hide();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$('.indicatorOverlay').show();
|
$('.indicatorOverlay').show();
|
||||||
$('.directions').show();
|
$('.directions').show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.mode_colors').hide();
|
$('.mode_colors').hide();
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.19.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.19.0")) {
|
||||||
// set mode colors visibility
|
// set mode colors visibility
|
||||||
|
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.20.0"))
|
if (semver.gte(CONFIG.apiVersion, "1.20.0"))
|
||||||
if (activeFunction == "function-f")
|
if (activeFunction == "function-f")
|
||||||
$('.mode_colors').show();
|
$('.mode_colors').show();
|
||||||
|
|
||||||
// set special colors visibility
|
// set special colors visibility
|
||||||
$('.special_colors').show();
|
$('.special_colors').show();
|
||||||
$('.mode_color-6-0').hide();
|
$('.mode_color-6-0').hide();
|
||||||
|
@ -857,11 +894,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
$('.mode_color-6-5').hide();
|
$('.mode_color-6-5').hide();
|
||||||
$('.mode_color-6-6').hide();
|
$('.mode_color-6-6').hide();
|
||||||
$('.mode_color-6-7').hide();
|
$('.mode_color-6-7').hide();
|
||||||
|
|
||||||
switch (activeFunction) {
|
switch (activeFunction) {
|
||||||
case "": // none
|
case "": // none
|
||||||
case "function-f": // Modes & Orientation
|
case "function-f": // Modes & Orientation
|
||||||
case "function-l": // Battery
|
case "function-l": // Battery
|
||||||
// $('.mode_color-6-3').show(); // background
|
// $('.mode_color-6-3').show(); // background
|
||||||
$('.special_colors').hide();
|
$('.special_colors').hide();
|
||||||
break;
|
break;
|
||||||
|
@ -872,47 +909,47 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
// $('.mode_color-6-3').show(); // background
|
// $('.mode_color-6-3').show(); // background
|
||||||
break;
|
break;
|
||||||
case "function-b": // Blink
|
case "function-b": // Blink
|
||||||
$('.mode_color-6-4').show(); // blink background
|
$('.mode_color-6-4').show(); // blink background
|
||||||
break;
|
break;
|
||||||
case "function-a": // Arm state
|
case "function-a": // Arm state
|
||||||
$('.mode_color-6-0').show(); // disarmed
|
$('.mode_color-6-0').show(); // disarmed
|
||||||
$('.mode_color-6-1').show(); // armed
|
$('.mode_color-6-1').show(); // armed
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "function-r": // Ring
|
case "function-r": // Ring
|
||||||
default:
|
default:
|
||||||
$('.special_colors').hide();
|
$('.special_colors').hide();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyFunctionToSelectedLeds() {
|
function applyFunctionToSelectedLeds() {
|
||||||
var activeFunction = $('select.functionSelect').val();
|
var activeFunction = $('select.functionSelect').val();
|
||||||
TABS.led_strip.baseFuncs.forEach(function(letter) {
|
TABS.led_strip.baseFuncs.forEach(function(letter) {
|
||||||
|
|
||||||
if (activeFunction == 'function-' + letter) {
|
if (activeFunction == 'function-' + letter) {
|
||||||
$('select.functionSelect').addClass('function-' + letter);
|
$('select.functionSelect').addClass('function-' + letter);
|
||||||
|
|
||||||
$('.ui-selected').find('.wire').each(function() {
|
$('.ui-selected').find('.wire').each(function() {
|
||||||
if ($(this).text() != "")
|
if ($(this).text() != "")
|
||||||
$(this).parent().addClass('function-' + letter);
|
$(this).parent().addClass('function-' + letter);
|
||||||
});
|
});
|
||||||
|
|
||||||
unselectOverlays(letter);
|
unselectOverlays(letter);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('select.functionSelect').removeClass('function-' + letter);
|
$('select.functionSelect').removeClass('function-' + letter);
|
||||||
$('.ui-selected').removeClass('function-' + letter);
|
$('.ui-selected').removeClass('function-' + letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeFunction == '') {
|
if (activeFunction == '') {
|
||||||
unselectOverlays(activeFunction);
|
unselectOverlays(activeFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function unselectOverlays(letter) {
|
function unselectOverlays(letter) {
|
||||||
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
|
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
|
||||||
if (letter == 'b' || letter == 'r') {
|
if (letter == 'b' || letter == 'r') {
|
||||||
|
@ -920,6 +957,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
if (letter == 'b' || letter == 'r' || letter == 'l' || letter == 'g') {
|
if (letter == 'b' || letter == 'r' || letter == 'l' || letter == 'g') {
|
||||||
unselectOverlay(letter, 'w');
|
unselectOverlay(letter, 'w');
|
||||||
|
unselectOverlay(letter, 'v');
|
||||||
unselectOverlay(letter, 't');
|
unselectOverlay(letter, 't');
|
||||||
unselectOverlay(letter, 's');
|
unselectOverlay(letter, 's');
|
||||||
}
|
}
|
||||||
|
@ -933,6 +971,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
if (letter == 'l' || letter == 'g' || letter == 's') {
|
if (letter == 'l' || letter == 'g' || letter == 's') {
|
||||||
unselectOverlay(letter, 'w');
|
unselectOverlay(letter, 'w');
|
||||||
|
unselectOverlay(letter, 'v');
|
||||||
unselectOverlay(letter, 't');
|
unselectOverlay(letter, 't');
|
||||||
unselectOverlay(letter, 'o');
|
unselectOverlay(letter, 'o');
|
||||||
unselectOverlay(letter, 'b');
|
unselectOverlay(letter, 'b');
|
||||||
|
@ -940,7 +979,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function unselectOverlay(func, overlay) {
|
function unselectOverlay(func, overlay) {
|
||||||
$('input.function-' + overlay).prop('checked', false);
|
$('input.function-' + overlay).prop('checked', false);
|
||||||
$('input.function-' + overlay).change();
|
$('input.function-' + overlay).change();
|
||||||
|
@ -950,12 +989,12 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateColors(value, hsvIndex) {
|
function updateColors(value, hsvIndex) {
|
||||||
var change = false;
|
var change = false;
|
||||||
|
|
||||||
value = Number(value);
|
value = Number(value);
|
||||||
|
|
||||||
var className = '.color-' + selectedColorIndex;
|
var className = '.color-' + selectedColorIndex;
|
||||||
if ($(className).hasClass('btnOn')) {
|
if ($(className).hasClass('btnOn')) {
|
||||||
switch (hsvIndex) {
|
switch (hsvIndex) {
|
||||||
|
@ -966,40 +1005,40 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
change = true
|
change = true
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (LED_COLORS[selectedColorIndex].s != value) {
|
if (LED_COLORS[selectedColorIndex].s != value) {
|
||||||
LED_COLORS[selectedColorIndex].s = value;
|
LED_COLORS[selectedColorIndex].s = value;
|
||||||
$('.colorDefineSliderValue.Svalue').text(LED_COLORS[selectedColorIndex].s);
|
$('.colorDefineSliderValue.Svalue').text(LED_COLORS[selectedColorIndex].s);
|
||||||
change = true
|
change = true
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (LED_COLORS[selectedColorIndex].v != value) {
|
if (LED_COLORS[selectedColorIndex].v != value) {
|
||||||
LED_COLORS[selectedColorIndex].v = value;
|
LED_COLORS[selectedColorIndex].v = value;
|
||||||
$('.colorDefineSliderValue.Vvalue').text(LED_COLORS[selectedColorIndex].v);
|
$('.colorDefineSliderValue.Vvalue').text(LED_COLORS[selectedColorIndex].v);
|
||||||
change = true
|
change = true
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// refresh color buttons
|
|
||||||
|
// refresh color buttons
|
||||||
$('.colors').children().each(function() { setBackgroundColor($(this)); });
|
$('.colors').children().each(function() { setBackgroundColor($(this)); });
|
||||||
$('.overlay-color').each(function() { setBackgroundColor($(this)); });
|
$('.overlay-color').each(function() { setBackgroundColor($(this)); });
|
||||||
|
|
||||||
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
$('.mode_colors').each(function() { setModeBackgroundColor($(this)); });
|
||||||
$('.special_colors').each(function() { setModeBackgroundColor($(this)); });
|
$('.special_colors').each(function() { setModeBackgroundColor($(this)); });
|
||||||
|
|
||||||
if (change)
|
if (change)
|
||||||
updateBulkCmd();
|
updateBulkCmd();
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawColorBoxesInColorLedPoints() {
|
function drawColorBoxesInColorLedPoints() {
|
||||||
$('.gPoint').each(function() {
|
$('.gPoint').each(function() {
|
||||||
if ($(this).is('.function-c') || $(this).is('.function-r') || $(this).is('.function-b')) {
|
if ($(this).is('.function-c') || $(this).is('.function-r') || $(this).is('.function-b')) {
|
||||||
$(this).find('.overlay-color').show();
|
$(this).find('.overlay-color').show();
|
||||||
|
|
||||||
for (var colorIndex = 0; colorIndex < 16; colorIndex++) {
|
for (var colorIndex = 0; colorIndex < 16; colorIndex++) {
|
||||||
var className = 'color-' + colorIndex;
|
var className = 'color-' + colorIndex;
|
||||||
if ($(this).is('.' + className)) {
|
if ($(this).is('.' + className)) {
|
||||||
|
@ -1015,27 +1054,27 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setColorSliders(colorIndex) {
|
function setColorSliders(colorIndex) {
|
||||||
|
|
||||||
var sliders = $('div.colorDefineSliders input');
|
var sliders = $('div.colorDefineSliders input');
|
||||||
var change = false;
|
var change = false;
|
||||||
|
|
||||||
if (!LED_COLORS[colorIndex])
|
if (!LED_COLORS[colorIndex])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (LED_COLORS[colorIndex].h != Number(sliders.eq(0).val())) {
|
if (LED_COLORS[colorIndex].h != Number(sliders.eq(0).val())) {
|
||||||
sliders.eq(0).val(LED_COLORS[colorIndex].h);
|
sliders.eq(0).val(LED_COLORS[colorIndex].h);
|
||||||
$('.colorDefineSliderValue.Hvalue').text(LED_COLORS[colorIndex].h);
|
$('.colorDefineSliderValue.Hvalue').text(LED_COLORS[colorIndex].h);
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LED_COLORS[colorIndex].s != Number(sliders.eq(1).val())) {
|
if (LED_COLORS[colorIndex].s != Number(sliders.eq(1).val())) {
|
||||||
sliders.eq(1).val(LED_COLORS[colorIndex].s);
|
sliders.eq(1).val(LED_COLORS[colorIndex].s);
|
||||||
$('.colorDefineSliderValue.Svalue').text(LED_COLORS[colorIndex].s);
|
$('.colorDefineSliderValue.Svalue').text(LED_COLORS[colorIndex].s);
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LED_COLORS[colorIndex].v != Number(sliders.eq(2).val())) {
|
if (LED_COLORS[colorIndex].v != Number(sliders.eq(2).val())) {
|
||||||
sliders.eq(2).val(LED_COLORS[colorIndex].v);
|
sliders.eq(2).val(LED_COLORS[colorIndex].v);
|
||||||
$('.colorDefineSliderValue.Vvalue').text(LED_COLORS[colorIndex].v);
|
$('.colorDefineSliderValue.Vvalue').text(LED_COLORS[colorIndex].v);
|
||||||
|
@ -1045,25 +1084,25 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
// only fire events when all values are set
|
// only fire events when all values are set
|
||||||
if (change)
|
if (change)
|
||||||
sliders.trigger('input');
|
sliders.trigger('input');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function HsvToColor(input) {
|
function HsvToColor(input) {
|
||||||
if (input == undefined)
|
if (input == undefined)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
var HSV = { h:Number(input.h), s:Number(input.s), v:Number(input.v) };
|
var HSV = { h:Number(input.h), s:Number(input.s), v:Number(input.v) };
|
||||||
|
|
||||||
if (HSV.s == 0 && HSV.v == 0)
|
if (HSV.s == 0 && HSV.v == 0)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
HSV = { h:HSV.h, s:1 - HSV.s / 255, v:HSV.v / 255 };
|
HSV = { h:HSV.h, s:1 - HSV.s / 255, v:HSV.v / 255 };
|
||||||
|
|
||||||
var HSL = { h:0, s:0, v:0};
|
var HSL = { h:0, s:0, v:0};
|
||||||
HSL.h = HSV.h;
|
HSL.h = HSV.h;
|
||||||
HSL.l = (2 - HSV.s) * HSV.v / 2;
|
HSL.l = (2 - HSV.s) * HSV.v / 2;
|
||||||
HSL.s = HSL.l && HSL.l < 1 ? HSV.s * HSV.v / (HSL.l < 0.5 ? HSL.l * 2 : 2 - HSL.l * 2) : HSL.s;
|
HSL.s = HSL.l && HSL.l < 1 ? HSV.s * HSV.v / (HSL.l < 0.5 ? HSL.l * 2 : 2 - HSL.l * 2) : HSL.s;
|
||||||
|
|
||||||
var ret = 'hsl(' + HSL.h + ', ' + HSL.s * 100 + '%, ' + HSL.l * 100 + '%)';
|
var ret = 'hsl(' + HSL.h + ', ' + HSL.s * 100 + '%, ' + HSL.l * 100 + '%)';
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1087,14 +1126,14 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearModeColorSelection() {
|
function clearModeColorSelection() {
|
||||||
selectedModeColor = null;
|
selectedModeColor = null;
|
||||||
$('.mode_colors').each(function() {
|
$('.mode_colors').each(function() {
|
||||||
$(this).children().each(function() {
|
$(this).children().each(function() {
|
||||||
if ($(this).is('.btnOn')) {
|
if ($(this).is('.btnOn')) {
|
||||||
$(this).removeClass('btnOn');
|
$(this).removeClass('btnOn');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue