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
a781d693
Commit
a781d693
authored
Jan 01, 2020
by
Gus Grubba
Committed by
Lorenz Meier
Jan 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make field aware of which chart index it belongs to.
parent
0de02e58
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
10 deletions
+38
-10
qgroundcontrol.pro
qgroundcontrol.pro
+1
-1
MAVLinkInspectorController.cc
src/AnalyzeView/MAVLinkInspectorController.cc
+12
-2
MAVLinkInspectorController.h
src/AnalyzeView/MAVLinkInspectorController.h
+5
-1
MAVLinkInspectorPage.qml
src/AnalyzeView/MAVLinkInspectorPage.qml
+4
-4
MAVLinkChart.qml
src/QmlControls/MAVLinkChart.qml
+16
-2
No files found.
qgroundcontrol.pro
View file @
a781d693
...
...
@@ -263,6 +263,7 @@ QT += \
svg
\
widgets
\
xml
\
charts
\
texttospeech
#
Multimedia
only
used
if
QVC
is
enabled
...
...
@@ -277,7 +278,6 @@ AndroidBuild || iOSBuild {
QT += \
printsupport \
serialport \
charts \
}
contains(DEFINES, QGC_ENABLE_BLUETOOTH) {
...
...
src/AnalyzeView/MAVLinkInspectorController.cc
View file @
a781d693
...
...
@@ -76,6 +76,15 @@ QGCMAVLinkMessageField::setSelectable(bool sel)
}
}
//-----------------------------------------------------------------------------
int
QGCMAVLinkMessageField
::
chartIndex
()
{
if
(
_chart
)
return
_chart
->
chartIndex
();
return
0
;
}
//-----------------------------------------------------------------------------
void
QGCMAVLinkMessageField
::
updateValue
(
QString
newValue
,
qreal
v
)
...
...
@@ -494,8 +503,9 @@ QGCMAVLinkVehicle::_checkCompID(QGCMAVLinkMessage* message)
}
//-----------------------------------------------------------------------------
MAVLinkChartController
::
MAVLinkChartController
(
MAVLinkInspectorController
*
parent
)
MAVLinkChartController
::
MAVLinkChartController
(
MAVLinkInspectorController
*
parent
,
int
index
)
:
QObject
(
parent
)
,
_index
(
index
)
,
_controller
(
parent
)
{
connect
(
&
_updateSeriesTimer
,
&
QTimer
::
timeout
,
this
,
&
MAVLinkChartController
::
_refreshSeries
);
...
...
@@ -789,7 +799,7 @@ MAVLinkInspectorController::_receiveMessage(LinkInterface*, mavlink_message_t me
MAVLinkChartController
*
MAVLinkInspectorController
::
createChart
()
{
MAVLinkChartController
*
pChart
=
new
MAVLinkChartController
(
this
);
MAVLinkChartController
*
pChart
=
new
MAVLinkChartController
(
this
,
_charts
.
count
()
);
QQmlEngine
::
setObjectOwnership
(
pChart
,
QQmlEngine
::
CppOwnership
);
_charts
.
append
(
pChart
);
emit
chartsChanged
();
...
...
src/AnalyzeView/MAVLinkInspectorController.h
View file @
a781d693
...
...
@@ -35,6 +35,7 @@ public:
Q_PROPERTY
(
QString
type
READ
type
CONSTANT
)
Q_PROPERTY
(
QString
value
READ
value
NOTIFY
valueChanged
)
Q_PROPERTY
(
bool
selectable
READ
selectable
NOTIFY
selectableChanged
)
Q_PROPERTY
(
int
chartIndex
READ
chartIndex
CONSTANT
)
Q_PROPERTY
(
QAbstractSeries
*
series
READ
series
NOTIFY
seriesChanged
)
QGCMAVLinkMessageField
(
QGCMAVLinkMessage
*
parent
,
QString
name
,
QString
type
);
...
...
@@ -49,6 +50,7 @@ public:
QList
<
QPointF
>*
values
()
{
return
&
_values
;}
qreal
rangeMin
()
{
return
_rangeMin
;
}
qreal
rangeMax
()
{
return
_rangeMax
;
}
int
chartIndex
();
void
setSelectable
(
bool
sel
);
void
updateValue
(
QString
newValue
,
qreal
v
);
...
...
@@ -157,7 +159,7 @@ private:
class
MAVLinkChartController
:
public
QObject
{
Q_OBJECT
public:
MAVLinkChartController
(
MAVLinkInspectorController
*
parent
);
MAVLinkChartController
(
MAVLinkInspectorController
*
parent
,
int
index
);
Q_PROPERTY
(
QVariantList
chartFields
READ
chartFields
NOTIFY
chartFieldsChanged
)
Q_PROPERTY
(
QDateTime
rangeXMin
READ
rangeXMin
NOTIFY
rangeXMinChanged
)
...
...
@@ -180,6 +182,7 @@ public:
qreal
rangeYMax
()
{
return
_rangeYMax
;
}
quint32
rangeXIndex
()
{
return
_rangeXIndex
;
}
quint32
rangeYIndex
()
{
return
_rangeYIndex
;
}
int
chartIndex
()
{
return
_index
;
}
void
setRangeXIndex
(
quint32
t
);
void
setRangeYIndex
(
quint32
r
);
...
...
@@ -202,6 +205,7 @@ private:
QTimer
_updateSeriesTimer
;
QDateTime
_rangeXMin
;
QDateTime
_rangeXMax
;
int
_index
=
0
;
qreal
_rangeYMin
=
0
;
qreal
_rangeYMax
=
1
;
quint32
_rangeXIndex
=
0
;
///< 5 Seconds
...
...
src/AnalyzeView/MAVLinkInspectorPage.qml
View file @
a781d693
...
...
@@ -302,8 +302,8 @@ AnalyzePage {
delegate
:
QGCCheckBox
{
Layout.row
:
index
Layout.column
:
3
enabled
:
(
object
.
series
!==
null
)
||
(
object
.
selectable
)
checked
:
enabled
?
(
object
.
series
!==
null
)
:
false
enabled
:
checked
||
(
object
.
selectable
&&
object
.
series
===
null
)
checked
:
object
.
series
!==
null
&&
object
.
chartIndex
===
0
onClicked
:
{
if
(
enabled
)
{
if
(
checked
)
{
...
...
@@ -320,8 +320,8 @@ AnalyzePage {
delegate
:
QGCCheckBox
{
Layout.row
:
index
Layout.column
:
4
enabled
:
(
object
.
series
!==
null
)
||
(
object
.
selectable
)
checked
:
enabled
?
(
object
.
series
!==
null
)
:
false
enabled
:
checked
||
(
object
.
selectable
&&
object
.
series
===
null
)
checked
:
object
.
series
!==
null
&&
object
.
chartIndex
===
1
onClicked
:
{
if
(
enabled
)
{
if
(
checked
)
{
...
...
src/QmlControls/MAVLinkChart.qml
View file @
a781d693
...
...
@@ -53,8 +53,8 @@ ChartView {
DateTimeAxis
{
id
:
axisX
min
:
chartController
?
chartController
.
rangeXMin
:
0
max
:
chartController
?
chartController
.
rangeXMax
:
0
min
:
chartController
?
chartController
.
rangeXMin
:
new
Date
()
max
:
chartController
?
chartController
.
rangeXMax
:
new
Date
()
format
:
"
mm:ss.zzz
"
tickCount
:
5
gridVisible
:
true
...
...
@@ -91,6 +91,7 @@ ChartView {
}
QGCComboBox
{
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
Layout.maximumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
height
:
ScreenTools
.
defaultFontPixelHeight
model
:
controller
.
timeScales
currentIndex
:
chartController
?
chartController
.
rangeXIndex
:
0
...
...
@@ -105,6 +106,7 @@ ChartView {
}
QGCComboBox
{
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
Layout.maximumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
height
:
ScreenTools
.
defaultFontPixelHeight
model
:
controller
.
rangeList
currentIndex
:
chartController
?
chartController
.
rangeYIndex
:
0
...
...
@@ -113,5 +115,17 @@ ChartView {
Layout
.
alignment
:
Qt
.
AlignVCenter
}
}
ColumnLayout
{
Layout.alignment
:
Qt
.
AlignVCenter
Layout.fillWidth
:
true
Repeater
{
model
:
chartController
?
chartController
.
chartFields
:
[]
QGCLabel
{
text
:
modelData
.
label
color
:
chartView
.
series
(
index
).
color
font.pixelSize
:
ScreenTools
.
smallFontPointSize
}
}
}
}
}
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