Commit 21a47432 authored by Cristina Cocho's avatar Cristina Cocho
Browse files

Added USB delay in spectro + count measures

parent a99d0049
......@@ -27,6 +27,8 @@ const std::string CountWithSpectro::TYPE = "count_with_spectro";
const int32 CountWithSpectro::XSIZE = 1044; //should be retrieved directly from the driver...
const int32 CountWithSpectro::YSIZE = 1044;
const int32 CountWithSpectro::USB_DELAY_MILLISEC = 50; //Empirical value obtained from tests
CountWithSpectro::CountWithSpectro(const std::string & name) :
ExperimentController(name), controller::Stoppable(this) {
......@@ -345,9 +347,11 @@ float64 CountWithSpectro::calculateWaitingTimeInSec() {
int32 scansToAverage = spectro->scansToAverage();
if (useSwitcher()) {
totalSpectroTime = 2 * (integrationTime() * 0.000001 * numSpectroMeasures() * scansToAverage + switcherSleep);
float64 measureTime = integrationTime() * 0.000001 + USB_DELAY_MILLISEC * 0.001;
totalSpectroTime = 2 * (measureTime * numSpectroMeasures() * scansToAverage + switcherSleep);
} else {
totalSpectroTime = integrationTime() * 0.000001 * numSpectroMeasures() * scansToAverage;
float64 measureTime = integrationTime() * 0.000001 + USB_DELAY_MILLISEC * 0.001;
totalSpectroTime = measureTime * numSpectroMeasures() * scansToAverage;
}
float64 countTime = getCountTimeInSec();
......
......@@ -35,6 +35,7 @@ public:
static const std::string TYPE;
static const int32 XSIZE;
static const int32 YSIZE;
static const int32 USB_DELAY_MILLISEC;
CountWithSpectro(const std::string & name);
virtual ~CountWithSpectro();
......
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