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
21923ab9
Commit
21923ab9
authored
Feb 27, 2017
by
Don Gagne
Committed by
GitHub
Feb 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4651 from DonLakeFlyer/TriggerCamera
Trigger camera in instrument panel page
parents
1f342e61
8339e840
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
159 additions
and
104 deletions
+159
-104
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
CameraWidget.qml
src/FlightMap/Widgets/CameraWidget.qml
+54
-0
InstrumentSwipeView.qml
src/FlightMap/Widgets/InstrumentSwipeView.qml
+67
-89
ValuesWidget.qml
src/FlightMap/Widgets/ValuesWidget.qml
+1
-1
VehicleHealthWidget.qml
src/FlightMap/Widgets/VehicleHealthWidget.qml
+5
-0
VibrationWidget.qml
src/FlightMap/Widgets/VibrationWidget.qml
+5
-0
qmldir
src/FlightMap/qmldir
+15
-14
Vehicle.cc
src/Vehicle/Vehicle.cc
+9
-0
Vehicle.h
src/Vehicle/Vehicle.h
+2
-0
No files found.
qgroundcontrol.qrc
View file @
21923ab9
...
...
@@ -144,6 +144,7 @@
<file alias="QGroundControl/FlightMap/QGCPitchIndicator.qml">src/FlightMap/Widgets/QGCPitchIndicator.qml</file>
<file alias="QGroundControl/FlightMap/QGCVideoBackground.qml">src/FlightMap/QGCVideoBackground.qml</file>
<file alias="QGroundControl/FlightMap/qmldir">src/FlightMap/qmldir</file>
<file alias="QGroundControl/FlightMap/CameraWidget.qml">src/FlightMap/Widgets/CameraWidget.qml</file>
<file alias="QGroundControl/FlightMap/ValuesWidget.qml">src/FlightMap/Widgets/ValuesWidget.qml</file>
<file alias="QGroundControl/FlightMap/VehicleHealthWidget.qml">src/FlightMap/Widgets/VehicleHealthWidget.qml</file>
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
...
...
src/FlightMap/Widgets/CameraWidget.qml
0 → 100644
View file @
21923ab9
/****************************************************************************
*
* (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.4
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
/// Camera controls used in InstrumentSwipeView
QGCFlickable
{
id
:
_root
height
:
Math
.
min
(
maxHeight
,
column
.
height
)
contentHeight
:
column
.
height
flickableDirection
:
Flickable
.
VerticalFlick
clip
:
true
property
var
qgcView
property
color
textColor
property
var
maxHeight
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
MouseArea
{
anchors.fill
:
parent
onClicked
:
showNextPage
()
}
Column
{
id
:
column
width
:
parent
.
width
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCLabel
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
color
:
textColor
text
:
qsTr
(
"
Camera Controls
"
)
}
QGCButton
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
qsTr
(
"
Trigger Camera
"
)
onClicked
:
_activeVehicle
.
triggerCamera
()
enabled
:
_activeVehicle
}
}
}
src/FlightMap/Widgets/InstrumentSwipeView.qml
View file @
21923ab9
import
QtQuick
2.5
import
QtQuick
.
Controls
1.4
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Layouts
1.3
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
FlightMap
1.0
Item
{
id
:
_root
clip
:
true
height
:
valuesPage
.
height
+
pageIndicatorRow
.
anchors
.
topMargin
+
pageIndicatorRow
.
height
id
:
_root
clip
:
true
height
:
column
.
height
property
var
qgcView
///< QGCView to use for showing dialogs
property
var
qgcView
///< QGCView to use for showing dialogs
property
color
textColor
property
color
backgroundColor
property
var
maxHeight
///< Maximum height that should be taken, smaller than this is ok
property
var
maxHeight
///< Maximum height that should be taken, smaller than this is ok
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_pageWidth
:
_root
.
width
property
int
_currentPage
:
0
property
int
_maxPage
:
2
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_pageWidth
:
_root
.
width
property
int
_currentPage
:
0
property
int
_maxPage
:
3
onWidthChanged
:
showPage
(
_currentPage
)
function
showPicker
()
{
valuesPage
.
showPicker
()
}
function
showPage
(
pageIndex
)
{
_root
.
height
=
Qt
.
binding
(
function
()
{
return
_root
.
children
[
pageIndex
].
height
+
pageIndicatorRow
.
anchors
.
topMargin
+
pageIndicatorRow
.
height
}
)
_root
.
children
[
0
].
x
=
-
(
pageIndex
*
_pageWidth
)
}
ValuesWidget
{
id
:
valuesPage
width
:
_pageWidth
qgcView
:
_root
.
qgcView
textColor
:
_root
.
textColor
maxHeight
:
_root
.
maxHeight
}
VehicleHealthWidget
{
id
:
healthPage
anchors.left
:
valuesPage
.
right
width
:
_pageWidth
qgcView
:
_root
.
qgcView
textColor
:
_root
.
textColor
maxHeight
:
_root
.
maxHeight
pageRow
.
x
=
-
(
pageIndex
*
_pageWidth
)
}
VibrationWidget
{
id
:
vibrationPage
anchors.left
:
healthPage
.
right
width
:
_pageWidth
textColor
:
_root
.
textColor
backgroundColor
:
_root
.
backgroundColor
maxHeight
:
_root
.
maxHeight
}
Row
{
id
:
pageIndicatorRow
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
_margins
Repeater
{
model
:
_maxPage
+
1
Rectangle
{
height
:
radius
*
2
width
:
radius
*
2
radius
:
ScreenTools
.
defaultFontPixelWidth
/
3
border.color
:
textColor
border.width
:
1
color
:
_currentPage
==
index
?
textColor
:
"
transparent
"
}
function
showNextPage
()
{
if
(
_currentPage
==
_maxPage
)
{
_currentPage
=
0
}
else
{
_currentPage
++
}
showPage
(
_currentPage
)
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
_currentPage
==
_maxPage
)
{
_currentPage
=
0
}
else
{
_currentPage
++
}
showPage
(
_currentPage
)
}
anchors.fill
:
parent
onClicked
:
showNextPage
()
}
/*
Switching from swipe to click to change pages. Keeping swipe code for now in case of change back.
MouseArea {
anchors.
fill: paren
t
Column
{
id
:
column
anchors.left
:
parent
.
left
anchors.
right
:
parent
.
righ
t
property real xDragStart
property real xFirstPageSave
Row
{
id
:
pageRow
onPressed: {
if (mouse.button == Qt.LeftButton) {
mouse.accepted = true
xDragStart = mouse.x
xFirstPageSave = _root.children[0].x
ValuesWidget
{
id
:
valuesPage
width
:
_pageWidth
qgcView
:
_root
.
qgcView
textColor
:
_root
.
textColor
maxHeight
:
_root
.
maxHeight
}
CameraWidget
{
width
:
_pageWidth
qgcView
:
_root
.
qgcView
textColor
:
_root
.
textColor
maxHeight
:
_root
.
maxHeight
}
VehicleHealthWidget
{
width
:
_pageWidth
qgcView
:
_root
.
qgcView
textColor
:
_root
.
textColor
maxHeight
:
_root
.
maxHeight
}
VibrationWidget
{
width
:
_pageWidth
textColor
:
_root
.
textColor
backgroundColor
:
_root
.
backgroundColor
maxHeight
:
_root
.
maxHeight
}
}
onPositionChanged: {
_root.children[0].x = xFirstPageSave + mouse.x - xDragStart
}
onReleased: {
if (mouse.x < xDragStart) {
// Swipe left
_currentPage = Math.min(_currentPage + 1, _maxPage)
} else {
// Swipe right
_currentPage = Math.max(_currentPage - 1, 0)
Row
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
_margins
Repeater
{
model
:
_maxPage
+
1
Rectangle
{
height
:
radius
*
2
width
:
radius
*
2
radius
:
ScreenTools
.
defaultFontPixelWidth
/
3
border.color
:
textColor
border.width
:
1
color
:
_currentPage
==
index
?
textColor
:
"
transparent
"
}
}
showPage(_currentPage)
}
}
*/
}
src/FlightMap/Widgets/ValuesWidget.qml
View file @
21923ab9
...
...
@@ -54,7 +54,7 @@ QGCFlickable {
MouseArea
{
anchors.fill
:
parent
onClicked
:
show
Picker
()
onClicked
:
show
NextPage
()
}
Column
{
...
...
src/FlightMap/Widgets/VehicleHealthWidget.qml
View file @
21923ab9
...
...
@@ -34,6 +34,11 @@ QGCFlickable {
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
showNextPage
()
}
Column
{
id
:
healthColumn
width
:
parent
.
width
...
...
src/FlightMap/Widgets/VibrationWidget.qml
View file @
21923ab9
...
...
@@ -39,6 +39,11 @@ QGCFlickable {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
showNextPage
()
}
Item
{
id
:
innerItem
width
:
parent
.
width
...
...
src/FlightMap/qmldir
View file @
21923ab9
...
...
@@ -5,20 +5,21 @@ FlightMap 1.0 FlightMap.qml
QGCVideoBackground 1.0 QGCVideoBackground.qml
# Widgets
CenterMapDropButton 1.0 CenterMapDropButton.qml
CenterMapDropPanel 1.0 CenterMapDropPanel.qml
InstrumentSwipeView 1.0 InstrumentSwipeView.qml
MapFitFunctions 1.0 MapFitFunctions.qml
MapScale 1.0 MapScale.qml
QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCCompassWidget 1.0 QGCCompassWidget.qml
QGCPitchIndicator 1.0 QGCPitchIndicator.qml
QGCSlider 1.0 QGCSlider.qml
ValuesWidget 1.0 ValuesWidget.qml
VehicleHealthWidget 1.0 VehicleHealthWidget.qml
VibrationWidget 1.0 VibrationWidget.qml
CameraWidget 1.0 CameraWidget.qml
CenterMapDropButton 1.0 CenterMapDropButton.qml
CenterMapDropPanel 1.0 CenterMapDropPanel.qml
InstrumentSwipeView 1.0 InstrumentSwipeView.qml
MapFitFunctions 1.0 MapFitFunctions.qml
MapScale 1.0 MapScale.qml
QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCCompassWidget 1.0 QGCCompassWidget.qml
QGCPitchIndicator 1.0 QGCPitchIndicator.qml
QGCSlider 1.0 QGCSlider.qml
ValuesWidget 1.0 ValuesWidget.qml
VehicleHealthWidget 1.0 VehicleHealthWidget.qml
VibrationWidget 1.0 VibrationWidget.qml
# Map items
MissionItemIndicator 1.0 MissionItemIndicator.qml
...
...
src/Vehicle/Vehicle.cc
View file @
21923ab9
...
...
@@ -2241,6 +2241,15 @@ void Vehicle::setOfflineEditingDefaultComponentId(int defaultComponentId)
}
}
void
Vehicle
::
triggerCamera
(
void
)
{
sendMavCommand
(
FactSystem
::
defaultComponentId
,
MAV_CMD_DO_DIGICAM_CONTROL
,
true
,
// show errors
0.0
,
0.0
,
0.0
,
0.0
,
// param 1-4 unused
1.0
);
// trigger camera
}
const
char
*
VehicleGPSFactGroup
::
_hdopFactName
=
"hdop"
;
const
char
*
VehicleGPSFactGroup
::
_vdopFactName
=
"vdop"
;
const
char
*
VehicleGPSFactGroup
::
_courseOverGroundFactName
=
"courseOverGround"
;
...
...
src/Vehicle/Vehicle.h
View file @
21923ab9
...
...
@@ -409,6 +409,8 @@ public:
/// Clear Messages
Q_INVOKABLE
void
clearMessages
();
Q_INVOKABLE
void
triggerCamera
(
void
);
#if 0
// Temporarily removed, waiting for new command implementation
/// Test motor
...
...
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