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

FivePointGainTest.h

00001 #ifndef FIVEPOINTGAIN_H
00002 #define FIVEPOINTGAIN_H
00003 
00004 #include "../ipc/TestRequest.h"
00005 #include "../ipc/CalibrationController.h"
00006 #include "../ipc/ScanLibrary.h"
00007 #include "../ipc/Sct_CalibrationController.hh"
00008 #include "../CalibrationControllerImpl.h"
00009 
00010 #include "../SctApiAccessException.h"
00011 #include "Sct/LogicErrors.h"
00012 #include "../SctApiCall.h"
00013 
00014 #include <CommonWithDsp/ABCD/ABCDscans.h>
00015 #include <iostream>
00016 #include <vector>
00017 
00018 using namespace Sct;
00019 using namespace std;
00020 using namespace SctCalibrationController::Ipc;
00021 using namespace SctCalibrationController;
00022 
00023 namespace SctCalibrationController {
00024 namespace Scripts {
00025     
00026 class FivePointGainTest : public TestRequestImpl {
00027 public: 
00028     static FivePointGainTest& instance() {
00029     static FivePointGainTest rc;
00030     return rc;
00031     }
00032     
00033     virtual void startTest(Sct_SctApi_T_SctApi& api, string& name, unsigned short& testVariable, unsigned long& nScans, vector<double>& testPoints) {   
00034     this->api = &api;
00035 
00036         // Compression mode X1X
00037         APICALL(&api, modifyABCDVar(&st, ST_COMPRESSION, 1), "FivePointGainTest::startTest")
00038 
00039         // Edge detect off
00040         APICALL(&api, modifyABCDVar(&st, ST_EDGE_DETECT, 0), "FivePointGainTest::startTest")
00041 
00042         // No masked channels
00043         APICALL(&api, modifyABCDVar(&st, ST_SEND_MASK, 0), "FivePointGainTest::startTest")
00044 
00045     name = "NPtGainTest";
00046     testVariable = ST_QCAL;
00047 
00048     charges.push_back(0.75);
00049     charges.push_back(1.0);
00050     charges.push_back(1.5);
00051     charges.push_back(2.0);
00052     charges.push_back(4.0);
00053     testPoints = charges;
00054     nScans = testPoints.size();
00055     }
00056 
00057     virtual ScanRequest* getNextScan(unsigned long index) {
00058     ScanLibrary& sl = CalibrationControllerImpl::instance().getScanLibrary();
00059 
00060     APICALL(api, modifyABCDVar(&st, ST_QCAL, charges[index]), "FivePointGainTest::getNextScan")
00061 
00062     return &sl.thresholdScanfC(200, charges[index]);
00063     }
00064 
00065     virtual bool canFeedback() {
00066     return true;
00067     }
00068 
00069     virtual void endTest() {
00070     api = 0;
00071     charges.clear();
00072     }
00073 
00074 
00075 private:
00076     FivePointGainTest() {}
00077     Sct_SctApi_T_SctApi* api;
00078     vector<double> charges;
00079 };
00080 }
00081 }
00082 #endif //FIVEPOINTGAIN_H

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