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
e09ff0eb
Commit
e09ff0eb
authored
Apr 28, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completed
parent
45e27160
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
58 deletions
+100
-58
CameraComponent.qml
src/AutoPilotPlugins/PX4/CameraComponent.qml
+47
-34
CameraComponentSummary.qml
src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
+29
-1
FactPanelController.cc
src/FactSystem/FactControls/FactPanelController.cc
+3
-2
FactPanelController.h
src/FactSystem/FactControls/FactPanelController.h
+21
-21
No files found.
src/AutoPilotPlugins/PX4/CameraComponent.qml
View file @
e09ff0eb
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
View file @
e09ff0eb
...
...
@@ -15,15 +15,43 @@ FactPanel {
FactPanelController
{
id
:
controller
;
factPanel
:
panel
}
property
Fact
_camTriggerMode
:
controller
.
getParameterFact
(
-
1
,
"
TRIG_MODE
"
)
property
Fact
_camTriggerPol
:
controller
.
getParameterFact
(
-
1
,
"
TRIG_POLARITY
"
,
false
)
// Don't bitch about missing as these only exist if trigger mode is enabled
property
Fact
_auxPins
:
controller
.
getParameterFact
(
-
1
,
"
TRIG_PINS
"
,
false
)
// Ditto
property
Fact
_timeInterval
:
controller
.
getParameterFact
(
-
1
,
"
TRIG_INTERVAL
"
,
false
)
// Ditto
property
Fact
_distanceInterval
:
controller
.
getParameterFact
(
-
1
,
"
TRIG_DISTANCE
"
,
false
)
// Ditto
Column
{
anchors.fill
:
parent
anchors.margins
:
8
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Camera
Trigger M
ode:
"
)
labelText
:
qsTr
(
"
Camera
trigger m
ode:
"
)
valueText
:
_camTriggerMode
?
_camTriggerMode
.
enumStringValue
:
""
}
VehicleSummaryRow
{
visible
:
_timeInterval
&&
_camTriggerMode
.
value
===
2
labelText
:
qsTr
(
"
Time interval:
"
)
valueText
:
_timeInterval
?
_timeInterval
.
value
:
""
}
VehicleSummaryRow
{
visible
:
_distanceInterval
&&
_camTriggerMode
.
value
===
3
labelText
:
qsTr
(
"
Distance interval:
"
)
valueText
:
_distanceInterval
?
_distanceInterval
.
value
:
""
}
VehicleSummaryRow
{
visible
:
_auxPins
labelText
:
qsTr
(
"
AUX pins:
"
)
valueText
:
_auxPins
?
_auxPins
.
value
:
""
}
VehicleSummaryRow
{
visible
:
_camTriggerPol
labelText
:
qsTr
(
"
AUX pin polarity:
"
)
valueText
:
_camTriggerPol
?
(
_camTriggerPol
.
value
?
"
High (3.3V)
"
:
"
Low (0V)
"
)
:
""
}
}
}
src/FactSystem/FactControls/FactPanelController.cc
View file @
e09ff0eb
...
...
@@ -129,14 +129,15 @@ void FactPanelController::_checkForMissingFactPanel(void)
}
}
Fact
*
FactPanelController
::
getParameterFact
(
int
componentId
,
const
QString
&
name
)
Fact
*
FactPanelController
::
getParameterFact
(
int
componentId
,
const
QString
&
name
,
bool
reportMissing
)
{
if
(
_autopilot
&&
_autopilot
->
parameterExists
(
componentId
,
name
))
{
Fact
*
fact
=
_autopilot
->
getParameterFact
(
componentId
,
name
);
QQmlEngine
::
setObjectOwnership
(
fact
,
QQmlEngine
::
CppOwnership
);
return
fact
;
}
else
{
_reportMissingParameter
(
componentId
,
name
);
if
(
reportMissing
)
_reportMissingParameter
(
componentId
,
name
);
return
NULL
;
}
}
...
...
src/FactSystem/FactControls/FactPanelController.h
View file @
e09ff0eb
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef FactPanelController_H
...
...
@@ -40,34 +40,34 @@ Q_DECLARE_LOGGING_CATEGORY(FactPanelControllerLog)
/// missing Facts from C++ code.
class
FactPanelController
:
public
QObject
{
Q_OBJECT
Q_OBJECT
public:
FactPanelController
(
void
);
FactPanelController
(
void
);
Q_PROPERTY
(
QQuickItem
*
factPanel
READ
factPanel
WRITE
setFactPanel
)
Q_INVOKABLE
Fact
*
getParameterFact
(
int
componentId
,
const
QString
&
nam
e
);
Q_INVOKABLE
bool
parameterExists
(
int
componentId
,
const
QString
&
name
);
Q_INVOKABLE
Fact
*
getParameterFact
(
int
componentId
,
const
QString
&
name
,
bool
reportMissing
=
tru
e
);
Q_INVOKABLE
bool
parameterExists
(
int
componentId
,
const
QString
&
name
);
QQuickItem
*
factPanel
(
void
);
void
setFactPanel
(
QQuickItem
*
panel
);
protected:
/// Checks for existence of the specified parameters
/// @return true: all parameters exists, false: parameters missing and reported
bool
_allParametersExists
(
int
componentId
,
QStringList
names
);
/// Report a missing parameter to the FactPanel Qml element
void
_reportMissingParameter
(
int
componentId
,
const
QString
&
name
);
Vehicle
*
_vehicle
;
UASInterface
*
_uas
;
AutoPilotPlugin
*
_autopilot
;
private
slots
:
void
_checkForMissingFactPanel
(
void
);
private:
void
_notifyPanelMissingParameter
(
const
QString
&
missingParam
);
void
_notifyPanelErrorMsg
(
const
QString
&
errorMsg
);
...
...
@@ -77,4 +77,4 @@ private:
QStringList
_delayedMissingParams
;
};
#endif
\ No newline at end of file
#endif
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