00001 #ifndef SROBEDELAYSCAN_H
00002 #define SROBEDELAYSCAN_H
00003
00004 #include "../ipc/Sct_CalibrationController.hh"
00005
00006 #include "../SctApiException.h"
00007 #include "Sct/LogicErrors.h"
00008
00009 #include <CommonWithDsp/ABCD/ABCDscans.h>
00010
00011 using namespace Sct;
00012
00013 namespace SctCalibrationController {
00014 namespace Scripts {
00015
00016 class StrobeDelayScan {
00017 public:
00018 static Sct_SctApi_T_Scan& strobeDelayScan(Sct_SctApi_T_SctApi& api, unsigned long nTrigs) {
00019 Sct_SctApiStatus status;
00020 Sct_SctApi_T_Scan* s = api.defaultScan(&status);
00021 if (status.returnCode != 0)
00022 throw SctApiException(status.returnCode, "StrobeDelayScan", __FILE__, __LINE__);
00023
00024 Sct_SctApi_T_Trigger* t = s->getTrigger1(&status);
00025 if (status.returnCode != 0)
00026 throw SctApiException(status.returnCode, "StrobeDelayScan", __FILE__, __LINE__);
00027
00028 t->calL1A(&status, 0x82);
00029 if (status.returnCode != 0)
00030 throw SctApiException(status.returnCode, "StrobeDelayScan", __FILE__, __LINE__);
00031
00032 s->setNTrigs(&status, nTrigs);
00033 if (status.returnCode != 0)
00034 throw SctApiException(status.returnCode, "StrobeDelayScan", __FILE__, __LINE__);
00035
00036 s->setOption(&status, Sct_SctApi_T_Scan_ScanOptions_loopCalLine, 1);
00037 if (status.returnCode != 0)
00038 throw SctApiException(status.returnCode, "StrobeDelayScan", __FILE__, __LINE__);
00039
00040 s->configure(&status, ST_STROBE_DELAY, 0, 63, 1);
00041 if (status.returnCode != 0)
00042 throw SctApiException(status.returnCode, "StrobeDelayScan", __FILE__, __LINE__);
00043
00044 return *s;
00045 }
00046
00047 private:
00048 StrobeDelayScan();
00049 };
00050
00051 }
00052 }
00053
00054 #endif //SROBEDELAYSCAN_H