00001 #ifndef FULLBYPASSBARRELTEST_H
00002 #define FULLBYPASSBARRELTEST_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 "../SctApiCall.h"
00011 #include "Sct/LogicErrors.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 FullBypassBarrelTest : public TestRequestImpl {
00026 public:
00027 static FullBypassBarrelTest& instance() {
00028 static FullBypassBarrelTest fb;
00029 return fb;
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
00036 APICALL(&api, modifyABCDVar(&st, ST_COMPRESSION, 1), "FullBypassBarrelTest::startTest")
00037
00038
00039 APICALL(&api, modifyABCDVar(&st, ST_EDGE_DETECT, 0), "FullBypassBarrelTest::startTest")
00040
00041
00042 APICALL(&api, modifyABCDVar(&st, ST_MASK, 3), "FullBypassBarrelTest::startTest")
00043
00044
00045 APICALL(&api, modifyABCDVar(&st, ST_SEND_MASK, 1), "FullBypassBarrelTest::startTest")
00046
00047 name = "FullBypassTest";
00048 testVariable = ST_ELAPSED;
00049
00050
00051
00052
00053
00054 vdd.clear();
00055 vdd.push_back(4.0);
00056
00057 testPoints = vdd;
00058 nScans = testPoints.size();
00059 }
00060
00064 virtual ScanRequest* getNextScan(unsigned long index) {
00065 if (api == 0)
00066 throw InvariantViolatedError("Api pointer is 0 in getNextScan!", __FILE__, __LINE__);
00067
00068
00069
00070
00071
00072
00073 ScanLibrary& sl = CalibrationControllerImpl::instance().getScanLibrary();
00074 return &sl.tokenScan();
00075 }
00076
00077 virtual bool canFeedback() {
00078 return false;
00079 }
00080
00081 virtual void endTest() {
00082 if (api == 0)
00083 throw InvariantViolatedError("Api pointer is 0 in endTest!", __FILE__, __LINE__);
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 api = 0;
00095 }
00096
00097 private:
00098 FullBypassBarrelTest() {}
00099 Sct_SctApi_T_SctApi* api;
00100 std::vector<double> vdd;
00101 };
00102 }
00103 }
00104 #endif //FULLBYPASSTEST_H