Fix Stop(DEVICE_OK) connect error in RealtimeWindow

The signal/slot connection in RealtimeWindow for the 'stop'
button fails. The code wants to pass DEVICE_OK to the slot
but the QWidget connect method wants a SLOT signature.

This patch sets a default of DEVICE_OK for the newly
introduced 'status' parameter to the Stop() method and
corrects the signature used in the connect statement. As
a result, if the Stop() button is pressed the status will
be 0 (DEVICE_OK).

If you press start then stop really quickly and there *is*
a device error then it will still create a CSV file with no
samples. The CsvRideFileReader should be fixed to parse
these files correctly.
This commit is contained in:
Mark Liversedge
2010-11-27 21:32:58 +00:00
parent 12fb154f5b
commit 5f13f4800b
2 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ RealtimeWindow::configUpdate()
disconnect(stopButton, SIGNAL(clicked()), this, SLOT(warnnoConfig()));
connect(startButton, SIGNAL(clicked()), this, SLOT(Start()));
connect(pauseButton, SIGNAL(clicked()), this, SLOT(Pause()));
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop(DEVICE_OK)));
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop()));
}
}
@@ -165,7 +165,7 @@ RealtimeWindow::RealtimeWindow(MainWindow *parent, TrainTool *trainTool, const Q
if (Devices.count() > 0) {
connect(startButton, SIGNAL(clicked()), this, SLOT(Start()));
connect(pauseButton, SIGNAL(clicked()), this, SLOT(Pause()));
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop(DEVICE_OK)));
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop()));
} else {
connect(startButton, SIGNAL(clicked()), this, SLOT(warnnoConfig()));
connect(pauseButton, SIGNAL(clicked()), this, SLOT(warnnoConfig()));

View File

@@ -70,7 +70,7 @@ class RealtimeWindow : public QWidget
void Start(); // when start button is pressed
void Pause(); // when Paude is pressed
void Stop(int status); // when stop button is pressed
void Stop(int status=0); // when stop button is pressed
void FFwd(); // jump forward when in a workout
void Rewind(); // jump backwards when in a workout