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
f556caea
Commit
f556caea
authored
May 04, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Noise and RSSI are negative values.
parent
a2150165
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
+19
-18
Vehicle.cc
src/Vehicle/Vehicle.cc
+9
-4
Vehicle.h
src/Vehicle/Vehicle.h
+8
-8
TelemetryRSSIIndicator.qml
src/ui/toolbar/TelemetryRSSIIndicator.qml
+2
-6
No files found.
src/Vehicle/Vehicle.cc
View file @
f556caea
...
...
@@ -919,6 +919,8 @@ void Vehicle::_handleRadioStatus(mavlink_message_t& message)
mavlink_msg_radio_status_decode
(
&
message
,
&
rstatus
);
int
rssi
=
rstatus
.
rssi
;
int
remrssi
=
rstatus
.
remrssi
;
int
lnoise
=
(
int
)(
int8_t
)
rstatus
.
noise
;
int
rnoise
=
(
int
)(
int8_t
)
rstatus
.
remnoise
;
//-- 3DR Si1k radio needs rssi fields to be converted to dBm
if
(
message
.
sysid
==
'3'
&&
message
.
compid
==
'D'
)
{
/* Per the Si1K datasheet figure 23.25 and SI AN474 code
...
...
@@ -933,6 +935,9 @@ void Vehicle::_handleRadioStatus(mavlink_message_t& message)
*/
rssi
=
qMin
(
qMax
(
qRound
(
static_cast
<
qreal
>
(
rssi
)
/
1.9
-
127.0
),
-
120
),
0
);
remrssi
=
qMin
(
qMax
(
qRound
(
static_cast
<
qreal
>
(
remrssi
)
/
1.9
-
127.0
),
-
120
),
0
);
}
else
{
rssi
=
(
int
)(
int8_t
)
rstatus
.
rssi
;
remrssi
=
(
int
)(
int8_t
)
rstatus
.
remrssi
;
}
//-- Check for changes
if
(
_telemetryLRSSI
!=
rssi
)
{
...
...
@@ -955,12 +960,12 @@ void Vehicle::_handleRadioStatus(mavlink_message_t& message)
_telemetryTXBuffer
=
rstatus
.
txbuf
;
emit
telemetryTXBufferChanged
(
_telemetryTXBuffer
);
}
if
(
_telemetryLNoise
!=
rstatus
.
noise
)
{
_telemetryLNoise
=
rstatus
.
noise
;
if
(
_telemetryLNoise
!=
l
noise
)
{
_telemetryLNoise
=
l
noise
;
emit
telemetryLNoiseChanged
(
_telemetryLNoise
);
}
if
(
_telemetryRNoise
!=
r
status
.
rem
noise
)
{
_telemetryRNoise
=
r
status
.
rem
noise
;
if
(
_telemetryRNoise
!=
rnoise
)
{
_telemetryRNoise
=
rnoise
;
emit
telemetryRNoiseChanged
(
_telemetryRNoise
);
}
}
...
...
src/Vehicle/Vehicle.h
View file @
f556caea
...
...
@@ -307,8 +307,8 @@ public:
Q_PROPERTY
(
unsigned
int
telemetryRXErrors
READ
telemetryRXErrors
NOTIFY
telemetryRXErrorsChanged
)
Q_PROPERTY
(
unsigned
int
telemetryFixed
READ
telemetryFixed
NOTIFY
telemetryFixedChanged
)
Q_PROPERTY
(
unsigned
int
telemetryTXBuffer
READ
telemetryTXBuffer
NOTIFY
telemetryTXBufferChanged
)
Q_PROPERTY
(
unsigned
int
telemetryLNoise
READ
telemetryLNoise
NOTIFY
telemetryLNoiseChanged
)
Q_PROPERTY
(
unsigned
int
telemetryRNoise
READ
telemetryRNoise
NOTIFY
telemetryRNoiseChanged
)
Q_PROPERTY
(
int
telemetryLNoise
READ
telemetryLNoise
NOTIFY
telemetryLNoiseChanged
)
Q_PROPERTY
(
int
telemetryRNoise
READ
telemetryRNoise
NOTIFY
telemetryRNoiseChanged
)
Q_PROPERTY
(
QVariantList
toolBarIndicators
READ
toolBarIndicators
CONSTANT
)
Q_PROPERTY
(
QVariantList
cameraList
READ
cameraList
CONSTANT
)
...
...
@@ -587,8 +587,8 @@ public:
unsigned
int
telemetryRXErrors
()
{
return
_telemetryRXErrors
;
}
unsigned
int
telemetryFixed
()
{
return
_telemetryFixed
;
}
unsigned
int
telemetryTXBuffer
()
{
return
_telemetryTXBuffer
;
}
unsigned
int
telemetryLNoise
()
{
return
_telemetryLNoise
;
}
unsigned
int
telemetryRNoise
()
{
return
_telemetryRNoise
;
}
int
telemetryLNoise
()
{
return
_telemetryLNoise
;
}
int
telemetryRNoise
()
{
return
_telemetryRNoise
;
}
bool
autoDisarm
();
Fact
*
roll
(
void
)
{
return
&
_rollFact
;
}
...
...
@@ -717,8 +717,8 @@ signals:
void
telemetryRXErrorsChanged
(
unsigned
int
value
);
void
telemetryFixedChanged
(
unsigned
int
value
);
void
telemetryTXBufferChanged
(
unsigned
int
value
);
void
telemetryLNoiseChanged
(
unsigned
int
value
);
void
telemetryRNoiseChanged
(
unsigned
int
value
);
void
telemetryLNoiseChanged
(
int
value
);
void
telemetryRNoiseChanged
(
int
value
);
void
autoDisarmChanged
(
void
);
void
firmwareMajorVersionChanged
(
int
major
);
...
...
@@ -881,8 +881,8 @@ private:
uint32_t
_telemetryRXErrors
;
uint32_t
_telemetryFixed
;
uint32_t
_telemetryTXBuffer
;
uint32_t
_telemetryLNoise
;
uint32_t
_telemetryRNoise
;
int
_telemetryLNoise
;
int
_telemetryRNoise
;
bool
_vehicleCapabilitiesKnown
;
bool
_supportsMissionItemInt
;
...
...
src/ui/toolbar/TelemetryRSSIIndicator.qml
View file @
f556caea
...
...
@@ -26,11 +26,7 @@ Item {
width
:
_hasTelemetry
?
telemIcon
.
width
*
1.1
:
0
visible
:
_hasTelemetry
//-- SiK Radio: -120 to < 0
//-- Others: > 0 - 100
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_isSiKRadio
:
_activeVehicle
?
_activeVehicle
.
telemetryLRSSI
<
0
:
false
property
bool
_hasTelemetry
:
_activeVehicle
?
_activeVehicle
.
telemetryLRSSI
!==
0
:
false
Component
{
...
...
@@ -60,9 +56,9 @@ Item {
columns
:
2
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCLabel
{
text
:
qsTr
(
"
Local RSSI:
"
)
}
QGCLabel
{
text
:
_activeVehicle
.
telemetryLRSSI
+
_isSiKRadio
?
"
dBm
"
:
"
"
}
QGCLabel
{
text
:
_activeVehicle
.
telemetryLRSSI
+
"
dBm
"
}
QGCLabel
{
text
:
qsTr
(
"
Remote RSSI:
"
)
}
QGCLabel
{
text
:
_activeVehicle
.
telemetryRRSSI
+
_isSiKRadio
?
"
dBm
"
:
"
"
}
QGCLabel
{
text
:
_activeVehicle
.
telemetryRRSSI
+
"
dBm
"
}
QGCLabel
{
text
:
qsTr
(
"
RX Errors:
"
)
}
QGCLabel
{
text
:
_activeVehicle
.
telemetryRXErrors
}
QGCLabel
{
text
:
qsTr
(
"
Errors Fixed:
"
)
}
...
...
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