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