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
45cc573d
Commit
45cc573d
authored
Feb 28, 2017
by
Gus Grubba
Committed by
Lorenz Meier
Feb 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add grid lines to video view
parent
21923ab9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
1 deletion
+69
-1
FlightDisplayViewVideo.qml
src/FlightDisplay/FlightDisplayViewVideo.qml
+31
-1
Video.SettingsGroup.json
src/Settings/Video.SettingsGroup.json
+9
-0
VideoSettings.cc
src/Settings/VideoSettings.cc
+11
-0
VideoSettings.h
src/Settings/VideoSettings.h
+4
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+14
-0
No files found.
src/FlightDisplay/FlightDisplayViewVideo.qml
View file @
45cc573d
...
...
@@ -23,7 +23,9 @@ import QGroundControl.Controllers 1.0
Item
{
id
:
root
property
double
_ar
:
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
.
rawValue
property
double
_ar
:
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
.
rawValue
property
bool
_showGrid
:
QGroundControl
.
settingsManager
.
videoSettings
.
gridLines
.
rawValue
>
0
Rectangle
{
id
:
noVideo
anchors.fill
:
parent
...
...
@@ -50,4 +52,32 @@ Item {
visible
:
QGroundControl
.
videoManager
.
videoRunning
}
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
height
:
parent
.
height
width
:
1
x
:
parent
.
width
*
0.33
visible
:
_showGrid
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
height
:
parent
.
height
width
:
1
x
:
parent
.
width
*
0.66
visible
:
_showGrid
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
width
:
parent
.
width
height
:
1
y
:
parent
.
height
*
0.33
visible
:
_showGrid
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
width
:
parent
.
width
height
:
1
y
:
parent
.
height
*
0.66
visible
:
_showGrid
}
}
src/Settings/Video.SettingsGroup.json
View file @
45cc573d
...
...
@@ -35,5 +35,14 @@
"type"
:
"float"
,
"decimalPlaces"
:
6
,
"defaultValue"
:
1.777777
},
{
"name"
:
"VideoGridLines"
,
"shortDescription"
:
"Video Grid Lines"
,
"longDescription"
:
"Displays a grid overlayed over the video view."
,
"type"
:
"uint32"
,
"enumStrings"
:
"Hide,Show"
,
"enumValues"
:
"1,0"
,
"defaultValue"
:
0
}
]
src/Settings/VideoSettings.cc
View file @
45cc573d
...
...
@@ -24,6 +24,7 @@ const char* VideoSettings::udpPortName = "VideoUDPPort";
const
char
*
VideoSettings
::
rtspUrlName
=
"VideoRTSPUrl"
;
const
char
*
VideoSettings
::
videoSavePathName
=
"VideoSavePath"
;
const
char
*
VideoSettings
::
videoAspectRatioName
=
"VideoAspectRatio"
;
const
char
*
VideoSettings
::
videoGridLinesName
=
"VideoGridLines"
;
const
char
*
VideoSettings
::
videoSourceNoVideo
=
"No Video Available"
;
const
char
*
VideoSettings
::
videoSourceUDP
=
"UDP Video Stream"
;
...
...
@@ -36,6 +37,7 @@ VideoSettings::VideoSettings(QObject* parent)
,
_rtspUrlFact
(
NULL
)
,
_videoSavePathFact
(
NULL
)
,
_videoAspectRatioFact
(
NULL
)
,
_gridLinesFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
VideoSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"VideoSettings"
,
"Reference only"
);
...
...
@@ -115,3 +117,12 @@ Fact* VideoSettings::aspectRatio(void)
return
_videoAspectRatioFact
;
}
Fact
*
VideoSettings
::
gridLines
(
void
)
{
if
(
!
_gridLinesFact
)
{
_gridLinesFact
=
_createSettingsFact
(
videoGridLinesName
);
}
return
_gridLinesFact
;
}
src/Settings/VideoSettings.h
View file @
45cc573d
...
...
@@ -24,12 +24,14 @@ public:
Q_PROPERTY
(
Fact
*
rtspUrl
READ
rtspUrl
CONSTANT
)
Q_PROPERTY
(
Fact
*
videoSavePath
READ
videoSavePath
CONSTANT
)
Q_PROPERTY
(
Fact
*
aspectRatio
READ
aspectRatio
CONSTANT
)
Q_PROPERTY
(
Fact
*
gridLines
READ
gridLines
CONSTANT
)
Fact
*
videoSource
(
void
);
Fact
*
udpPort
(
void
);
Fact
*
rtspUrl
(
void
);
Fact
*
videoSavePath
(
void
);
Fact
*
aspectRatio
(
void
);
Fact
*
gridLines
(
void
);
static
const
char
*
videoSettingsGroupName
;
...
...
@@ -38,6 +40,7 @@ public:
static
const
char
*
rtspUrlName
;
static
const
char
*
videoSavePathName
;
static
const
char
*
videoAspectRatioName
;
static
const
char
*
videoGridLinesName
;
static
const
char
*
videoSourceNoVideo
;
static
const
char
*
videoSourceUDP
;
...
...
@@ -49,6 +52,7 @@ private:
SettingsFact
*
_rtspUrlFact
;
SettingsFact
*
_videoSavePathFact
;
SettingsFact
*
_videoAspectRatioFact
;
SettingsFact
*
_gridLinesFact
;
};
#endif
src/ui/preferences/GeneralSettings.qml
View file @
45cc573d
...
...
@@ -512,6 +512,20 @@ QGCView {
fact
:
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
<
2
&&
QGroundControl
.
settingsManager
.
videoSettings
.
gridLines
.
visible
QGCLabel
{
anchors.baseline
:
gridField
.
baseline
text
:
qsTr
(
"
Grid Lines:
"
)
width
:
_labelWidth
}
FactComboBox
{
id
:
gridField
width
:
_editFieldWidth
fact
:
QGroundControl
.
settingsManager
.
videoSettings
.
gridLines
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
videoSavePath
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
QGroundControl
.
videoManager
.
recordingEnabled
...
...
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