00001 #ifndef TOKENSCAN_H 00002 #define TOKENSCAN_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 TokenScan { 00017 public: 00018 static Sct_SctApi_T_Scan& tokenScan(Sct_SctApi_T_SctApi& api) { 00019 Sct_SctApiStatus status; 00020 Sct_SctApi_T_Scan* s = api.defaultScan(&status); 00021 if (status.returnCode != 0) 00022 throw SctApiException(status.returnCode, "tokenScan", __FILE__, __LINE__); 00023 00024 s->setNTrigs(&status, 100); 00025 if (status.returnCode != 0) 00026 throw SctApiException(status.returnCode, "tokenScan", __FILE__, __LINE__); 00027 00028 Sct_SctApi_T_Trigger* t = s->getTrigger1(&status); 00029 if (status.returnCode != 0) 00030 throw SctApiException(status.returnCode, "tokenScan", __FILE__, __LINE__); 00031 00032 t->singleL1A(&status); 00033 if (status.returnCode != 0) 00034 throw SctApiException(status.returnCode, "tokenScan", __FILE__, __LINE__); 00035 00036 s->configure(&status, ST_TOKEN, 0, 36, 1); 00037 if (status.returnCode != 0) 00038 throw SctApiException(status.returnCode, "tokenScan", __FILE__, __LINE__); 00039 00040 return *s; 00041 } 00042 00043 private: 00044 TokenScan(); 00045 }; 00046 00047 } 00048 } 00049 00050 #endif //TOKENSCAN_H