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

StrobeDelayTest.h

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

Generated on Mon Dec 15 19:36:18 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3