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
5b6fa856
Commit
5b6fa856
authored
Jun 02, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on second linechartplot time mode
parent
80e1204f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
LinechartPlot.cc
src/ui/linechart/LinechartPlot.cc
+19
-1
LinechartPlot.h
src/ui/linechart/LinechartPlot.h
+4
-0
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+8
-0
No files found.
src/ui/linechart/LinechartPlot.cc
View file @
5b6fa856
...
...
@@ -56,6 +56,7 @@ maxInterval(MAX_STORAGE_INTERVAL),
timeScaleStep
(
DEFAULT_SCALE_INTERVAL
),
// 10 seconds
automaticScrollActive
(
false
),
m_active
(
true
),
m_groundTime
(
false
),
d_data
(
NULL
),
d_curve
(
NULL
)
{
...
...
@@ -232,7 +233,16 @@ void LinechartPlot::appendData(QString dataname, quint64 ms, double value)
TimeSeriesData
*
dataset
=
data
.
value
(
dataname
);
// Append data
dataset
->
append
(
ms
,
value
);
if
(
m_groundTime
)
{
// Use the current (receive) time
dataset
->
append
(
MG
::
TIME
::
getGroundTimeNow
(),
value
);
}
else
{
// Use timestamp from dataset
dataset
->
append
(
ms
,
value
);
}
// Scaling values
if
(
ms
<
minTime
)
minTime
=
ms
;
...
...
@@ -253,6 +263,14 @@ void LinechartPlot::appendData(QString dataname, quint64 ms, double value)
datalock
.
unlock
();
}
/**
* @param enforce true to reset the data timestamp with the receive / ground timestamp
*/
void
LinechartPlot
::
enforceGroundTime
(
bool
enforce
)
{
m_groundTime
=
enforce
;
}
void
LinechartPlot
::
addCurve
(
QString
id
)
{
QColor
currentColor
=
getNextColor
();
...
...
src/ui/linechart/LinechartPlot.h
View file @
5b6fa856
...
...
@@ -241,6 +241,9 @@ public slots:
//void showCurve(QString id, int position);
void
setCurveColor
(
QString
id
,
QColor
color
);
/** @brief Enforce the use of the receive timestamp */
void
enforceGroundTime
(
bool
enforce
);
// General interaction
void
setWindowPosition
(
quint64
end
);
void
setPlotInterval
(
int
interval
);
...
...
@@ -292,6 +295,7 @@ protected:
QTime
lastMaxTimeAdded
;
int
plotid
;
bool
m_active
;
///< Decides wether the plot is active or not
bool
m_groundTime
;
///< Enforce the use of the receive timestamp instead of the data timestamp
// Methods
void
addCurve
(
QString
id
);
...
...
src/ui/linechart/LinechartWidget.cc
View file @
5b6fa856
...
...
@@ -152,6 +152,14 @@ void LinechartWidget::createLayout()
layout
->
setColumnStretch
(
3
,
0
);
connect
(
logButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
startLogging
()));
// Ground time button
QToolButton
*
timeButton
=
new
QToolButton
(
this
);
timeButton
->
setText
(
tr
(
"Ground Time"
));
timeButton
->
setCheckable
(
true
);
layout
->
addWidget
(
timeButton
,
1
,
4
);
layout
->
setColumnStretch
(
4
,
0
);
connect
(
timeButton
,
SIGNAL
(
clicked
(
bool
)),
activePlot
,
SLOT
(
enforceGroundTime
(
bool
)));
// Create the scroll bar
scrollbar
=
new
QScrollBar
(
Qt
::
Horizontal
,
ui
.
diagramGroupBox
);
scrollbar
->
setMinimum
(
MIN_TIME_SCROLLBAR_VALUE
);
...
...
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