diff --git a/qgcresources.qrc b/qgcresources.qrc index 9e03b520e441637b43b5e959f58fbfb0d3740731..0ed46b8829b1ce5bd8562b002771293444acc8a6 100644 --- a/qgcresources.qrc +++ b/qgcresources.qrc @@ -151,6 +151,9 @@ src/MissionManager/CogWheel.svg src/AutoPilotPlugins/Common/Images/StationMode.svg src/AutoPilotPlugins/Common/Images/APMode.svg + src/AutoPilotPlugins/Common/Images/ArrowDirection.svg + src/AutoPilotPlugins/Common/Images/ArrowCW.svg + src/AutoPilotPlugins/Common/Images/ArrowCCW.svg resources/Antenna_RC.svg diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 0f6a054fd82e742c3fce791c4f65f68d7aa94ee0..1c2b007821f4d6d761863be9b8ac03e3043dac0d 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -57,7 +57,6 @@ src/MissionEditor/MissionItemStatus.qml src/QmlControls/MissionCommandDialog.qml src/QmlControls/MultiRotorMotorDisplay.qml - src/QmlControls/MultiRotorMotorDisplayLegend.qml src/QmlControls/ModeSwitchDisplay.qml src/QmlControls/ParameterEditor.qml src/QmlControls/ParameterEditorDialog.qml diff --git a/src/AutoPilotPlugins/Common/Images/ArrowCCW.svg b/src/AutoPilotPlugins/Common/Images/ArrowCCW.svg new file mode 100644 index 0000000000000000000000000000000000000000..4760018788d64fb5a370ea35fcd6cb99cbde45b6 --- /dev/null +++ b/src/AutoPilotPlugins/Common/Images/ArrowCCW.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/src/AutoPilotPlugins/Common/Images/ArrowCW.svg b/src/AutoPilotPlugins/Common/Images/ArrowCW.svg new file mode 100644 index 0000000000000000000000000000000000000000..42dbfb26beb23fa7b21411faa8ce08c06e5073bd --- /dev/null +++ b/src/AutoPilotPlugins/Common/Images/ArrowCW.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/src/AutoPilotPlugins/Common/Images/ArrowDirection.svg b/src/AutoPilotPlugins/Common/Images/ArrowDirection.svg new file mode 100644 index 0000000000000000000000000000000000000000..67d4ee2d9e8df412bf3318c03d5f22c1e0e99e82 --- /dev/null +++ b/src/AutoPilotPlugins/Common/Images/ArrowDirection.svg @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/src/AutoPilotPlugins/Common/MotorComponent.qml b/src/AutoPilotPlugins/Common/MotorComponent.qml index 2c8c3c536f898ff0b8ed8f869d54b270f6ad96d8..fd41c08a3fe7b3deaa07fe07464057f8d9ead5fc 100644 --- a/src/AutoPilotPlugins/Common/MotorComponent.qml +++ b/src/AutoPilotPlugins/Common/MotorComponent.qml @@ -106,11 +106,6 @@ SetupPage { coaxial: controller.vehicle.coaxialMotors } - MultiRotorMotorDisplayLegend { - anchors.top: parent.top - anchors.bottom: parent.bottom - width: height - } } // Row QGCLabel { @@ -137,7 +132,7 @@ SetupPage { QGCLabel { color: qgcPal.warningText - text: qsTr("Propellors are removed - Enable motor sliders") + text: qsTr("Propellers are removed - Enable motor sliders") } } // Row } // Column diff --git a/src/QmlControls/MultiRotorMotorDisplay.qml b/src/QmlControls/MultiRotorMotorDisplay.qml index c1cd094816bda9e632c2e78dc83620356eb39bed..2034e9806be2b75c32af00dfd2887ee64ad6a48a 100644 --- a/src/QmlControls/MultiRotorMotorDisplay.qml +++ b/src/QmlControls/MultiRotorMotorDisplay.qml @@ -15,8 +15,8 @@ Item { property real _rotorRadius: motorRoot.height / 8 property int _motorsPerSide: motorCount / (coaxial ? 2 : 1) - readonly property string _cwColor: "green" - readonly property string _ccwColor: "blue" + readonly property string _cwColor: "#15ce15" // Green + readonly property string _ccwColor: "#1283e0" // Blue readonly property var _motorColors4Plus: [ _ccwColor, _cwColor ] readonly property var _motorColors4X: [ _cwColor, _ccwColor ] readonly property var _motorColors6: [ _cwColor, _ccwColor ] @@ -75,24 +75,58 @@ Item { property real _armXCenter: Math.cos(_armOffsetIndexRadians) * _armLength // adjacent = cos * hypotenuse property real _armYCenter: Math.sin(_armOffsetIndexRadians) * _armLength // opposite = sin * hypotenuse - Rectangle {id: rotor + Rectangle { + id: rotor anchors.fill: parent radius: _rotorRadius color: motorColors[index & 1] opacity: topCoaxial ? 0.65 : 1.0 border.color: topCoaxial ? "black" : color - + antialiasing: true readonly property bool topCoaxial: topMotors && coaxial + //-- Top Directional Arrow + QGCColoredImage { + color: _qgcPal.globalTheme === QGCPalette.Light ? "black" : "white" + height: parent.height * 0.2 + width: height + sourceSize.height: height + mipmap: true + fillMode: Image.PreserveAspectFit + source: (index & 1) ? "/qmlimages/ArrowCW.svg" : "/qmlimages/ArrowCCW.svg" + anchors.top: parent.top + anchors.topMargin: height * -0.5 + anchors.horizontalCenter: parent.horizontalCenter + } + //-- Bottom Directional Arrow + QGCColoredImage { + color: _qgcPal.globalTheme === QGCPalette.Light ? "black" : "white" + height: parent.height * 0.2 + width: height + sourceSize.height: height + mipmap: true + fillMode: Image.PreserveAspectFit + source: (index & 1) ? "/qmlimages/ArrowCCW.svg" : "/qmlimages/ArrowCW.svg" + anchors.bottom: parent.bottom + anchors.bottomMargin: height * -0.5 + anchors.horizontalCenter: parent.horizontalCenter + } + transform: [ + Rotation { + origin.x: rotor.width / 2 + origin.y: rotor.height / 2 + angle: (index & 1) ? 45 : -45 + }] } Rectangle { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - width: radius *2 - height: radius *2 - radius: ScreenTools.defaultFontPixelHeight / 2 - color: "white" - border.color: "black" + width: radius * 2 + height: radius * 2 + radius: ScreenTools.defaultFontPixelHeight * 0.666 + color: Qt.rgba(1,1,1,1) + border.color: Qt.rgba(0,0,0,0.75) + antialiasing: true QGCLabel { anchors.fill: parent @@ -133,24 +167,16 @@ Item { property var motorColors: _motorColors4Top } - // Body direction - Canvas { - anchors.fill: parent - - property real _centerX : width / 2 - property real _centerY : height / 2 - - onPaint: { - var ctx = getContext("2d"); - ctx.lineWidth = 3 - ctx.strokeStyle = _qgcPal.text - ctx.translate(_centerX, _centerY) - ctx.moveTo(0, -_rotorRadius / 2); - ctx.lineTo(_rotorRadius / 2, _rotorRadius); - ctx.lineTo(-_rotorRadius / 2, _rotorRadius); - ctx.lineTo(0, -_rotorRadius / 2); - ctx.stroke(); - } + QGCColoredImage { + color: _qgcPal.text + height: parent.height * 0.5 + width: height * 0.55 + sourceSize.height: height + mipmap: true + fillMode: Image.PreserveAspectFit + source: "/qmlimages/ArrowDirection.svg" + anchors.centerIn: parent } + } // Item } // Item diff --git a/src/QmlControls/MultiRotorMotorDisplayLegend.qml b/src/QmlControls/MultiRotorMotorDisplayLegend.qml deleted file mode 100644 index 97f186cdc3e5f0de6574d06059789cf9eb0e487d..0000000000000000000000000000000000000000 --- a/src/QmlControls/MultiRotorMotorDisplayLegend.qml +++ /dev/null @@ -1,71 +0,0 @@ -import QtQuick 2.2 - -import QGroundControl.Palette 1.0 -import QGroundControl.ScreenTools 1.0 - -Item { - id: legendRoot - - property var _qgcPal: QGCPalette { colorGroupEnabled: enabled } - property real _rotorRadius: legendRoot.height / 16 - - readonly property string _cwColor: "green" - readonly property string _ccwColor: "blue" - - Item { - id: cwItem - anchors.left: parent.left - anchors.right: parent.right - height: legendRoot.height / 2 - - Rectangle { - id: cwRotor - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - width: _rotorRadius * 2 - height: _rotorRadius * 2 - radius: _rotorRadius - color: _cwColor - } - - QGCLabel { - anchors.leftMargin: ScreenTools.defaultFontPixelWidth - anchors.left: cwRotor.right - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - verticalAlignment: Text.AlignVCenter - wrapMode: Text.WordWrap - text: qsTr("Clockwise rotation, use pusher propellor") - } - } - - Item { - id: ccwItem - anchors.top: cwItem.bottom - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - - Rectangle { - id: ccwRotor - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - width: _rotorRadius * 2 - height: _rotorRadius * 2 - radius: _rotorRadius - color: _ccwColor - } - - QGCLabel { - anchors.leftMargin: ScreenTools.defaultFontPixelWidth - anchors.left: ccwRotor.right - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - verticalAlignment: Text.AlignVCenter - wrapMode: Text.WordWrap - text: qsTr("Counter-Clockwise rotation, use normal propellor") - } - } -} // Item diff --git a/src/QmlControls/QGroundControl.Controls.qmldir b/src/QmlControls/QGroundControl.Controls.qmldir index 6a9a1170cbdd2b320c370d2c82def990c55416dd..472abd579ab5707515adf00b8b09d7618353ad70 100644 --- a/src/QmlControls/QGroundControl.Controls.qmldir +++ b/src/QmlControls/QGroundControl.Controls.qmldir @@ -14,7 +14,6 @@ MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml MissionItemStatus 1.0 MissionItemStatus.qml ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml -MultiRotorMotorDisplayLegend 1.0 MultiRotorMotorDisplayLegend.qml ParameterEditor 1.0 ParameterEditor.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml RCChannelMonitor 1.0 RCChannelMonitor.qml