Cleanup + led overlay expansion (#3390)

* Cleanup + led overlay expansion

* Delete unused class and design fixes

* more spacing

* Revert #3391
master
ASDosjani 2023-04-04 16:46:53 +02:00 committed by GitHub
parent 08100bafa8
commit e87ffaa390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 33 deletions

View File

@ -229,11 +229,21 @@
color: var(--defaultText);
}
}
.header {
color: #c4c4c4;
font-size: 13px;
font-weight: 600;
}
.overlays {
display: inline-block;
margin-top: 5px;
}
.modifiers {
display: inline-block;
margin-top: 5px;
.rainbowOverlay {
margin-top: 1px;
}
.auxSelect {
border: 1px solid var(--subtleAccent);
border-radius: 3px;
@ -499,9 +509,6 @@
z-index: 100;
border: 1px dotted white;
}
.modifiers .switchery, .overlays .switchery {
margin-top: 2px !important;
}
}
.gridWire {
.wire {

View File

@ -1170,9 +1170,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
let ledCount = (data.byteLength - 2) / 4;
// The 32 bit config of each LED contains these in LSB:
// +--------------------+--------------------+------------------+------------------+----------------------+-----------+-----------+
// | Parameters - 3 bit | Directions - 6 bit | Color ID - 4 bit | Overlays - 7 bit | Function ID - 4 bit | X - 4 bit | Y - 4 bit |
// +--------------------+--------------------+------------------+------------------+----------------------+-----------+-----------+
// +----------------------------------------------------------------------------------------------------------+
// | Directions - 6 bit | Color ID - 4 bit | Overlays - 10 bit | Function ID - 4 bit | X - 4 bit | Y - 4 bit |
// +----------------------------------------------------------------------------------------------------------+
// According to betaflight/src/main/msp/msp.c
// API 1.41 - add indicator for advanced profile support and the current profile selection
// 0 = basic ledstrip available
@ -1196,14 +1196,14 @@ MspHelper.prototype.process_data = function(dataHandler) {
}
}
const overlayMask = (mask >> 12) & 0x7F;
const overlayMask = (mask >> 12) & 0x3FF;
for (let overlayLetterIndex = 0; overlayLetterIndex < ledOverlayLetters.length; overlayLetterIndex++) {
if (bit_check(overlayMask, overlayLetterIndex)) {
functions.push(ledOverlayLetters[overlayLetterIndex]);
}
}
const directionMask = (mask >> 23) & 0x3F;
const directionMask = (mask >> 26) & 0x3F;
const directions = [];
for (let directionLetterIndex = 0; directionLetterIndex < ledDirectionLetters.length; directionLetterIndex++) {
if (bit_check(directionMask, directionLetterIndex)) {
@ -1214,9 +1214,8 @@ MspHelper.prototype.process_data = function(dataHandler) {
y: (mask) & 0xF,
x: (mask >> 4) & 0xF,
functions: functions,
color: (mask >> 19) & 0xF,
color: (mask >> 22) & 0xF,
directions: directions,
parameters: (mask >>> 29) & 0x7,
};
FC.LED_STRIP.push(led);
@ -2552,17 +2551,15 @@ MspHelper.prototype.sendLedStripConfig = function(onCompleteCallback) {
}
}
mask |= (led.color << 19);
mask |= (led.color << 22);
for (let directionLetterIndex = 0; directionLetterIndex < led.directions.length; directionLetterIndex++) {
const bitIndex = ledDirectionLetters.indexOf(led.directions[directionLetterIndex]);
if (bitIndex >= 0) {
mask |= bit_set(mask, bitIndex + 23);
mask |= bit_set(mask, bitIndex + 26);
}
}
mask |= (0 << 29); // parameters
buffer.push32(mask);
}
else {

View File

@ -777,13 +777,6 @@ led_strip.initialize = function (callback, scrollPosition) {
const activeFunction = $('select.functionSelect').val();
$('select.functionSelect').addClass(activeFunction);
// >= 20
// Show GPS (Func)
// Hide RSSI (O/L), Blink (Func)
// Show Battery, RSSI (Func), Larson (O/L), Blink (O/L), Landing (O/L)
$(".extra_functions20").show();
$(".mode_colors").show();
// set color modifiers (check-boxes) visibility
$('.overlays').toggle(areOverlaysActive(activeFunction));
@ -795,13 +788,13 @@ led_strip.initialize = function (callback, scrollPosition) {
$('.vtxOverlay').toggle(isVtxActive(activeFunction));
$('.mode_colors').hide();
// set mode colors visibility
if (activeFunction === "function-f") {
$('.mode_colors').show();
}
else {
$('.mode_colors').hide();
}
// set special colors visibility
$('.special_colors').show();

View File

@ -38,22 +38,22 @@
<div class="select">
<span class="color_section" i18n="ledStripFunctionTitle"></span>
<span i18n="ledStripFunctionTitle"></span>
<select id="ledStripFunctionSelect" class="functionSelect">
<option value="" i18n="ledStripFunctionNoneOption"></option>
<option value="function-c" i18n="ledStripFunctionColorOption"></option>
<option value="function-f" i18n="ledStripFunctionModesOption"></option>
<option value="function-a" i18n="ledStripFunctionArmOption"></option>
<option value="function-l" class="extra_functions20" i18n="ledStripFunctionBatteryOption"></option>
<option value="function-s" class="extra_functions20" i18n="ledStripFunctionRSSIOption"></option>
<option value="function-g" class="extra_functions20" i18n="ledStripFunctionGPSOption"></option>
<option value="function-l" i18n="ledStripFunctionBatteryOption"></option>
<option value="function-s" i18n="ledStripFunctionRSSIOption"></option>
<option value="function-g" i18n="ledStripFunctionGPSOption"></option>
<option value="function-r" i18n="ledStripFunctionRingOption"></option>
</select>
</div>
<div class="modifiers">
<span class="color_section" i18n="ledStripColorModifierTitle"></span>
<span class="header" i18n="ledStripColorModifierTitle"></span>
<div class="checkbox">
<input type="checkbox" name="ThrottleHue" class="toggle function-t" />
<label>
@ -75,24 +75,24 @@
</label>
</div>
<div class="checkbox extra_functions20">
<div class="checkbox">
<input type="checkbox" name="LarsonScanner" class="toggle function-o" />
<label> <span i18n="ledStripLarsonOverlay"></span></label>
</div>
<div class="checkbox extra_functions20">
<div class="checkbox">
<input type="checkbox" name="blink" class="toggle function-b" />
<label> <span i18n="ledStripBlinkAlwaysOverlay"></span></label>
</div>
<div class="checkbox extra_functions20 rainbowOverlay">
<div class="checkbox rainbowOverlay">
<input type="checkbox" name="Rainbow" class="toggle function-y" />
<label> <span i18n="ledStripRainbowOverlay"></span></label>
</div>
</div>
<div class="overlays">
<span class="color_section" i18n="ledStripOverlayTitle"></span>
<span class="header" i18n="ledStripOverlayTitle"></span>
<div class="checkbox warningOverlay">
<input type="checkbox" name="Warnings" class="toggle function-w" />
<label> <span i18n="ledStripWarningsOverlay"></span></label>