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

TimeWalkTest.h

00001 #ifndef TIMEWALKTEST_H
00002 #define TIMEWALKTEST_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 TimeWalkTest : public TestRequestImpl {
00026 public: 
00027     static TimeWalkTest& instance() {
00028     static TimeWalkTest tw;
00029     return tw;
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), "TimeWalkTest::startTest")
00037 
00038         // Edge detect on
00039         APICALL(&api, modifyABCDVar(&st, ST_EDGE_DETECT, 1), "TimeWalkTest::startTest")
00040 
00041         // No masked channels
00042         APICALL(&api, modifyABCDVar(&st, ST_SEND_MASK, 0), "TimeWalkTest::startTest")
00043 
00044          // 1 fC threshold
00045         APICALL(&api, modifyABCDVar(&st, ST_QTHR, 1), "TimeWalkTest::startTest")
00046 
00047     name = "TimeWalkTest";
00048     testVariable = ST_QCAL;                     // QCAL
00049 
00050     charges.push_back(1.25);
00051     charges.push_back(1.50);
00052     charges.push_back(1.75);
00053     charges.push_back(2.00);
00054     charges.push_back(3.0);
00055     charges.push_back(4.00);
00056     charges.push_back(5.00);
00057     charges.push_back(6.00);
00058     charges.push_back(8.00);
00059     charges.push_back(10.00);
00060 
00061     testPoints = charges;
00062     nScans = testPoints.size();
00063     }
00064 
00065     virtual ScanRequest* getNextScan(unsigned long index) {
00066     APICALL(api, modifyABCDVar(&st, ST_QCAL, charges[index]), "TimeWalkTest::getNextScan")
00067 
00068     ScanLibrary& sl = CalibrationControllerImpl::instance().getScanLibrary();
00069         return &sl.strobeDelayScan(100);
00070     }
00071 
00072     virtual bool canFeedback() {
00073     return false;
00074     }
00075 
00076     virtual void endTest() {
00077     charges.clear();
00078     api = 0;
00079     }
00080 
00081 private:
00082     TimeWalkTest() {}
00083     Sct_SctApi_T_SctApi* api;
00084     std::vector<double> charges;
00085 };
00086 }
00087 }
00088 #endif //TIMEWALKTEST_H

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