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
90393e32
Commit
90393e32
authored
Apr 11, 2017
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configurable survey in
parent
09bde0c7
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
178 additions
and
12 deletions
+178
-12
qgroundcontrol.pro
qgroundcontrol.pro
+2
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
Drivers
src/GPS/Drivers
+1
-1
GPSManager.cc
src/GPS/GPSManager.cc
+6
-1
GPSProvider.cc
src/GPS/GPSProvider.cc
+14
-9
GPSProvider.h
src/GPS/GPSProvider.h
+3
-1
RTK.SettingsGroup.json
src/Settings/RTK.SettingsGroup.json
+22
-0
RTKSettings.cc
src/Settings/RTKSettings.cc
+44
-0
RTKSettings.h
src/Settings/RTKSettings.h
+35
-0
SettingsManager.cc
src/Settings/SettingsManager.cc
+2
-0
SettingsManager.h
src/Settings/SettingsManager.h
+4
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+44
-0
No files found.
qgroundcontrol.pro
View file @
90393e32
...
@@ -504,6 +504,7 @@ HEADERS += \
...
@@ -504,6 +504,7 @@ HEADERS += \
src/Settings/AppSettings.h \
src/Settings/AppSettings.h \
src/Settings/AutoConnectSettings.h \
src/Settings/AutoConnectSettings.h \
src/Settings/FlightMapSettings.h \
src/Settings/FlightMapSettings.h \
src/Settings/RTKSettings.h \
src/Settings/SettingsGroup.h \
src/Settings/SettingsGroup.h \
src/Settings/SettingsManager.h \
src/Settings/SettingsManager.h \
src/Settings/UnitsSettings.h \
src/Settings/UnitsSettings.h \
...
@@ -682,6 +683,7 @@ SOURCES += \
...
@@ -682,6 +683,7 @@ SOURCES += \
src/Settings/AppSettings.cc \
src/Settings/AppSettings.cc \
src/Settings/AutoConnectSettings.cc \
src/Settings/AutoConnectSettings.cc \
src/Settings/FlightMapSettings.cc \
src/Settings/FlightMapSettings.cc \
src/Settings/RTKSettings.cc \
src/Settings/SettingsGroup.cc \
src/Settings/SettingsGroup.cc \
src/Settings/SettingsManager.cc \
src/Settings/SettingsManager.cc \
src/Settings/UnitsSettings.cc \
src/Settings/UnitsSettings.cc \
...
...
qgroundcontrol.qrc
View file @
90393e32
...
@@ -190,6 +190,7 @@
...
@@ -190,6 +190,7 @@
<file alias="App.SettingsGroup.json">src/Settings/App.SettingsGroup.json</file>
<file alias="App.SettingsGroup.json">src/Settings/App.SettingsGroup.json</file>
<file alias="AutoConnect.SettingsGroup.json">src/Settings/AutoConnect.SettingsGroup.json</file>
<file alias="AutoConnect.SettingsGroup.json">src/Settings/AutoConnect.SettingsGroup.json</file>
<file alias="FlightMap.SettingsGroup.json">src/Settings/FlightMap.SettingsGroup.json</file>
<file alias="FlightMap.SettingsGroup.json">src/Settings/FlightMap.SettingsGroup.json</file>
<file alias="RTK.SettingsGroup.json">src/Settings/RTK.SettingsGroup.json</file>
<file alias="Survey.SettingsGroup.json">src/MissionManager/Survey.SettingsGroup.json</file>
<file alias="Survey.SettingsGroup.json">src/MissionManager/Survey.SettingsGroup.json</file>
<file alias="Units.SettingsGroup.json">src/Settings/Units.SettingsGroup.json</file>
<file alias="Units.SettingsGroup.json">src/Settings/Units.SettingsGroup.json</file>
<file alias="Video.SettingsGroup.json">src/Settings/Video.SettingsGroup.json</file>
<file alias="Video.SettingsGroup.json">src/Settings/Video.SettingsGroup.json</file>
...
...
Drivers
@
381061af
Subproject commit 3
cac6a5bc5826d7ac495827a46b63f476d82ba86
Subproject commit 3
81061af5aa2ab7a2b1fcf243d01fcd721caebae
src/GPS/GPSManager.cc
View file @
90393e32
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
#include "GPSManager.h"
#include "GPSManager.h"
#include "QGCLoggingCategory.h"
#include "QGCLoggingCategory.h"
#include "QGCApplication.h"
#include "SettingsManager.h"
#include "RTKSettings.h"
GPSManager
::
GPSManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
GPSManager
::
GPSManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
:
QGCTool
(
app
,
toolbox
)
...
@@ -27,9 +30,11 @@ void GPSManager::connectGPS(const QString& device)
...
@@ -27,9 +30,11 @@ void GPSManager::connectGPS(const QString& device)
{
{
Q_ASSERT
(
_toolbox
);
Q_ASSERT
(
_toolbox
);
RTKSettings
*
rtkSettings
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
rtkSettings
();
cleanup
();
cleanup
();
_requestGpsStop
=
false
;
_requestGpsStop
=
false
;
_gpsProvider
=
new
GPSProvider
(
device
,
true
,
_requestGpsStop
);
_gpsProvider
=
new
GPSProvider
(
device
,
true
,
rtkSettings
->
surveyInAccuracyLimit
()
->
rawValue
().
toDouble
(),
rtkSettings
->
surveyInMinObservationDuration
()
->
rawValue
().
toInt
(),
_requestGpsStop
);
_gpsProvider
->
start
();
_gpsProvider
->
start
();
//create RTCM device
//create RTCM device
...
...
src/GPS/GPSProvider.cc
View file @
90393e32
...
@@ -53,18 +53,19 @@ void GPSProvider::run()
...
@@ -53,18 +53,19 @@ void GPSProvider::run()
_serial
->
setFlowControl
(
QSerialPort
::
NoFlowControl
);
_serial
->
setFlowControl
(
QSerialPort
::
NoFlowControl
);
unsigned
int
baudrate
;
unsigned
int
baudrate
;
GPS
Helper
*
gpsHelp
er
=
nullptr
;
GPS
DriverUBX
*
gpsDriv
er
=
nullptr
;
while
(
!
_requestStop
)
{
while
(
!
_requestStop
)
{
if
(
gps
Help
er
)
{
if
(
gps
Driv
er
)
{
delete
gps
Help
er
;
delete
gps
Driv
er
;
gps
Help
er
=
nullptr
;
gps
Driv
er
=
nullptr
;
}
}
gpsHelper
=
new
GPSDriverUBX
(
&
callbackEntry
,
this
,
&
_reportGpsPos
,
_pReportSatInfo
);
gpsDriver
=
new
GPSDriverUBX
(
GPSDriverUBX
::
Interface
::
UART
,
&
callbackEntry
,
this
,
&
_reportGpsPos
,
_pReportSatInfo
);
gpsDriver
->
setSurveyInSpecs
(
_surveyInAccMeters
*
10000
,
_surveryInDurationSecs
);
if
(
gps
Helper
->
configure
(
baudrate
,
GPSHelper
::
OutputMode
::
RTCM
)
==
0
)
{
if
(
gps
Driver
->
configure
(
baudrate
,
GPSDriverUBX
::
OutputMode
::
RTCM
)
==
0
)
{
/* reset report */
/* reset report */
memset
(
&
_reportGpsPos
,
0
,
sizeof
(
_reportGpsPos
));
memset
(
&
_reportGpsPos
,
0
,
sizeof
(
_reportGpsPos
));
...
@@ -74,7 +75,7 @@ void GPSProvider::run()
...
@@ -74,7 +75,7 @@ void GPSProvider::run()
int
numTries
=
0
;
int
numTries
=
0
;
while
(
!
_requestStop
&&
numTries
<
3
)
{
while
(
!
_requestStop
&&
numTries
<
3
)
{
int
helperRet
=
gps
Help
er
->
receive
(
GPS_RECEIVE_TIMEOUT
);
int
helperRet
=
gps
Driv
er
->
receive
(
GPS_RECEIVE_TIMEOUT
);
if
(
helperRet
>
0
)
{
if
(
helperRet
>
0
)
{
numTries
=
0
;
numTries
=
0
;
...
@@ -100,9 +101,13 @@ void GPSProvider::run()
...
@@ -100,9 +101,13 @@ void GPSProvider::run()
qCDebug
(
RTKGPSLog
)
<<
"Exiting GPS thread"
;
qCDebug
(
RTKGPSLog
)
<<
"Exiting GPS thread"
;
}
}
GPSProvider
::
GPSProvider
(
const
QString
&
device
,
bool
enableSatInfo
,
const
std
::
atomic_bool
&
requestStop
)
GPSProvider
::
GPSProvider
(
const
QString
&
device
,
bool
enableSatInfo
,
double
surveyInAccMeters
,
int
surveryInDurationSecs
,
const
std
::
atomic_bool
&
requestStop
)
:
_device
(
device
),
_requestStop
(
requestStop
)
:
_device
(
device
)
,
_requestStop
(
requestStop
)
,
_surveyInAccMeters
(
surveyInAccMeters
)
,
_surveryInDurationSecs
(
surveryInDurationSecs
)
{
{
qCDebug
(
RTKGPSLog
)
<<
"Survey in accuracy:duration"
<<
surveyInAccMeters
<<
surveryInDurationSecs
;
if
(
enableSatInfo
)
_pReportSatInfo
=
new
satellite_info_s
();
if
(
enableSatInfo
)
_pReportSatInfo
=
new
satellite_info_s
();
}
}
...
...
src/GPS/GPSProvider.h
View file @
90393e32
...
@@ -29,7 +29,7 @@ class GPSProvider : public QThread
...
@@ -29,7 +29,7 @@ class GPSProvider : public QThread
{
{
Q_OBJECT
Q_OBJECT
public:
public:
GPSProvider
(
const
QString
&
device
,
bool
enableSatInfo
,
const
std
::
atomic_bool
&
requestStop
);
GPSProvider
(
const
QString
&
device
,
bool
enableSatInfo
,
double
surveyInAccMeters
,
int
surveryInDurationSecs
,
const
std
::
atomic_bool
&
requestStop
);
~
GPSProvider
();
~
GPSProvider
();
/**
/**
...
@@ -57,6 +57,8 @@ private:
...
@@ -57,6 +57,8 @@ private:
QString
_device
;
QString
_device
;
const
std
::
atomic_bool
&
_requestStop
;
const
std
::
atomic_bool
&
_requestStop
;
double
_surveyInAccMeters
;
int
_surveryInDurationSecs
;
struct
vehicle_gps_position_s
_reportGpsPos
;
struct
vehicle_gps_position_s
_reportGpsPos
;
struct
satellite_info_s
*
_pReportSatInfo
=
nullptr
;
struct
satellite_info_s
*
_pReportSatInfo
=
nullptr
;
...
...
src/Settings/RTK.SettingsGroup.json
0 → 100644
View file @
90393e32
[
{
"name"
:
"SurveyInAccuracyLimit"
,
"shortDescription"
:
"Survey in accuracy limit"
,
"longDescription"
:
"The maximum accuracy allowed prior to completing survey in."
,
"type"
:
"double"
,
"defaultValue"
:
2.0
,
"min"
:
0.5
,
"units"
:
"m"
,
"decimalPlaces"
:
1
},
{
"name"
:
"SurveyInMinObservationDuration"
,
"shortDescription"
:
"Minimum observation time"
,
"longDescription"
:
"Defines the minimum amount of observation time for the position calculation."
,
"type"
:
"Uint32"
,
"defaultValue"
:
180
,
"min"
:
1
,
"units"
:
"secs"
,
"decimalPlaces"
:
0
}
]
src/Settings/RTKSettings.cc
0 → 100644
View file @
90393e32
/****************************************************************************
*
* (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.
*
****************************************************************************/
#include "RTKSettings.h"
#include <QQmlEngine>
#include <QtQml>
const
char
*
RTKSettings
::
RTKSettingsGroupName
=
"RTK"
;
const
char
*
RTKSettings
::
surveyInAccuracyLimitName
=
"SurveyInAccuracyLimit"
;
const
char
*
RTKSettings
::
surveyInMinObservationDurationName
=
"SurveyInMinObservationDuration"
;
RTKSettings
::
RTKSettings
(
QObject
*
parent
)
:
SettingsGroup
(
RTKSettingsGroupName
,
QString
(
RTKSettingsGroupName
),
parent
)
,
_surveyInAccuracyLimitFact
(
NULL
)
,
_surveyInMinObservationDurationFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
RTKSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"RTKSettings"
,
"Reference only"
);
}
Fact
*
RTKSettings
::
surveyInAccuracyLimit
(
void
)
{
if
(
!
_surveyInAccuracyLimitFact
)
{
_surveyInAccuracyLimitFact
=
_createSettingsFact
(
surveyInAccuracyLimitName
);
}
return
_surveyInAccuracyLimitFact
;
}
Fact
*
RTKSettings
::
surveyInMinObservationDuration
(
void
)
{
if
(
!
_surveyInMinObservationDurationFact
)
{
_surveyInMinObservationDurationFact
=
_createSettingsFact
(
surveyInMinObservationDurationName
);
}
return
_surveyInMinObservationDurationFact
;
}
src/Settings/RTKSettings.h
0 → 100644
View file @
90393e32
/****************************************************************************
*
* (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.
*
****************************************************************************/
#pragma once
#include "SettingsGroup.h"
class
RTKSettings
:
public
SettingsGroup
{
Q_OBJECT
public:
RTKSettings
(
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
Fact
*
surveyInAccuracyLimit
READ
surveyInAccuracyLimit
CONSTANT
)
Q_PROPERTY
(
Fact
*
surveyInMinObservationDuration
READ
surveyInMinObservationDuration
CONSTANT
)
Fact
*
surveyInAccuracyLimit
(
void
);
Fact
*
surveyInMinObservationDuration
(
void
);
static
const
char
*
RTKSettingsGroupName
;
static
const
char
*
surveyInAccuracyLimitName
;
static
const
char
*
surveyInMinObservationDurationName
;
private:
SettingsFact
*
_surveyInAccuracyLimitFact
;
SettingsFact
*
_surveyInMinObservationDurationFact
;
};
src/Settings/SettingsManager.cc
View file @
90393e32
...
@@ -19,6 +19,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
...
@@ -19,6 +19,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
,
_autoConnectSettings
(
NULL
)
,
_autoConnectSettings
(
NULL
)
,
_videoSettings
(
NULL
)
,
_videoSettings
(
NULL
)
,
_flightMapSettings
(
NULL
)
,
_flightMapSettings
(
NULL
)
,
_rtkSettings
(
NULL
)
{
{
}
}
...
@@ -34,4 +35,5 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
...
@@ -34,4 +35,5 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
_autoConnectSettings
=
new
AutoConnectSettings
(
this
);
_autoConnectSettings
=
new
AutoConnectSettings
(
this
);
_videoSettings
=
new
VideoSettings
(
this
);
_videoSettings
=
new
VideoSettings
(
this
);
_flightMapSettings
=
new
FlightMapSettings
(
this
);
_flightMapSettings
=
new
FlightMapSettings
(
this
);
_rtkSettings
=
new
RTKSettings
(
this
);
}
}
src/Settings/SettingsManager.h
View file @
90393e32
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "AutoConnectSettings.h"
#include "AutoConnectSettings.h"
#include "VideoSettings.h"
#include "VideoSettings.h"
#include "FlightMapSettings.h"
#include "FlightMapSettings.h"
#include "RTKSettings.h"
#include <QVariantList>
#include <QVariantList>
...
@@ -35,6 +36,7 @@ public:
...
@@ -35,6 +36,7 @@ public:
Q_PROPERTY
(
QObject
*
autoConnectSettings
READ
autoConnectSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
autoConnectSettings
READ
autoConnectSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
videoSettings
READ
videoSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
videoSettings
READ
videoSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
flightMapSettings
READ
flightMapSettings
CONSTANT
)
Q_PROPERTY
(
QObject
*
rtkSettings
READ
rtkSettings
CONSTANT
)
// Override from QGCTool
// Override from QGCTool
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
...
@@ -44,6 +46,7 @@ public:
...
@@ -44,6 +46,7 @@ public:
AutoConnectSettings
*
autoConnectSettings
(
void
)
{
return
_autoConnectSettings
;
}
AutoConnectSettings
*
autoConnectSettings
(
void
)
{
return
_autoConnectSettings
;
}
VideoSettings
*
videoSettings
(
void
)
{
return
_videoSettings
;
}
VideoSettings
*
videoSettings
(
void
)
{
return
_videoSettings
;
}
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
FlightMapSettings
*
flightMapSettings
(
void
)
{
return
_flightMapSettings
;
}
RTKSettings
*
rtkSettings
(
void
)
{
return
_rtkSettings
;
}
private:
private:
AppSettings
*
_appSettings
;
AppSettings
*
_appSettings
;
...
@@ -51,6 +54,7 @@ private:
...
@@ -51,6 +54,7 @@ private:
AutoConnectSettings
*
_autoConnectSettings
;
AutoConnectSettings
*
_autoConnectSettings
;
VideoSettings
*
_videoSettings
;
VideoSettings
*
_videoSettings
;
FlightMapSettings
*
_flightMapSettings
;
FlightMapSettings
*
_flightMapSettings
;
RTKSettings
*
_rtkSettings
;
};
};
#endif
#endif
src/ui/preferences/GeneralSettings.qml
View file @
90393e32
...
@@ -389,6 +389,50 @@ QGCView {
...
@@ -389,6 +389,50 @@ QGCView {
}
}
}
}
//-----------------------------------------------------------------
//-- RTK GPS
Item
{
width
:
_qgcView
.
width
*
0.8
height
:
unitLabel
.
height
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
rtkSettings
.
visible
QGCLabel
{
id
:
rtkLabel
text
:
qsTr
(
"
RTK GPS (Requires Restart)
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
Rectangle
{
height
:
rtkGrid
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
width
:
_qgcView
.
width
*
0.8
color
:
qgcPal
.
windowShade
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.horizontalCenter
:
parent
.
horizontalCenter
visible
:
QGroundControl
.
settingsManager
.
rtkSettings
.
visible
GridLayout
{
id
:
rtkGrid
anchors.centerIn
:
parent
columns
:
2
rowSpacing
:
ScreenTools
.
defaultFontPixelWidth
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
Survey in accuracy:
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
rtkSettings
.
surveyInAccuracyLimit
}
QGCLabel
{
text
:
qsTr
(
"
Minumum observation duration:
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
rtkSettings
.
surveyInMinObservationDuration
}
}
}
//-----------------------------------------------------------------
//-----------------------------------------------------------------
//-- Autoconnect settings
//-- Autoconnect settings
Item
{
Item
{
...
...
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