6import QGroundControl.Controls
8import "PX4SensorsOrientation.js" as Orientation
10/// The large picture of the vehicle on the side to calibrate next, or on the side it is on now.
14 property string side: "level"
15 /// The vehicle is being turned on this side, so the picture shows the turn
16 property bool rotating: false
17 /// What to do with the vehicle now, shown with a busy indicator. Empty when there is nothing to do.
18 property string instruction: ""
19 property bool active: false
20 property string tag: ""
21 property string caption: ""
22 /// "ok" or "error" draws that mark over the picture
23 property string mark: ""
24 /// "multiRotor", "fixedWing", "vtol", "rover" or anything else for a flat board
25 property string vehicleKind: ""
27 objectName: "sensorsCal_stage"
28 implicitWidth: ScreenTools.defaultFontPixelWidth * 50
29 implicitHeight: ScreenTools.defaultFontPixelHeight * 19
30 radius: ScreenTools.defaultBorderRadius * 2
31 color: active ? qgcPal.accentSubtle : qgcPal.windowCard
32 border.color: mark === "ok" ? qgcPal.colorGreen : mark === "error" ? qgcPal.colorRed : active ? qgcPal.accent : qgcPal.borderSubtle
34 QGCPalette { id: qgcPal }
37 anchors.left: parent.left
38 anchors.top: parent.top
39 anchors.margins: ScreenTools.defaultFontPixelWidth
41 textColor: qgcPal.accent
42 visible: control.tag !== ""
46 anchors.right: parent.right
47 anchors.top: parent.top
48 anchors.margins: ScreenTools.defaultFontPixelWidth
50 visible: control.instruction !== ""
51 implicitWidth: ScreenTools.defaultFontPixelHeight * 1.5
52 implicitHeight: implicitWidth
57 anchors.margins: ScreenTools.defaultFontPixelWidth
58 spacing: ScreenTools.defaultFontPixelHeight * 0.25
60 // Qt Quick 3D needs a GPU renderer. Without one the still pictures are shown instead.
63 Layout.fillWidth: true
64 Layout.fillHeight: true
65 opacity: control.mark === "" ? 1 : 0.3
67 switch (GraphicsInfo.api) {
68 case GraphicsInfo.Unknown:
70 case GraphicsInfo.Software:
82 rotating: control.rotating
83 vehicleKind: control.vehicleKind
91 source: Orientation.imageSource(control.side, control.rotating)
92 fillMode: Image.PreserveAspectFit
97 Layout.alignment: Qt.AlignHCenter
98 text: control.instruction !== "" ? qsTr("%1 - %2").arg(control.caption).arg(control.instruction) : control.caption
99 font.pointSize: ScreenTools.mediumFontPointSize
105 anchors.centerIn: parent
106 implicitWidth: ScreenTools.defaultFontPixelHeight * 5
107 implicitHeight: implicitWidth
108 radius: implicitWidth / 2
109 color: control.mark === "ok" ? qgcPal.colorGreen : qgcPal.colorRed
110 visible: control.mark !== ""
113 anchors.centerIn: parent
114 text: control.mark === "ok" ? "✓" : "!"
115 font.pointSize: ScreenTools.largeFontPointSize