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
3089da58
Commit
3089da58
authored
5 years ago
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
bf9dbefb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
168 additions
and
6 deletions
+168
-6
APMAutoPilotPlugin.cc
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
+1
-1
APMMotorComponent.cc
src/AutoPilotPlugins/APM/APMMotorComponent.cc
+8
-1
APMMotorComponent.h
src/AutoPilotPlugins/APM/APMMotorComponent.h
+5
-1
APMMotorComponent.qml
src/AutoPilotPlugins/APM/APMMotorComponent.qml
+147
-0
APMResources.qrc
src/FirmwarePlugin/APM/APMResources.qrc
+1
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+2
-2
Vehicle.h
src/Vehicle/Vehicle.h
+2
-1
SetupView.qml
src/VehicleSetup/SetupView.qml
+2
-0
No files found.
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
3089da58
...
@@ -91,7 +91,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
...
@@ -91,7 +91,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_powerComponent
->
setupTriggerSignals
();
_powerComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_powerComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_powerComponent
));
if
(
_vehicle
->
sub
()
&&
_vehicle
->
versionCompare
(
3
,
5
,
3
)
>=
0
)
{
if
(
!
_vehicle
->
sub
()
||
(
_vehicle
->
sub
()
&&
_vehicle
->
versionCompare
(
3
,
5
,
3
)
>=
0
)
)
{
_motorComponent
=
new
APMMotorComponent
(
_vehicle
,
this
);
_motorComponent
=
new
APMMotorComponent
(
_vehicle
,
this
);
_motorComponent
->
setupTriggerSignals
();
_motorComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_motorComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_motorComponent
));
...
...
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/APM/APMMotorComponent.cc
View file @
3089da58
...
@@ -22,6 +22,13 @@ QUrl APMMotorComponent::setupSource(void) const
...
@@ -22,6 +22,13 @@ QUrl APMMotorComponent::setupSource(void) const
case
MAV_TYPE_SUBMARINE
:
case
MAV_TYPE_SUBMARINE
:
return
QUrl
::
fromUserInput
(
QStringLiteral
(
"qrc:/qml/APMSubMotorComponent.qml"
));
return
QUrl
::
fromUserInput
(
QStringLiteral
(
"qrc:/qml/APMSubMotorComponent.qml"
));
default:
default:
return
QUrl
::
fromUserInput
(
QStringLiteral
(
"qrc:/qml/MotorComponent.qml"
));
return
QUrl
::
fromUserInput
(
QStringLiteral
(
"qrc:/qml/
APM
MotorComponent.qml"
));
}
}
}
}
QString
APMMotorComponent
::
motorIndexToLetter
(
int
index
)
{
char
letter
=
'A'
;
return
QString
(
letter
+
index
);
}
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/APM/APMMotorComponent.h
View file @
3089da58
...
@@ -20,7 +20,11 @@ class APMMotorComponent : public MotorComponent
...
@@ -20,7 +20,11 @@ class APMMotorComponent : public MotorComponent
public:
public:
APMMotorComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
nullptr
);
APMMotorComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
nullptr
);
QUrl
setupSource
(
void
)
const
final
;
// VehicleComponent overrides
QUrl
setupSource
(
void
)
const
override
;
bool
allowSetupWhileArmed
(
void
)
const
override
{
return
true
;
}
Q_INVOKABLE
QString
motorIndexToLetter
(
int
index
);
private:
private:
const
QString
_name
;
const
QString
_name
;
...
...
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/APM/APMMotorComponent.qml
0 → 100644
View file @
3089da58
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
ScreenTools
1.0
SetupPage
{
id
:
motorPage
pageComponent
:
pageComponent
readonly
property
int
_barHeight
:
10
readonly
property
int
_barWidth
:
5
readonly
property
int
_sliderHeight
:
10
readonly
property
int
_motorTimeoutSecs
:
3
FactPanelController
{
id
:
controller
}
Component
{
id
:
pageComponent
Column
{
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
text
:
qsTr
(
"
Warning: Unable to determine motor count
"
)
color
:
qgcPal
.
warningText
visible
:
controller
.
vehicle
.
motorCount
==
-
1
}
Row
{
id
:
motorSliders
enabled
:
safetySwitch
.
checked
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
4
Repeater
{
id
:
sliderRepeater
model
:
controller
.
vehicle
.
motorCount
==
-
1
?
8
:
controller
.
vehicle
.
motorCount
Column
{
property
alias
motorSlider
:
slider
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
vehicleComponent
.
motorIndexToLetter
(
index
)
}
QGCSlider
{
id
:
slider
height
:
ScreenTools
.
defaultFontPixelHeight
*
_sliderHeight
orientation
:
Qt
.
Vertical
minimumValue
:
0
maximumValue
:
100
stepSize
:
1
value
:
0
updateValueWhileDragging
:
false
onValueChanged
:
{
controller
.
vehicle
.
motorTest
(
index
+
1
,
value
,
value
==
0
?
0
:
_motorTimeoutSecs
)
if
(
value
!=
0
)
{
motorTimer
.
restart
()
}
}
Timer
{
id
:
motorTimer
interval
:
_motorTimeoutSecs
*
1000
repeat
:
false
running
:
false
onTriggered
:
{
allSlider
.
value
=
0
slider
.
value
=
0
}
}
}
}
// Column
}
// Repeater
Column
{
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
qsTr
(
"
All
"
)
}
QGCSlider
{
id
:
allSlider
height
:
ScreenTools
.
defaultFontPixelHeight
*
_sliderHeight
orientation
:
Qt
.
Vertical
minimumValue
:
0
maximumValue
:
100
stepSize
:
1
value
:
0
updateValueWhileDragging
:
false
onValueChanged
:
{
for
(
var
sliderIndex
=
0
;
sliderIndex
<
sliderRepeater
.
count
;
sliderIndex
++
)
{
sliderRepeater
.
itemAt
(
sliderIndex
).
motorSlider
.
value
=
allSlider
.
value
}
}
}
}
// Column
}
// Row
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
Moving the sliders will causes the motors to spin. Make sure you remove all props.
"
)
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Switch
{
id
:
safetySwitch
onClicked
:
{
if
(
!
checked
)
{
for
(
var
sliderIndex
=
0
;
sliderIndex
<
sliderRepeater
.
count
;
sliderIndex
++
)
{
sliderRepeater
.
itemAt
(
sliderIndex
).
motorSlider
.
value
=
0
}
allSlider
.
value
=
0
}
}
}
QGCLabel
{
color
:
qgcPal
.
warningText
text
:
safetySwitch
.
checked
?
qsTr
(
"
Careful: Motor sliders are enabled
"
)
:
qsTr
(
"
Propellers are removed - Enable motor sliders
"
)
}
}
// Row
}
// Column
}
// Component
}
// SetupPahe
This diff is collapsed.
Click to expand it.
src/FirmwarePlugin/APM/APMResources.qrc
View file @
3089da58
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<file alias="APMHeliComponent.qml">../../AutoPilotPlugins/APM/APMHeliComponent.qml</file>
<file alias="APMHeliComponent.qml">../../AutoPilotPlugins/APM/APMHeliComponent.qml</file>
<file alias="APMLightsComponent.qml">../../AutoPilotPlugins/APM/APMLightsComponent.qml</file>
<file alias="APMLightsComponent.qml">../../AutoPilotPlugins/APM/APMLightsComponent.qml</file>
<file alias="APMLightsComponentSummary.qml">../../AutoPilotPlugins/APM/APMLightsComponentSummary.qml</file>
<file alias="APMLightsComponentSummary.qml">../../AutoPilotPlugins/APM/APMLightsComponentSummary.qml</file>
<file alias="APMMotorComponent.qml">../../AutoPilotPlugins/APM/APMMotorComponent.qml</file>
<file alias="APMSubFrameComponent.qml">../../AutoPilotPlugins/APM/APMSubFrameComponent.qml</file>
<file alias="APMSubFrameComponent.qml">../../AutoPilotPlugins/APM/APMSubFrameComponent.qml</file>
<file alias="APMSubFrameComponentSummary.qml">../../AutoPilotPlugins/APM/APMSubFrameComponentSummary.qml</file>
<file alias="APMSubFrameComponentSummary.qml">../../AutoPilotPlugins/APM/APMSubFrameComponentSummary.qml</file>
<file alias="APMSubMotorComponent.qml">../../AutoPilotPlugins/APM/APMSubMotorComponent.qml</file>
<file alias="APMSubMotorComponent.qml">../../AutoPilotPlugins/APM/APMSubMotorComponent.qml</file>
...
...
This diff is collapsed.
Click to expand it.
src/Vehicle/Vehicle.cc
View file @
3089da58
...
@@ -3487,9 +3487,9 @@ void Vehicle::setSoloFirmware(bool soloFirmware)
...
@@ -3487,9 +3487,9 @@ void Vehicle::setSoloFirmware(bool soloFirmware)
}
}
}
}
void
Vehicle
::
motorTest
(
int
motor
,
int
percent
)
void
Vehicle
::
motorTest
(
int
motor
,
int
percent
,
int
timeoutSecs
)
{
{
sendMavCommand
(
_defaultComponentId
,
MAV_CMD_DO_MOTOR_TEST
,
true
,
motor
,
MOTOR_TEST_THROTTLE_PERCENT
,
percent
,
0
,
0
,
MOTOR_TEST_ORDER_BOARD
);
sendMavCommand
(
_defaultComponentId
,
MAV_CMD_DO_MOTOR_TEST
,
true
,
motor
,
MOTOR_TEST_THROTTLE_PERCENT
,
percent
,
timeoutSecs
,
0
,
MOTOR_TEST_ORDER_BOARD
);
}
}
QString
Vehicle
::
brandImageIndoor
(
void
)
const
QString
Vehicle
::
brandImageIndoor
(
void
)
const
...
...
This diff is collapsed.
Click to expand it.
src/Vehicle/Vehicle.h
View file @
3089da58
...
@@ -765,7 +765,8 @@ public:
...
@@ -765,7 +765,8 @@ public:
/// Test motor
/// Test motor
/// @param motor Motor number, 1-based
/// @param motor Motor number, 1-based
/// @param percent 0-no power, 100-full power
/// @param percent 0-no power, 100-full power
Q_INVOKABLE
void
motorTest
(
int
motor
,
int
percent
);
/// @param timeoutSec Disabled motor after this amount of time
Q_INVOKABLE
void
motorTest
(
int
motor
,
int
percent
,
int
timeoutSecs
);
Q_INVOKABLE
void
setPIDTuningTelemetryMode
(
bool
pidTuning
);
Q_INVOKABLE
void
setPIDTuningTelemetryMode
(
bool
pidTuning
);
...
...
This diff is collapsed.
Click to expand it.
src/VehicleSetup/SetupView.qml
View file @
3089da58
...
@@ -337,11 +337,13 @@ Rectangle {
...
@@ -337,11 +337,13 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
function
setSource
(
source
,
vehicleComponent
)
{
function
setSource
(
source
,
vehicleComponent
)
{
panelLoader
.
source
=
""
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
source
=
source
panelLoader
.
source
=
source
}
}
function
setSourceComponent
(
sourceComponent
,
vehicleComponent
)
{
function
setSourceComponent
(
sourceComponent
,
vehicleComponent
)
{
panelLoader
.
sourceComponent
=
undefined
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
vehicleComponent
=
vehicleComponent
panelLoader
.
sourceComponent
=
sourceComponent
panelLoader
.
sourceComponent
=
sourceComponent
}
}
...
...
This diff is collapsed.
Click to expand it.
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