6import QGroundControl.Controls
10 property alias value: channelSlider.value
12 // If the default value is NaN, we add a small range
13 // below, which snaps into place
14 property var snap: isNaN(channel.defaultValue)
15 property var span: channel.max - channel.min
16 property var snapRange: span * 0.15
17 property var defaultVal: snap ? channel.min - snapRange : channel.defaultValue
18 property var blockUpdates: true // avoid slider changes on startup
22 Layout.alignment: Qt.AlignTop
24 readonly property int _sliderHeight: 6
26 function stopTimer() {
31 channelSlider.value = defaultVal;
35 signal actuatorValueChanged(real value, real sliderValue)
39 orientation: Qt.Vertical
40 from: snap ? channel.min - snapRange : channel.min
42 stepSize: (channel.max-channel.min)/100
45 anchors.horizontalCenter: parent.horizontalCenter
46 height: ScreenTools.defaultFontPixelHeight * _sliderHeight
52 if (value < channel.min) {
53 if (value < channel.min - snapRange/2) {
54 value = channel.min - snapRange;
66 triggeredOnStart: true
70 var sendValue = channelSlider.value;
71 if (sendValue < channel.min - snapRange/2) {
72 sendValue = channel.defaultValue;
74 root.actuatorValueChanged(sendValue, channelSlider.value)
78 Component.onCompleted: {
85 anchors.horizontalCenter: parent.horizontalCenter
90 Rotation { origin.x: 0; origin.y: 0; angle: -90 },
91 Translate { y: channelLabel.height + 5 }