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

StrobeDelayTest.h

00001 #ifndef STROBEDELAYTEST_H
00002 #define STROBEDELAYTEST_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 "Sct/LogicErrors.h"
00011 #include "../SctApiCall.h"
00012 
00013 #include <CommonWithDsp/ABCD/ABCDscans.h>
00014 #include <iostream>
00015 #include <vector>
00016 
00017 using namespace Sct;
00018 using namespace std;
00019 using namespace SctCalibrationController::Ipc;
00020 using namespace SctCalibrationController;
00021 
00022 namespace SctCalibrationController {
00023 namespace Scripts {
00024     
00025 class StrobeDelayTest : public TestRequestImpl {
00026 public: 
00027     static StrobeDelayTest& instance() {
00028     static StrobeDelayTest rc;
00029     return rc;
00030     }
00031     
00032     virtual void startTest(Sct_SctApi_T_SctApi& api, string& name, unsigned short& testVariable, unsigned long& nScans, vector<double>& testPoints) {   
00033     this->api = &api;
00034 
00035         // Compression mode 2
00036         APICALL(&api, modifyABCDVar(&st, ST_COMPRESSION, 2), "StrobeDelayTest::startTest")
00037 
00038         // Edge detect on
00039         APICALL(&api, modifyABCDVar(&st, ST_EDGE_DETECT, 1), "StrobeDelayTest::startTest")
00040 
00041         // No masked channels
00042         APICALL(&api, modifyABCDVar(&st, ST_SEND_MASK, 0), "StrobeDelayTest::startTest")
00043 
00044         // Set threshold to 2fC (based on previous configuration)
00045         APICALL(&api, modifyABCDVar(&st, ST_QTHR, 2), "StrobeDelayTest::startTest")
00046 
00047         // 4.00 fC input charge
00048         APICALL(&api, modifyABCDVar(&st, ST_VCAL, 40), "StrobeDelayTest::startTest")
00049 
00050     name = "StrobeDelayTest";
00051     testVariable = ST_ELAPSED;
00052     nScans = 1;
00053 
00054     testPoints.push_back(0);
00055     }
00056     
00057     virtual ScanRequest* getNextScan(unsigned long index) {
00058     ScanLibrary& sl = CalibrationControllerImpl::instance().getScanLibrary();
00059     return &sl.strobeDelayScan(1000);       
00060     }
00061     
00062     virtual bool canFeedback() {
00063     return true;
00064     }    
00065     
00066     virtual void endTest() {
00067     api = 0;
00068     }
00069     
00070 private:
00071     StrobeDelayTest() {}
00072     Sct_SctApi_T_SctApi* api;    
00073 };
00074 }
00075 }
00076 #endif //STROBEDELAYTEST_H

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