Commit 6e6bf4cc authored by dogmaphobic's avatar dogmaphobic

Tweaking Motor Component.

parent fa84ada7
...@@ -151,6 +151,9 @@ ...@@ -151,6 +151,9 @@
<file alias="CogWheel.svg">src/MissionManager/CogWheel.svg</file> <file alias="CogWheel.svg">src/MissionManager/CogWheel.svg</file>
<file alias="StationMode.svg">src/AutoPilotPlugins/Common/Images/StationMode.svg</file> <file alias="StationMode.svg">src/AutoPilotPlugins/Common/Images/StationMode.svg</file>
<file alias="APMode.svg">src/AutoPilotPlugins/Common/Images/APMode.svg</file> <file alias="APMode.svg">src/AutoPilotPlugins/Common/Images/APMode.svg</file>
<file alias="ArrowDirection.svg">src/AutoPilotPlugins/Common/Images/ArrowDirection.svg</file>
<file alias="ArrowCW.svg">src/AutoPilotPlugins/Common/Images/ArrowCW.svg</file>
<file alias="ArrowCCW.svg">src/AutoPilotPlugins/Common/Images/ArrowCCW.svg</file>
</qresource> </qresource>
<qresource prefix="/res"> <qresource prefix="/res">
<file alias="AntennaRC">resources/Antenna_RC.svg</file> <file alias="AntennaRC">resources/Antenna_RC.svg</file>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<polygon fill="#FFFFFF" points="68.4,36 3.6,3.6 3.6,36 3.6,68.4 "/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<polygon fill="#FFFFFF" points="3.6,36 68.4,3.6 68.4,36 68.4,68.4 "/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<g>
<rect x="30.93" y="40.239" fill="#FFFFFF" width="10.139" height="28.161"/>
<polygon fill="#FFFFFF" points="36,3.6 54.056,40.227 36,40.227 17.944,40.227 "/>
</g>
</svg>
...@@ -137,7 +137,7 @@ SetupPage { ...@@ -137,7 +137,7 @@ SetupPage {
QGCLabel { QGCLabel {
color: qgcPal.warningText color: qgcPal.warningText
text: qsTr("Propellors are removed - Enable motor sliders") text: qsTr("Propellers are removed - Enable motor sliders")
} }
} // Row } // Row
} // Column } // Column
......
...@@ -15,8 +15,8 @@ Item { ...@@ -15,8 +15,8 @@ Item {
property real _rotorRadius: motorRoot.height / 8 property real _rotorRadius: motorRoot.height / 8
property int _motorsPerSide: motorCount / (coaxial ? 2 : 1) property int _motorsPerSide: motorCount / (coaxial ? 2 : 1)
readonly property string _cwColor: "green" readonly property string _cwColor: "#15ce15" // Green
readonly property string _ccwColor: "blue" readonly property string _ccwColor: "#1283e0" // Blue
readonly property var _motorColors4Plus: [ _ccwColor, _cwColor ] readonly property var _motorColors4Plus: [ _ccwColor, _cwColor ]
readonly property var _motorColors4X: [ _cwColor, _ccwColor ] readonly property var _motorColors4X: [ _cwColor, _ccwColor ]
readonly property var _motorColors6: [ _cwColor, _ccwColor ] readonly property var _motorColors6: [ _cwColor, _ccwColor ]
...@@ -75,24 +75,58 @@ Item { ...@@ -75,24 +75,58 @@ Item {
property real _armXCenter: Math.cos(_armOffsetIndexRadians) * _armLength // adjacent = cos * hypotenuse property real _armXCenter: Math.cos(_armOffsetIndexRadians) * _armLength // adjacent = cos * hypotenuse
property real _armYCenter: Math.sin(_armOffsetIndexRadians) * _armLength // opposite = sin * hypotenuse property real _armYCenter: Math.sin(_armOffsetIndexRadians) * _armLength // opposite = sin * hypotenuse
Rectangle {id: rotor Rectangle {
id: rotor
anchors.fill: parent anchors.fill: parent
radius: _rotorRadius radius: _rotorRadius
color: motorColors[index & 1] color: motorColors[index & 1]
opacity: topCoaxial ? 0.65 : 1.0 opacity: topCoaxial ? 0.65 : 1.0
border.color: topCoaxial ? "black" : color border.color: topCoaxial ? "black" : color
antialiasing: true
readonly property bool topCoaxial: topMotors && coaxial 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 { Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: radius *2 width: radius * 2
height: radius *2 height: radius * 2
radius: ScreenTools.defaultFontPixelHeight / 2 radius: ScreenTools.defaultFontPixelHeight * 0.666
color: "white" color: Qt.rgba(1,1,1,1)
border.color: "black" border.color: Qt.rgba(0,0,0,0.75)
antialiasing: true
QGCLabel { QGCLabel {
anchors.fill: parent anchors.fill: parent
...@@ -133,24 +167,16 @@ Item { ...@@ -133,24 +167,16 @@ Item {
property var motorColors: _motorColors4Top property var motorColors: _motorColors4Top
} }
// Body direction QGCColoredImage {
Canvas { color: _qgcPal.text
anchors.fill: parent height: parent.height * 0.5
width: height * 0.55
property real _centerX : width / 2 sourceSize.height: height
property real _centerY : height / 2 mipmap: true
fillMode: Image.PreserveAspectFit
onPaint: { source: "/qmlimages/ArrowDirection.svg"
var ctx = getContext("2d"); anchors.centerIn: parent
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();
}
} }
} // Item } // Item
} // Item } // Item
...@@ -9,8 +9,8 @@ Item { ...@@ -9,8 +9,8 @@ Item {
property var _qgcPal: QGCPalette { colorGroupEnabled: enabled } property var _qgcPal: QGCPalette { colorGroupEnabled: enabled }
property real _rotorRadius: legendRoot.height / 16 property real _rotorRadius: legendRoot.height / 16
readonly property string _cwColor: "green" readonly property string _cwColor: "#15ce15" // Green
readonly property string _ccwColor: "blue" readonly property string _ccwColor: "#1283e0" // Blue
Item { Item {
id: cwItem id: cwItem
...@@ -36,7 +36,7 @@ Item { ...@@ -36,7 +36,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Clockwise rotation, use pusher propellor") text: qsTr("Clockwise rotation, use pusher propeller")
} }
} }
...@@ -65,7 +65,7 @@ Item { ...@@ -65,7 +65,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Counter-Clockwise rotation, use normal propellor") text: qsTr("Counter Clockwise rotation, use normal propeller")
} }
} }
} // Item } // Item
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment