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
1da34402
Commit
1da34402
authored
Feb 02, 2018
by
acfloria
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add highLatency property to LinkConfiguration
parent
7aa4b6a7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
84 additions
and
1 deletion
+84
-1
LinkConfiguration.cc
src/comm/LinkConfiguration.cc
+3
-0
LinkConfiguration.h
src/comm/LinkConfiguration.h
+23
-0
LinkInterface.cc
src/comm/LinkInterface.cc
+1
-1
SerialLink.h
src/comm/SerialLink.h
+1
-0
TCPLink.h
src/comm/TCPLink.h
+1
-0
UDPLink.h
src/comm/UDPLink.h
+1
-0
SerialSettings.qml
src/ui/preferences/SerialSettings.qml
+18
-0
TcpSettings.qml
src/ui/preferences/TcpSettings.qml
+18
-0
UdpSettings.qml
src/ui/preferences/UdpSettings.qml
+18
-0
No files found.
src/comm/LinkConfiguration.cc
View file @
1da34402
...
...
@@ -37,6 +37,7 @@ LinkConfiguration::LinkConfiguration(const QString& name)
,
_name
(
name
)
,
_dynamic
(
false
)
,
_autoConnect
(
false
)
,
_highLatency
(
false
)
{
_name
=
name
;
if
(
_name
.
isEmpty
())
{
...
...
@@ -50,6 +51,7 @@ LinkConfiguration::LinkConfiguration(LinkConfiguration* copy)
_name
=
copy
->
name
();
_dynamic
=
copy
->
isDynamic
();
_autoConnect
=
copy
->
isAutoConnect
();
_highLatency
=
copy
->
isHighLatency
();
Q_ASSERT
(
!
_name
.
isEmpty
());
}
...
...
@@ -60,6 +62,7 @@ void LinkConfiguration::copyFrom(LinkConfiguration* source)
_name
=
source
->
name
();
_dynamic
=
source
->
isDynamic
();
_autoConnect
=
source
->
isAutoConnect
();
_highLatency
=
source
->
isHighLatency
();
}
/*!
...
...
src/comm/LinkConfiguration.h
View file @
1da34402
...
...
@@ -33,6 +33,8 @@ public:
Q_PROPERTY
(
bool
autoConnect
READ
isAutoConnect
WRITE
setAutoConnect
NOTIFY
autoConnectChanged
)
Q_PROPERTY
(
bool
autoConnectAllowed
READ
isAutoConnectAllowed
CONSTANT
)
Q_PROPERTY
(
QString
settingsURL
READ
settingsURL
CONSTANT
)
Q_PROPERTY
(
bool
highLatency
READ
isHighLatency
WRITE
setHighLatency
NOTIFY
highLatencyChanged
)
Q_PROPERTY
(
bool
highLatencyAllowed
READ
isHighLatencyAllowed
CONSTANT
)
// Property accessors
...
...
@@ -76,6 +78,13 @@ public:
*/
bool
isAutoConnect
()
{
return
_autoConnect
;
}
/*!
*
* Is this a High Latency configuration?
* @return True if this is an High Latency configuration (link with large delays).
*/
bool
isHighLatency
()
{
return
_highLatency
;
}
/*!
* Set if this is this a dynamic configuration. (decided at runtime)
*/
...
...
@@ -86,6 +95,11 @@ public:
*/
void
setAutoConnect
(
bool
autoc
=
true
)
{
_autoConnect
=
autoc
;
emit
autoConnectChanged
();
}
/*!
* Set if this is this an High Latency configuration.
*/
void
setHighLatency
(
bool
hl
=
false
)
{
_highLatency
=
hl
;
emit
highLatencyChanged
();
}
/// Virtual Methods
/*!
...
...
@@ -95,6 +109,13 @@ public:
*/
virtual
bool
isAutoConnectAllowed
()
{
return
false
;
}
/*!
*
* Is High Latency allowed for this type?
* @return True if this type can be set as an High Latency configuration
*/
virtual
bool
isHighLatencyAllowed
()
{
return
false
;
}
/*!
* @brief Connection type
*
...
...
@@ -174,6 +195,7 @@ signals:
void
dynamicChanged
();
void
autoConnectChanged
();
void
linkChanged
(
LinkInterface
*
link
);
void
highLatencyChanged
();
protected:
LinkInterface
*
_link
;
///< Link currently using this configuration (if any)
...
...
@@ -181,6 +203,7 @@ private:
QString
_name
;
bool
_dynamic
;
///< A connection added automatically and not persistent (unless it's edited).
bool
_autoConnect
;
///< This connection is started automatically at boot
bool
_highLatency
;
};
typedef
QSharedPointer
<
LinkConfiguration
>
SharedLinkConfigurationPointer
;
...
...
src/comm/LinkInterface.cc
View file @
1da34402
...
...
@@ -23,7 +23,7 @@ uint8_t LinkInterface::mavlinkChannel(void) const
LinkInterface
::
LinkInterface
(
SharedLinkConfigurationPointer
&
config
)
:
QThread
(
0
)
,
_config
(
config
)
,
_highLatency
(
false
)
,
_highLatency
(
config
->
isHighLatency
()
)
,
_mavlinkChannelSet
(
false
)
,
_active
(
false
)
,
_enableRateCollection
(
false
)
...
...
src/comm/SerialLink.h
View file @
1da34402
...
...
@@ -86,6 +86,7 @@ public:
/// From LinkConfiguration
LinkType
type
()
{
return
LinkConfiguration
::
TypeSerial
;
}
void
copyFrom
(
LinkConfiguration
*
source
);
bool
isHighLatencyAllowed
()
{
return
true
;
}
void
loadSettings
(
QSettings
&
settings
,
const
QString
&
root
);
void
saveSettings
(
QSettings
&
settings
,
const
QString
&
root
);
void
updateSettings
();
...
...
src/comm/TCPLink.h
View file @
1da34402
...
...
@@ -97,6 +97,7 @@ public:
/// From LinkConfiguration
LinkType
type
()
{
return
LinkConfiguration
::
TypeTcp
;
}
void
copyFrom
(
LinkConfiguration
*
source
);
bool
isHighLatencyAllowed
()
{
return
true
;
}
void
loadSettings
(
QSettings
&
settings
,
const
QString
&
root
);
void
saveSettings
(
QSettings
&
settings
,
const
QString
&
root
);
void
updateSettings
();
...
...
src/comm/UDPLink.h
View file @
1da34402
...
...
@@ -134,6 +134,7 @@ public:
void
saveSettings
(
QSettings
&
settings
,
const
QString
&
root
);
void
updateSettings
();
bool
isAutoConnectAllowed
()
{
return
true
;
}
bool
isHighLatencyAllowed
()
{
return
true
;
}
QString
settingsURL
()
{
return
"UdpSettings.qml"
;
}
signals:
...
...
src/ui/preferences/SerialSettings.qml
View file @
1da34402
...
...
@@ -43,6 +43,24 @@ Item {
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
QGCCheckBox
{
text
:
"
High Latency
"
checked
:
false
visible
:
editConfig
?
editConfig
.
highLatencyAllowed
:
false
onCheckedChanged
:
{
if
(
editConfig
)
{
editConfig
.
highLatency
=
checked
}
}
Component
.
onCompleted
:
{
if
(
editConfig
)
checked
=
editConfig
.
highLatency
}
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
...
...
src/ui/preferences/TcpSettings.qml
View file @
1da34402
...
...
@@ -46,6 +46,24 @@ Item {
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
QGCCheckBox
{
text
:
"
High Latency
"
checked
:
false
visible
:
editConfig
?
editConfig
.
highLatencyAllowed
:
false
onCheckedChanged
:
{
if
(
editConfig
)
{
editConfig
.
highLatency
=
checked
}
}
Component
.
onCompleted
:
{
if
(
editConfig
)
checked
=
editConfig
.
highLatency
}
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
...
...
src/ui/preferences/UdpSettings.qml
View file @
1da34402
...
...
@@ -52,6 +52,24 @@ Item {
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
QGCCheckBox
{
text
:
"
High Latency
"
checked
:
false
visible
:
editConfig
?
editConfig
.
highLatencyAllowed
:
false
onCheckedChanged
:
{
if
(
editConfig
)
{
editConfig
.
highLatency
=
checked
}
}
Component
.
onCompleted
:
{
if
(
editConfig
)
checked
=
editConfig
.
highLatency
}
}
Item
{
height
:
ScreenTools
.
defaultFontPixelHeight
/
2
width
:
parent
.
width
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
...
...
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