mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-20 23:05:13 +03:00
Merge remote-tracking branch 'origin/release_7.1.0' into Autoland-7.0.1
This commit is contained in:
commit
002d3d0b9a
22 changed files with 3171 additions and 11021 deletions
|
@ -14,6 +14,9 @@
|
|||
"options_showProfileParameters": {
|
||||
"message": "Highlight parameters that change when switching battery or control profiles"
|
||||
},
|
||||
"options_cliAutocomplete": {
|
||||
"message": "Advanced CLI AutoComplete"
|
||||
},
|
||||
"options_unit_type": {
|
||||
"message": "Set how the units render on the configurator only"
|
||||
},
|
||||
|
@ -1302,6 +1305,9 @@
|
|||
"portsFunction_MSP_DISPLAYPORT": {
|
||||
"message": "MSP DisplayPort"
|
||||
},
|
||||
"portsFunction_SBUS_OUTPUT": {
|
||||
"message": "SBus Output"
|
||||
},
|
||||
"pidTuning_ShowAllPIDs": {
|
||||
"message": "Show all PIDs"
|
||||
},
|
||||
|
@ -4343,8 +4349,8 @@
|
|||
"missionMultiAddNewMission": {
|
||||
"message": "Add New Mission"
|
||||
},
|
||||
"missionLevelEarthDEMModel": {
|
||||
"message": "Use Sea Level Earth DEM Model: "
|
||||
"missionEllipsoidEarthDEMModel": {
|
||||
"message": "Use Ellipsoid instead of SL DEM: "
|
||||
},
|
||||
"SafehomeLegend": {
|
||||
"message": "Legend : "
|
||||
|
@ -5004,10 +5010,10 @@
|
|||
"message": "Illegal state. Restart required."
|
||||
},
|
||||
"motor_direction_inverted": {
|
||||
"message": "Normal motor direction / Props In configuration"
|
||||
"message": "Normal motor direction / Props-in configuration"
|
||||
},
|
||||
"motor_direction_isInverted": {
|
||||
"message": "Reversed motor direction / Props Out configuration"
|
||||
"message": "Reversed motor direction / Props-out configuration"
|
||||
},
|
||||
"motor_direction_inverted_hint": {
|
||||
"message": "Enable if the motor direction is reversed and the props are mounted in the opposite direction."
|
||||
|
|
|
@ -138,6 +138,8 @@ sources.js = [
|
|||
'./node_modules/openlayers/dist/ol.js',
|
||||
'./js/libraries/plotly-latest.min.js',
|
||||
'./js/sitl.js',
|
||||
'./js/CliAutoComplete.js',
|
||||
'./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js',
|
||||
'./js/fwApproach.js',
|
||||
'./js/fwApproachCollection.js'
|
||||
];
|
||||
|
|
554
js/CliAutoComplete.js
Normal file
554
js/CliAutoComplete.js
Normal file
|
@ -0,0 +1,554 @@
|
|||
/**
|
||||
* Encapsulates the AutoComplete logic
|
||||
*
|
||||
* Uses: https://github.com/yuku/jquery-textcomplete
|
||||
* Check out the docs at https://github.com/yuku/jquery-textcomplete/tree/v1/doc
|
||||
*/
|
||||
const CliAutoComplete = {
|
||||
configEnabled: false,
|
||||
builder: { state: 'reset', numFails: 0 },
|
||||
};
|
||||
|
||||
CliAutoComplete.isEnabled = function() {
|
||||
return this.isBuilding() || (this.configEnabled && CONFIG.flightControllerIdentifier === "INAV" && this.builder.state !== 'fail');
|
||||
};
|
||||
|
||||
CliAutoComplete.isBuilding = function() {
|
||||
return this.builder.state !== 'reset' && this.builder.state !== 'done' && this.builder.state !== 'fail';
|
||||
};
|
||||
|
||||
CliAutoComplete.isOpen = function() {
|
||||
return $('.cli-textcomplete-dropdown').is(':visible');
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {boolean} force - Forces AutoComplete to be shown even if the matching strategy has less that minChars input
|
||||
*/
|
||||
CliAutoComplete.openLater = function(force) {
|
||||
const self = this;
|
||||
setTimeout(function() {
|
||||
self.forceOpen = !!force;
|
||||
self.$textarea.textcomplete('trigger');
|
||||
self.forceOpen = false;
|
||||
}, 0);
|
||||
};
|
||||
|
||||
CliAutoComplete.setEnabled = function(enable) {
|
||||
if (this.configEnabled !== enable) {
|
||||
this.configEnabled = enable;
|
||||
|
||||
if (CONFIGURATOR.cliActive && CONFIGURATOR.cliValid) {
|
||||
// cli is already open
|
||||
if (this.isEnabled()) {
|
||||
this.builderStart();
|
||||
} else if (!this.isEnabled() && !this.isBuilding()) {
|
||||
this.cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CliAutoComplete.initialize = function($textarea, sendLine, writeToOutput) {
|
||||
this.$textarea = $textarea;
|
||||
this.forceOpen = false;
|
||||
this.sendLine = sendLine;
|
||||
this.writeToOutput = writeToOutput;
|
||||
this.cleanup();
|
||||
};
|
||||
|
||||
CliAutoComplete.cleanup = function() {
|
||||
this.$textarea.textcomplete('destroy');
|
||||
this.builder.state = 'reset';
|
||||
this.builder.numFails = 0;
|
||||
};
|
||||
|
||||
CliAutoComplete._builderWatchdogTouch = function() {
|
||||
const self = this;
|
||||
|
||||
this._builderWatchdogStop();
|
||||
|
||||
helper.timeout.add('autocomplete_builder_watchdog', function() {
|
||||
if (self.builder.numFails) {
|
||||
self.builder.numFails++;
|
||||
self.builder.state = 'fail';
|
||||
self.writeToOutput('Failed!<br># ');
|
||||
$(self).trigger('build:stop');
|
||||
} else {
|
||||
// give it one more try
|
||||
self.builder.state = 'reset';
|
||||
self.builderStart();
|
||||
}
|
||||
}, 3000);
|
||||
};
|
||||
|
||||
CliAutoComplete._builderWatchdogStop = function() {
|
||||
helper.timeout.remove('autocomplete_builder_watchdog');
|
||||
};
|
||||
|
||||
CliAutoComplete.builderStart = function() {
|
||||
if (this.builder.state === 'reset') {
|
||||
this.cache = {
|
||||
commands: [],
|
||||
resources: [],
|
||||
resourcesCount: {},
|
||||
settings: [],
|
||||
settingsAcceptedValues: {},
|
||||
feature: [],
|
||||
beeper: ['ALL'],
|
||||
};
|
||||
this.builder.commandSequence = ['help', 'dump', 'get'];
|
||||
this.builder.currentSetting = null;
|
||||
this.builder.sentinel = `# ${Math.random()}`;
|
||||
this.builder.state = 'init';
|
||||
this.writeToOutput('<br># Building AutoComplete Cache ... ');
|
||||
this.sendLine(this.builder.sentinel);
|
||||
$(this).trigger('build:start');
|
||||
}
|
||||
};
|
||||
|
||||
CliAutoComplete.builderParseLine = function(line) {
|
||||
const cache = this.cache;
|
||||
const builder = this.builder;
|
||||
|
||||
this._builderWatchdogTouch();
|
||||
|
||||
if (line.indexOf(builder.sentinel) !== -1) {
|
||||
// got sentinel
|
||||
const command = builder.commandSequence.shift();
|
||||
|
||||
if (command && this.configEnabled) {
|
||||
// next state
|
||||
builder.state = `parse-${command}`;
|
||||
this.sendLine(command);
|
||||
this.sendLine(builder.sentinel);
|
||||
} else {
|
||||
// done
|
||||
this._builderWatchdogStop();
|
||||
|
||||
if (!this.configEnabled) {
|
||||
// disabled while we were building
|
||||
this.writeToOutput('Cancelled!<br># ');
|
||||
this.cleanup();
|
||||
} else {
|
||||
cache.settings.sort();
|
||||
cache.commands.sort();
|
||||
cache.feature.sort();
|
||||
cache.beeper.sort();
|
||||
cache.resources = Object.keys(cache.resourcesCount).sort();
|
||||
|
||||
this._initTextcomplete();
|
||||
this.writeToOutput('Done!<br># ');
|
||||
builder.state = 'done';
|
||||
}
|
||||
$(this).trigger('build:stop');
|
||||
}
|
||||
} else {
|
||||
switch (builder.state) {
|
||||
case 'parse-help':
|
||||
const matchHelp = line.match(/^(\w+)/);
|
||||
if (matchHelp) {
|
||||
cache.commands.push(matchHelp[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'parse-dump':
|
||||
const matchDump = line.match(/^resource\s+(\w+)/i);
|
||||
if (matchDump) {
|
||||
const r = matchDump[1].toUpperCase(); // should alread be upper, but to be sure, since we depend on that later
|
||||
cache.resourcesCount[r] = (cache.resourcesCount[r] || 0) + 1;
|
||||
} else {
|
||||
const matchFeatBeep = line.match(/^(feature|beeper)\s+-?(\w+)/i);
|
||||
if (matchFeatBeep) {
|
||||
cache[matchFeatBeep[1].toLowerCase()].push(matchFeatBeep[2]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'parse-get':
|
||||
const matchGet = line.match(/^(\w+)\s*=/);
|
||||
if (matchGet) {
|
||||
// setting name
|
||||
cache.settings.push(matchGet[1]);
|
||||
builder.currentSetting = matchGet[1].toLowerCase();
|
||||
} else {
|
||||
const matchGetSettings = line.match(/^(.*): (.*)/);
|
||||
if (matchGetSettings !== null && builder.currentSetting) {
|
||||
if (matchGetSettings[1].match(/values/i)) {
|
||||
// Allowed Values
|
||||
cache.settingsAcceptedValues[builder.currentSetting] = matchGetSettings[2].split(/\s*,\s*/).sort();
|
||||
} else if (matchGetSettings[1].match(/range|length/i)){
|
||||
// "Allowed range" or "Array length", store as string hint
|
||||
cache.settingsAcceptedValues[builder.currentSetting] = matchGetSettings[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializes textcomplete with all the autocomplete strategies
|
||||
*/
|
||||
CliAutoComplete._initTextcomplete = function() {
|
||||
let sendOnEnter = false;
|
||||
const self = this;
|
||||
const $textarea = this.$textarea;
|
||||
const cache = self.cache;
|
||||
|
||||
let savedMouseoverItemHandler = null;
|
||||
|
||||
// helper functions
|
||||
const highlighter = function(anywhere) {
|
||||
return function(value, term) {
|
||||
const anywherePrefix = anywhere ? '': '^';
|
||||
const termValue = value.replace(new RegExp(`${anywherePrefix}(${term})`, 'gi'), '<b>$1</b>');
|
||||
return term ? termValue : value;
|
||||
};
|
||||
};
|
||||
const highlighterAnywhere = highlighter(true);
|
||||
const highlighterPrefix = highlighter(false);
|
||||
|
||||
const searcher = function(term, callback, array, minChars, matchPrefix) {
|
||||
const res = [];
|
||||
|
||||
if ((minChars !== false && term.length >= minChars) || self.forceOpen || self.isOpen()) {
|
||||
term = term.toLowerCase();
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
const v = array[i].toLowerCase();
|
||||
if (matchPrefix && v.startsWith(term) || !matchPrefix && v.indexOf(term) !== -1) {
|
||||
res.push(array[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
callback(res);
|
||||
|
||||
if (self.forceOpen && res.length === 1) {
|
||||
// hacky: if we came here because of Tab and there's only one match
|
||||
// trigger Tab again, so that textcomplete should immediately select the only result
|
||||
// instead of showing the menu
|
||||
$textarea.trigger($.Event('keydown', {keyCode:9}));
|
||||
}
|
||||
};
|
||||
|
||||
const contexter = function(text) {
|
||||
const val = $textarea.val();
|
||||
if (val.length === text.length || val[text.length].match(/\s/)) {
|
||||
return true;
|
||||
}
|
||||
return false; // do not show autocomplete if in the middle of a word
|
||||
};
|
||||
|
||||
const basicReplacer = function(value) {
|
||||
return `$1${value} `;
|
||||
};
|
||||
// end helper functions
|
||||
|
||||
// init textcomplete
|
||||
$textarea.textcomplete([],
|
||||
{
|
||||
maxCount: 10000,
|
||||
debounce: 0,
|
||||
className: 'cli-textcomplete-dropdown',
|
||||
placement: 'top',
|
||||
onKeydown: function(e) {
|
||||
// some strategies may set sendOnEnter only at the replace stage, thus we call with timeout
|
||||
// since this handler [onKeydown] is triggered before replace()
|
||||
if (e.which === 13) {
|
||||
setTimeout(function() {
|
||||
if (sendOnEnter) {
|
||||
// fake "enter" to run the textarea's handler
|
||||
$textarea.trigger($.Event('keypress', {which:13}));
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
},
|
||||
)
|
||||
.on('textComplete:show', function() {
|
||||
/**
|
||||
* The purpose of this code is to disable initially the `mouseover` menu item handler.
|
||||
* Normally, when the menu pops up, if the mouse cursor is in the same area,
|
||||
* the `mouseover` event triggers immediately and activates the item under
|
||||
* the cursor. This might be undesirable when using the keyboard.
|
||||
*
|
||||
* Here we save the original `mouseover` handler and remove it on popup show.
|
||||
* Then add `mousemove` handler. If the mouse moves we consider that mouse interaction
|
||||
* is desired so we reenable the `mouseover` handler
|
||||
*/
|
||||
|
||||
const textCompleteDropDownElement = $('.textcomplete-dropdown');
|
||||
|
||||
if (!savedMouseoverItemHandler) {
|
||||
// save the original 'mouseover' handeler
|
||||
try {
|
||||
savedMouseoverItemHandler = $._data(textCompleteDropDownElement[0], 'events').mouseover[0].handler;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
if (savedMouseoverItemHandler) {
|
||||
textCompleteDropDownElement
|
||||
.off('mouseover') // initially disable it
|
||||
.off('mousemove') // avoid `mousemove` accumulation if previous show did not trigger `mousemove`
|
||||
.on('mousemove', '.textcomplete-item', function(e) {
|
||||
// the mouse has moved so reenable `mouseover`
|
||||
$(this).parent()
|
||||
.off('mousemove')
|
||||
.on('mouseover', '.textcomplete-item', savedMouseoverItemHandler);
|
||||
|
||||
// trigger the mouseover handler to select the item under the cursor
|
||||
savedMouseoverItemHandler(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// textcomplete autocomplete strategies
|
||||
|
||||
// strategy builder helper
|
||||
const strategy = function(s) {
|
||||
return $.extend({
|
||||
template: highlighterAnywhere,
|
||||
replace: basicReplacer,
|
||||
context: contexter,
|
||||
index: 2,
|
||||
}, s);
|
||||
};
|
||||
|
||||
$textarea.textcomplete('register', [
|
||||
strategy({ // "command"
|
||||
match: /^(\s*)(\w*)$/,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = false;
|
||||
searcher(term, callback, cache.commands, false, true);
|
||||
},
|
||||
template: highlighterPrefix,
|
||||
}),
|
||||
|
||||
strategy({ // "get"
|
||||
match: /^(\s*get\s+)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = true;
|
||||
searcher(term, function(arr) {
|
||||
if (term.length > 0 && arr.length > 1) {
|
||||
// prepend the uncompleted term in the popup
|
||||
arr = [term].concat(arr);
|
||||
}
|
||||
callback(arr);
|
||||
}, cache.settings, 3);
|
||||
},
|
||||
}),
|
||||
|
||||
strategy({ // "set"
|
||||
match: /^(\s*set\s+)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = false;
|
||||
searcher(term, callback, cache.settings, 3);
|
||||
},
|
||||
}),
|
||||
|
||||
strategy({ // "set ="
|
||||
match: /^(\s*set\s+\w*\s*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = false;
|
||||
searcher('', callback, ['='], false);
|
||||
},
|
||||
replace: function(value) {
|
||||
self.openLater();
|
||||
return basicReplacer(value);
|
||||
},
|
||||
}),
|
||||
|
||||
strategy({ // "set with value"
|
||||
match: /^(\s*set\s+(\w+))\s*=\s*(.*)$/i,
|
||||
search: function(term, callback, match) {
|
||||
const arr = [];
|
||||
const settingName = match[2].toLowerCase();
|
||||
this.isSettingValueArray = false;
|
||||
this.value = match[3];
|
||||
sendOnEnter = !!term;
|
||||
|
||||
if (settingName in cache.settingsAcceptedValues) {
|
||||
const val = cache.settingsAcceptedValues[settingName];
|
||||
|
||||
if (Array.isArray(val)) {
|
||||
// setting uses lookup strings
|
||||
this.isSettingValueArray = true;
|
||||
sendOnEnter = true;
|
||||
searcher(term, callback, val, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// the settings uses a numeric value.
|
||||
// Here we use a little trick - we use the autocomplete
|
||||
// list as kind of a tooltip to display the Accepted Range hint
|
||||
arr.push(val);
|
||||
}
|
||||
|
||||
callback(arr);
|
||||
},
|
||||
replace: function (value) {
|
||||
if (!this.isSettingValueArray) {
|
||||
// `value` is the tooltip text, so use the saved match
|
||||
value = this.value;
|
||||
}
|
||||
|
||||
return `$1 = ${value}`; // cosmetic - make sure we have spaces around the `=`
|
||||
},
|
||||
index: 3,
|
||||
isSettingValueArray: false,
|
||||
}),
|
||||
|
||||
strategy({ // "resource"
|
||||
match: /^(\s*resource\s+)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = false;
|
||||
let arr = cache.resources;
|
||||
arr = ['show'].concat(arr);
|
||||
searcher(term, callback, arr, 1);
|
||||
},
|
||||
replace: function(value) {
|
||||
if (value in cache.resourcesCount) {
|
||||
self.openLater();
|
||||
} else if (value === 'list' || value === 'show') {
|
||||
sendOnEnter = true;
|
||||
}
|
||||
return basicReplacer(value);
|
||||
},
|
||||
}),
|
||||
|
||||
strategy({ // "resource index"
|
||||
match: /^(\s*resource\s+(\w+)\s+)(\d*)$/i,
|
||||
search: function(term, callback, match) {
|
||||
sendOnEnter = false;
|
||||
this.savedTerm = term;
|
||||
callback([`<1-${cache.resourcesCount[match[2].toUpperCase()]}>`]);
|
||||
},
|
||||
replace: function() {
|
||||
if (this.savedTerm) {
|
||||
self.openLater();
|
||||
return '$1$3 ';
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
context: function(text) {
|
||||
const matchResource = text.match(/^\s*resource\s+(\w+)\s/i);
|
||||
// use this strategy only for resources with more than one index
|
||||
if (matchResource && (cache.resourcesCount[matchResource[1].toUpperCase()] || 0) > 1 ) {
|
||||
return contexter(text);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
index: 3,
|
||||
savedTerm: null,
|
||||
}),
|
||||
|
||||
strategy({ // "resource pin"
|
||||
match: /^(\s*resource\s+\w+\s+(\d*\s+)?)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = !!term;
|
||||
if (term) {
|
||||
if ('none'.startsWith(term)) {
|
||||
callback(['none']);
|
||||
} else {
|
||||
callback(['<pin>']);
|
||||
}
|
||||
} else {
|
||||
callback(['<pin>', 'none']);
|
||||
}
|
||||
},
|
||||
template: function(value, term) {
|
||||
if (value === 'none') {
|
||||
return highlighterPrefix(value, term);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
replace: function(value) {
|
||||
if (value === 'none') {
|
||||
sendOnEnter = true;
|
||||
return '$1none ';
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
context: function(text) {
|
||||
const m = text.match(/^\s*resource\s+(\w+)\s+(\d+\s)?/i);
|
||||
if (m) {
|
||||
// show pin/none for resources having only one index (it's not needed at the commend line)
|
||||
// OR having more than one index and the index is supplied at the command line
|
||||
const count = cache.resourcesCount[m[1].toUpperCase()] || 0;
|
||||
if (count && (m[2] || count === 1)) {
|
||||
return contexter(text);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
index: 3,
|
||||
}),
|
||||
|
||||
strategy({ // "feature" and "beeper"
|
||||
match: /^(\s*(feature|beeper)\s+(-?))(\w*)$/i,
|
||||
search: function(term, callback, match) {
|
||||
sendOnEnter = !!term;
|
||||
let arr = cache[match[2].toLowerCase()];
|
||||
if (!match[3]) {
|
||||
arr = ['-', 'list'].concat(arr);
|
||||
}
|
||||
searcher(term, callback, arr, 1);
|
||||
},
|
||||
replace: function(value) {
|
||||
if (value === '-') {
|
||||
self.openLater(true);
|
||||
return '$1-';
|
||||
}
|
||||
return basicReplacer(value);
|
||||
},
|
||||
index: 4,
|
||||
}),
|
||||
|
||||
]);
|
||||
|
||||
$textarea.textcomplete('register', [
|
||||
strategy({ // "resource show all", from BF 4.0.0 onwards
|
||||
match: /^(\s*resource\s+show\s+)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = true;
|
||||
searcher(term, callback, ['all'], 1, true);
|
||||
},
|
||||
template: highlighterPrefix,
|
||||
}),
|
||||
]);
|
||||
|
||||
// diff command
|
||||
const diffArgs1 = ["master", "profile", "rates", "all"];
|
||||
const diffArgs2 = [];
|
||||
|
||||
// above 3.4.0
|
||||
diffArgs2.push("defaults");
|
||||
diffArgs1.push("hardware");
|
||||
diffArgs2.push("bare");
|
||||
|
||||
diffArgs1.sort();
|
||||
diffArgs2.sort();
|
||||
|
||||
$textarea.textcomplete('register', [
|
||||
strategy({ // "diff arg1"
|
||||
match: /^(\s*diff\s+)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = true;
|
||||
searcher(term, callback, diffArgs1, 1, true);
|
||||
},
|
||||
template: highlighterPrefix,
|
||||
}),
|
||||
|
||||
strategy({ // "diff arg1 arg2"
|
||||
match: /^(\s*diff\s+\w+\s+)(\w*)$/i,
|
||||
search: function(term, callback) {
|
||||
sendOnEnter = true;
|
||||
searcher(term, callback, diffArgs2, 1, true);
|
||||
},
|
||||
template: highlighterPrefix,
|
||||
}),
|
||||
]);
|
||||
};
|
|
@ -42,6 +42,7 @@ var mspHelper = (function (gui) {
|
|||
'GSM_SMS': 19,
|
||||
'FRSKY_OSD': 20,
|
||||
'DJI_FPV': 21,
|
||||
'SBUS_OUTPUT': 22,
|
||||
'SMARTPORT_MASTER': 23,
|
||||
'MSP_DISPLAYPORT': 25,
|
||||
};
|
||||
|
|
|
@ -22,7 +22,16 @@ PortHandler.initialize = function () {
|
|||
PortHandler.check = function () {
|
||||
var self = this;
|
||||
|
||||
ConnectionSerial.getDevices(function(current_ports) {
|
||||
ConnectionSerial.getDevices(function(all_ports) {
|
||||
|
||||
// filter out ports that are not serial
|
||||
let current_ports = [];
|
||||
for (var i = 0; i < all_ports.length; i++) {
|
||||
if (all_ports[i].indexOf(':') === -1) {
|
||||
current_ports.push(all_ports[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// port got removed or initial_ports wasn't initialized yet
|
||||
if (self.array_difference(self.initial_ports, current_ports).length > 0 || !self.initial_ports) {
|
||||
var removed_ports = self.array_difference(self.initial_ports, current_ports);
|
||||
|
|
|
@ -61,6 +61,8 @@ var Settings = (function () {
|
|||
if (input.prop('tagName') == 'SELECT' || s.setting.table) {
|
||||
if (input.attr('type') == 'checkbox') {
|
||||
input.prop('checked', s.value > 0);
|
||||
} else if (input.attr('type') == 'radio') {
|
||||
input.prop( 'checked', s.value == input.attr('value') );
|
||||
} else {
|
||||
input.empty();
|
||||
let option = null;
|
||||
|
@ -515,6 +517,10 @@ var Settings = (function () {
|
|||
if (setting.table) {
|
||||
if (input.attr('type') == 'checkbox') {
|
||||
value = input.prop('checked') ? 1 : 0;
|
||||
} else if (input.attr('type') == 'radio') {
|
||||
if (input.prop('checked')) {
|
||||
value = parseInt(input.val());
|
||||
}
|
||||
} else {
|
||||
value = parseInt(input.val());
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ let Waypoint = function (number, action, lat, lon, alt=0, p1=0, p2=0, p3=0, endM
|
|||
self.getElevation = async function (globalSettings) {
|
||||
let elevation = "N/A";
|
||||
if (globalSettings.mapProviderType == 'bing') {
|
||||
let elevationEarthModel = $('#elevationEarthModel').prop("checked") ? "sealevel" : "ellipsoid";
|
||||
let elevationEarthModel = $('#elevationEarthModel').prop("checked") ? "ellipsoid" : "sealevel";
|
||||
|
||||
const response = await fetch('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+self.getLatMap()+','+self.getLonMap()+'&heights='+elevationEarthModel+'&key='+globalSettings.mapApiKey);
|
||||
const myJson = await response.json();
|
||||
|
|
22
main.js
22
main.js
|
@ -78,6 +78,14 @@ $(document).ready(function () {
|
|||
// Update CSS on to show highlighing or not
|
||||
updateProfilesHighlightColours();
|
||||
});
|
||||
chrome.storage.local.get('cli_autocomplete', function (result) {
|
||||
if (typeof result.cliAutocomplete === 'undefined') {
|
||||
result.cli_autocomplete = 1;
|
||||
}
|
||||
globalSettings.cliAutocomplete = result.cli_autocomplete;
|
||||
CliAutoComplete.setEnabled(globalSettings.cliAutocomplete);
|
||||
});
|
||||
|
||||
|
||||
// Resets the OSD units used by the unit coversion when the FC is disconnected.
|
||||
if (!CONFIGURATOR.connectionValid) {
|
||||
|
@ -122,9 +130,13 @@ $(document).ready(function () {
|
|||
//Get saved size and position
|
||||
chrome.storage.local.get('windowSize', function (result) {
|
||||
if (result.windowSize) {
|
||||
if (result.windowSize.height <= window.screen.availHeight)
|
||||
win.height = result.windowSize.height;
|
||||
if (result.windowSize.width <= window.screen.availWidth)
|
||||
win.width = result.windowSize.width;
|
||||
if (result.windowSize.x >= window.screen.availLeft)
|
||||
win.x = result.windowSize.x;
|
||||
if (result.windowSize.y >= window.screen.availTop)
|
||||
win.y = result.windowSize.y;
|
||||
}
|
||||
});
|
||||
|
@ -367,6 +379,15 @@ $(document).ready(function () {
|
|||
activeTab.removeClass('active');
|
||||
activeTab.find('a').click();
|
||||
});
|
||||
$('div.cli_autocomplete input').change(function () {
|
||||
globalSettings.cliAutocomplete = $(this).is(':checked');
|
||||
chrome.storage.local.set({
|
||||
'cli_autocomplete': globalSettings.cliAutocomplete
|
||||
});
|
||||
|
||||
CliAutoComplete.setEnabled($(this).is(':checked'));
|
||||
});
|
||||
|
||||
|
||||
$('#ui-unit-type').val(globalSettings.unitType);
|
||||
$('#map-provider-type').val(globalSettings.mapProviderType);
|
||||
|
@ -374,6 +395,7 @@ $(document).ready(function () {
|
|||
$('#proxyurl').val(globalSettings.proxyURL);
|
||||
$('#proxylayer').val(globalSettings.proxyLayer);
|
||||
$('#showProfileParameters').prop('checked', globalSettings.showProfileParameters);
|
||||
$('#cliAutocomplete').prop('checked', globalSettings.cliAutocomplete);
|
||||
|
||||
// Set the value of the unit type
|
||||
// none, OSD, imperial, metric
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"minimum_chrome_version": "38",
|
||||
"version": "7.0.0",
|
||||
"version": "7.1.0",
|
||||
"author": "Several",
|
||||
"name": "INAV - Configurator",
|
||||
"short_name": "INAV",
|
||||
|
|
13110
package-lock.json
generated
13110
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "inav-configurator",
|
||||
"description": "INAV Configurator",
|
||||
"version": "7.0.0",
|
||||
"version": "7.1.0",
|
||||
"main": "main.html",
|
||||
"default_locale": "en",
|
||||
"scripts": {
|
||||
|
@ -33,6 +33,7 @@
|
|||
"gulp-concat": "^2.6.1",
|
||||
"inflection": "1.12.0",
|
||||
"jquery": "2.1.4",
|
||||
"jquery-textcomplete": "^1.8.5",
|
||||
"jquery-ui-npm": "1.12.0",
|
||||
"marked": "^0.3.17",
|
||||
"minimist": "^1.2.0",
|
||||
|
|
|
@ -1,44 +1,121 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Public domain (CC-BY-SA if you or your laws insist), generated by Jonathan Hudson's svg_model_motors.rb -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200pt" height="200pt" viewBox="0 0 200 200" version="1.1">
|
||||
<defs>
|
||||
<g>
|
||||
<symbol overflow="visible" id="glyph0-0">
|
||||
<path style="stroke:none;" d=""/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-1">
|
||||
<path style="stroke:none;" d="M 2.679688 -13.863281 L 2.679688 -15.75 C 4.457031 -15.921875 5.695312 -16.210938 6.398438 -16.617188 C 7.101562 -17.023438 7.625 -17.984375 7.96875 -19.496094 L 9.914062 -19.496094 L 9.914062 0 L 7.289062 0 L 7.289062 -13.863281 Z M 2.679688 -13.863281 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-2">
|
||||
<path style="stroke:none;" d="M 1.921875 -4.402344 C 2.527344 -5.652344 3.710938 -6.785156 5.46875 -7.804688 L 8.09375 -9.324219 C 9.269531 -10.007812 10.09375 -10.589844 10.570312 -11.074219 C 11.316406 -11.832031 11.6875 -12.695312 11.6875 -13.671875 C 11.6875 -14.8125 11.347656 -15.714844 10.664062 -16.386719 C 9.980469 -17.054688 9.070312 -17.390625 7.929688 -17.390625 C 6.242188 -17.390625 5.078125 -16.753906 4.429688 -15.476562 C 4.082031 -14.792969 3.890625 -13.84375 3.855469 -12.632812 L 1.351562 -12.632812 C 1.378906 -14.335938 1.695312 -15.726562 2.296875 -16.804688 C 3.363281 -18.699219 5.246094 -19.648438 7.945312 -19.648438 C 10.1875 -19.648438 11.824219 -19.039062 12.859375 -17.828125 C 13.894531 -16.617188 14.410156 -15.265625 14.410156 -13.78125 C 14.410156 -12.214844 13.859375 -10.875 12.757812 -9.761719 C 12.117188 -9.113281 10.972656 -8.332031 9.324219 -7.410156 L 7.453125 -6.371094 C 6.558594 -5.878906 5.855469 -5.410156 5.34375 -4.960938 C 4.433594 -4.167969 3.859375 -3.289062 3.625 -2.324219 L 14.3125 -2.324219 L 14.3125 0 L 0.875 0 C 0.964844 -1.6875 1.316406 -3.152344 1.921875 -4.402344 Z M 1.921875 -4.402344 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-3">
|
||||
<path style="stroke:none;" d="M 2.234375 -1.375 C 1.191406 -2.644531 0.671875 -4.191406 0.671875 -6.015625 L 3.242188 -6.015625 C 3.351562 -4.75 3.585938 -3.828125 3.953125 -3.253906 C 4.589844 -2.222656 5.742188 -1.710938 7.410156 -1.710938 C 8.703125 -1.710938 9.742188 -2.054688 10.527344 -2.75 C 11.3125 -3.441406 11.703125 -4.335938 11.703125 -5.429688 C 11.703125 -6.777344 11.289062 -7.71875 10.464844 -8.257812 C 9.640625 -8.796875 8.496094 -9.0625 7.027344 -9.0625 C 6.863281 -9.0625 6.695312 -9.0625 6.527344 -9.058594 C 6.359375 -9.054688 6.1875 -9.046875 6.015625 -9.039062 L 6.015625 -11.210938 C 6.269531 -11.183594 6.484375 -11.164062 6.65625 -11.15625 C 6.832031 -11.148438 7.019531 -11.140625 7.21875 -11.140625 C 8.140625 -11.140625 8.894531 -11.289062 9.488281 -11.578125 C 10.527344 -12.089844 11.046875 -13 11.046875 -14.3125 C 11.046875 -15.289062 10.699219 -16.042969 10.007812 -16.570312 C 9.316406 -17.097656 8.507812 -17.363281 7.585938 -17.363281 C 5.945312 -17.363281 4.8125 -16.816406 4.183594 -15.722656 C 3.835938 -15.121094 3.640625 -14.265625 3.59375 -13.152344 L 1.164062 -13.152344 C 1.164062 -14.609375 1.453125 -15.851562 2.039062 -16.871094 C 3.039062 -18.695312 4.804688 -19.605469 7.328125 -19.605469 C 9.324219 -19.605469 10.867188 -19.160156 11.960938 -18.273438 C 13.054688 -17.382812 13.601562 -16.097656 13.601562 -14.410156 C 13.601562 -13.207031 13.28125 -12.230469 12.632812 -11.484375 C 12.230469 -11.019531 11.710938 -10.65625 11.074219 -10.390625 C 12.105469 -10.109375 12.910156 -9.5625 13.488281 -8.757812 C 14.066406 -7.949219 14.355469 -6.964844 14.355469 -5.796875 C 14.355469 -3.929688 13.742188 -2.40625 12.507812 -1.230469 C 11.277344 -0.0546875 9.535156 0.53125 7.273438 0.53125 C 4.957031 0.53125 3.277344 -0.101562 2.234375 -1.375 Z M 2.234375 -1.375 "/>
|
||||
</symbol>
|
||||
<symbol overflow="visible" id="glyph0-4">
|
||||
<path style="stroke:none;" d="M 9.257812 -6.929688 L 9.257812 -15.804688 L 2.980469 -6.929688 Z M 9.296875 0 L 9.296875 -4.785156 L 0.710938 -4.785156 L 0.710938 -7.191406 L 9.679688 -19.632812 L 11.757812 -19.632812 L 11.757812 -6.929688 L 14.640625 -6.929688 L 14.640625 -4.785156 L 11.757812 -4.785156 L 11.757812 0 Z M 9.296875 0 "/>
|
||||
</symbol>
|
||||
</g>
|
||||
</defs>
|
||||
<g id="surface11">
|
||||
<path style="fill:none;stroke-width:28;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(72.941176%,72.941176%,72.941176%);stroke-opacity:1;stroke-miterlimit:10;" d="M 40 40 L 160 160 M 40 160 L 160 40 "/>
|
||||
<path style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;" d="M 188 160 C 188 175.464844 175.464844 188 160 188 C 144.535156 188 132 175.464844 132 160 C 132 144.535156 144.535156 132 160 132 C 175.464844 132 188 144.535156 188 160 M 179.800781 179.800781 L 177.785156 163 M 179.800781 179.800781 L 196.601562 179.800781 "/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-1" x="153" y="167"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;" d="M 188 40 C 188 55.464844 175.464844 68 160 68 C 144.535156 68 132 55.464844 132 40 C 132 24.535156 144.535156 12 160 12 C 175.464844 12 188 24.535156 188 40 M 179.800781 20.199219 L 177.785156 37 M 179.800781 20.199219 L 196.601562 20.199219 "/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-2" x="153" y="47"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;" d="M 68 160 C 68 175.464844 55.464844 188 40 188 C 24.535156 188 12 175.464844 12 160 C 12 144.535156 24.535156 132 40 132 C 55.464844 132 68 144.535156 68 160 M 20.199219 179.800781 L 22.214844 163 M 20.199219 179.800781 L 3.398438 179.800781 "/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-3" x="33" y="167"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;" d="M 68 40 C 68 55.464844 55.464844 68 40 68 C 24.535156 68 12 55.464844 12 40 C 12 24.535156 24.535156 12 40 12 C 55.464844 12 68 24.535156 68 40 M 20.199219 20.199219 L 22.214844 37 M 20.199219 20.199219 L 3.398438 20.199219 "/>
|
||||
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
|
||||
<use xlink:href="#glyph0-4" x="33" y="47"/>
|
||||
</g>
|
||||
<path style="fill:none;stroke-width:12;stroke-linecap:butt;stroke-linejoin:bevel;stroke:rgb(98.039216%,2.745098%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 100 80 L 100 120 "/>
|
||||
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(98.039216%,2.745098%,0%);fill-opacity:1;" d="M 100 75 L 85 90 L 115 90 L 100 75 "/>
|
||||
</g>
|
||||
|
||||
<svg
|
||||
width="200pt"
|
||||
height="200pt"
|
||||
viewBox="0 0 200 200"
|
||||
version="1.1"
|
||||
id="svg52"
|
||||
sodipodi:docname="quad_x.svg"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview54"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:document-units="pt"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.165"
|
||||
inkscape:cx="133.17536"
|
||||
inkscape:cy="133.49131"
|
||||
inkscape:window-width="1850"
|
||||
inkscape:window-height="1016"
|
||||
inkscape:window-x="1990"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g45" />
|
||||
<defs
|
||||
id="defs19">
|
||||
<g
|
||||
id="g17">
|
||||
<symbol
|
||||
overflow="visible"
|
||||
id="glyph0-0">
|
||||
<path
|
||||
style="stroke:none;"
|
||||
d=""
|
||||
id="path2" />
|
||||
</symbol>
|
||||
<symbol
|
||||
overflow="visible"
|
||||
id="glyph0-1">
|
||||
<path
|
||||
style="stroke:none;"
|
||||
d="M 2.679688 -13.863281 L 2.679688 -15.75 C 4.457031 -15.921875 5.695312 -16.210938 6.398438 -16.617188 C 7.101562 -17.023438 7.625 -17.984375 7.96875 -19.496094 L 9.914062 -19.496094 L 9.914062 0 L 7.289062 0 L 7.289062 -13.863281 Z M 2.679688 -13.863281 "
|
||||
id="path5" />
|
||||
</symbol>
|
||||
<symbol
|
||||
overflow="visible"
|
||||
id="glyph0-2">
|
||||
<path
|
||||
style="stroke:none;"
|
||||
d="M 1.921875 -4.402344 C 2.527344 -5.652344 3.710938 -6.785156 5.46875 -7.804688 L 8.09375 -9.324219 C 9.269531 -10.007812 10.09375 -10.589844 10.570312 -11.074219 C 11.316406 -11.832031 11.6875 -12.695312 11.6875 -13.671875 C 11.6875 -14.8125 11.347656 -15.714844 10.664062 -16.386719 C 9.980469 -17.054688 9.070312 -17.390625 7.929688 -17.390625 C 6.242188 -17.390625 5.078125 -16.753906 4.429688 -15.476562 C 4.082031 -14.792969 3.890625 -13.84375 3.855469 -12.632812 L 1.351562 -12.632812 C 1.378906 -14.335938 1.695312 -15.726562 2.296875 -16.804688 C 3.363281 -18.699219 5.246094 -19.648438 7.945312 -19.648438 C 10.1875 -19.648438 11.824219 -19.039062 12.859375 -17.828125 C 13.894531 -16.617188 14.410156 -15.265625 14.410156 -13.78125 C 14.410156 -12.214844 13.859375 -10.875 12.757812 -9.761719 C 12.117188 -9.113281 10.972656 -8.332031 9.324219 -7.410156 L 7.453125 -6.371094 C 6.558594 -5.878906 5.855469 -5.410156 5.34375 -4.960938 C 4.433594 -4.167969 3.859375 -3.289062 3.625 -2.324219 L 14.3125 -2.324219 L 14.3125 0 L 0.875 0 C 0.964844 -1.6875 1.316406 -3.152344 1.921875 -4.402344 Z M 1.921875 -4.402344 "
|
||||
id="path8" />
|
||||
</symbol>
|
||||
<symbol
|
||||
overflow="visible"
|
||||
id="glyph0-3">
|
||||
<path
|
||||
style="stroke:none;"
|
||||
d="M 2.234375 -1.375 C 1.191406 -2.644531 0.671875 -4.191406 0.671875 -6.015625 L 3.242188 -6.015625 C 3.351562 -4.75 3.585938 -3.828125 3.953125 -3.253906 C 4.589844 -2.222656 5.742188 -1.710938 7.410156 -1.710938 C 8.703125 -1.710938 9.742188 -2.054688 10.527344 -2.75 C 11.3125 -3.441406 11.703125 -4.335938 11.703125 -5.429688 C 11.703125 -6.777344 11.289062 -7.71875 10.464844 -8.257812 C 9.640625 -8.796875 8.496094 -9.0625 7.027344 -9.0625 C 6.863281 -9.0625 6.695312 -9.0625 6.527344 -9.058594 C 6.359375 -9.054688 6.1875 -9.046875 6.015625 -9.039062 L 6.015625 -11.210938 C 6.269531 -11.183594 6.484375 -11.164062 6.65625 -11.15625 C 6.832031 -11.148438 7.019531 -11.140625 7.21875 -11.140625 C 8.140625 -11.140625 8.894531 -11.289062 9.488281 -11.578125 C 10.527344 -12.089844 11.046875 -13 11.046875 -14.3125 C 11.046875 -15.289062 10.699219 -16.042969 10.007812 -16.570312 C 9.316406 -17.097656 8.507812 -17.363281 7.585938 -17.363281 C 5.945312 -17.363281 4.8125 -16.816406 4.183594 -15.722656 C 3.835938 -15.121094 3.640625 -14.265625 3.59375 -13.152344 L 1.164062 -13.152344 C 1.164062 -14.609375 1.453125 -15.851562 2.039062 -16.871094 C 3.039062 -18.695312 4.804688 -19.605469 7.328125 -19.605469 C 9.324219 -19.605469 10.867188 -19.160156 11.960938 -18.273438 C 13.054688 -17.382812 13.601562 -16.097656 13.601562 -14.410156 C 13.601562 -13.207031 13.28125 -12.230469 12.632812 -11.484375 C 12.230469 -11.019531 11.710938 -10.65625 11.074219 -10.390625 C 12.105469 -10.109375 12.910156 -9.5625 13.488281 -8.757812 C 14.066406 -7.949219 14.355469 -6.964844 14.355469 -5.796875 C 14.355469 -3.929688 13.742188 -2.40625 12.507812 -1.230469 C 11.277344 -0.0546875 9.535156 0.53125 7.273438 0.53125 C 4.957031 0.53125 3.277344 -0.101562 2.234375 -1.375 Z M 2.234375 -1.375 "
|
||||
id="path11" />
|
||||
</symbol>
|
||||
<symbol
|
||||
overflow="visible"
|
||||
id="glyph0-4">
|
||||
<path
|
||||
style="stroke:none;"
|
||||
d="M 9.257812 -6.929688 L 9.257812 -15.804688 L 2.980469 -6.929688 Z M 9.296875 0 L 9.296875 -4.785156 L 0.710938 -4.785156 L 0.710938 -7.191406 L 9.679688 -19.632812 L 11.757812 -19.632812 L 11.757812 -6.929688 L 14.640625 -6.929688 L 14.640625 -4.785156 L 11.757812 -4.785156 L 11.757812 0 Z M 9.296875 0 "
|
||||
id="path14" />
|
||||
</symbol>
|
||||
</g>
|
||||
</defs>
|
||||
<g
|
||||
id="surface11">
|
||||
<path
|
||||
style="fill:none;stroke-width:28;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(72.941176%,72.941176%,72.941176%);stroke-opacity:1;stroke-miterlimit:10;"
|
||||
d="M 40 40 L 160 160 M 40 160 L 160 40 "
|
||||
id="path21" />
|
||||
<path
|
||||
style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;"
|
||||
d="M 188 160 C 188 175.464844 175.464844 188 160 188 C 144.535156 188 132 175.464844 132 160 C 132 144.535156 144.535156 132 160 132 C 175.464844 132 188 144.535156 188 160 M 179.800781 179.800781 L 177.785156 163 M 179.800781 179.800781 L 196.601562 179.800781 "
|
||||
id="path23" />
|
||||
<g
|
||||
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
|
||||
id="g27" />
|
||||
<path
|
||||
style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;"
|
||||
d="M 188 40 C 188 55.464844 175.464844 68 160 68 C 144.535156 68 132 55.464844 132 40 C 132 24.535156 144.535156 12 160 12 C 175.464844 12 188 24.535156 188 40 M 179.800781 20.199219 L 177.785156 37 M 179.800781 20.199219 L 196.601562 20.199219 "
|
||||
id="path29" />
|
||||
<g
|
||||
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
|
||||
id="g33" />
|
||||
<path
|
||||
style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;"
|
||||
d="M 68 160 C 68 175.464844 55.464844 188 40 188 C 24.535156 188 12 175.464844 12 160 C 12 144.535156 24.535156 132 40 132 C 55.464844 132 68 144.535156 68 160 M 20.199219 179.800781 L 22.214844 163 M 20.199219 179.800781 L 3.398438 179.800781 "
|
||||
id="path35" />
|
||||
<path
|
||||
style="fill:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(55,168,219);stroke-opacity:1;stroke-miterlimit:10;"
|
||||
d="M 68 40 C 68 55.464844 55.464844 68 40 68 C 24.535156 68 12 55.464844 12 40 C 12 24.535156 24.535156 12 40 12 C 55.464844 12 68 24.535156 68 40 M 20.199219 20.199219 L 22.214844 37 M 20.199219 20.199219 L 3.398438 20.199219 "
|
||||
id="path41" />
|
||||
<g
|
||||
style="fill:rgb(0%,0%,0%);fill-opacity:1;"
|
||||
id="g45" />
|
||||
<path
|
||||
style="fill:none;stroke-width:12;stroke-linecap:butt;stroke-linejoin:bevel;stroke:rgb(98.039216%,2.745098%,0%);stroke-opacity:1;stroke-miterlimit:10;"
|
||||
d="M 100 80 L 100 120 "
|
||||
id="path47" />
|
||||
<path
|
||||
style=" stroke:none;fill-rule:nonzero;fill:rgb(98.039216%,2.745098%,0%);fill-opacity:1;"
|
||||
d="M 100 75 L 85 90 L 115 90 L 100 75 "
|
||||
id="path49" />
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.9 KiB |
|
@ -8,10 +8,9 @@
|
|||
version="1.1"
|
||||
id="svg52"
|
||||
sodipodi:docname="quad_x_reverse.svg"
|
||||
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
|
||||
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
|
@ -25,14 +24,14 @@
|
|||
inkscape:document-units="pt"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.1269514"
|
||||
inkscape:cx="-5.3240981"
|
||||
inkscape:cy="231.15459"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1009"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:cx="-4.8804234"
|
||||
inkscape:cy="231.1546"
|
||||
inkscape:window-width="1850"
|
||||
inkscape:window-height="1016"
|
||||
inkscape:window-x="1990"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg52" />
|
||||
inkscape:current-layer="g862" />
|
||||
<defs
|
||||
id="defs19">
|
||||
<g
|
||||
|
@ -89,62 +88,18 @@
|
|||
style="fill:none;stroke:#37a8db;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1"
|
||||
d="m 188,160 c 0,-15.46484 -12.53516,-28 -28,-28 -15.46484,0 -28,12.53516 -28,28 0,15.46484 12.53516,28 28,28 15.46484,0 28,-12.53516 28,-28 M 179.80078,140.19922 177.78516,157 m 2.01562,-16.80078 h 16.80078"
|
||||
id="path23" />
|
||||
<g
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
id="g27">
|
||||
<use
|
||||
xlink:href="#glyph0-1"
|
||||
x="153"
|
||||
y="167"
|
||||
id="use25"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#37a8db;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1"
|
||||
d="m 188,40 c 0,-15.464844 -12.53516,-28 -28,-28 -15.46484,0 -28,12.535156 -28,28 0,15.464844 12.53516,28 28,28 15.46484,0 28,-12.535156 28,-28 M 179.80078,59.800781 177.78516,43 m 2.01562,16.800781 h 16.80078"
|
||||
id="path29" />
|
||||
<g
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
id="g33">
|
||||
<use
|
||||
xlink:href="#glyph0-2"
|
||||
x="153"
|
||||
y="47"
|
||||
id="use31"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#37a8db;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1"
|
||||
d="m 68,160 c 0,-15.46484 -12.535156,-28 -28,-28 -15.464844,0 -28,12.53516 -28,28 0,15.46484 12.535156,28 28,28 15.464844,0 28,-12.53516 28,-28 M 20.199219,140.19922 22.214844,157 M 20.199219,140.19922 H 3.398438"
|
||||
id="path35" />
|
||||
<g
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
id="g39">
|
||||
<use
|
||||
xlink:href="#glyph0-3"
|
||||
x="33"
|
||||
y="167"
|
||||
id="use37"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#37a8db;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1"
|
||||
d="M 68,40 C 68,24.535156 55.464844,12 40,12 24.535156,12 12,24.535156 12,40 12,55.464844 24.535156,68 40,68 55.464844,68 68,55.464844 68,40 M 20.199219,59.800781 22.214844,43 M 20.199219,59.800781 H 3.398438"
|
||||
id="path41" />
|
||||
<g
|
||||
style="fill:#000000;fill-opacity:1"
|
||||
id="g45">
|
||||
<use
|
||||
xlink:href="#glyph0-4"
|
||||
x="33"
|
||||
y="47"
|
||||
id="use43"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#fa0500;stroke-width:12;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:10;stroke-opacity:1"
|
||||
d="m 100,80 v 40"
|
||||
|
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 7.5 KiB |
|
@ -79,6 +79,24 @@
|
|||
color: white;
|
||||
}
|
||||
|
||||
.cli-textcomplete-dropdown {
|
||||
border: 1px solid black;
|
||||
background-color: #4f4f4f;
|
||||
border-radius: 5px;
|
||||
max-height: 50%;
|
||||
overflow: auto;
|
||||
list-style: none;
|
||||
padding: 5px;
|
||||
margin: 0;
|
||||
}
|
||||
.cli-textcomplete-dropdown a {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
.cli-textcomplete-dropdown .active {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
||||
|
||||
.tab-cli .content_wrapper {
|
||||
|
|
|
@ -119,3 +119,13 @@
|
|||
line-height: 27px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
|
||||
.motorNumber {
|
||||
position: absolute;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
.mixer-preview-image-numbers {
|
||||
width: fit-content;
|
||||
}
|
||||
|
|
50
tabs/cli.js
50
tabs/cli.js
|
@ -151,6 +151,19 @@ TABS.cli.initialize = function (callback) {
|
|||
CONFIGURATOR.cliActive = true;
|
||||
|
||||
var textarea = $('.tab-cli textarea[name="commands"]');
|
||||
CliAutoComplete.initialize(textarea, self.sendLine.bind(self), writeToOutput);
|
||||
$(CliAutoComplete).on('build:start', function() {
|
||||
textarea
|
||||
.val('')
|
||||
.attr('placeholder', chrome.i18n.getMessage('cliInputPlaceholderBuilding'))
|
||||
.prop('disabled', true);
|
||||
});
|
||||
$(CliAutoComplete).on('build:stop', function() {
|
||||
textarea
|
||||
.attr('placeholder', chrome.i18n.getMessage('cliInputPlaceholder'))
|
||||
.prop('disabled', false)
|
||||
.focus();
|
||||
});
|
||||
|
||||
$('.tab-cli .save').click(function() {
|
||||
var prefix = 'cli';
|
||||
|
@ -266,6 +279,8 @@ TABS.cli.initialize = function (callback) {
|
|||
if (event.which == tabKeyCode) {
|
||||
// prevent default tabbing behaviour
|
||||
event.preventDefault();
|
||||
|
||||
if (!CliAutoComplete.isEnabled()) {
|
||||
const outString = textarea.val();
|
||||
const lastCommand = outString.split("\n").pop();
|
||||
const command = getCliCommand(lastCommand, self.cliBuffer);
|
||||
|
@ -274,6 +289,11 @@ TABS.cli.initialize = function (callback) {
|
|||
textarea.val('');
|
||||
}
|
||||
}
|
||||
else if (!CliAutoComplete.isOpen() && !CliAutoComplete.isBuilding()) {
|
||||
// force show autocomplete on Tab
|
||||
CliAutoComplete.openLater(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
textarea.keypress(function (event) {
|
||||
|
@ -281,6 +301,10 @@ TABS.cli.initialize = function (callback) {
|
|||
if (event.which == enterKeyCode) {
|
||||
event.preventDefault(); // prevent the adding of new line
|
||||
|
||||
if (CliAutoComplete.isBuilding()) {
|
||||
return; // silently ignore commands if autocomplete is still building
|
||||
}
|
||||
|
||||
var out_string = textarea.val();
|
||||
self.history.add(out_string.trim());
|
||||
|
||||
|
@ -300,6 +324,10 @@ TABS.cli.initialize = function (callback) {
|
|||
var keyUp = {38: true},
|
||||
keyDown = {40: true};
|
||||
|
||||
if (CliAutoComplete.isOpen()) {
|
||||
return; // disable history keys if autocomplete is open
|
||||
}
|
||||
|
||||
if (event.keyCode in keyUp) {
|
||||
textarea.val(self.history.prev());
|
||||
}
|
||||
|
@ -370,6 +398,11 @@ function writeToOutput(text) {
|
|||
}
|
||||
|
||||
function writeLineToOutput(text) {
|
||||
if (CliAutoComplete.isBuilding()) {
|
||||
CliAutoComplete.builderParseLine(text);
|
||||
return; // suppress output if in building state
|
||||
}
|
||||
|
||||
if (text.startsWith("### ERROR: ")) {
|
||||
writeToOutput('<span class="error_message">' + text + '</span><br>');
|
||||
} else {
|
||||
|
@ -444,7 +477,10 @@ TABS.cli.read = function (readInfo) {
|
|||
this.cliBuffer += currentChar;
|
||||
}
|
||||
|
||||
if (!CliAutoComplete.isBuilding()) {
|
||||
// do not include the building dialog into the history
|
||||
this.outputHistory += currentChar;
|
||||
}
|
||||
|
||||
if (this.cliBuffer == 'Rebooting') {
|
||||
CONFIGURATOR.cliActive = false;
|
||||
|
@ -459,7 +495,16 @@ TABS.cli.read = function (readInfo) {
|
|||
if (!CONFIGURATOR.cliValid && validateText.indexOf('CLI') !== -1) {
|
||||
GUI.log(chrome.i18n.getMessage('cliEnter'));
|
||||
CONFIGURATOR.cliValid = true;
|
||||
validateText = "";
|
||||
|
||||
if (CliAutoComplete.isEnabled() && !CliAutoComplete.isBuilding()) {
|
||||
// start building autoComplete
|
||||
CliAutoComplete.builderStart();
|
||||
}
|
||||
}
|
||||
|
||||
// fallback to native autocomplete
|
||||
if (!CliAutoComplete.isEnabled()) {
|
||||
setPrompt(removePromptHash(this.cliBuffer));
|
||||
}
|
||||
|
||||
setPrompt(removePromptHash(this.cliBuffer));
|
||||
|
@ -498,5 +543,8 @@ TABS.cli.cleanup = function (callback) {
|
|||
if (callback) callback();
|
||||
}, 1000); // if we dont allow enough time to reboot, CRC of "first" command sent will fail, keep an eye for this one
|
||||
CONFIGURATOR.cliActive = false;
|
||||
|
||||
CliAutoComplete.cleanup();
|
||||
$(CliAutoComplete).off();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -174,8 +174,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="point" id="elevationEarthModelclass" style="display: none">
|
||||
<label class="spacer_box_title" for="elevationEarthModel" data-i18n="missionLevelEarthDEMModel"></label>
|
||||
<input id="elevationEarthModel" type="checkbox" value="0" class="togglemedium" checked required>
|
||||
<label class="spacer_box_title" for="elevationEarthModel" data-i18n="missionEllipsoidEarthDEMModel"></label>
|
||||
<input id="elevationEarthModel" type="checkbox" value="0" class="togglemedium" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -809,6 +809,7 @@ TABS.mission_control.initialize = function (callback) {
|
|||
|
||||
if (globalSettings.mapProviderType == 'bing') {
|
||||
$('#elevationEarthModelclass').fadeIn(300);
|
||||
changeSwitchery($('#elevationEarthModel'), settings.bingDemModel);
|
||||
} else {
|
||||
$('#elevationEarthModelclass').fadeOut(300);
|
||||
}
|
||||
|
@ -2407,14 +2408,17 @@ TABS.mission_control.initialize = function (callback) {
|
|||
const elevationAtWP = await selectedMarker.getElevation(globalSettings);
|
||||
$('#elevationValueAtWP').text(elevationAtWP);
|
||||
var altitude = Number($('#pointAlt').val());
|
||||
|
||||
if (P3Value != selectedMarker.getP3()) {
|
||||
selectedMarker.setP3(P3Value);
|
||||
|
||||
if ($('#pointP3Alt').prop("checked")) {
|
||||
if (altitude < 0) {
|
||||
altitude = settings.alt;
|
||||
let groundClearance = 100 * Number($('#groundClearanceValueAtWP').text());
|
||||
if (isNaN(groundClearance)) {
|
||||
groundClearance = settings.alt; // use default altitude if no current ground clearance
|
||||
}
|
||||
selectedMarker.setAlt(altitude + elevationAtWP * 100);
|
||||
|
||||
if ($('#pointP3Alt').prop("checked")) {
|
||||
selectedMarker.setAlt(groundClearance + elevationAtWP * 100);
|
||||
} else {
|
||||
selectedMarker.setAlt(altitude - Number(elevationAtWP) * 100);
|
||||
}
|
||||
|
@ -2924,6 +2928,9 @@ TABS.mission_control.initialize = function (callback) {
|
|||
redrawLayer();
|
||||
plotElevation();
|
||||
})()
|
||||
|
||||
settings.bingDemModel = $('#elevationEarthModel').prop("checked") ? true : false;
|
||||
saveSettings();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -3087,11 +3094,13 @@ TABS.mission_control.initialize = function (callback) {
|
|||
let oldSafeRadiusSH = settings.safeRadiusSH;
|
||||
settings = { speed: Number($('#MPdefaultPointSpeed').val()), alt: Number($('#MPdefaultPointAlt').val()), safeRadiusSH: Number($('#MPdefaultSafeRangeSH').val()), maxDistSH : vMaxDistSH, fwApproachAlt: Number($('#MPdefaultFwApproachAlt').val()), fwLandAlt:Number($('#MPdefaultLandAlt').val())};
|
||||
saveSettings();
|
||||
|
||||
if (settings.safeRadiusSH != oldSafeRadiusSH && $('#showHideSafehomeButton').is(":visible")) {
|
||||
cleanSafehomeLayers();
|
||||
renderSafehomesOnMap();
|
||||
$('#SafeHomeSafeDistance').text(settings.safeRadiusSH);
|
||||
}
|
||||
|
||||
closeSettingsPanel();
|
||||
});
|
||||
|
||||
|
@ -3517,7 +3526,11 @@ TABS.mission_control.initialize = function (callback) {
|
|||
alert(chrome.i18n.getMessage('MissionPlannerAltitudeChangeReset'));
|
||||
altitude = selectedMarker.getAlt();
|
||||
} else {
|
||||
altitude = settings.alt + 100 * (elevation - elevationAtHome);
|
||||
let currentGroundClearance = 100 * Number($('#groundClearanceValueAtWP').text());
|
||||
if (isNaN(currentGroundClearance) || selectedMarker == null) {
|
||||
currentGroundClearance = settings.alt; // use default altitude if no current ground clearance
|
||||
}
|
||||
altitude = currentGroundClearance + 100 * (elevation - elevationAtHome);
|
||||
}
|
||||
}
|
||||
groundClearance = altitude / 100 + (elevationAtHome - elevation);
|
||||
|
|
|
@ -15,11 +15,26 @@
|
|||
<span data-i18n="platformType"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<input id="motor_direction_inverted" type="checkbox" class="toggle" data-setting="motor_direction_inverted" />
|
||||
<label for="motor_direction_inverted"><span data-i18n="motor_direction_inverted"></span></label>
|
||||
<div class="radio">
|
||||
<fieldset>
|
||||
<legend>Motor direction</legend>
|
||||
<label for="motor_direction_normal">
|
||||
<input id="motor_direction_normal" name="motor_direction_inverted" type="radio"
|
||||
value="0" data-setting="motor_direction_inverted" class="left" />
|
||||
<span data-i18n="motor_direction_inverted"></span>
|
||||
</label><br class="clear-both"/>
|
||||
|
||||
<label class="checkbox-inline">
|
||||
<input id="motor_direction_inverted" name="motor_direction_inverted" type="radio"
|
||||
value="1" data-setting="motor_direction_inverted" class="left"/>
|
||||
<span data-i18n="motor_direction_isInverted"></span>
|
||||
</span></label>
|
||||
|
||||
<div class="helpicon cf_tip" data-i18n_title="motor_direction_inverted_hint"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="checkbox">
|
||||
<input id="mixer_pid_profile_linking" type="checkbox" class="toggle" data-setting="mixer_pid_profile_linking" />
|
||||
<label for="mixer_pid_profile_linking"><span data-i18n="mixer_pid_profile_linking"></span></label>
|
||||
|
@ -44,7 +59,11 @@
|
|||
<div class="spacer_box">
|
||||
<div class="select position-relative">
|
||||
<div class="mixerPreview" style="max-width: 175px">
|
||||
<img src="./resources/motor_order/custom.svg" />
|
||||
<img src="./resources/motor_order/custom.svg" id="motor-mixer-preview-img"/>
|
||||
<div class="motorNumber" id="motorNumber1">1</div>
|
||||
<div class="motorNumber" id="motorNumber2">2</div>
|
||||
<div class="motorNumber" id="motorNumber3">3</div>
|
||||
<div class="motorNumber" id="motorNumber4">4</div>
|
||||
</div>
|
||||
<div class="half" style="width: calc(50% - 10px); margin-left: 10px;">
|
||||
<select id="mixer-preset"></select>
|
||||
|
|
|
@ -421,6 +421,45 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
|||
return (parseInt(weight) + 100) * 1000 / 200 + 1000;
|
||||
}
|
||||
|
||||
|
||||
function labelMotorNumbers() {
|
||||
|
||||
let index = 0;
|
||||
var rules
|
||||
|
||||
if (currentMixerPreset.id == loadedMixerPresetID) {
|
||||
rules = MOTOR_RULES.get();
|
||||
} else {
|
||||
rules = currentMixerPreset.motorMixer;
|
||||
}
|
||||
|
||||
for (const i in rules) {
|
||||
if (rules.hasOwnProperty(i)) {
|
||||
const rule = rules[i];
|
||||
index++;
|
||||
|
||||
if (currentMixerPreset.image != 'quad_x') {
|
||||
$("#motorNumber"+index).css("visibility", "hidden");
|
||||
continue;
|
||||
}
|
||||
|
||||
let top_px = 30;
|
||||
let left_px = 28;
|
||||
if (rule.getRoll() < -0.5) {
|
||||
left_px = $("#motor-mixer-preview-img").width() - 42;
|
||||
}
|
||||
|
||||
if (rule.getPitch() > 0.5) {
|
||||
top_px = $("#motor-mixer-preview-img").height() - 42;
|
||||
}
|
||||
$("#motorNumber"+index).css("left", left_px + "px");
|
||||
$("#motorNumber"+index).css("top", top_px + "px");
|
||||
$("#motorNumber"+index).css("visibility", "visible");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function renderMotorMixRules() {
|
||||
|
||||
/*
|
||||
|
@ -484,6 +523,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
|
||||
}
|
||||
labelMotorNumbers();
|
||||
localize();
|
||||
}
|
||||
|
||||
|
@ -601,25 +641,17 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
|||
});
|
||||
|
||||
const updateMotorDirection = function () {
|
||||
let motorDirectionCheckbox = $("#motor_direction_inverted");
|
||||
const isReversed = motorDirectionCheckbox.is(":checked") && (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
|
||||
let motorDirectionCheckbox = $('input[name=motor_direction_inverted]:checked');
|
||||
const isReversed = motorDirectionCheckbox.val() == 1 && (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
|
||||
|
||||
const path = './resources/motor_order/'
|
||||
+ currentMixerPreset.image + (isReversed ? "_reverse" : "") + '.svg';
|
||||
$('.mixerPreview img').attr('src', path);
|
||||
|
||||
if (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER) {
|
||||
if (isReversed) {
|
||||
motorDirectionCheckbox.parent().find("label span").html(chrome.i18n.getMessage("motor_direction_isInverted"));
|
||||
} else {
|
||||
motorDirectionCheckbox.parent().find("label span").html(chrome.i18n.getMessage("motor_direction_inverted"));
|
||||
}
|
||||
}
|
||||
|
||||
renderServoOutputImage();
|
||||
};
|
||||
|
||||
$("#motor_direction_inverted").change(updateMotorDirection);
|
||||
$("input[name=motor_direction_inverted]").change(updateMotorDirection);
|
||||
|
||||
$platformSelect.find("*").remove();
|
||||
|
||||
|
@ -675,7 +707,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
|
||||
updateRefreshButtonStatus();
|
||||
|
||||
labelMotorNumbers();
|
||||
updateMotorDirection();
|
||||
});
|
||||
|
||||
|
|
|
@ -20,6 +20,11 @@
|
|||
<input id="showProfileParameters" type="checkbox" />
|
||||
<label for="showProfileParameters"><span data-i18n="options_showProfileParameters"></span></label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox cli_autocomplete">
|
||||
<input id="cliAutocomplete" type="checkbox" />
|
||||
<label for="cliAutocomplete"><span data-i18n="options_cliAutocomplete"></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -114,6 +114,12 @@ TABS.ports.initialize = function (callback) {
|
|||
maxPorts: 1,
|
||||
defaultBaud: 57600 }
|
||||
);
|
||||
portFunctionRules.push({
|
||||
name: 'SBUS_OUTPUT',
|
||||
groups: ['peripherals'],
|
||||
maxPorts: 1,
|
||||
defaultBaud: 115200 }
|
||||
);
|
||||
|
||||
for (var i = 0; i < portFunctionRules.length; i++) {
|
||||
portFunctionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + portFunctionRules[i].name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue