Skip to content

Commit 9272151

Browse files
authored
Merge pull request #1381 from breadoven/abo_mission_cont_multimissions
Mission control Multi Missions
2 parents e091d98 + b9d8246 commit 9272151

File tree

7 files changed

+674
-120
lines changed

7 files changed

+674
-120
lines changed

_locales/en/messages.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,6 +3508,9 @@
35083508
"missionSafehomeHead": {
35093509
"message": "Safe Home manager"
35103510
},
3511+
"missionMultiMissionHead": {
3512+
"message": "Multi Missions"
3513+
},
35113514
"missionTemplateHead": {
35123515
"message": "Mission template"
35133516
},
@@ -3526,6 +3529,15 @@
35263529
"confirm_delete_point_with_options": {
35273530
"message": "Do you really want to delete this Waypoint with non-Geo JUMP/SET_HEAD/RTH options? \nIf yes, Non-Geo options attached will be removed also!"
35283531
},
3532+
"confirm_multimission_file_load": {
3533+
"message": "This is a multi mission file. Loading will over write current multi mission.\nContinue?"
3534+
},
3535+
"confirm_overwrite_multimission_file_load_option": {
3536+
"message": "This will over write current multi mission.\nContinue?"
3537+
},
3538+
"multimission_active_index_saved_eeprom": {
3539+
"message": "Mission active index saved"
3540+
},
35293541
"no_waypoints_to_load": {
35303542
"message": "No waypoints to load !"
35313543
},
Lines changed: 50 additions & 0 deletions
Loading

js/msp/MSPHelper.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,8 @@ var mspHelper = (function (gui) {
455455
data.getInt32(10, true),
456456
data.getInt16(14, true),
457457
data.getInt16(16, true),
458-
data.getInt16(18, true)
458+
data.getInt16(18, true),
459+
data.getUint8(20)
459460
));
460461
break;
461462
case MSPCodes.MSP_BOXIDS:
@@ -3207,9 +3208,9 @@ var mspHelper = (function (gui) {
32073208
});
32083209
};
32093210

3210-
self.setSetting = function (name, value) {
3211+
self.setSetting = function (name, value, callback) {
32113212
this.encodeSetting(name, value).then(function (data) {
3212-
return MSP.promise(MSPCodes.MSPV2_SET_SETTING, data);
3213+
return MSP.promise(MSPCodes.MSPV2_SET_SETTING, data).then(callback);
32133214
});
32143215
};
32153216

js/waypointCollection.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ let WaypointCollection = function () {
149149
data = tmpData;
150150
};
151151

152-
self.update = function (bMWPfile=false, bReverse=false) {
152+
self.update = function (updateEndFlag = true, bMWPfile=false, bReverse=false) {
153153
let oldWPNumber = 0;
154154
let optionIdx = 0;
155155
let idx = 0;
@@ -180,11 +180,15 @@ let WaypointCollection = function () {
180180
optionIdx = 0;
181181
idx++;
182182
}
183-
if (element.getNumber() == ((bMWPfile && bReverse) ? self.get().length : self.get().length-1)) {
184-
element.setEndMission(0xA5);
185-
}
186-
else {
187-
element.setEndMission(0);
183+
184+
/* only update EndMission flag when required and only if single mission loaded on map */
185+
if (updateEndFlag) {
186+
if (element.getNumber() == self.get().length - 1) {
187+
element.setEndMission(0xA5);
188+
}
189+
else if ((element.getNumber() == self.get().length - 2) && element.getEndMission() == 0xA5) {
190+
element.setEndMission(0);
191+
}
188192
}
189193
}
190194
});

src/css/tabs/mission_planer.css

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
background-image: url(../images/icons/cf_icon_MP_removeAll_grey.svg);
6262
}
6363

64+
.tab-mission-control .ic_openMultimission {
65+
background-image: url(../images/icons/cf_icon_multimission_white.svg);
66+
}
67+
6468
.tab-mission-control .ic_save {
6569
background-image: url(../images/icons/cf_icon_MP_save_grey.svg);
6670
}
@@ -93,6 +97,10 @@
9397
background-image: url(../images/icons/cf_icon_MP_center_grey.svg);
9498
}
9599

100+
.tab-mission-control .ic_setup {
101+
background-image: url(../images/icons/cf_icon_setup_white.svg);
102+
}
103+
96104
.tab-mission-control .btnicon {
97105
background-repeat: no-repeat;
98106
background-position: center;
@@ -277,21 +285,31 @@
277285
.ol-touch .mission-control-settings {
278286
top: 80px;
279287
}
280-
.mission-control-safehome {
281-
top: 115px;
288+
289+
.mission-control-multimission {
290+
top: 90px;
282291
left: .5em;
283292
}
284-
.ol-touch .mission-control-safehome {
285-
top: 120px;
293+
.ol-touch .mission-control-multimission {
294+
top: 100px;
286295
}
287296

288297
.mission-control-elevation {
289-
top: 90px;
298+
top: 115px;
290299
left: .5em;
291300
}
292301
.ol-touch .mission-control-elevation {
293-
top: 100px;
302+
top: 120px;
303+
}
304+
305+
.mission-control-safehome {
306+
top: 140px;
307+
left: .5em;
308+
}
309+
.ol-touch .mission-control-safehome {
310+
top: 140px;
294311
}
312+
295313
.mission-control-template {
296314
top: 140px;
297315
left: .5em;

tabs/mission_control.html

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
</div>
3838
</div>
3939
</div>
40+
4041
<div id="missionPlanerTotalInfo" class="gui_box grey">
4142
<div class="gui_box_titlebar">
4243
<div class="spacer_box_title i18n-replaced" data-i18n="missionTotalInformationHead">Total information</div>
@@ -63,6 +64,7 @@
6364
</div>
6465
</div>
6566
</div>
67+
6668
<div id="missionPlanerSettings" class="gui_box grey" style="display: none">
6769
<div class="gui_box_titlebar">
6870
<div class="spacer_box_title i18n-replaced" data-i18n="missionDefaultSettingsHead">Default settings</div>
@@ -87,6 +89,46 @@
8789
</div>
8890
</div>
8991

92+
<div id="missionPlannerMultiMission" class="gui_box grey" style="display: none">
93+
<div class="gui_box_titlebar">
94+
<div class="spacer_box_title i18n-replaced" data-i18n="missionMultiMissionHead">Multi Missions</div>
95+
<div class="btnMenu btnMenuIcon save_btn">
96+
<div id="showHideMultimissionButton">
97+
<a class="ic_hide" href="#" title="Hide"></a>
98+
</div>
99+
<a id="cancelMultimission" class="ic_cancel" href="#" title="Cancel"></a>
100+
</div>
101+
</div>
102+
<div class="spacer" id="multimissionContent">
103+
<div class="btn btnTable btnTableIcon save_btn">
104+
<div>
105+
<span>Missions Info:</span>
106+
<span id="multimissionInfo">None</span>
107+
</div>
108+
<div style="margin-top: 5px">
109+
<span>Active Mission:</span>
110+
<span id="activeNissionIndex">1</span>
111+
<a class="ic_save disabled" id="setActiveMissionButton" href="#" title="Set Active"></a>
112+
</div>
113+
<hr>
114+
<div style="display: inline-block">
115+
<label for="multimissionOptionList">Mission No.</label>
116+
<select name="Number" id="multimissionOptionList" style="width: 50px">
117+
<option value="0">ALL</option>
118+
</select>
119+
<div style="float: right">
120+
<span>Update All</span>
121+
<a class="ic_save disabled" id="updateMultimissionButton" href="#" title="Update All"></a>
122+
</div>
123+
<div style="margin-bottom: 5px; margin-top: 5px">
124+
<label for="addMultimissionButton">Add New Mission</label>
125+
<a class="ic_add disabled" id="addMultimissionButton" href="#" title="Add"></a>
126+
</div>
127+
</div>
128+
</div>
129+
</div>
130+
</div>
131+
90132
<div id="missionPlanerHome" class="gui_box grey" style="display: none">
91133
<div class="gui_box_titlebar">
92134
<div class="spacer_box_title i18n-replaced" data-i18n="missionHomeHead">Take Off home</div>
@@ -110,13 +152,13 @@
110152
</thead>
111153
<tbody id="homeTableBody">
112154
<tr>
113-
<td><div id="viewHomePoint" class="btnTable btnTableIcon">
114-
<a class="ic_center" data-role="home-center" href="#" title="move to center view"></a>
115-
</div>
116-
</td>
117-
<td><input type="number" class="home-lon" /></td>
118-
<td><input type="number" class="home-lat" /></td>
119-
<td><span id="elevationValueAtHome">N/A</span></td>
155+
<td><div id="viewHomePoint" class="btnTable btnTableIcon">
156+
<a class="ic_center" data-role="home-center" href="#" title="move to center view"></a>
157+
</div>
158+
</td>
159+
<td><input type="number" class="home-lon" /></td>
160+
<td><input type="number" class="home-lat" /></td>
161+
<td><span id="elevationValueAtHome">N/A</span></td>
120162
</tr>
121163
</tbody>
122164
</table>
@@ -180,8 +222,11 @@
180222
<div id="showHideWPeditButton" class="save_btn">
181223
<a class="ic_hide" href="#" title="Hide"></a>
182224
</div>
183-
<div id="removePoint" class="btnMenu-danger">
184-
<a class="ic_removeAll" href="#" title="Remove"></a>
225+
<div id="removePoint" class="btn btnMenu-danger">
226+
<a id="removePointButton" class="ic_removeAll" href="#" title="Remove"></a>
227+
</div>
228+
<div id="editMission" class="save_btn" style="display: none">
229+
<a id="editMissionButton" class="ic_setup" href="#" title="Edit Mission"></a>
185230
</div>
186231
</div>
187232
</div>
@@ -238,8 +283,8 @@
238283
<thead>
239284
<tr>
240285
<th style="width: 30px">
241-
<div id="addOptionsPoint" class="btnTable btnTableIcon btnTable-success">
242-
<a class="ic_add" data-role="waypointOptions-add" href="#" style="float: center" title="Add"></a>
286+
<div id="addOptionsPoint" class="btn btnTable btnTableIcon btnTable-success">
287+
<a id="addOptionsPointButton" class="ic_add" data-role="waypointOptions-add" href="#" style="float: center" title="Add"></a>
243288
</div>
244289
</th>
245290
<th style="width: 50px" data-i18n="WaypointOptionId"></th>

0 commit comments

Comments
 (0)