mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-06 20:47:22 +00:00
Added AOS/LOS timer to each pass and a SearchBar filter
This commit is contained in:
1 parent
782b438a07
commit
83ce7229f6
9 files changed
+396
-249
No files matched your search
@@ -31,4 +31,15 @@ data class OrbitalPass(
|
||||
val catNum: Int = orbitalObject.data.catnum
|
||||
val name: String = if (hasDecayed) "${orbitalObject.data.name} (decayed?)" else orbitalObject.data.name
|
||||
val isDeepSpace: Boolean = orbitalObject.data.isDeepSpace
|
||||
|
||||
/**
|
||||
* Fraction of the pass elapsed at [timeMillis], derived on demand so that a ticking clock
|
||||
* never has to rewrite the pass list. A DeepSpace object is always in view, so it reads 1.
|
||||
*/
|
||||
fun progressAt(timeMillis: Long): Float {
|
||||
if (isDeepSpace) return 1f
|
||||
val total = (losTime - aosTime).toFloat()
|
||||
if (total <= 0f) return 0f
|
||||
return ((timeMillis - aosTime) / total).coerceIn(0f, 1f)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user