fix: use passes list with corrected station position, fallback to independent search

This commit is contained in:
atsunatsu committed 2026-08-03 03:08:35 +08:00
1 parent df083840ac
commit 7bdff5df81
1 file changed
+10
@@ -230,6 +230,16 @@ class MutualViewModel(
): List<MutualPass> {
val endTime = time + hours * 60L * 60L * 1000L
val sampleInterval = 5_000L
// Use the main page's pass list for AOS/LOS times, then sample the curves
// using the actual positions. The passes list is already computed by getLeoPass
// and its AOS/LOS times match the Passes page exactly.
val existingPasses = satelliteRepo.passes.value
val results = findMutualPassesFromList(existingPasses, satellites, posA, posB,
minElevADeg, minElevBDeg, time, endTime, sampleInterval)
if (results.isNotEmpty()) return results
// Fallback: try the independent search.
return findMutualPassesFallback(satellites, posA, posB,
minElevADeg, minElevBDeg, time, endTime, sampleInterval)
}