28 backgroundColor,
const QColor& foregroundColor,
size_t numRows,
29 size_t numColumns,
bool linkScale,
bool linkCursor,
bool trackPoints) :
31 backgroundColor_(backgroundColor),
32 foregroundColor_(foregroundColor),
33 linkScale_(linkScale),
34 linkCursor_(linkCursor),
35 trackPoints_(trackPoints) {
36 if (numRows && numColumns) {
39 for (
size_t row = 0; row < numRows; ++row) {
42 for (
size_t column = 0; column < numColumns; ++column) {
90 if (!numRows || !numColumns) {
95 QVector<QVector<PlotConfig*> > plotConfig(numRows);
97 for (
size_t row = 0; row < numRows; ++row) {
98 plotConfig[row].resize(numColumns);
100 for (
size_t column = 0; column < numColumns; ++column) {
101 if ((row < oldNumRows) && (column < oldNumColumns))
102 plotConfig[row][column] =
plotConfig_[row][column];
104 plotConfig[row][column] =
new PlotConfig(
this);
106 connect(plotConfig[row][column], SIGNAL(
changed()),
this,
112 for (
size_t row = 0; row < oldNumRows; ++row)
113 for (
size_t column = 0; column < oldNumColumns; ++column)
114 if ((row >= numRows) || (column >= numColumns))
194 settings.setValue(
"background_color", QVariant::fromValue<QColor>(
196 settings.setValue(
"foreground_color", QVariant::fromValue<QColor>(
199 settings.beginGroup(
"plots");
201 for (
size_t row = 0; row <
plotConfig_.count(); ++row) {
202 settings.beginGroup(
"row_"+QString::number(row));
204 for (
size_t column = 0; column <
plotConfig_[row].count(); ++column) {
205 settings.beginGroup(
"column_"+QString::number(column));
226 settings.beginGroup(
"plots");
228 QStringList rowGroups = settings.childGroups();
230 size_t numColumns = 0;
232 for (QStringList::iterator it = rowGroups.begin();
233 it != rowGroups.end(); ++it) {
237 settings.beginGroup(*it);
239 QStringList columnGroups = settings.childGroups();
242 for (QStringList::iterator jt = columnGroups.begin();
243 jt != columnGroups.end(); ++jt) {
247 settings.beginGroup(*jt);
256 numColumns = std::max(numColumns, column);
264 setLinkScale(settings.value(
"link_scale",
false).toBool());
265 setLinkCursor(settings.value(
"link_cursor",
false).toBool());
287 for (
size_t row = 0; row <
plotConfig_.count(); ++row)
288 for (
size_t column = 0; column <
plotConfig_[row].count(); ++column)
297 QColor backgroundColor, foregroundColor;
298 bool linkScale, linkCursor, trackPoints;
299 quint64 numRows, numColumns;
301 stream >> backgroundColor;
303 stream >> foregroundColor;
306 stream >> numRows >> numColumns;
308 for (
size_t row = 0; row <
plotConfig_.count(); ++row)
309 for (
size_t column = 0; column <
plotConfig_[row].count(); ++column)
314 stream >> linkCursor;
316 stream >> trackPoints;
330 for (
size_t row = 0; row <
getNumRows(); ++row)
QVector< QVector< PlotConfig * > > plotConfig_
void linkScaleChanged(bool link)
void setNumRows(size_t numRows)
void load(QSettings &settings)
bool arePointsTracked() const
const QColor & getForegroundColor() const
void backgroundColorChanged(const QColor &color)
void setNumColumns(size_t numColumns)
void foregroundColorChanged(const QColor &color)
PlotConfig * getPlotConfig(size_t row, size_t column) const
const QColor & getBackgroundColor() const
void setForegroundColor(const QColor &color)
void setLinkCursor(bool link)
size_t getNumColumns() const
void linkCursorChanged(bool link)
void save(QSettings &settings) const
void write(QDataStream &stream) const
void setLinkScale(bool link)
PlotTableConfig & operator=(const PlotTableConfig &src)
void setBackgroundColor(const QColor &color)
PlotTableConfig(QObject *parent, const QColor &backgroundColor=Qt::white, const QColor &foregroundColor=Qt::black, size_t numRows=1, size_t numColumns=1, bool linkScale=false, bool linkCursor=false, bool trackPoints=false)
void trackPointsChanged(bool track)
void numPlotsChanged(size_t numRows, size_t numColumns)
bool isCursorLinked() const
size_t getNumRows() const
void setNumPlots(size_t numRows, size_t numColumns)
void read(QDataStream &stream)
bool isScaleLinked() const
void setTrackPoints(bool track)