|
|
@ -76,6 +76,11 @@ ChartsWidget::ChartsWidget(QWidget *parent) : QWidget(parent) { |
|
|
|
docking = !docking; |
|
|
|
docking = !docking; |
|
|
|
updateTitleBar(); |
|
|
|
updateTitleBar(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
QObject::connect(&settings, &Settings::changed, [this]() { |
|
|
|
|
|
|
|
for (auto chart : charts) { |
|
|
|
|
|
|
|
chart->setHeight(settings.chart_height); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ChartsWidget::updateTitleBar() { |
|
|
|
void ChartsWidget::updateTitleBar() { |
|
|
@ -152,7 +157,7 @@ ChartWidget::ChartWidget(const QString &id, const Signal *sig, QWidget *parent) |
|
|
|
main_layout->addWidget(header); |
|
|
|
main_layout->addWidget(header); |
|
|
|
|
|
|
|
|
|
|
|
chart_view = new ChartView(id, sig, this); |
|
|
|
chart_view = new ChartView(id, sig, this); |
|
|
|
chart_view->setFixedHeight(300); |
|
|
|
chart_view->setFixedHeight(settings.chart_height); |
|
|
|
main_layout->addWidget(chart_view); |
|
|
|
main_layout->addWidget(chart_view); |
|
|
|
main_layout->addStretch(); |
|
|
|
main_layout->addStretch(); |
|
|
|
|
|
|
|
|
|
|
@ -205,6 +210,10 @@ ChartView::ChartView(const QString &id, const Signal *sig, QWidget *parent) |
|
|
|
updateSeries(); |
|
|
|
updateSeries(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ChartWidget::setHeight(int height) { |
|
|
|
|
|
|
|
chart_view->setFixedHeight(height); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ChartView::updateState() { |
|
|
|
void ChartView::updateState() { |
|
|
|
auto axis_x = dynamic_cast<QValueAxis *>(chart()->axisX()); |
|
|
|
auto axis_x = dynamic_cast<QValueAxis *>(chart()->axisX()); |
|
|
|
int x = chart()->plotArea().left() + chart()->plotArea().width() * (can->currentSec() - axis_x->min()) / (axis_x->max() - axis_x->min()); |
|
|
|
int x = chart()->plotArea().left() + chart()->plotArea().width() * (can->currentSec() - axis_x->min()) / (axis_x->max() - axis_x->min()); |
|
|
|