File tree Expand file tree Collapse file tree
Detectors/CTF/workflow/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919#include " Framework/ControlService.h"
2020#include " Framework/ConfigParamRegistry.h"
2121#include " Framework/InputSpec.h"
22+ #include " Framework/RawDeviceService.h"
2223#include " CommonUtils/StringUtils.h"
2324#include " CommonUtils/FileFetcher.h"
2425#include " CTFWorkflow/CTFReaderSpec.h"
@@ -176,7 +177,7 @@ void CTFReaderSpec::run(ProcessingContext& pc)
176177
177178 if (!mCTFCounter ) { // RS FIXME: this is a temporary hack to avoid late-starting devices to lose the input
178179 LOG (warning) << " This is a hack, sleeping 5 s at startup" ;
179- usleep ( 1000000 );
180+ pc. services (). get <RawDeviceService>(). waitFor ( 1000 );
180181 }
181182
182183 std::string tfFileName;
@@ -206,7 +207,7 @@ void CTFReaderSpec::run(ProcessingContext& pc)
206207 mRunning = false ;
207208 break ;
208209 }
209- usleep ( 5000 ); // wait 5ms for the files cache to be filled
210+ pc. services (). get <RawDeviceService>(). waitFor ( 5 );
210211 continue ;
211212 }
212213 LOG (info) << " Reading CTF input " << ' ' << tfFileName;
@@ -285,7 +286,7 @@ void CTFReaderSpec::processTF(ProcessingContext& pc)
285286 auto tDiff = tNow - mLastSendTime ;
286287 if (mCTFCounter ) {
287288 if (tDiff < mInput .delay_us ) {
288- usleep ( mInput .delay_us - tDiff); // respect requested delay before sending
289+ pc. services (). get <RawDeviceService>(). waitFor (( mInput .delay_us - tDiff) / 1000 ); // respect requested delay before sending
289290 }
290291 } else {
291292 mLastSendTime = tNow;
You can’t perform that action at this time.
0 commit comments