Skip to content

Commit

Permalink
Resist attempts to close GraphDlg while running
Browse files Browse the repository at this point in the history
  • Loading branch information
kernfel committed Oct 14, 2016
1 parent 1398c1e commit 65b7597
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/GraphDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ GraphDlg::~GraphDlg()
delete ui;
}

void GraphDlg::reject()
{
if ( !dataTimer.isActive() )
QDialog::reject();
}

void GraphDlg::reloadGraphs()
{
ui->plot->clearGraphs();
Expand Down Expand Up @@ -161,7 +167,7 @@ void GraphDlg::replot()
bool rangeFound;
QCPRange range = ui->plot->graph()->getKeyRange(rangeFound);

DataPoint point;
DataPoint point {0., 0.};

if ( initial && q[0]->pop(point) ) {
initial = false;
Expand All @@ -170,7 +176,7 @@ void GraphDlg::replot()

int i = 0;
double fac;
double tNow;
double tNow = 0.;
for ( auto &queue : q ) {
if ( Graphp[i].isVoltage )
fac = 1e3;
Expand Down
1 change: 1 addition & 0 deletions src/include/GraphDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public slots:
void startPlotting(DCThread *);
void stopPlotting();
void reloadGraphs();
void reject();
};

#endif

0 comments on commit 65b7597

Please sign in to comment.