Commit 2177b9e6 authored by Cristina Cocho's avatar Cristina Cocho
Browse files

Tests in spectrometer 2

parent dc25cfc1
......@@ -112,58 +112,37 @@ void QE65000Controller::start() {
//Get size from driver
size = spectroDriver->size();
if (isConnected()) {
//if (isConnected()) {
//Take into account number of scans to average
if (scansToAverage() == 1) {
cout << "start " << endl;
common::Date startTime = common::Date();
commandProgression = 50;
spectroDriver.execute("start", false);
commandProgression = 75;
cout << "after start " << endl;
common::Date time1 = common::Date();
common::Duration duration = time1 - startTime;
cout << "Time executing START command " << duration.getMilliseconds() << endl;
//x data
xData.update(spectroDriver->xData());
xData.setSize(size());
cout << "after 2 " << endl;
common::Date time2 = common::Date();
duration = time2 - time1;
cout << "Time executing updating xdata command " << duration.getMilliseconds() << endl;
//y data
yData.update(spectroDriver->yData());
yData.setSize(size());
cout << "after 3" << endl;
common::Date time3 = common::Date();
duration = time3 - time2;
cout << "Time executing updating ydata command " << duration.getMilliseconds() << endl;
//To take those changes into account do the following:
xData.sendEvent();
yData.sendEvent();
cout << "after 4" << endl;
common::Date time4 = common::Date();
duration = time4 - time3;
cout << "Time executing updating sending both arrays command " << duration.getMilliseconds() << endl;
commandProgression = 99;
spectroDriver.execute("stop", false);
cout << "after 5" << endl;
common::Date time5 = common::Date();
duration = time5 - time4;
cout << "Time executing STOP command " << duration.getMilliseconds() << endl;
common::Duration duration = time5- startTime;
cout << "TOTAL TIME " << duration.getMilliseconds() << endl;
} else {
//REVISE THE USAGE OF THE ARRAYS HERE
......@@ -218,7 +197,7 @@ void QE65000Controller::start() {
spectroDriver.execute("stop", false);
}
}
//}
}
......
......@@ -49,8 +49,8 @@ QE65000Driver::QE65000Driver(const std::string& name) : DeviceDriver(name) {
updateValue(DEVICE_TYPE_DEVICE_CONTAINER,std::string(ROOT_DEVICE_TYPE_DEVICE_CONTAINER));
//Register the Spy and Observer commands necessary to do the updates.
registerSpyCommand(driver::STATUS_COMMAND, 1);
registerObserverCommand(driver::STATUS_COMMAND, 20);
// registerSpyCommand(driver::STATUS_COMMAND, 1);
// registerObserverCommand(driver::STATUS_COMMAND, 20);
}
......
......@@ -22,6 +22,8 @@
#include <iomanip>
#include "api/seabreezeapi/SeaBreezeAPI.h"
#include "api/SeaBreezeWrapper.h"
#include <common/base/Date.h>
using namespace std;
......@@ -65,15 +67,16 @@ void RealQE65000Driver::start() {
delete[] owner()->xData();
delete[] owner()->yData();
common::Date startTime = common::Date();
cout << "starting spectro " << owner()->integrationTime() << endl;
//Get deviceID necessary to use library methods
sbapi_initialize();
sbapi_probe_devices();
//Retrieve necessary ids
getDeviceID();
getSpectroID();
// //Get deviceID necessary to use library methods
// sbapi_initialize();
// sbapi_probe_devices();
//
// //Retrieve necessary ids
// getDeviceID();
// getSpectroID();
//Open device
int32 result = sbapi_open_device(deviceId, &error);
if (result == 0) {
......@@ -92,12 +95,15 @@ void RealQE65000Driver::start() {
sbapi_close_device(deviceId, &error);
}
cout << "end of spectro " << endl;
common::Date time1 = common::Date();
common::Duration duration = time1 - startTime;
cout << "end of spectro " << duration.getMilliseconds() << endl;
}
void RealQE65000Driver::stop() {
cout << "in stop Realqe65000" << endl;
owner()->commandProgression = PROGRESSION_END_DEVICE_CONTAINER;
}
......@@ -105,15 +111,16 @@ void RealQE65000Driver::stop() {
* Check the status of the spectrometer: plugged or unplugged
*/
void RealQE65000Driver::readStatus() {
sbapi_initialize();
sbapi_probe_devices();
int32 numberOfDevices = sbapi_get_number_of_device_ids();
if (numberOfDevices != 0) {
owner()->status.update(QE65000Driver::PLUGGED);
} else {
owner()->status.update(QE65000Driver::UNPLUGGED);
}
cout << "reading qe65000 status" << endl;
// sbapi_initialize();
// sbapi_probe_devices();
// int32 numberOfDevices = sbapi_get_number_of_device_ids();
// if (numberOfDevices != 0) {
// owner()->status.update(QE65000Driver::PLUGGED);
//
// } else {
// owner()->status.update(QE65000Driver::UNPLUGGED);
// }
}
void RealQE65000Driver::getDeviceID() {
......
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