00001 #ifndef SCTCALIBRATIONCONTROLLER_RAWSCAN_H 00002 #define SCTCALIBRATIONCONTROLLER_RAWSCAN_H 00003 00004 #include "../ipc/CalibrationController.hh" 00005 #include "../CalibrationControllerImpl.h" 00006 #include "../SctApiAccessException.h" 00007 #include "../SctApiCall.h" 00008 #include "Sct/LogicErrors.h" 00009 00010 #include <Sct/AbcdScans.h> 00011 00012 using namespace Sct; 00013 using namespace SctCalibrationController::Ipc; 00014 namespace SctCalibrationController { 00015 namespace Scripts { 00016 00019 class RawScan : public ScanRequestImpl { 00020 public: 00021 static ScanRequestImpl& rawScan(unsigned long nTrigs, bool issueSoftReset) { 00022 static RawScan request; 00023 static const long initialWidth = request.widthCorba(); 00024 static bool first = true; 00025 if (first) { 00026 first=false; 00027 } else { 00028 request.setWidthCorba(initialWidth); 00029 }; 00030 00031 Sct_SctApi::SctApiIPC_var api = CalibrationControllerImpl::instance()->getApi(); 00032 Sct_SctApi::Scan_var s; 00033 APIRETCALL(api, s, createScan(), "Failed to create scan") 00034 request.setScanNice(s); 00035 00036 APICALL(s, setNTrigs(nTrigs), "Failed to set triggers") 00037 request.setClockByTwoNice(false); 00038 00039 Sct_SctApi::Trigger_var t; 00040 APIRETCALL(s, t, getTrigger1(), "Failed to get Trigger1") 00041 00042 APICALL(s, configure(1, 0, 2, 1), "Failed to set Scan information") 00043 00044 if (issueSoftReset) { 00045 const int delayBetweenSoftResetAndTrigger = 30; 00046 APICALL(t, softL1A(delayBetweenSoftResetAndTrigger), "Failed to set trigger type with soft reset") 00047 } else { 00048 APICALL(t, singleL1A(), "Failed to set trigger type") 00049 } 00050 00051 return request; 00052 } 00053 00054 virtual bool isRawNice(){ 00055 return true; 00056 } 00057 00058 virtual long delayNice(){ 00059 return 1; 00060 } 00061 00062 private: 00063 RawScan(){;} 00064 }; 00065 00066 } 00067 } 00068 00069 #endif //SCTCALIBRATIONCONTROLLER_RAWSCAN_H