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

NMaskTest.h

Go to the documentation of this file.
00001 #ifndef SCTCALIBRATIONCONTROLLER_NMASKTEST_H
00002 #define SCTCALIBRATIONCONTROLLER_NMASKTEST_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 NMaskTest : public TestRequestImpl {
00025 public: 
00026     static NMaskTest& instance() {
00027     static NMaskTest 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_COMPRESSION, 1);     // Compression mode 1
00037     if (status.returnCode != 0)
00038         throw SctApiException(status.returnCode, "NMaskTest::startTest", __FILE__, __LINE__);
00039     
00040     api.modifyABCDVar(&status, ST_EDGE_DETECT, 0);     // Edge detect off
00041     if (status.returnCode != 0)
00042         throw SctApiException(status.returnCode, "NMaskTest::startTest", __FILE__, __LINE__);
00043     
00044     api.modifyABCDVar(&status, ST_SEND_MASK, 1);    // Send mask on
00045     if (status.returnCode != 0)
00046         throw SctApiException(status.returnCode, "NMaskTest::startTest", __FILE__, __LINE__);
00047     
00048     name = "NMaskTest";
00049     testVariable = ST_ELAPSED;
00050     nScans = 1;
00051     
00052     testPoints.push_back(nTriggers);
00053     }
00054     
00055     virtual Sct_SctApi_T_Scan* getNextScan(unsigned long index) {
00056     ScanLibrary& sl = CalibrationControllerImpl::instance().getScanLibrary();
00057     return &sl.nmaskScan(nTriggers);
00058     }
00059     
00060     virtual bool canFeedback() {
00061     return false;
00062     }
00063     
00064     virtual void endTest() {
00065     api = 0;
00066     }
00067     
00068 private:
00069     NMaskTest() {}
00070     Sct_SctApi_T_SctApi* api;    
00071     static const int nTriggers = 100;
00072 };
00073 }
00074 }
00075 #endif //SCTCALIBRATIONCONTROLLER_NMASKTEST_H

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