Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e6e0429b
Commit
e6e0429b
authored
Jul 20, 2016
by
Gus Grubba
Committed by
GitHub
Jul 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3834 from dogmaphobic/motorTweak
Tweaking Motor Component.
parents
fa84ada7
0a815248
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
106 deletions
+78
-106
qgcresources.qrc
qgcresources.qrc
+3
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+0
-1
ArrowCCW.svg
src/AutoPilotPlugins/Common/Images/ArrowCCW.svg
+6
-0
ArrowCW.svg
src/AutoPilotPlugins/Common/Images/ArrowCW.svg
+6
-0
ArrowDirection.svg
src/AutoPilotPlugins/Common/Images/ArrowDirection.svg
+9
-0
MotorComponent.qml
src/AutoPilotPlugins/Common/MotorComponent.qml
+1
-6
MultiRotorMotorDisplay.qml
src/QmlControls/MultiRotorMotorDisplay.qml
+53
-27
MultiRotorMotorDisplayLegend.qml
src/QmlControls/MultiRotorMotorDisplayLegend.qml
+0
-71
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+0
-1
No files found.
qgcresources.qrc
View file @
e6e0429b
...
...
@@ -151,6 +151,9 @@
<file alias="CogWheel.svg">src/MissionManager/CogWheel.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="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 prefix="/res">
<file alias="AntennaRC">resources/Antenna_RC.svg</file>
...
...
qgroundcontrol.qrc
View file @
e6e0429b
...
...
@@ -57,7 +57,6 @@
<file alias="QGroundControl/Controls/MissionItemStatus.qml">src/MissionEditor/MissionItemStatus.qml</file>
<file alias="QGroundControl/Controls/MissionCommandDialog.qml">src/QmlControls/MissionCommandDialog.qml</file>
<file alias="QGroundControl/Controls/MultiRotorMotorDisplay.qml">src/QmlControls/MultiRotorMotorDisplay.qml</file>
<file alias="QGroundControl/Controls/MultiRotorMotorDisplayLegend.qml">src/QmlControls/MultiRotorMotorDisplayLegend.qml</file>
<file alias="QGroundControl/Controls/ModeSwitchDisplay.qml">src/QmlControls/ModeSwitchDisplay.qml</file>
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
...
...
src/AutoPilotPlugins/Common/Images/ArrowCCW.svg
0 → 100644
View file @
e6e0429b
<?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>
src/AutoPilotPlugins/Common/Images/ArrowCW.svg
0 → 100644
View file @
e6e0429b
<?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>
src/AutoPilotPlugins/Common/Images/ArrowDirection.svg
0 → 100644
View file @
e6e0429b
<?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>
src/AutoPilotPlugins/Common/MotorComponent.qml
View file @
e6e0429b
...
...
@@ -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
(
"
Propell
o
rs are removed - Enable motor sliders
"
)
text
:
qsTr
(
"
Propell
e
rs are removed - Enable motor sliders
"
)
}
}
// Row
}
// Column
...
...
src/QmlControls/MultiRotorMotorDisplay.qml
View file @
e6e0429b
...
...
@@ -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
src/QmlControls/MultiRotorMotorDisplayLegend.qml
deleted
100644 → 0
View file @
fa84ada7
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
src/QmlControls/QGroundControl.Controls.qmldir
View file @
e6e0429b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment