6import QGroundControl.Controls
13 unitsString: _fact.units
14 decimalPlaces: _fact.decimalPlaces
16 required property Fact fact
18 property Fact _nullFact: Fact { }
19 property Fact _fact: fact ? fact : _nullFact
21 property bool _loadComplete: false
23 Component.onCompleted: {
25 if (fact && fact.minIsDefaultForType && fact.min == from) {
26 console.error("FactSlider: Fact is minIsDefaultForType", _fact.name)
28 if (fact && fact.maxIsDefaultForType && fact.max == to) {
29 console.error("FactSlider: Fact is maxIsDefaultForType", _fact.name)
33 Component.onDestruction: {
34 if (updateTimer.running) {
36 _fact.value = control.value
45 onTriggered: _fact.value = control.value
49 // We don't want to spam the vehicle with parameter updates so we coalesce multiple updated with a timer
50 // We also don't want to update the fact value until we know the control has finished initialization. During
51 // initialization the fact value can go through slight changes due to cooked value floating point inprecision.