Commit d3aa3dc9 authored by Cristina Cocho's avatar Cristina Cocho
Browse files

Added "usb open error" when using QE65000 controller

parent 0556f6c7
......@@ -44,6 +44,7 @@ QE65000Controller::QE65000Controller(const std::string& name) :
size.init(this, SAVE, "size");
spectroStatus.init(this, SAVE, "spectro_status");
spectroStatusMessage.init(this, SAVE, "spectro_status_message");
spectroOpenErrorMessage.init(this, SAVE, "spectro_open_error_message");
mode.init(this, SAVE, "mode");
spectroMode.init(this, SAVE, "spectro_mode");
plotName.init(this, SAVE, "plot_name");
......@@ -64,6 +65,7 @@ void QE65000Controller::postConfiguration() {
//Get info from driver
registerUpdater(spectroDriver->status, &QE65000Controller::updateStatus, this);
registerUpdater(spectroDriver->openError, &QE65000Controller::updateOpenError, this);
registerUpdater(spectroDriver->size, &QE65000Controller::updateSize, this);
registerProgression(spectroDriver, &QE65000Controller::updateProgression, this);
......@@ -75,7 +77,6 @@ void QE65000Controller::postConfiguration() {
//plotName.update(""); //original value = empty
//Get size from driver
size = spectroDriver->size();
}
......@@ -92,6 +93,14 @@ void QE65000Controller::updateStatus() {
}
}
void QE65000Controller::updateOpenError() {
if (spectroDriver->openError()) {
spectroOpenErrorMessage.update("USB OPEN ERROR");
} else {
spectroOpenErrorMessage.update("");
}
}
void QE65000Controller::updateSize() {
size.update(spectroDriver->size());
}
......@@ -112,15 +121,12 @@ void QE65000Controller::start() {
//Get size from driver
size = spectroDriver->size();
//if (isConnected()) {
if (isConnected() && (!spectroDriver->openError())) {
common::Date startTime = common::Date();
//Take into account number of scans to average
if (scansToAverage() == 1) {
common::Date startTime = common::Date();
commandProgression = 50;
spectroDriver.execute("start", false);
commandProgression = 75;
......@@ -140,10 +146,6 @@ void QE65000Controller::start() {
commandProgression = 99;
spectroDriver.execute("stop", false);
common::Date time5 = common::Date();
common::Duration duration = time5- startTime;
cout << "TOTAL TIME " << duration.getMilliseconds() << endl;
} else {
//REVISE THE USAGE OF THE ARRAYS HERE
float64* tempYData;
......@@ -197,7 +199,11 @@ void QE65000Controller::start() {
spectroDriver.execute("stop", false);
}
//}
//For debug purposes
common::Date endTime = common::Date();
common::Duration duration = endTime - startTime;
cout << "TOTAL TIME " << duration.getMilliseconds() << endl;
}
}
......
......@@ -43,6 +43,7 @@ public:
Property<std::string> plotName;
Property<int32> numor;
Property<std::string> spectroStatusMessage;
Property<std::string> spectroOpenErrorMessage;
Property<int32> scansToAverage;
Property<int32> size;
ArrayProperty<float64> xData;
......@@ -69,6 +70,7 @@ public:
void updateProgression();
void updateStatus();
void updateSize();
void updateOpenError();
void setPlotName(int32 plotId);
......
......@@ -8,6 +8,7 @@
<summary>
<summary_content>
<label role="spectro1" property="spectro_status_message"/>
<label role="spectro1" property="spectro_open_error_message"/>
</summary_content>
</summary>
</plugin>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment