1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-25 09:15:42 +03:00

Merge branch 'iNavFlight:master' into rearange-modes-to-make-clearere

This commit is contained in:
Darren Lines 2021-10-09 14:21:46 +01:00 committed by GitHub
commit 3d61a9d3d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 42 deletions

View file

@ -27,12 +27,12 @@ viewBox="0 0 850 850"
<polygon id="_1" class="fil1" points="435.91,470.5 416,524.05 407.87,524.05 427.82,470.5 "/>
<path id="_2" class="fil1" d="M476.15 524.05l-36.3 0 0 -6.51 13.81 -13.89c4.07,-4.17 6.77,-7.12 8.11,-8.87 1.33,-1.75 2.3,-3.39 2.91,-4.93 0.62,-1.53 0.92,-3.18 0.92,-4.95 0,-2.41 -0.73,-4.32 -2.18,-5.71 -1.45,-1.39 -3.46,-2.09 -6.02,-2.09 -2.05,0 -4.04,0.38 -5.97,1.14 -1.91,0.75 -4.12,2.13 -6.65,4.1l-4.65 -5.67c2.99,-2.52 5.88,-4.29 8.69,-5.34 2.81,-1.05 5.8,-1.58 8.98,-1.58 4.97,0 8.97,1.3 11.97,3.9 3.01,2.6 4.51,6.1 4.51,10.49 0,2.43 -0.43,4.71 -1.3,6.89 -0.87,2.17 -2.2,4.41 -4,6.72 -1.8,2.3 -4.77,5.43 -8.96,9.35l-9.3 9.02 0 0.36 25.43 0 0 7.57z"/>
<rect class="fil0 str1" x="108.12" y="583.6" width="90" height="90"/>
<path class="fil1" d="M174.4 643.67l-7.23 0 0 11.7 -8.38 0 0 -11.7 -24.48 0 0 -6.61 24.48 -35.39 8.38 0 0 34.88 7.23 0 0 7.12zm-15.61 -7.12l0 -13.45c0,-4.79 0.12,-8.7 0.36,-11.77l-0.29 0c-0.69,1.62 -1.76,3.58 -3.22,5.87l-13.3 19.35 16.45 0z"/>
<path class="fil1" d="M170.47 614.13c0,3.4 -0.98,6.23 -2.96,8.48 -1.99,2.26 -4.76,3.77 -8.36,4.56l0 0.29c4.3,0.54 7.52,1.87 9.67,4.01 2.15,2.14 3.23,4.99 3.23,8.53 0,5.15 -1.83,9.13 -5.46,11.92 -3.64,2.8 -8.82,4.2 -15.53,4.2 -5.94,0 -10.95,-0.96 -15.02,-2.9l0 -7.66c2.27,1.12 4.67,1.99 7.21,2.6 2.55,0.61 4.99,0.91 7.34,0.91 4.15,0 7.25,-0.77 9.3,-2.31 2.05,-1.54 3.07,-3.91 3.07,-7.14 0,-2.86 -1.12,-4.96 -3.4,-6.31 -2.27,-1.34 -5.84,-2.01 -10.7,-2.01l-4.65 0 0 -6.98 4.73 0c8.55,0 12.82,-2.95 12.82,-8.86 0,-2.3 -0.75,-4.08 -2.24,-5.33 -1.48,-1.23 -3.68,-1.86 -6.6,-1.86 -2.02,0 -3.97,0.29 -5.86,0.86 -1.87,0.58 -4.1,1.69 -6.66,3.35l-4.21 -6c4.9,-3.61 10.61,-5.41 17.1,-5.41 5.4,0 9.61,1.16 12.65,3.48 3.02,2.32 4.53,5.51 4.53,9.58z"/>
<path class="fil2" d="M490.19 412.07l345.42 169.55 0 -179.94 -376.74 -217.33c-18.77,-10.83 -46,-10.37 -65.03,0l-379.45 206.74 0 179.93 345.42 -158.95 130.38 0z"/>
<polygon class="fil3" points="581.33,456.8 814.41,571.21 814.41,498.09 581.33,383.68 "/>
<polygon class="fil4" points="35.59,561.27 268.67,454.01 268.67,380.88 35.59,488.14 "/>
<path class="fil5" d="M404.3 385.32l0 -89.14 -28.9 0 49.6 -89.14 49.6 89.14 -28.9 0 0 89.14 -41.4 0zm0 -44.57m-14.45 -44.57m10.35 -44.57m49.6 0m10.35 44.57m-14.45 44.57m-20.7 44.57"/>
<rect class="fil0 str2" x="653.12" y="583.6" width="90" height="90"/>
<path class="fil1" d="M699.34 621.92c5.4,0 9.68,1.43 12.83,4.29 3.15,2.86 4.72,6.76 4.72,11.7 0,5.71 -1.78,10.17 -5.36,13.39 -3.57,3.21 -8.66,4.82 -15.26,4.82 -5.98,0 -10.69,-0.96 -14.1,-2.9l0 -7.81c1.97,1.12 4.25,1.99 6.81,2.6 2.56,0.61 4.95,0.91 7.15,0.91 3.88,0 6.84,-0.86 8.86,-2.6 2.03,-1.72 3.04,-4.26 3.04,-7.61 0,-6.39 -4.07,-9.59 -12.23,-9.59 -1.16,0 -2.57,0.11 -4.26,0.35 -1.68,0.23 -3.16,0.49 -4.42,0.79l-3.85 -2.28 2.05 -26.16 27.84 0 0 7.65 -20.27 0 -1.2 13.25c0.85,-0.14 1.89,-0.31 3.13,-0.51 1.24,-0.19 2.75,-0.29 4.52,-0.29z"/>
<path class="fil1" d="M719.39 643.67l-7.22 0 0 11.7 -8.39 0 0 -11.7 -24.47 0 0 -6.61 24.47 -35.39 8.39 0 0 34.88 7.22 0 0 7.12zm-15.61 -7.12l0 -13.45c0,-4.79 0.13,-8.7 0.36,-11.77l-0.28 0c-0.69,1.62 -1.76,3.58 -3.23,5.87l-13.3 19.35 16.45 0z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

@ -302,7 +302,7 @@
.tab-mission-control .safehomesTable {
width: 100%;
text-align: center;
font-size: 8px;
font-size: 12px;
}
.tab-mission-control .safehomesTable input[type="text"] {
@ -311,7 +311,7 @@
}
.tab-mission-control .safehomesTable input[type="number"] {
font-size: 8px;
font-size: 10px;
width: 100%;
-moz-appearance: textfield;
}
@ -498,8 +498,8 @@
width:20px;
}
.tab-mission-control .textLegend{
margin:2px;
.tab-mission-control .textLegend{
margin:2px;
}
.tab-mission-control .valueLegend{
float:right;

View file

@ -200,6 +200,7 @@ TABS.auxiliary.initialize = function (callback) {
$(rangeElement).find('a.deleteRange').click(function () {
var rangeElement = $(this).data('rangeElement');
modeElement.removeClass('inRange');
rangeElement.remove();
});

View file

@ -102,10 +102,10 @@
<table class="safehomesTable">
<thead>
<tr>
<th style="width: 50px" data-i18n="SafehomeSelected"></th>
<th style="width: 120px" data-i18n="SafehomeLon"></th>
<th style="width: 120px" data-i18n="SafehomeLat"></th>
<th style="width: 120px" data-i18n="SafehomeAlt"></th>
<th style="width: 40px" data-i18n="SafehomeSelected"></th>
<th style="width: 140px" data-i18n="SafehomeLat"></th>
<th style="width: 140px" data-i18n="SafehomeLon"></th>
<th style="width: 100px" data-i18n="SafehomeAlt"></th>
</tr>
</thead>
<tbody id="homeTableBody">
@ -145,11 +145,11 @@
<table class="safehomesTable">
<thead>
<tr>
<th style="width: 80px" data-i18n="SafehomeSelected"></th>
<th style="width: 50px" data-i18n="SafehomeId"></th>
<th style="width: 80px" data-i18n="SafehomeEnabled"></th>
<th style="width: 120px" data-i18n="SafehomeLon"></th>
<th style="width: 120px" data-i18n="SafehomeLat"></th>
<th style="width: 40px" data-i18n="SafehomeSelected"></th>
<th style="width: 40px" data-i18n="SafehomeId"></th>
<th style="width: 60px" data-i18n="SafehomeEnabled"></th>
<th style="width: 140px" data-i18n="SafehomeLat"></th>
<th style="width: 140px" data-i18n="SafehomeLon"></th>
</tr>
</thead>
<tbody id="safehomesTableBody">

View file

@ -474,8 +474,8 @@ TABS.mission_control.initialize = function (callback) {
</td> \
<td><span class="safehome-number"/></td>\
<td class="safehome-enabled"><input type="checkbox" class="togglesmall safehome-enabled-value"/></td> \
<td><input type="number" class="safehome-lon" /></td>\
<td><input type="number" class="safehome-lat" /></td>\
<td><input type="number" class="safehome-lon" /></td>\
</tr>\
');
@ -645,23 +645,27 @@ TABS.mission_control.initialize = function (callback) {
* Process home table UI
*/
$(".home-lon").val(HOME.getLonMap()).change(function () {
HOME.setLon(Math.round(Number($(this).val()) * 10000000));
cleanHomeLayers();
renderHomeOnMap();
});
$(".home-lat").val(HOME.getLatMap()).change(function () {
HOME.setLat(Math.round(Number($(this).val()) * 10000000));
cleanHomeLayers();
renderHomeOnMap();
});
(async () => {
const elevationAtHome = await HOME.getElevation(globalSettings);
$('#elevationValueAtHome').text(elevationAtHome+' m');
HOME.setAlt(elevationAtHome);
})()
$(".home-lon").val(HOME.getLonMap()).change(function () {
HOME.setLon(Math.round(Number($(this).val()) * 10000000));
cleanHomeLayers();
renderHomeOnMap();
});
if (HOME.getLatMap() == 0 && HOME.getLonMap() == 0) {
HOME.setAlt("N/A");
} else {
(async () => {
const elevationAtHome = await HOME.getElevation(globalSettings);
$('#elevationValueAtHome').text(elevationAtHome+' m');
HOME.setAlt(elevationAtHome);
})()
}
if (globalSettings.mapProviderType == 'bing') {
$('#elevationEarthModelclass').fadeIn(300);
@ -2009,7 +2013,6 @@ TABS.mission_control.initialize = function (callback) {
$('#loadEepromMissionButton').on('click', function () {
if (markers.length && !confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) return;
removeAllWaypoints();
GUI.log(chrome.i18n.getMessage('eeprom_load_ok'));
MSP.send_message(MSPCodes.MSP_WP_MISSION_LOAD, [0], getWaypointsFromFC);
});
@ -2017,12 +2020,6 @@ TABS.mission_control.initialize = function (callback) {
$(this).addClass('disabled');
GUI.log('Start send point');
sendWaypointsToFC();
GUI.log('End send point');
$('#saveEepromMissionButton').removeClass('disabled');
GUI.log(chrome.i18n.getMessage('eeprom_saved_ok'));
setTimeout(function(){
MSP.send_message(MSPCodes.MSP_WP_MISSION_SAVE, [0], false);
},2000);
});
/////////////////////////////////////////////
@ -2168,7 +2165,9 @@ TABS.mission_control.initialize = function (callback) {
}
redrawLayers();
updateHome();
if (!(HOME.getLatMap() == 0 && HOME.getLonMap() == 0)) {
updateHome();
}
updateTotalInfo();
let sFilename = String(filename.split('\\').pop().split('/').pop());
GUI.log(sFilename+' has been loaded successfully !');
@ -2227,8 +2226,8 @@ TABS.mission_control.initialize = function (callback) {
//
/////////////////////////////////////////////
function getWaypointsFromFC() {
mspHelper.loadWaypoints();
setTimeout(function(){
mspHelper.loadWaypoints(function() {
GUI.log(chrome.i18n.getMessage('eeprom_load_ok'));
mission.reinit();
mission.copy(MISSION_PLANER);
mission.update(true);
@ -2237,15 +2236,19 @@ TABS.mission_control.initialize = function (callback) {
map.getView().setZoom(16);
redrawLayers();
updateTotalInfo();
}, 2000);
});
}
function sendWaypointsToFC() {
MISSION_PLANER.reinit();
MISSION_PLANER.copy(mission);
MISSION_PLANER.update(true, true);
mspHelper.saveWaypoints();
setTimeout(function(){
mspHelper.saveWaypoints(function() {
GUI.log('End send point');
$('#saveEepromMissionButton').removeClass('disabled');
GUI.log(chrome.i18n.getMessage('eeprom_saved_ok'));
MSP.send_message(MSPCodes.MSP_WP_MISSION_SAVE, [0], false);
mission.setMaxWaypoints(MISSION_PLANER.getMaxWaypoints());
mission.setValidMission(MISSION_PLANER.getValidMission());
mission.setCountBusyPoints(MISSION_PLANER.getCountBusyPoints());
@ -2256,7 +2259,7 @@ TABS.mission_control.initialize = function (callback) {
cleanLayers();
redrawLayers();
$('#MPeditPoint').fadeOut(300);
}, 2000);
});
}

View file

@ -2716,11 +2716,18 @@ OSD.GUI.updatePreviews = function() {
// consume drag/drop events.
$img.find('img').css('pointer-events', 'none');
if (item && item.positionable !== false) {
var nameKey = 'osdElement_' + item.name;
var nameMessage = chrome.i18n.getMessage(nameKey);
if (!nameMessage) {
nameMessage = inflection.titleize(item.name);
}
$img.addClass('field-' + item.id)
.data('item', item)
.prop('draggable', true)
.on('dragstart', OSD.GUI.preview.onDragStart)
.prop('title', inflection.titleize(item.name));
.prop('title', nameMessage);
}
$row.append($img);