Improves boundary recording and simulator lockout#1209
Conversation
Once DisableSim runs in a session (live fix arrived), it now stays off permanently via a sticky isSimDisabledLocked flag. Prevents rogue timerSim ticks from overwriting pn.fix with stale sim.CurrentLatLon (e.g. ~7000km away when sim defaults to Alberta), which also triggered the fixQuality cycler in GUI.Designer.cs to override live RTK quality and cascade into the RTK-alarm autosteer auto-disable loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When an operator drives a boundary and passes the start point before stopping, the overshoot used to confuse the self-intersection cleanup: RemoveSelfIntersections detected a near-start crossing, removed the whole field, and left only a small artifact triangle around the start point. Add CBoundaryList.TrimDrivenOvershoot(), run before the polygon is finalized, handling both ways the overshoot closes on itself: 1. The last points loop straight back onto the start (first ~= last point) -> strip the trailing points near the start. 2. The closing/tail run crosses the boundary opening at an angle -> find that crossing with the existing TrySegmentIntersection and keep only the enclosed loop, dropping the head stub and overshoot tail. The search is limited to the first/last ~30 points (the only place a driven overshoot can fold back), so it does nothing when there is no overlap and a clean boundary is left as-is. Two safety guards ensure a freshly recorded boundary is never discarded: - TrimDrivenOvershoot only trims when the enclosed loop still holds the bulk (>=50%) of the recording. - RemoveSelfIntersections restores the original when cleanup collapses the boundary below a quarter of the input points, not just below 3 - protecting every caller, including KML and ISOXML import. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e58cd7e82b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Once SIM has been disabled this session, it stays disabled until app restart. | ||
| if (isSimDisabledLocked) | ||
| { | ||
| simulatorOnToolStripMenuItem.Checked = false; | ||
| simulatorOnToolStripMenuItem.Enabled = false; | ||
| return; |
There was a problem hiding this comment.
Set the sticky lock when the user turns simulator off
This guard only takes effect after isSimDisabledLocked has been set by DisableSim(), but the manual toggle path below never sets that flag when the user unchecks Simulator On; it only disables timerSim and saves the unchecked setting. In a session where the operator manually turns the simulator off without a live-fix-triggered DisableSim(), the next click still passes this guard and can re-enable the simulator, so the new session-long lockout is bypassed for the manual-off scenario it is meant to cover.
Useful? React with 👍 / 👎.
Addresses artifacts in boundary recording and enhances simulator stability.
Boundary Recording Improvements:
TrimDrivenOvershootto intelligently remove excess path by:RemoveSelfIntersectionsto prevent discarding valid boundaries if the cleanup process results in a disproportionately small or degenerate polygon.Simulator Safety & Lockout:
isSimDisabledLocked) that permanently disables the simulator for the remainder of the session once it's turned off (either manually or by the system).