mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-10-26 08:07:14 +01:00
20 lines
584 B
Kotlin
20 lines
584 B
Kotlin
package kst4contest.view.compose
|
|
|
|
import kst4contest.model.ChatPreferences
|
|
|
|
private const val MIN_QTF = 0.0
|
|
private const val MAX_QTF = 360.0
|
|
|
|
/**
|
|
* Applies a deliberate filter direction to the runtime antenna heading without sending a rotor command.
|
|
*
|
|
* @return true when the runtime heading was updated
|
|
*/
|
|
internal fun applyExplicitQtfHeading(prefs: ChatPreferences, qtf: Double): Boolean {
|
|
if (!qtf.isFinite() || qtf !in MIN_QTF..MAX_QTF) return false
|
|
if (!prefs.isQtfFilterDirectionAsAntennaHeadingEnabled) return false
|
|
|
|
prefs.actualQTF.set(qtf)
|
|
return true
|
|
}
|