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

RxDelayTest.h

00001 #ifndef SCTCALIBRATIONCONTROLLER_RXDELAYTEST_H
00002 #define SCTCALIBRATIONCONTROLLER_RXDELAYTEST_H
00003 
00004 #include "../ipc/TestRequest.h"
00005 #include "../ipc/CalibrationController.h"
00006 #include "../ipc/ScanLibrary.h"
00007 #include "../ipc/Sct_CalibrationController.hh"
00008 
00009 #include "../SctApiAccessException.h"
00010 #include "../SctApiCall.h"
00011 #include "../CalibrationControllerImpl.h"
00012 #include "Sct/LogicErrors.h"
00013 #include "SctApi/extraScans.h"
00014 
00015 #include <CommonWithDsp/ABCD/ABCDscans.h>
00016 #include <iostream>
00017 #include <vector>
00018 
00019 using namespace Sct;
00020 using namespace std;
00021 using namespace SctCalibrationController::Ipc;
00022 using namespace SctCalibrationController;
00023 
00024 namespace SctCalibrationController {
00025 namespace Scripts {
00026     
00027 class RxDelayTest : public TestRequestImpl {
00028 public: 
00029     static RxDelayTest& instance() {
00030     static RxDelayTest rc;
00031     return rc;
00032     }
00033     
00034     virtual void startTest(Sct_SctApi_T_SctApi& the_api, string& name, unsigned short& testVariable, unsigned long& nScans, vector<double>& testPoints) {   
00035     this->api = &the_api;
00036         // No masked channels
00037     name = "RxDelayTest";
00038     testVariable = ST_ELAPSED;
00039     nScans = 1;
00040     // put module in clock / 2 mode.
00041     APICALL(api, modifyABCDVar(&st, ST_FEEDTHROUGH, 0), "RxDelayTest::startTest");
00042     testPoints.push_back(nTriggers);
00043     }
00044     
00045     virtual ScanRequest* getNextScan(unsigned long index) {
00046     ScanLibrary& sl = CalibrationControllerImpl::instance().getScanLibrary();
00047     ScanRequest& request = sl.rawScan(nTriggers);
00048     // put BOC in sample-at-clock-by-two mode
00049     request.setClockByTwo(true);
00050     Sct_SctApi_T_Scan* scan = request.getScan();
00051 
00052     APICALL(scan, configure(&st, ST_RX_DELAY, 0, 24, 1), "Failed to set Scan information")
00053         return &request;
00054     }
00055     
00056     virtual bool canFeedback() {
00057     return true;
00058     }
00059     
00060     virtual void endTest() {
00061       // put module back in not clock/2 mode
00062         APICALL(api, modifyABCDVar(&st, ST_FEEDTHROUGH, 1), "RxDelayTest::startTest");
00063     api = 0;
00064     }
00065     
00066 private:
00067     RxDelayTest() {}
00068     Sct_SctApi_T_SctApi* api;    
00069     static const int nTriggers = 10;
00070 };
00071 }
00072 }
00073 #endif //SCTCALIBRATIONCONTROLLER_RXDELAYTEST_H

Generated on Thu Jul 15 09:50:51 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5