Plan: add an ALL mission type to edit mission, fence and rally items … - #3780
Open
Autonomost wants to merge 2 commits into
Open
Autonomost wants to merge 2 commits into
Autonomost wants to merge 2 commits into
Conversation
…together The mission type dropdown on the Plan screen gains an ALL entry. In that mode the single command grid holds mission, fence and rally items at once; a row's type follows its command (RALLY_POINT, FENCE_* or anything else), so no extra columns are needed. The map draws all three sets in one overlay with type-aware midline handles, and the fence polygon tools work in this mode. Read and Write open a small picker (Mission / Fence / Rally, all ticked by default) so one click transfers everything or any subset. Reading a subset keeps the grid rows of the types that were not fetched. Uploads go in mission, fence, rally order; a type the vehicle rejects (for example fence items on old firmware) is reported without aborting the rest. The MAVFTP download path now updates the cache matching the item type instead of always writing the mission cache.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate issues affect mixed-item handling and transfers.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds an ALL mission type combining mission, fence, and rally items in Flight Planner.
Changes:
- Adds unified editing and type-aware map rendering.
- Adds selective Mission/Fence/Rally read and write support.
- Updates MAVFTP caching by item type.
File summaries
| File | Summary |
|---|---|
GCSViews/FlightPlanner.cs |
Implements ALL-mode planning, transfers, rendering, and cache updates. |
Controls/MissionTypePicker.cs |
Adds the Mission/Fence/Rally selection dialog. |
Review details
Suppressed comments (3)
GCSViews/FlightPlanner.cs:722
- After a subset is selected here, the existing confirmation below still says the read will clear all existing points, while
getWPs(sender, types)deliberately preserves rows whose types were not fetched. The prompt is false for the new partial-read flow and can make users cancel a safe refresh; make it conditional on all types being selected or change its wording.
types = MissionTypePicker.Show(this, "Read");
if (types == null || types.Count == 0)
return;
GCSViews/FlightPlanner.cs:8006
- This infers the midline type from the physical row immediately before
pnt2, but ALL-mode mission midlines are built after fence/rally points are filtered out. A mission edge can therefore span fence rows; dragging it sees a fence vertex atpnt2 - 2and inserts/recalculates a fence command instead of a mission waypoint. Determine the type from the midline's tagged endpoints or attach the type when creating the marker.
if (midtype == MAVLink.MAV_MISSION_TYPE.ALL)
midtype = IsFencePolygonVertexRow(pnt2 - 2)
? MAVLink.MAV_MISSION_TYPE.FENCE
: MAVLink.MAV_MISSION_TYPE.MISSION;
GCSViews/FlightPlanner.cs:850
- The picker is shown only after the preflight loop above validates every grid row. In ALL mode, choosing only one type still fails on an invalid number or zero-altitude warning in an unselected fence/rally row, so the new subset write cannot ignore that type. Select the types before validation or limit validation to rows whose command type is selected.
types = MissionTypePicker.Show(this, "Write", counts);
- Files reviewed: 2/2 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Classify FENCE_HOME_CIRCLE_INCLUSION (legacy home centred fence) as a fence item so it is not uploaded as a mission command. - Reading a subset of types now says it replaces only those types instead of claiming all points will be cleared. - Ask which types to write before checking the grid, and only apply the altitude checks to rows of a type that is being sent. - Distance, gradient and bearing are computed from a mission-only list in ALL mode, so mission legs no longer span fence or rally rows and those rows are left alone. - Dragging a mission midline takes its type from the row it starts at rather than the physical row before its end, which could be a fence vertex in ALL mode. - Insert the home sentinel when the downloaded mission is empty, not only when the mission was not refreshed, so the first fence or rally row is not stripped as home. - When several types are written, a type the vehicle rejects is logged and the remaining types are still sent; the failures are reported together at the end. A single type fails as before. - MissionTypePicker takes its captions from Strings.resx so the dialog is translated like the rest of the planner.
Autonomost
commented
Sep 17, 2026
Autonomost
left a comment
Contributor
Author
There was a problem hiding this comment.
Made the changes as requested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…together
The mission type dropdown on the Plan screen gains an ALL entry. In that mode the single command grid holds mission, fence and rally items at once; a row's type follows its command (RALLY_POINT, FENCE_* or anything else), so no extra columns are needed. The map draws all three sets in one overlay with type-aware midline handles, and the fence polygon tools work in this mode.
Read and Write open a small picker (Mission / Fence / Rally, all ticked by default) so one click transfers everything or any subset. Reading a subset keeps the grid rows of the types that were not fetched. Uploads go in mission, fence, rally order; a type the vehicle rejects (for example fence items on old firmware) is reported without aborting the rest.
The MAVFTP download path now updates the cache matching the item type instead of always writing the mission cache.