Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadSpecialModules
Commits
2177b9e6
Commit
2177b9e6
authored
Aug 04, 2016
by
Cristina Cocho
Browse files
Tests in spectrometer 2
parent
dc25cfc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/controllers/spectrometer/QE65000Controller.cpp
View file @
2177b9e6
...
...
@@ -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
);
}
}
//
}
}
...
...
src/drivers/oceanoptics/QE65000Driver.cpp
View file @
2177b9e6
...
...
@@ -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);
}
...
...
src/drivers/oceanoptics/RealQE65000Driver.cpp
View file @
2177b9e6
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment