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

NoiseOccupancyTest.h

00001 #ifndef NOISEOCCUPANCY_H
00002 #define NOISEOCCUPANCY_H
00003 
00004 #include "../ipc/TestRequest.h"
00005 #include "../ipc/CalibrationController.h"
00006 #include "../ipc/ScanLibrary.h"
00007 #include "../ipc/CalibrationController.hh"
00008 #include "../CalibrationControllerImpl.h"
00009 
00010 #include "../SctApiAccessException.h"
00011 #include "Sct/LogicErrors.h"
00012 #include "../SctApiCall.h"
00013 
00014 #include "NoiseOccupancyScan.h"
00015 
00016 #include <CommonWithDsp/ABCD/ABCDscans.h>
00017 #include <iostream>
00018 #include <vector>
00019 
00020 using namespace Sct;
00021 using namespace std;
00022 using namespace SctCalibrationController::Ipc;
00023 using namespace SctCalibrationController;
00024 
00025 namespace SctCalibrationController {
00026 namespace Scripts {
00027 
00030 class NoiseOccupancyTest : public TestRequestImpl {
00031 private:
00032    static const bool registeredInTestLibrary;
00033 
00034 public: 
00035     static Sct_CalibrationController::TestRequest_ptr instance() {
00036     static NoiseOccupancyTest no;
00037     return no._this();
00038     }
00039     
00040     virtual void startTestRealImpl(Sct_SctApi::SctApiIPC_ptr api,
00041                string& name, 
00042                unsigned short& testVariable, 
00043                unsigned long& nScans, 
00044                vector<double>& testPoints) {    
00045     this->api = Sct_SctApi::SctApiIPC::_duplicate(api);
00046 
00047         // Compression mode X1X
00048         APICALL(api, modifyABCDVar(ST_COMPRESSION, 1), "NoiseOccupancyTest::startTest")
00049 
00050         // Edge detect off
00051         APICALL(api, modifyABCDVar(ST_EDGE_DETECT, 0), "NoiseOccupancyTest::startTest")
00052 
00053         // No masked channels
00054         APICALL(api, modifyABCDVar(ST_SEND_MASK, 0), "NoiseOccupancyTest::startTest")
00055 
00056     name = "NoiseOccupancyTest";
00057     testVariable = ST_ELAPSED;
00058     nScans = 1;
00059     testPoints.push_back(0.);
00060     }
00061     
00062     virtual Sct_CalibrationController::ScanRequest_ptr getNextScanRealImpl(unsigned long index) {
00063     Sct_CalibrationController::ScanLibrary_var sl = CalibrationControllerImpl::instance()->getScanLibrary();
00064        
00065        // AJB removed the line below 7/4/2005 as it is unnecessary - the scan should have NO CAL PULSE!!!
00066        // APICALL(api, modifyABCDVar(ST_VCAL, 0.), "NoiseOccupancyTest::getNextScan")
00067 
00068     return sl->noiseOccupancyScan();
00069     }
00070     
00071     virtual bool canFeedbackRealImpl() {
00072     return false;
00073     }
00074     
00075     virtual void endTestRealImpl() {
00076     api = Sct_SctApi::SctApiIPC::_nil();
00077     }
00078     
00079     
00080 private:
00081     NoiseOccupancyTest() {}
00082     Sct_SctApi::SctApiIPC_var api;    
00083 };
00084 }
00085 }
00086 #endif //RESPONSECURVE_H

Generated on Fri Sep 16 18:01:53 2005 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5