Skip to content

Commit

Permalink
Fix infinite streaming buffer regression (#953)
Browse files Browse the repository at this point in the history
Co-authored-by: paul <paul@WorkLaptop>
  • Loading branch information
kutukvpavel and paul authored Apr 29, 2024
1 parent 3a90d88 commit eedbd9c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion plotjuggler_app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2422,7 +2422,14 @@ void MainWindow::updateDataAndReplot(bool replot_hidden_tabs)
_curvelist_widget->refreshColumns();
}

_mapped_plot_data.setMaximumRangeX(ui->streamingSpinBox->value());
if (ui->streamingSpinBox->value() == ui->streamingSpinBox->maximum())
{
_mapped_plot_data.setMaximumRangeX(std::numeric_limits<double>::max());
}
else
{
_mapped_plot_data.setMaximumRangeX(ui->streamingSpinBox->value());
}
}

const bool is_streaming_active = isStreamingActive();
Expand Down Expand Up @@ -2474,6 +2481,18 @@ void MainWindow::on_streamingSpinBox_valueChanged(int value)
{
double real_value = value;

if (value == ui->streamingSpinBox->maximum())
{
real_value = std::numeric_limits<double>::max();
ui->streamingSpinBox->setStyleSheet("QSpinBox { color: red; }");
ui->streamingSpinBox->setSuffix("=inf");
}
else
{
ui->streamingSpinBox->setStyleSheet("QSpinBox { color: black; }");
ui->streamingSpinBox->setSuffix(" sec");
}

if (isStreamingActive() == false)
{
return;
Expand Down

0 comments on commit eedbd9c

Please sign in to comment.