1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 19:40:22 +03:00

remove flags

This commit is contained in:
breadoven 2021-10-18 21:13:39 +01:00
parent 92a12fc7b0
commit 54241f8afc
6 changed files with 62 additions and 81 deletions

View file

@ -455,8 +455,8 @@ var mspHelper = (function (gui) {
data.getInt32(10, true), data.getInt32(10, true),
data.getInt16(14, true), data.getInt16(14, true),
data.getInt16(16, true), data.getInt16(16, true),
data.getInt16(18, true), // CR8 data.getInt16(18, true),
data.getUint8(20) // CR8 data.getUint8(20)
)); ));
break; break;
case MSPCodes.MSP_BOXIDS: case MSPCodes.MSP_BOXIDS:

View file

@ -72,7 +72,7 @@ let WaypointCollection = function () {
}; };
self.isEmpty = function () { self.isEmpty = function () {
return data.length == 0; // CR9 return data.length == 0;
}; };
self.flush = function () { self.flush = function () {
@ -180,7 +180,6 @@ let WaypointCollection = function () {
optionIdx = 0; optionIdx = 0;
idx++; idx++;
} }
// CR8
if (!(bMWPfile && bReverse)) { if (!(bMWPfile && bReverse)) {
if (element.getNumber() == self.get().length - 1) { if (element.getNumber() == self.get().length - 1) {
element.setEndMission(0xA5); element.setEndMission(0xA5);
@ -189,7 +188,6 @@ let WaypointCollection = function () {
element.setEndMission(0); element.setEndMission(0);
} }
} }
// CR8
} }
}); });
}; };

View file

@ -60,11 +60,11 @@
.tab-mission-control .ic_removeAll { .tab-mission-control .ic_removeAll {
background-image: url(../images/icons/cf_icon_MP_removeAll_grey.svg); background-image: url(../images/icons/cf_icon_MP_removeAll_grey.svg);
} }
/* CR8 */
.tab-mission-control .ic_openMultimission { .tab-mission-control .ic_openMultimission {
background-image: url(../images/icons/cf_icon_multimission_white.svg); background-image: url(../images/icons/cf_icon_multimission_white.svg);
} }
/* CR8 */
.tab-mission-control .ic_save { .tab-mission-control .ic_save {
background-image: url(../images/icons/cf_icon_MP_save_grey.svg); background-image: url(../images/icons/cf_icon_MP_save_grey.svg);
} }
@ -96,11 +96,11 @@
.tab-mission-control .ic_center { .tab-mission-control .ic_center {
background-image: url(../images/icons/cf_icon_MP_center_grey.svg); background-image: url(../images/icons/cf_icon_MP_center_grey.svg);
} }
/* CR8 */
.tab-mission-control .ic_setup { .tab-mission-control .ic_setup {
background-image: url(../images/icons/cf_icon_setup_white.svg); background-image: url(../images/icons/cf_icon_setup_white.svg);
} }
/* CR8 */
.tab-mission-control .btnicon { .tab-mission-control .btnicon {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
@ -285,7 +285,7 @@
.ol-touch .mission-control-settings { .ol-touch .mission-control-settings {
top: 80px; top: 80px;
} }
/* CR8 */
.mission-control-multimission { .mission-control-multimission {
top: 90px; top: 90px;
left: .5em; left: .5em;
@ -309,7 +309,7 @@
.ol-touch .mission-control-safehome { .ol-touch .mission-control-safehome {
top: 140px; top: 140px;
} }
/* CR8 */
.mission-control-template { .mission-control-template {
top: 140px; top: 140px;
left: .5em; left: .5em;

View file

@ -88,7 +88,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- CR8 -->
<div id="missionPlannerMultiMission" class="gui_box grey" style="display: none"> <div id="missionPlannerMultiMission" class="gui_box grey" style="display: none">
<div class="gui_box_titlebar"> <div class="gui_box_titlebar">
<div class="spacer_box_title i18n-replaced" data-i18n="missionSafehomeHead">Multi Mission Manager</div> <div class="spacer_box_title i18n-replaced" data-i18n="missionSafehomeHead">Multi Mission Manager</div>
@ -118,7 +118,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- CR8 -->
<div id="missionPlanerHome" class="gui_box grey" style="display: none"> <div id="missionPlanerHome" class="gui_box grey" style="display: none">
<div class="gui_box_titlebar"> <div class="gui_box_titlebar">
<div class="spacer_box_title i18n-replaced" data-i18n="missionHomeHead">Take Off home</div> <div class="spacer_box_title i18n-replaced" data-i18n="missionHomeHead">Take Off home</div>
@ -212,8 +212,8 @@
<div id="showHideWPeditButton" class="save_btn"> <div id="showHideWPeditButton" class="save_btn">
<a class="ic_hide" href="#" title="Hide"></a> <a class="ic_hide" href="#" title="Hide"></a>
</div> </div>
<!-- CR8 --> <div id="removePoint" class="btn btnMenu-danger"> <div id="removePoint" class="btn btnMenu-danger">
<!-- CR8 --> <a id="removePointButton" class="ic_removeAll" href="#" title="Remove"></a> <a id="removePointButton" class="ic_removeAll" href="#" title="Remove"></a>
</div> </div>
</div> </div>
</div> </div>
@ -270,8 +270,8 @@
<thead> <thead>
<tr> <tr>
<th style="width: 30px"> <th style="width: 30px">
<!-- CR8 --> <div id="addOptionsPoint" class="btn btnTable btnTableIcon btnTable-success"> <div id="addOptionsPoint" class="btn btnTable btnTableIcon btnTable-success">
<!-- CR8 --> <a id="addOptionsPointButton" class="ic_add" data-role="waypointOptions-add" href="#" style="float: center" title="Add"></a> <a id="addOptionsPointButton" class="ic_add" data-role="waypointOptions-add" href="#" style="float: center" title="Add"></a>
</div> </div>
</th> </th>
<th style="width: 50px" data-i18n="WaypointOptionId"></th> <th style="width: 50px" data-i18n="WaypointOptionId"></th>

View file

@ -357,7 +357,7 @@ TABS.mission_control.initialize = function (callback) {
var selectedMarker = null; var selectedMarker = null;
var selectedFeature = null; var selectedFeature = null;
var tempMarker = null; var tempMarker = null;
var disableMarkerEdit = false; // CR8 var disableMarkerEdit = false;
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
// define & init parameters for default Settings // define & init parameters for default Settings
@ -385,14 +385,14 @@ TABS.mission_control.initialize = function (callback) {
// define & init Waypoints parameters // define & init Waypoints parameters
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
var mission = new WaypointCollection(); var mission = new WaypointCollection();
// CR8
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
// define & init Multi Mission parameters // define & init Multi Mission parameters
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
var multimission = new WaypointCollection(); var multimission = new WaypointCollection();
var multimissionCount = 0; var multimissionCount = 0;
var maxMultimissionCount = 9; var maxMultimissionCount = 9;
// CR8
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
// define & init home parameters // define & init home parameters
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
@ -742,7 +742,7 @@ TABS.mission_control.initialize = function (callback) {
renderHomeOnMap(); renderHomeOnMap();
plotElevation(); plotElevation();
} }
// CR8
///////////////////////////////////////////// /////////////////////////////////////////////
// //
// Manage Multi Mission // Manage Multi Mission
@ -967,7 +967,7 @@ TABS.mission_control.initialize = function (callback) {
$("#waypointOptionsTableBody").fadeOut(); $("#waypointOptionsTableBody").fadeOut();
} }
} }
// CR8
///////////////////////////////////////////// /////////////////////////////////////////////
// //
@ -977,7 +977,7 @@ TABS.mission_control.initialize = function (callback) {
function removeAllWaypoints() { function removeAllWaypoints() {
mission.reinit(); mission.reinit();
refreshLayers(); // CR8 refreshLayers();
clearEditForm(); clearEditForm();
updateTotalInfo(); updateTotalInfo();
clearFilename(); clearFilename();
@ -1047,7 +1047,7 @@ TABS.mission_control.initialize = function (callback) {
oldAction, oldAction,
poiList = [], poiList = [],
oldHeading, oldHeading,
multiMissionWPNum = 0; // CR8 multiMissionWPNum = 0;
let activatePoi = false; let activatePoi = false;
let activateHead = false; let activateHead = false;
$('#missionDistance').text(0); $('#missionDistance').text(0);
@ -1079,7 +1079,7 @@ TABS.mission_control.initialize = function (callback) {
else if (typeof oldPos !== 'undefined' && activatePoi != true && activateHead == true) { else if (typeof oldPos !== 'undefined' && activatePoi != true && activateHead == true) {
paintLine(oldPos, coord, element.getNumber(), color='#1497f1', lineDash=0, lineText=String(oldHeading)+"°"); paintLine(oldPos, coord, element.getNumber(), color='#1497f1', lineDash=0, lineText=String(oldHeading)+"°");
} }
// CR8
if (element.getEndMission() == 0xA5) { if (element.getEndMission() == 0xA5) {
oldPos = 'undefined'; oldPos = 'undefined';
activatePoi = false; activatePoi = false;
@ -1088,16 +1088,13 @@ TABS.mission_control.initialize = function (callback) {
} else { } else {
oldPos = coord; oldPos = coord;
} }
// CR8
} }
} }
else if (element.isAttached()) { else if (element.isAttached()) {
if (element.getAction() == MWNP.WPTYPE.JUMP) { if (element.getAction() == MWNP.WPTYPE.JUMP) {
// CR8
let jumpWPIndex = 0; let jumpWPIndex = 0;
jumpWPIndex = multiMissionWPNum + element.getP1(); jumpWPIndex = multiMissionWPNum + element.getP1();
let coord = ol.proj.fromLonLat([mission.getWaypoint(jumpWPIndex).getLonMap(), mission.getWaypoint(jumpWPIndex).getLatMap()]); let coord = ol.proj.fromLonLat([mission.getWaypoint(jumpWPIndex).getLonMap(), mission.getWaypoint(jumpWPIndex).getLatMap()]);
// CR8
paintLine(oldPos, coord, element.getNumber(), color='#e935d6', lineDash=5, lineText="Repeat x"+(element.getP2() == -1 ? " infinite" : String(element.getP2())), selection=false, arrow=true); paintLine(oldPos, coord, element.getNumber(), color='#e935d6', lineDash=5, lineText="Repeat x"+(element.getP2() == -1 ? " infinite" : String(element.getP2())), selection=false, arrow=true);
} }
// If classic WPs is defined with a heading = -1, change Boolean for POI to false. If it is defined with a value different from -1, activate Heading boolean // If classic WPs is defined with a heading = -1, change Boolean for POI to false. If it is defined with a value different from -1, activate Heading boolean
@ -1113,14 +1110,13 @@ TABS.mission_control.initialize = function (callback) {
oldHeading = String(element.getP1()); oldHeading = String(element.getP1());
} }
} }
// CR8
if (element.getEndMission() == 0xA5) { if (element.getEndMission() == 0xA5) {
oldPos = 'undefined'; oldPos = 'undefined';
activatePoi = false; activatePoi = false;
activateHead = false; activateHead = false;
multiMissionWPNum = element.getNumber() + 1; multiMissionWPNum = element.getNumber() + 1;
} }
// CR8
} }
}); });
//reset text position //reset text position
@ -1209,12 +1205,12 @@ TABS.mission_control.initialize = function (callback) {
map.addLayer(vectorLayer); map.addLayer(vectorLayer);
} }
// CR8
function refreshLayers() { function refreshLayers() {
cleanLayers(); cleanLayers();
redrawLayers(); redrawLayers();
} }
// CR8
function cleanLayers() { function cleanLayers() {
for (var i in lines) { for (var i in lines) {
map.removeLayer(lines[i]); map.removeLayer(lines[i]);
@ -1241,7 +1237,7 @@ TABS.mission_control.initialize = function (callback) {
map.addLayer(addWaypointMarker(element)); map.addLayer(addWaypointMarker(element));
} }
}); });
repaintLine4Waypoints(mission); // CR9 repaintLine4Waypoints(mission);
} }
} }
@ -1358,13 +1354,13 @@ TABS.mission_control.initialize = function (callback) {
localize(); localize();
return waypoint; return waypoint;
} }
// CR8
function setView(zoom) { function setView(zoom) {
var coord = ol.proj.fromLonLat([mission.getWaypoint(0).getLonMap(), mission.getWaypoint(0).getLatMap()]); var coord = ol.proj.fromLonLat([mission.getWaypoint(0).getLonMap(), mission.getWaypoint(0).getLatMap()]);
map.getView().setCenter(coord); map.getView().setCenter(coord);
map.getView().setZoom(zoom); map.getView().setZoom(zoom);
} }
// CR8
///////////////////////////////////////////// /////////////////////////////////////////////
// //
// Manage Map construction // Manage Map construction
@ -1528,7 +1524,6 @@ TABS.mission_control.initialize = function (callback) {
}; };
ol.inherits(app.PlannerElevationControl, ol.control.Control); ol.inherits(app.PlannerElevationControl, ol.control.Control);
// CR8
// /** // /**
// * @constructor // * @constructor
// * @extends {ol.control.Control} // * @extends {ol.control.Control}
@ -1559,14 +1554,13 @@ TABS.mission_control.initialize = function (callback) {
}); });
}; };
ol.inherits(app.PlannerMultiMissionControl, ol.control.Control); ol.inherits(app.PlannerMultiMissionControl, ol.control.Control);
// CR8
/** /**
* @param {ol.MapBrowserEvent} evt Map browser event. * @param {ol.MapBrowserEvent} evt Map browser event.
* @return {boolean} `true` to start the drag sequence. * @return {boolean} `true` to start the drag sequence.
*/ */
app.Drag.prototype.handleDownEvent = function (evt) { app.Drag.prototype.handleDownEvent = function (evt) {
if (disableMarkerEdit) return false; // CR8 if (disableMarkerEdit) return false;
var map = evt.map; var map = evt.map;
@ -1714,7 +1708,7 @@ TABS.mission_control.initialize = function (callback) {
if (CONFIGURATOR.connectionValid) { if (CONFIGURATOR.connectionValid) {
control_list = [ control_list = [
new app.PlannerSettingsControl(), new app.PlannerSettingsControl(),
new app.PlannerMultiMissionControl(), // CR8 new app.PlannerMultiMissionControl(),
new app.PlannerSafehomeControl(), new app.PlannerSafehomeControl(),
new app.PlannerElevationControl(), new app.PlannerElevationControl(),
] ]
@ -1722,7 +1716,7 @@ TABS.mission_control.initialize = function (callback) {
else { else {
control_list = [ control_list = [
new app.PlannerSettingsControl(), new app.PlannerSettingsControl(),
new app.PlannerMultiMissionControl(), // CR8 new app.PlannerMultiMissionControl(),
new app.PlannerElevationControl(), new app.PlannerElevationControl(),
// new app.PlannerSafehomeControl() // TO COMMENT FOR RELEASE : DECOMMENT FOR DEBUG // new app.PlannerSafehomeControl() // TO COMMENT FOR RELEASE : DECOMMENT FOR DEBUG
] ]
@ -1846,7 +1840,7 @@ TABS.mission_control.initialize = function (callback) {
$('#MPeditPoint').fadeIn(300); $('#MPeditPoint').fadeIn(300);
redrawLayer(); redrawLayer();
} }
else if (selectedFeature && tempMarker.kind == "line" && tempMarker.selection && !disableMarkerEdit) { // CR8 else if (selectedFeature && tempMarker.kind == "line" && tempMarker.selection && !disableMarkerEdit) {
let tempWpCoord = ol.proj.toLonLat(evt.coordinate); let tempWpCoord = ol.proj.toLonLat(evt.coordinate);
let tempWp = new Waypoint(tempMarker.number, MWNP.WPTYPE.WAYPOINT, Math.round(tempWpCoord[1] * 10000000), Math.round(tempWpCoord[0] * 10000000), alt=Number(settings.alt), p1=Number(settings.speed)); let tempWp = new Waypoint(tempMarker.number, MWNP.WPTYPE.WAYPOINT, Math.round(tempWpCoord[1] * 10000000), Math.round(tempWpCoord[0] * 10000000), alt=Number(settings.alt), p1=Number(settings.speed));
if (homeMarkers.length && HOME.getAlt() != "N/A") { if (homeMarkers.length && HOME.getAlt() != "N/A") {
@ -1856,13 +1850,13 @@ TABS.mission_control.initialize = function (callback) {
mission.insertWaypoint(tempWp, tempMarker.number); mission.insertWaypoint(tempWp, tempMarker.number);
mission.update(); mission.update();
refreshLayers(); // CR8 refreshLayers();
plotElevation(); plotElevation();
})() })()
} else { } else {
mission.insertWaypoint(tempWp, tempMarker.number); mission.insertWaypoint(tempWp, tempMarker.number);
mission.update(); mission.update();
refreshLayers(); // CR8 refreshLayers();
plotElevation(); plotElevation();
} }
} }
@ -1881,7 +1875,7 @@ TABS.mission_control.initialize = function (callback) {
$('.home-lon').val(Math.round(coord[0] * 10000000) / 10000000); $('.home-lon').val(Math.round(coord[0] * 10000000) / 10000000);
$('.home-lat').val(Math.round(coord[1] * 10000000) / 10000000); $('.home-lat').val(Math.round(coord[1] * 10000000) / 10000000);
} }
else if (!disableMarkerEdit) { // CR8 else if (!disableMarkerEdit) {
let tempWpCoord = ol.proj.toLonLat(evt.coordinate); let tempWpCoord = ol.proj.toLonLat(evt.coordinate);
let tempWp = new Waypoint(mission.get().length, MWNP.WPTYPE.WAYPOINT, Math.round(tempWpCoord[1] * 10000000), Math.round(tempWpCoord[0] * 10000000), alt=Number(settings.alt), p1=Number(settings.speed)); let tempWp = new Waypoint(mission.get().length, MWNP.WPTYPE.WAYPOINT, Math.round(tempWpCoord[1] * 10000000), Math.round(tempWpCoord[0] * 10000000), alt=Number(settings.alt), p1=Number(settings.speed));
if (homeMarkers.length && HOME.getAlt() != "N/A") { if (homeMarkers.length && HOME.getAlt() != "N/A") {
@ -1891,29 +1885,26 @@ TABS.mission_control.initialize = function (callback) {
mission.put(tempWp); mission.put(tempWp);
mission.update(); mission.update();
refreshLayers(); // CR8 refreshLayers();
plotElevation(); plotElevation();
})() })()
} else { } else {
mission.put(tempWp); mission.put(tempWp);
mission.update(); mission.update();
refreshLayers(); // CR8 refreshLayers();
plotElevation(); plotElevation();
} }
} }
//mission.missionDisplayDebug(); //mission.missionDisplayDebug();
updateMultimissionState(); // CR8 updateMultimissionState();
}); });
// CR8
map.on('dblclick', function () { map.on('dblclick', function () {
if (!(multimissionCount && multimissionAllWPLoaded()) || selectedMarker == null) return; if (!(multimissionCount && multimissionAllWPLoaded()) || selectedMarker == null) return;
mapSelectEditMultimission(selectedMarker.getNumber()); mapSelectEditMultimission(selectedMarker.getNumber());
updateMultimissionState(); updateMultimissionState();
}); });
// CR8
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// change mouse cursor when over marker // change mouse cursor when over marker
@ -2056,7 +2047,7 @@ TABS.mission_control.initialize = function (callback) {
selectedMarker.setLat(Math.round(Number($('#pointLat').val()) * 10000000)); selectedMarker.setLat(Math.round(Number($('#pointLat').val()) * 10000000));
mission.updateWaypoint(selectedMarker); mission.updateWaypoint(selectedMarker);
mission.update(); mission.update();
refreshLayers(); // CR8 refreshLayers();
selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0]; selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0];
selectedFeature.setStyle(getWaypointIcon(selectedMarker, true)); selectedFeature.setStyle(getWaypointIcon(selectedMarker, true));
plotElevation(); plotElevation();
@ -2068,7 +2059,7 @@ TABS.mission_control.initialize = function (callback) {
selectedMarker.setLon(Math.round(Number($('#pointLon').val()) * 10000000)); selectedMarker.setLon(Math.round(Number($('#pointLon').val()) * 10000000));
mission.updateWaypoint(selectedMarker); mission.updateWaypoint(selectedMarker);
mission.update(); mission.update();
refreshLayers(); // CR8 refreshLayers();
selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0]; selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0];
selectedFeature.setStyle(getWaypointIcon(selectedMarker, true)); selectedFeature.setStyle(getWaypointIcon(selectedMarker, true));
plotElevation(); plotElevation();
@ -2106,11 +2097,10 @@ TABS.mission_control.initialize = function (callback) {
}); });
$('#pointP3').on('change', function (event) { $('#pointP3').on('change', function (event) {
// CR8
if (disableMarkerEdit) { if (disableMarkerEdit) {
changeSwitchery($('#pointP3'), selectedMarker.getP3() == 1); changeSwitchery($('#pointP3'), selectedMarker.getP3() == 1);
} }
// CR8
if (selectedMarker) { if (selectedMarker) {
const P3Value = selectedMarker.getP3(); const P3Value = selectedMarker.getP3();
selectedMarker.setP3( $('#pointP3').prop("checked") ? 1.0 : 0.0); selectedMarker.setP3( $('#pointP3').prop("checked") ? 1.0 : 0.0);
@ -2150,7 +2140,7 @@ TABS.mission_control.initialize = function (callback) {
mission.dropAttachedFromWaypoint(selectedMarker, $(event.currentTarget).attr("data-index")-1); mission.dropAttachedFromWaypoint(selectedMarker, $(event.currentTarget).attr("data-index")-1);
renderWaypointOptionsTable(selectedMarker); renderWaypointOptionsTable(selectedMarker);
//cleanLines(); //cleanLines();
refreshLayers(); // CR8 refreshLayers();
selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0]; selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0];
selectedFeature.setStyle(getWaypointIcon(selectedMarker, true)); selectedFeature.setStyle(getWaypointIcon(selectedMarker, true));
} }
@ -2161,7 +2151,7 @@ TABS.mission_control.initialize = function (callback) {
mission.addAttachedFromWaypoint(selectedMarker); mission.addAttachedFromWaypoint(selectedMarker);
renderWaypointOptionsTable(selectedMarker); renderWaypointOptionsTable(selectedMarker);
//cleanLines(); //cleanLines();
refreshLayers(); // CR8 refreshLayers();
selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0]; selectedFeature = markers[selectedMarker.getLayerNumber()].getSource().getFeatures()[0];
selectedFeature.setStyle(getWaypointIcon(selectedMarker, true)); selectedFeature.setStyle(getWaypointIcon(selectedMarker, true));
} }
@ -2250,7 +2240,6 @@ TABS.mission_control.initialize = function (callback) {
} }
}); });
// CR8
///////////////////////////////////////////// /////////////////////////////////////////////
// Callback for MULTIMISSION Table // Callback for MULTIMISSION Table
///////////////////////////////////////////// /////////////////////////////////////////////
@ -2288,19 +2277,17 @@ TABS.mission_control.initialize = function (callback) {
$('#cancelMultimission').on('click', function () { $('#cancelMultimission').on('click', function () {
$('#missionPlannerMultiMission').fadeOut(300); $('#missionPlannerMultiMission').fadeOut(300);
}); });
// CR8
///////////////////////////////////////////// /////////////////////////////////////////////
// Callback for Remove buttons // Callback for Remove buttons
///////////////////////////////////////////// /////////////////////////////////////////////
$('#removeAllPoints').on('click', function () { $('#removeAllPoints').on('click', function () {
if (markers.length && confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) { if (markers.length && confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) {
// CR8
if (removeAllMultiMissionCheck()) { if (removeAllMultiMissionCheck()) {
removeAllWaypoints(); removeAllWaypoints();
updateMultimissionState(); updateMultimissionState();
} }
// CR8
plotElevation(); plotElevation();
} }
}); });
@ -2320,7 +2307,7 @@ TABS.mission_control.initialize = function (callback) {
selectedMarker = null; selectedMarker = null;
mission.update(); mission.update();
clearEditForm(); clearEditForm();
refreshLayers(); // CR8 refreshLayers();
plotElevation(); plotElevation();
} }
} }
@ -2329,10 +2316,10 @@ TABS.mission_control.initialize = function (callback) {
selectedMarker = null; selectedMarker = null;
mission.update(); mission.update();
clearEditForm(); clearEditForm();
refreshLayers(); // CR8 refreshLayers();
plotElevation(); plotElevation();
} }
updateMultimissionState(); // CR8 updateMultimissionState();
} }
}); });
@ -2340,7 +2327,7 @@ TABS.mission_control.initialize = function (callback) {
// Callback for Save/load buttons // Callback for Save/load buttons
///////////////////////////////////////////// /////////////////////////////////////////////
$('#loadFileMissionButton').on('click', function () { $('#loadFileMissionButton').on('click', function () {
if (!fileLoadMultiMissionCheck()) return; // CR8 if (!fileLoadMultiMissionCheck()) return;
if (markers.length && !confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) return; if (markers.length && !confirm(chrome.i18n.getMessage('confirm_delete_all_points'))) return;
nwdialog.setContext(document); nwdialog.setContext(document);
@ -2366,7 +2353,7 @@ TABS.mission_control.initialize = function (callback) {
}); });
$('#saveMissionButton').on('click', function () { $('#saveMissionButton').on('click', function () {
if (mission.isEmpty()) { // CR8 if (mission.isEmpty()) {
alert(chrome.i18n.getMessage('no_waypoints_to_save')); alert(chrome.i18n.getMessage('no_waypoints_to_save'));
return; return;
} }
@ -2385,7 +2372,7 @@ TABS.mission_control.initialize = function (callback) {
}); });
$('#saveEepromMissionButton').on('click', function () { $('#saveEepromMissionButton').on('click', function () {
if (mission.isEmpty()) { // CR8 if (mission.isEmpty()) {
alert(chrome.i18n.getMessage('no_waypoints_to_save')); alert(chrome.i18n.getMessage('no_waypoints_to_save'));
return; return;
} }
@ -2442,7 +2429,7 @@ TABS.mission_control.initialize = function (callback) {
// parse mission file // parse mission file
removeAllWaypoints(); removeAllWaypoints();
missionEndFlagCount = 0; // CR8 missionEndFlagCount = 0;
var node = null; var node = null;
var nodemission = null; var nodemission = null;
for (var noderoot in result) { for (var noderoot in result) {
@ -2509,14 +2496,12 @@ TABS.mission_control.initialize = function (callback) {
point.setP2(parseInt(node.$[attr])); point.setP2(parseInt(node.$[attr]));
} else if (attr.match(/parameter3/i)) { } else if (attr.match(/parameter3/i)) {
point.setP3(parseInt(node.$[attr])); point.setP3(parseInt(node.$[attr]));
// CR8
} else if (attr.match(/flag/i)) { } else if (attr.match(/flag/i)) {
point.setEndMission(parseInt(node.$[attr])); point.setEndMission(parseInt(node.$[attr]));
if (parseInt(node.$[attr]) == 0xA5) { if (parseInt(node.$[attr]) == 0xA5) {
missionEndFlagCount ++; missionEndFlagCount ++;
} }
} }
// CR8
} }
mission.put(point); mission.put(point);
} }
@ -2526,7 +2511,7 @@ TABS.mission_control.initialize = function (callback) {
} }
// update Attached Waypoints (i.e non Map Markers) // update Attached Waypoints (i.e non Map Markers)
mission.update(true); mission.update(true);
// CR8
if (missionEndFlagCount > 1) { if (missionEndFlagCount > 1) {
if (multimissionCount && !confirm(chrome.i18n.getMessage('confirm_multimission_file_load'))) { if (multimissionCount && !confirm(chrome.i18n.getMessage('confirm_multimission_file_load'))) {
mission.flush(); mission.flush();
@ -2541,7 +2526,7 @@ TABS.mission_control.initialize = function (callback) {
} }
} }
updateMultimissionState(); updateMultimissionState();
// CR8
if (Object.keys(mission.getCenter()).length !== 0) { if (Object.keys(mission.getCenter()).length !== 0) {
var coord = ol.proj.fromLonLat([mission.getCenter().lon / 10000000 , mission.getCenter().lat / 10000000]); var coord = ol.proj.fromLonLat([mission.getCenter().lon / 10000000 , mission.getCenter().lat / 10000000]);
map.getView().setCenter(coord); map.getView().setCenter(coord);
@ -2553,7 +2538,7 @@ TABS.mission_control.initialize = function (callback) {
} }
} }
else { else {
setView(16); // CR8 setView(16);
} }
redrawLayers(); redrawLayers();
@ -2595,7 +2580,7 @@ TABS.mission_control.initialize = function (callback) {
'parameter1': (MWNP.WPTYPE.REV[waypoint.getAction()] == "JUMP" ? waypoint.getP1()+1 : waypoint.getP1()), 'parameter1': (MWNP.WPTYPE.REV[waypoint.getAction()] == "JUMP" ? waypoint.getP1()+1 : waypoint.getP1()),
'parameter2': waypoint.getP2(), 'parameter2': waypoint.getP2(),
'parameter3': waypoint.getP3(), 'parameter3': waypoint.getP3(),
'flag': waypoint.getEndMission(), // CR8 'flag': waypoint.getEndMission(),
} }; } };
data.missionitem.push(point); data.missionitem.push(point);
}); });
@ -2641,7 +2626,7 @@ TABS.mission_control.initialize = function (callback) {
mission.reinit(); mission.reinit();
mission.copy(MISSION_PLANER); mission.copy(MISSION_PLANER);
mission.update(true); mission.update(true);
// CR8
multimissionCount = 0; multimissionCount = 0;
let missionEndFlagCount = 0; let missionEndFlagCount = 0;
mission.get().forEach(function (element) { mission.get().forEach(function (element) {
@ -2658,8 +2643,8 @@ TABS.mission_control.initialize = function (callback) {
setMultimissionEditControl(false); setMultimissionEditControl(false);
} }
updateMultimissionState(); updateMultimissionState();
setView(16); setView(16);
// CR8
redrawLayers(); redrawLayers();
updateTotalInfo(); updateTotalInfo();
}); });
@ -2686,14 +2671,14 @@ TABS.mission_control.initialize = function (callback) {
mission.reinit(); mission.reinit();
mission.copy(MISSION_PLANER); mission.copy(MISSION_PLANER);
mission.update(true); mission.update(true);
refreshLayers(); // CR8 refreshLayers();
$('#MPeditPoint').fadeOut(300); $('#MPeditPoint').fadeOut(300);
}); });
} }
function updateTotalInfo() { function updateTotalInfo() {
if (CONFIGURATOR.connectionValid) { if (CONFIGURATOR.connectionValid) {
let availableWPs = mission.getMaxWaypoints() - mission.getCountBusyPoints(); // CR8 let availableWPs = mission.getMaxWaypoints() - mission.getCountBusyPoints();
$('#availablePoints').text(availableWPs + '/' + mission.getMaxWaypoints()); $('#availablePoints').text(availableWPs + '/' + mission.getMaxWaypoints());
$('#missionValid').html(mission.getValidMission() ? chrome.i18n.getMessage('armingCheckPass') : chrome.i18n.getMessage('armingCheckFail')); $('#missionValid').html(mission.getValidMission() ? chrome.i18n.getMessage('armingCheckPass') : chrome.i18n.getMessage('armingCheckFail'));
} }
@ -2747,8 +2732,8 @@ TABS.mission_control.initialize = function (callback) {
} }
function plotElevation() { function plotElevation() {
if ($('#missionPlanerElevation').is(":visible") && !disableMarkerEdit) { // CR8 if ($('#missionPlanerElevation').is(":visible") && !disableMarkerEdit) {
if (mission.isEmpty()) { // CR8 if (mission.isEmpty()) {
var data = [[0], [0]]; var data = [[0], [0]];
var layout = {showlegend: true, var layout = {showlegend: true,
legend: { legend: {

View file

@ -908,13 +908,11 @@ OSD.constants = {
min_version: '3.0.0', min_version: '3.0.0',
preview: FONT.symbol(SYM.GLIDESLOPE) + FONT.embed_dot('12.3'), preview: FONT.symbol(SYM.GLIDESLOPE) + FONT.embed_dot('12.3'),
}, },
// CR8
{ {
name: 'MISSION INFO', name: 'MISSION INFO',
id: 128, id: 128,
preview: 'M1/6>27WP' preview: 'M1/6>27WP'
}, },
// CR8
{ {
name: 'VERSION', name: 'VERSION',
id: 119, id: 119,