7import QGroundControl.Controls
8import QGroundControl.FactControls
12 height: monitorColumn.height
14 property bool twoColumn: false
16 readonly property int _pwmMin: 800
17 readonly property int _pwmMax: 2200
18 readonly property int _pwmRange: _pwmMax - _pwmMin
20 RCChannelMonitorController {
24 // Live channel monitor control component
26 id: channelMonitorDisplayComponent
29 height: ScreenTools.defaultFontPixelHeight
31 property int rcValue: 1500
33 property int __lastRcValue: 1500
34 readonly property int __rcValueMaxJitter: 2
35 property color __barColor: qgcPal.windowShade
40 anchors.verticalCenter: parent.verticalCenter
42 height: parent.height / 2
48 anchors.horizontalCenter: parent.horizontalCenter
49 width: ScreenTools.defaultFontPixelWidth / 2
56 anchors.verticalCenter: parent.verticalCenter
57 width: parent.height * 0.75
59 x: (((reversed ? _pwmMax - rcValue : rcValue - _pwmMin) / _pwmRange) * parent.width) - (width / 2)
67 horizontalAlignment: Text.AlignHCenter
68 verticalAlignment: Text.AlignVCenter
69 text: qsTr("Not Mapped")
82 } // Component - channelMonitorDisplayComponent
87 columns: twoColumn ? 2 : 1
90 Layout.columnSpan: parent.columns
91 text: qsTr("Channel Monitor")
97 function onChannelValueChanged(channel, rcValue) {
98 if (channelMonitorRepeater.itemAt(channel)) {
99 channelMonitorRepeater.itemAt(channel).loader.item.rcValue = rcValue
105 id: channelMonitorRepeater
106 model: controller.channelCount
109 // Need this to get to loader from Connections above
110 property Item loader: theLoader
119 Layout.fillWidth: true
120 //height: ScreenTools.defaultFontPixelHeight
121 //width: parent.width - anchors.leftMargin - ScreenTools.defaultFontPixelWidth
122 sourceComponent: channelMonitorDisplayComponent
124 property bool mapped: true
125 readonly property bool reversed: false