Merge pull request #862 from iNavFlight/release-2-3-0

Release Configurator 2.3.1
pull/864/head
Paweł Spychalski 5 years ago committed by GitHub
commit 0fbdc439ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -199,6 +199,10 @@ function onValidFirmware()
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice(); GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
onConnect(); onConnect();
if (semver.gte(CONFIG.flightControllerVersion, "2.3.0")) {
helper.defaultsDialog.init();
}
$('#tabs ul.mode-connected .tab_setup a').click(); $('#tabs ul.mode-connected .tab_setup a').click();
}); });
}); });

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"minimum_chrome_version": "38", "minimum_chrome_version": "38",
"version": "2.3.0-RC3", "version": "2.3.1",
"author": "Several", "author": "Several",
"name": "INAV - Configurator", "name": "INAV - Configurator",
"short_name": "INAV", "short_name": "INAV",

6
package-lock.json generated

@ -3728,7 +3728,7 @@
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
"integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"requires": { "requires": {
"is-plain-object": "^2.0.4" "is-plain-object": "2.0.4"
} }
} }
} }
@ -5130,7 +5130,7 @@
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"requires": { "requires": {
"is-extendable": "^0.1.0" "is-extendable": "0.1.1"
} }
} }
} }
@ -5950,7 +5950,7 @@
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"requires": { "requires": {
"is-extendable": "^0.1.0" "is-extendable": "0.1.1"
} }
}, },
"set-value": { "set-value": {

@ -1,7 +1,7 @@
{ {
"name": "inav-configurator", "name": "inav-configurator",
"description": "INAV Configurator", "description": "INAV Configurator",
"version": "2.3.0-RC3", "version": "2.3.1",
"main": "main.html", "main": "main.html",
"default_locale": "en", "default_locale": "en",
"scripts": { "scripts": {

@ -1,5 +1,5 @@
'use strict'; 'use strict';
/*global chrome*/ /*global chrome,GUI,TABS,nwdialog,$*/
TABS.cli = { TABS.cli = {
lineDelayMs: 50, lineDelayMs: 50,
profileSwitchDelayMs: 100, profileSwitchDelayMs: 100,
@ -96,13 +96,13 @@ function sendLinesWithDelay(outputArray) {
return (delay, line, index) => { return (delay, line, index) => {
return new Promise((resolve) => { return new Promise((resolve) => {
helper.timeout.add('CLI_send_slowly', () => { helper.timeout.add('CLI_send_slowly', () => {
var processingDelay = self.lineDelayMs; let processingDelay = TABS.cli.lineDelayMs;
if (line.toLowerCase().startsWith('profile')) { if (line.toLowerCase().startsWith('profile')) {
processingDelay = self.profileSwitchDelayMs; processingDelay = TABS.cli.profileSwitchDelayMs;
} }
const isLastCommand = outputArray.length === index + 1; const isLastCommand = outputArray.length === index + 1;
if (isLastCommand && self.cliBuffer) { if (isLastCommand && TABS.cli.cliBuffer) {
line = getCliCommand(line, self.cliBuffer); line = getCliCommand(line, TABS.cli.cliBuffer);
} }
TABS.cli.sendLine(line, () => { TABS.cli.sendLine(line, () => {
resolve(processingDelay); resolve(processingDelay);
@ -160,40 +160,22 @@ TABS.cli.initialize = function (callback) {
description: suffix.toUpperCase() + ' files', extensions: [suffix], description: suffix.toUpperCase() + ' files', extensions: [suffix],
}]; }];
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: filename, accepts: accepts}, function(entry) { nwdialog.setContext(document);
if (chrome.runtime.lastError) { nwdialog.saveFileDialog(filename, accepts, '', function(result) {
if (chrome.runtime.lastError.message === 'User cancelled') { if (!result) {
GUI.log(chrome.i18n.getMessage('cliSaveToFileAborted')); GUI.log(chrome.i18n.getMessage('cliSaveToFileAborted'));
} else {
GUI.log(chrome.i18n.getMessage('cliSaveToFileFailed'));
console.error(chrome.runtime.lastError.message);
}
return; return;
} }
const fs = require('fs');
if (!entry) { fs.writeFile(result, self.outputHistory, (err) => {
GUI.log(chrome.i18n.getMessage('cliSaveToFileAborted')); if (err) {
return; GUI.log('<span style="color: red">Error writing file</span>');
return console.error(err);
} }
GUI.log('File saved');
entry.createWriter(function (writer) {
writer.onerror = function (){
GUI.log(chrome.i18n.getMessage('cliSaveToFileFailed'));
};
writer.onwriteend = function () {
if (self.outputHistory.length > 0 && writer.length === 0) {
writer.write(new Blob([self.outputHistory], {type: 'text/plain'}));
} else {
GUI.log(chrome.i18n.getMessage('cliSaveToFileCompleted'));
}
};
writer.truncate(0);
}, function (){
GUI.log(chrome.i18n.getMessage('cliSaveToFileFailed'));
console.error('Failed to get file writer');
}); });
}); });
}); });
@ -211,22 +193,9 @@ TABS.cli.initialize = function (callback) {
} }
$('.tab-cli .load').click(function() { $('.tab-cli .load').click(function() {
var accepts = [ nwdialog.setContext(document);
{ nwdialog.openFileDialog(".txt", false, '', function(result) {
description: 'Config files', extensions: ["txt", "config"], if (!result) {
},
{
description: 'All files',
},
];
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: accepts}, function(entry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
if (!entry) {
console.log('No file selected'); console.log('No file selected');
return; return;
} }
@ -257,12 +226,15 @@ TABS.cli.initialize = function (callback) {
self.GUI.snippetPreviewWindow.open(); self.GUI.snippetPreviewWindow.open();
} }
entry.file((file) => { const fs = require('fs');
let reader = new FileReader();
reader.onload = fs.readFile(result, (err, data) => {
() => previewCommands(reader.result); if (err) {
reader.onerror = () => console.error(reader.error); GUI.log('<span style="color: red">Error reading file</span>');
reader.readAsText(file); return console.error(err);
}
previewCommands(data);
}); });
}); });
}); });

@ -354,8 +354,10 @@ TABS.mission_control.initialize = function (callback) {
} }
}); });
//reset text position //reset text position
if (textGeom) {
textGeom.setCoordinates(map.getCoordinateFromPixel([0,0])); textGeom.setCoordinates(map.getCoordinateFromPixel([0,0]));
} }
}
function paintLine(pos1, pos2) { function paintLine(pos1, pos2) {
var line = new ol.geom.LineString([pos1, pos2]); var line = new ol.geom.LineString([pos1, pos2]);

Loading…
Cancel
Save