1/****************************************************************************
3 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
5 * QGroundControl is licensed according to the terms in the file
6 * COPYING.md in the root of the source code directory.
8 ****************************************************************************/
12import QtQuick.Controls
17import QGroundControl.Controls
18import QGroundControl.FactControls
20/// Generic version of Channel Monitor which should work with both RC Transmitters and Joysticks
21/// Used to display raw channel values
23 required property int channelCount
24 required property int channelValueMin
25 required property int channelValueMax
27 property bool twoColumn: false
29 /// Should be called by consumers whenever a raw channel value changes
30 function rawChannelValueChanged(channel, channelValue) {
31 if (channelMonitorRepeater.itemAt(channel)) {
32 let channelValueDisplayItem = channelMonitorRepeater.itemAt(channel)._channelValueDisplayLoader.item
33 let filteredChannelValue = Math.min(Math.max(channelValue, channelValueMin), channelValueMax)
34 channelValueDisplayItem.channelValue = filteredChannelValue
39 columns: control.twoColumn ? 2 : 1
40 columnSpacing: ScreenTools.defaultFontPixelWidth / 2
43 QGCPalette { id: qgcPal; colorGroupEnabled: control.enabled }
46 Layout.columnSpan: parent.columns
47 text: qsTr("Raw Channel Monitor")
51 id: channelMonitorRepeater
55 Layout.fillWidth: true
56 spacing: ScreenTools.defaultFontPixelWidth / 2
58 property var _channelValueDisplayLoader: channelValueDisplayLoader
65 id: channelValueDisplayLoader
66 Layout.fillWidth: true
67 sourceComponent: RemoteControlChannelValueDisplay {
68 mode: RemoteControlChannelValueDisplay.RawValue
69 channelValueMin: control.channelValueMin
70 channelValueMax: control.channelValueMax