00001 #ifndef NMASKSCAN_H
00002 #define NMASKSCAN_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 namespace SctCalibrationController {
00013 namespace Scripts {
00014
00015 class NMaskScan {
00016 public:
00017 static Sct_SctApi_T_Scan& nmaskScan(Sct_SctApi_T_SctApi& api, unsigned long nTrigs) {
00018 Sct_SctApiStatus status;
00019 Sct_SctApi_T_Scan* s = api.defaultScan(&status);
00020 if (status.returnCode != 0)
00021 throw SctApiException(status.returnCode, "NMaskScan", __FILE__, __LINE__);
00022
00023 Sct_SctApi_T_Trigger* t = s->getTrigger1(&status);
00024 if (status.returnCode != 0)
00025 throw SctApiException(status.returnCode, "NMaskScan", __FILE__, __LINE__);
00026
00027 t->singleL1A(&status);
00028 if (status.returnCode != 0)
00029 throw SctApiException(status.returnCode, "NMaskScan", __FILE__, __LINE__);
00030
00031 s->setNTrigs(&status, nTrigs);
00032 if (status.returnCode != 0)
00033 throw SctApiException(status.returnCode, "NMaskScan", __FILE__, __LINE__);
00034
00035 s->configure(&status, ST_NMASK, 0, 128, 1);
00036 if (status.returnCode != 0)
00037 throw SctApiException(status.returnCode, "NMaskScan", __FILE__, __LINE__);
00038
00039 return *s;
00040 }
00041
00042 private:
00043 NMaskScan();
00044 };
00045
00046 }
00047 }
00048
00049 #endif //NMASKSCAN_H