Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

RawScan.h

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

Generated on Fri Jan 14 12:47:05 2005 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5