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
e4dfd0ee
Commit
e4dfd0ee
authored
Feb 12, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checkbox to enable / disable all curves at once
parent
d4f5cb86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+14
-2
LinechartWidget.h
src/ui/linechart/LinechartWidget.h
+3
-0
No files found.
src/ui/linechart/LinechartWidget.cc
View file @
e4dfd0ee
...
@@ -107,7 +107,9 @@ updateTimer(new QTimer())
...
@@ -107,7 +107,9 @@ updateTimer(new QTimer())
int
labelRow
=
curvesWidgetLayout
->
rowCount
();
int
labelRow
=
curvesWidgetLayout
->
rowCount
();
curvesWidgetLayout
->
addWidget
(
new
QLabel
(
tr
(
"On"
)),
labelRow
,
0
,
1
,
2
);
selectAllCheckBox
=
new
QCheckBox
(
""
,
this
);
connect
(
selectAllCheckBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
selectAllCurves
(
bool
)));
curvesWidgetLayout
->
addWidget
(
selectAllCheckBox
,
labelRow
,
0
,
1
,
2
);
label
=
new
QLabel
(
this
);
label
=
new
QLabel
(
this
);
label
->
setText
(
"Name"
);
label
->
setText
(
"Name"
);
...
@@ -153,6 +155,15 @@ LinechartWidget::~LinechartWidget()
...
@@ -153,6 +155,15 @@ LinechartWidget::~LinechartWidget()
listedCurves
=
NULL
;
listedCurves
=
NULL
;
}
}
void
LinechartWidget
::
selectAllCurves
(
bool
all
)
{
QMap
<
QString
,
QLabel
*>::
iterator
i
;
for
(
i
=
curveLabels
->
begin
();
i
!=
curveLabels
->
end
();
++
i
)
{
activePlot
->
setVisible
(
i
.
key
(),
all
);
}
}
void
LinechartWidget
::
writeSettings
()
void
LinechartWidget
::
writeSettings
()
{
{
QSettings
settings
;
QSettings
settings
;
...
@@ -299,7 +310,7 @@ void LinechartWidget::appendData(int uasId, QString curve, double value, quint64
...
@@ -299,7 +310,7 @@ void LinechartWidget::appendData(int uasId, QString curve, double value, quint64
// Log data
// Log data
if
(
logging
)
if
(
logging
)
{
{
if
(
activePlot
->
isVisible
(
curve
))
if
(
activePlot
->
isVisible
(
curve
+
unit
))
{
{
if
(
logStartTime
==
0
)
logStartTime
=
usec
;
if
(
logStartTime
==
0
)
logStartTime
=
usec
;
qint64
time
=
usec
-
logStartTime
;
qint64
time
=
usec
-
logStartTime
;
...
@@ -660,6 +671,7 @@ void LinechartWidget::addCurve(const QString& curve, const QString& unit)
...
@@ -660,6 +671,7 @@ void LinechartWidget::addCurve(const QString& curve, const QString& unit)
// TODO
// TODO
// Connect actions
// Connect actions
connect
(
selectAllCheckBox
,
SIGNAL
(
clicked
(
bool
)),
checkBox
,
SLOT
(
setChecked
(
bool
)));
QObject
::
connect
(
checkBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
takeButtonClick
(
bool
)));
QObject
::
connect
(
checkBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
takeButtonClick
(
bool
)));
QObject
::
connect
(
this
,
SIGNAL
(
curveVisible
(
QString
,
bool
)),
plot
,
SLOT
(
setVisible
(
QString
,
bool
)));
QObject
::
connect
(
this
,
SIGNAL
(
curveVisible
(
QString
,
bool
)),
plot
,
SLOT
(
setVisible
(
QString
,
bool
)));
...
...
src/ui/linechart/LinechartWidget.h
View file @
e4dfd0ee
...
@@ -99,6 +99,8 @@ public slots:
...
@@ -99,6 +99,8 @@ public slots:
void
writeSettings
();
void
writeSettings
();
/** @brief Read the current configuration from disk */
/** @brief Read the current configuration from disk */
void
readSettings
();
void
readSettings
();
/** @brief Select all curves */
void
selectAllCurves
(
bool
all
);
protected:
protected:
void
addCurveToList
(
QString
curve
);
void
addCurveToList
(
QString
curve
);
...
@@ -145,6 +147,7 @@ protected:
...
@@ -145,6 +147,7 @@ protected:
quint64
logStartTime
;
quint64
logStartTime
;
QTimer
*
updateTimer
;
QTimer
*
updateTimer
;
LogCompressor
*
compressor
;
LogCompressor
*
compressor
;
QCheckBox
*
selectAllCheckBox
;
static
const
int
updateInterval
=
400
;
///< Time between number updates, in milliseconds
static
const
int
updateInterval
=
400
;
///< Time between number updates, in milliseconds
static
const
int
MAX_CURVE_MENUITEM_NUMBER
=
8
;
static
const
int
MAX_CURVE_MENUITEM_NUMBER
=
8
;
...
...
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