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
45da9517
Commit
45da9517
authored
Jun 04, 2013
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the styling of all ChartPlot instances updating when the MainWindow updates.
parent
467280bb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
21 deletions
+24
-21
QGCDataPlot2D.cc
src/ui/QGCDataPlot2D.cc
+4
-0
ChartPlot.cc
src/ui/linechart/ChartPlot.cc
+2
-6
ChartPlot.h
src/ui/linechart/ChartPlot.h
+5
-5
IncrementalPlot.cc
src/ui/linechart/IncrementalPlot.cc
+0
-1
LinechartPlot.cc
src/ui/linechart/LinechartPlot.cc
+5
-6
LinechartPlot.h
src/ui/linechart/LinechartPlot.h
+1
-1
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+7
-2
No files found.
src/ui/QGCDataPlot2D.cc
View file @
45da9517
...
...
@@ -70,6 +70,10 @@ QGCDataPlot2D::QGCDataPlot2D(QWidget *parent) :
connect
(
ui
->
gridCheckBox
,
SIGNAL
(
clicked
(
bool
)),
plot
,
SLOT
(
showGrid
(
bool
)));
connect
(
ui
->
regressionButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
calculateRegression
()));
connect
(
ui
->
style
,
SIGNAL
(
currentIndexChanged
(
QString
)),
plot
,
SLOT
(
setStyleText
(
QString
)));
// Allow style changes to propagate through this widget
connect
(
MainWindow
::
instance
(),
SIGNAL
(
styleChanged
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)),
plot
,
SLOT
(
styleChanged
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)));
}
void
QGCDataPlot2D
::
reloadFile
()
...
...
src/ui/linechart/ChartPlot.cc
View file @
45da9517
...
...
@@ -27,10 +27,10 @@ const QColor ChartPlot::baseColors[numColors] = {
ChartPlot
::
ChartPlot
(
QWidget
*
parent
)
:
QwtPlot
(
parent
),
nextColorIndex
(
0
),
symbolWidth
(
1.2
f
),
symbolWidth
(
2.0
f
),
curveWidth
(
2.0
f
),
gridWidth
(
0.8
f
),
zoomerWidth
(
3
.0
f
)
zoomerWidth
(
2
.0
f
)
{
// Initialize the list of curves.
curves
=
QMap
<
QString
,
QwtPlotCurve
*>
();
...
...
@@ -54,10 +54,6 @@ ChartPlot::ChartPlot(QWidget *parent):
// Now that all objects have been initialized, color everything.
applyColorScheme
(
MainWindow
::
instance
()
->
getStyle
());
// And make sure we're listening for future style changes
connect
(
MainWindow
::
instance
(),
SIGNAL
(
styleChanged
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)),
this
,
SLOT
(
applyColorScheme
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)));
}
ChartPlot
::~
ChartPlot
()
...
...
src/ui/linechart/ChartPlot.h
View file @
45da9517
...
...
@@ -22,6 +22,11 @@ public:
/** @brief Reset color map */
void
shuffleColors
();
public
slots
:
/** @brief Generate coloring for this plot canvas based on current window theme */
void
applyColorScheme
(
MainWindow
::
QGC_MAINWINDOW_STYLE
style
);
protected:
const
static
int
numColors
=
20
;
const
static
QColor
baseColors
[
numColors
];
...
...
@@ -35,11 +40,6 @@ protected:
float
curveWidth
;
///< Width of curve lines in pixels
float
gridWidth
;
///< Width of gridlines in pixels
float
zoomerWidth
;
///< Width of zoomer selection box
protected
slots
:
/** @brief Generate coloring for this plot canvas based on current window theme */
void
applyColorScheme
(
MainWindow
::
QGC_MAINWINDOW_STYLE
style
);
};
#endif // CHARTPLOT_H
src/ui/linechart/IncrementalPlot.cc
View file @
45da9517
...
...
@@ -87,7 +87,6 @@ IncrementalPlot::IncrementalPlot(QWidget *parent):
ChartPlot
(
parent
),
symmetric
(
false
)
{
setAutoReplot
(
false
);
setStyleText
(
"solid crosses"
);
plotLayout
()
->
setAlignCanvasToScales
(
true
);
...
...
src/ui/linechart/LinechartPlot.cc
View file @
45da9517
...
...
@@ -60,8 +60,6 @@ LinechartPlot::LinechartPlot(QWidget *parent, int plotid, quint64 interval):
yScaleEngine
=
new
QwtLinearScaleEngine
();
setAxisScaleEngine
(
QwtPlot
::
yLeft
,
yScaleEngine
);
setAutoReplot
(
false
);
// Set left scale
//setAxisOptions(QwtPlot::yLeft, QwtAutoScale::Logarithmic);
...
...
@@ -462,9 +460,7 @@ void LinechartPlot::showCurve(QString id)
//}
/**
* @brief Set the color of a curve
*
* This method emits the colorSet(id, color) signal.
* @brief Set the color of a curve and its symbols.
*
* @param id The id-string of the curve
* @param color The newly assigned color
...
...
@@ -472,7 +468,10 @@ void LinechartPlot::showCurve(QString id)
void
LinechartPlot
::
setCurveColor
(
QString
id
,
QColor
color
)
{
QwtPlotCurve
*
curve
=
curves
.
value
(
id
);
curve
->
setPen
(
color
);
curve
->
setPen
(
QPen
(
QBrush
(
color
),
curveWidth
));
QwtSymbol
x
=
curve
->
symbol
();
x
.
setPen
(
QPen
(
QBrush
(
color
),
symbolWidth
));
curve
->
setSymbol
(
x
);
}
/**
...
...
src/ui/linechart/LinechartPlot.h
View file @
45da9517
...
...
@@ -216,7 +216,7 @@ public slots:
void
setVisible
(
QString
id
,
bool
visible
);
/**
* @brief Set the color of a curve
* @brief Set the color of a curve
and its symbols.
*
* @param id The id-string of the curve
* @param color The newly assigned color
...
...
src/ui/linechart/LinechartWidget.cc
View file @
45da9517
...
...
@@ -141,6 +141,12 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent
//connect(this, SIGNAL(plotWindowPositionUpdated(int)), scrollbar, SLOT(setValue(int)));
//connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(setPlotWindowPosition(int)));
// And make sure we're listening for future style changes
connect
(
MainWindow
::
instance
(),
SIGNAL
(
styleChanged
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)),
this
,
SLOT
(
applyColorScheme
(
MainWindow
::
QGC_MAINWINDOW_STYLE
)));
connect
(
MainWindow
::
instance
(),
SIGNAL
(
styleChanged
()),
this
,
SLOT
(
recolor
()));
updateTimer
->
setInterval
(
updateInterval
);
connect
(
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
refresh
()));
connect
(
ui
.
uasSelectionBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
selectActiveSystem
(
int
)));
...
...
@@ -771,8 +777,7 @@ void LinechartWidget::removeCurve(QString curve)
void
LinechartWidget
::
recolor
()
{
activePlot
->
shuffleColors
();
activePlot
->
applyColorScheme
(
MainWindow
::
instance
()
->
getStyle
());
foreach
(
QString
key
,
colorIcons
.
keys
())
{
QWidget
*
colorIcon
=
colorIcons
.
value
(
key
,
0
);
...
...
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