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
f8e70445
Commit
f8e70445
authored
Mar 01, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger list now QStringList
parent
a7c79618
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
44 deletions
+32
-44
AirframeComponent.cc
src/AutoPilotPlugins/PX4/AirframeComponent.cc
+3
-6
AirframeComponent.h
src/AutoPilotPlugins/PX4/AirframeComponent.h
+1
-1
FlightModesComponent.cc
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
+3
-6
FlightModesComponent.h
src/AutoPilotPlugins/PX4/FlightModesComponent.h
+1
-1
PX4Component.cc
src/AutoPilotPlugins/PX4/PX4Component.cc
+3
-6
PX4Component.h
src/AutoPilotPlugins/PX4/PX4Component.h
+5
-3
RadioComponent.h
src/AutoPilotPlugins/PX4/RadioComponent.h
+1
-1
SafetyComponent.cc
src/AutoPilotPlugins/PX4/SafetyComponent.cc
+2
-5
SafetyComponent.h
src/AutoPilotPlugins/PX4/SafetyComponent.h
+1
-1
SensorsComponent.cc
src/AutoPilotPlugins/PX4/SensorsComponent.cc
+11
-13
SensorsComponent.h
src/AutoPilotPlugins/PX4/SensorsComponent.h
+1
-1
No files found.
src/AutoPilotPlugins/PX4/AirframeComponent.cc
View file @
f8e70445
...
...
@@ -27,9 +27,6 @@
#include "AirframeComponent.h"
#include "QGCPX4AirframeConfig.h"
/// @brief Parameters which signal a change in setupComplete state
static
const
char
*
triggerParams
[]
=
{
"SYS_AUTOSTART"
,
NULL
};
#if 0
// Broken by latest mavlink module changes. Not used yet. Comment out for now.
// Discussing mavlink fix.
...
...
@@ -146,7 +143,7 @@ bool AirframeComponent::requiresSetup(void) const
bool
AirframeComponent
::
setupComplete
(
void
)
const
{
QVariant
value
;
if
(
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
triggerParams
[
0
]
,
value
))
{
if
(
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
"SYS_AUTOSTART"
,
value
))
{
return
value
.
toInt
()
!=
0
;
}
else
{
Q_ASSERT
(
false
);
...
...
@@ -166,9 +163,9 @@ QString AirframeComponent::setupStateDescription(void) const
return
QString
(
stateDescription
);
}
const
char
**
AirframeComponent
::
setupCompleteChangedTriggerList
(
void
)
const
QStringList
AirframeComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
return
triggerParams
;
return
QStringList
(
"SYS_AUTOSTART"
)
;
}
QStringList
AirframeComponent
::
paramFilterList
(
void
)
const
...
...
src/AutoPilotPlugins/PX4/AirframeComponent.h
View file @
f8e70445
...
...
@@ -38,7 +38,7 @@ public:
AirframeComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
virtual
QString
name
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
View file @
f8e70445
...
...
@@ -28,9 +28,6 @@
#include "FlightModeConfig.h"
#include "PX4AutoPilotPlugin.h"
/// @brief Parameters which signal a change in setupComplete state
static
const
char
*
triggerParams
[]
=
{
"RC_MAP_MODE_SW"
,
NULL
};
struct
SwitchListItem
{
const
char
*
param
;
const
char
*
name
;
...
...
@@ -76,7 +73,7 @@ bool FlightModesComponent::requiresSetup(void) const
bool
FlightModesComponent
::
setupComplete
(
void
)
const
{
QVariant
value
;
if
(
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
triggerParams
[
0
]
,
value
))
{
if
(
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
"RC_MAP_MODE_SW"
,
value
))
{
return
value
.
toInt
()
!=
0
;
}
else
{
Q_ASSERT
(
false
);
...
...
@@ -96,9 +93,9 @@ QString FlightModesComponent::setupStateDescription(void) const
return
QString
(
stateDescription
);
}
const
char
**
FlightModesComponent
::
setupCompleteChangedTriggerList
(
void
)
const
QStringList
FlightModesComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
return
triggerParams
;
return
QStringList
(
"RC_MAP_MODE_SW"
)
;
}
QStringList
FlightModesComponent
::
paramFilterList
(
void
)
const
...
...
src/AutoPilotPlugins/PX4/FlightModesComponent.h
View file @
f8e70445
...
...
@@ -38,7 +38,7 @@ public:
FlightModesComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
virtual
QString
name
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/PX4Component.cc
View file @
f8e70445
...
...
@@ -39,15 +39,12 @@ void PX4Component::_parameterUpdated(int compId, QString paramName, QVariant val
Q_UNUSED
(
value
);
if
(
compId
==
_paramMgr
->
getDefaultComponentId
())
{
const
char
**
prgTriggers
=
setupCompleteChangedTriggerList
();
Q_ASSERT
(
prgTriggers
);
while
(
*
prgTriggers
!=
NULL
)
{
if
(
paramName
==
*
prgTriggers
)
{
QStringList
triggerList
=
setupCompleteChangedTriggerList
();
foreach
(
QString
triggerParam
,
triggerList
)
{
if
(
paramName
==
triggerParam
)
{
emit
setupCompleteChanged
(
setupComplete
());
return
;
}
prgTriggers
++
;
}
}
}
src/AutoPilotPlugins/PX4/PX4Component.h
View file @
f8e70445
...
...
@@ -26,6 +26,8 @@
#include "VehicleComponent.h"
#include <QStringList>
/// @file
/// @brief This class is used as an abstract base class for all PX4 VehicleComponent objects.
/// @author Don Gagne <don@thegagnes.com>
...
...
@@ -37,9 +39,9 @@ class PX4Component : public VehicleComponent
public:
PX4Component
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
/// @brief Returns an
array
of parameter names for which a change should cause the setupCompleteChanged
/// signal to be emitted. Last element is signalled by NULL.
Must be implemented by upper level class.
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
=
0
;
/// @brief Returns an
list
of parameter names for which a change should cause the setupCompleteChanged
/// signal to be emitted. Last element is signalled by NULL.
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
=
0
;
private
slots
:
/// @brief Connected to QGCUASParamManagerInterface::parameterUpdated signal in order to signal
...
...
src/AutoPilotPlugins/PX4/RadioComponent.h
View file @
f8e70445
...
...
@@ -39,7 +39,7 @@ public:
RadioComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
virtual
QString
name
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.cc
View file @
f8e70445
...
...
@@ -29,9 +29,6 @@
#include "QGCQmlWidgetHolder.h"
#include "PX4AutoPilotPlugin.h"
/// @brief Parameters which signal a change in setupComplete state
static
const
char
*
triggerParams
[]
=
{
NULL
};
SafetyComponent
::
SafetyComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Safety"
))
...
...
@@ -76,9 +73,9 @@ QString SafetyComponent::setupStateDescription(void) const
return
QString
(
stateDescription
);
}
const
char
**
SafetyComponent
::
setupCompleteChangedTriggerList
(
void
)
const
QStringList
SafetyComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
return
triggerParams
;
return
QStringList
()
;
}
QStringList
SafetyComponent
::
paramFilterList
(
void
)
const
...
...
src/AutoPilotPlugins/PX4/SafetyComponent.h
View file @
f8e70445
...
...
@@ -39,7 +39,7 @@ public:
SafetyComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
virtual
QString
name
(
void
)
const
;
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.cc
View file @
f8e70445
...
...
@@ -31,10 +31,6 @@
// These two list must be kept in sync
/// @brief Parameters which signal a change in setupComplete state
static
const
char
*
triggerParams
[]
=
{
"CAL_MAG0_ID"
,
"CAL_GYRO0_ID"
,
"CAL_ACC0_ID"
,
NULL
};
static
const
char
*
triggerParamsFixedWing
[]
=
{
"CAL_MAG0_ID"
,
"CAL_GYRO0_ID"
,
"CAL_ACC0_ID"
,
"SENS_DPRES_OFF"
,
NULL
};
SensorsComponent
::
SensorsComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
)
:
PX4Component
(
uas
,
autopilot
,
parent
),
_name
(
tr
(
"Sensors"
))
...
...
@@ -65,13 +61,10 @@ bool SensorsComponent::requiresSetup(void) const
bool
SensorsComponent
::
setupComplete
(
void
)
const
{
const
char
**
prgTriggers
=
setupCompleteChangedTriggerList
();
Q_ASSERT
(
prgTriggers
);
while
(
*
prgTriggers
!=
NULL
)
{
foreach
(
QString
triggerParam
,
setupCompleteChangedTriggerList
())
{
QVariant
value
;
if
(
!
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
*
prgTriggers
,
value
))
{
if
(
!
_paramMgr
->
getParameterValue
(
_paramMgr
->
getDefaultComponentId
(),
triggerParam
,
value
))
{
Q_ASSERT
(
false
);
return
false
;
}
...
...
@@ -79,8 +72,6 @@ bool SensorsComponent::setupComplete(void) const
if
(
value
.
toFloat
()
==
0.0
f
)
{
return
false
;
}
prgTriggers
++
;
}
return
true
;
...
...
@@ -98,9 +89,16 @@ QString SensorsComponent::setupStateDescription(void) const
return
QString
(
stateDescription
);
}
const
char
**
SensorsComponent
::
setupCompleteChangedTriggerList
(
void
)
const
QStringList
SensorsComponent
::
setupCompleteChangedTriggerList
(
void
)
const
{
return
_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
?
triggerParamsFixedWing
:
triggerParams
;
QStringList
triggers
;
triggers
<<
"CAL_MAG0_ID"
<<
"CAL_GYRO0_ID"
<<
"CAL_ACC0_ID"
;
if
(
_uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
{
triggers
<<
"SENS_DPRES_OFF"
;
}
return
triggers
;
}
QStringList
SensorsComponent
::
paramFilterList
(
void
)
const
...
...
src/AutoPilotPlugins/PX4/SensorsComponent.h
View file @
f8e70445
...
...
@@ -38,7 +38,7 @@ public:
SensorsComponent
(
UASInterface
*
uas
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Virtuals from PX4Component
virtual
const
char
**
setupCompleteChangedTriggerList
(
void
)
const
;
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
// Virtuals from VehicleComponent
virtual
QString
name
(
void
)
const
;
...
...
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