Skip to content

Commit 38dfd33

Browse files
sebgodclaude
andcommitted
Full rescan when site coordinates change >1 degree
The planner fast-path (RecomputeForDate) only recalculates altitude profiles for existing targets. When the site moves significantly (e.g. -37S to 50N), southern-hemisphere targets would show 0 degrees with no replacement. Now compares new lat/lon against previous values and triggers a full ComputeTonightsBestAsync when the difference exceeds 1 degree. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b61853e commit 38dfd33

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## Next Up
44

55
- [x] Fake filter wheels should have pre-installed filters (realistic filter sets per device ID)
6+
- [ ] Planner: full rescan when site coordinates change significantly (>1°) instead of fast-path recompute — currently changing lat from -37 to 50 keeps southern-hemisphere targets with 0° altitude
7+
- [ ] Extract VkImageRenderer UI layout to Abstractions — toolbar, file list, status bar, hit testing are renderer-agnostic; image rendering + texture upload stay Vulkan-specific in Shared
68
- [ ] Pinned items in planner should persist to disk (`<CommonDataRoot>/Sessions/Uncommitted.json`) so they survive app restarts while not yet committed to a planned session
79
- [ ] Seed focuser `MaxStep` from hardware during ZWO EAF discovery (same `seedQueryParams` pattern as EFW slot count)
810
- [ ] Remember last focus position in profile URI after auto-focus (save after every auto-focus attempt, whether successful or not) so the focuser can start near the last known good position on next session

src/TianWen.UI.Gui/Program.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,17 @@ await PlannerActions.ComputeTonightsBestAsync(
222222
transform.DateTimeOffset = noon;
223223
}
224224

225+
// Detect significant site change (>1°) — requires full rescan, not just recompute
226+
var siteChanged = Math.Abs(transform.SiteLatitude - plannerState.SiteLatitude) > 1.0
227+
|| Math.Abs(transform.SiteLongitude - plannerState.SiteLongitude) > 1.0;
228+
225229
plannerState.SiteLatitude = transform.SiteLatitude;
226230
plannerState.SiteLongitude = transform.SiteLongitude;
227231
plannerState.SiteTimeZone = transform.SiteTimeZone;
228232

229-
// Fast path: if we already have targets, just recompute night window + profiles
230-
// Full rescan only needed on first load
231-
if (plannerState.TonightsBest.Count > 0)
233+
// Fast path: if we already have targets and site didn't change significantly,
234+
// just recompute night window + altitude profiles
235+
if (plannerState.TonightsBest.Count > 0 && !siteChanged)
232236
{
233237
PlannerActions.RecomputeForDate(plannerState, transform);
234238
}

0 commit comments

Comments
 (0)