pxar
 All Classes Namespaces Functions Variables Typedefs Friends
PixTestFactory.cc
1 #include <iostream>
2 #include <algorithm>
3 
4 #include "PixTestFactory.hh"
5 #include "log.h"
6 
7 #include "PixTestCurrentVsDac.hh"
8 #include "PixTestIV.hh"
9 #include "PixTestAlive.hh"
10 #include "PixTestTbm.hh"
11 #include "PixTestDacScan.hh"
12 #include "PixTestDacDacScan.hh"
13 #include "PixTestTrim.hh"
14 #include "PixTestScurves.hh"
15 #include "PixTestGainPedestal.hh"
16 #include "PixTestSetup.hh"
17 #include "PixTestPretest.hh"
18 #include "PixTestTiming.hh"
19 #include "PixTestPattern.hh"
20 #include "PixTestDaq.hh"
21 #include "PixTestXray.hh"
22 #include "PixTestHighRate.hh"
23 #include "PixTestPh.hh"
24 #include "PixTestPhOptimization.hh"
25 #include "PixTestReadback.hh"
26 #include "PixTestBBMap.hh"
27 #include "PixTestBB2Map.hh"
28 #include "PixTestBareModule.hh"
29 #include "PixTestFullTest.hh"
30 
31 using namespace std;
32 using namespace pxar;
33 
34 
35 PixTestFactory* PixTestFactory::fInstance = 0;
36 
37 
38 // ----------------------------------------------------------------------
39 PixTestFactory* PixTestFactory::instance() {
40  if (0 == fInstance) {
41  fInstance = new PixTestFactory;
42  }
43  return fInstance;
44 }
45 
46 
47 
48 // ----------------------------------------------------------------------
49 PixTestFactory::PixTestFactory() {
50  LOG(logDEBUG) << "PixTestFactory::PixTestFactory()";
51 }
52 
53 // ----------------------------------------------------------------------
54 PixTestFactory::~PixTestFactory() {
55  LOG(logDEBUG) << "PixTestFactory::~PixTestFactory()";
56 }
57 
58 // ----------------------------------------------------------------------
59 PixTest* PixTestFactory::createTest(string name, PixSetup *a) {
60  ::transform(name.begin(), name.end(), name.begin(), ::tolower);
61 
62  if( !name.compare("curvsdac" ) ) return new PixTestCurrentVsDac(a, "CurVsDac" );
63  if( !name.compare("iv" ) ) return new PixTestIV(a, "IV" );
64  if (!name.compare("dacscan")) return new PixTestDacScan(a, "DacScan");
65  if (!name.compare("dacdacscan")) return new PixTestDacDacScan(a, "DacDacScan");
66  if (!name.compare("pixelalive")) return new PixTestAlive(a, "PixelAlive");
67  if (!name.compare("alive")) return new PixTestAlive(a, "PixelAlive"); // synonym
68  if (!name.compare("pretest")) return new PixTestPretest(a, "Pretest");
69  if (!name.compare("timing")) return new PixTestTiming(a, "Timing");
70  if (!name.compare("pattern")) return new PixTestPattern(a, "Pattern");
71  if (!name.compare("scurves")) return new PixTestScurves(a, "Scurves");
72  if (!name.compare("gainpedestal")) return new PixTestGainPedestal(a, "GainPedestal");
73  if (!name.compare("setup")) return new PixTestSetup(a, "Setup");
74  if (!name.compare("tbm")) return new PixTestTbm(a, "Tbm");
75  if (!name.compare("trim")) return new PixTestTrim(a, "Trim");
76  if (!name.compare("daq")) return new PixTestDaq(a, "DAQ");
77  if (!name.compare("xray")) return new PixTestXray(a, "Xray");
78  if (!name.compare("highrate")) return new PixTestHighRate(a, "HighRate");
79  if (!name.compare("ph")) return new PixTestPh(a, "Ph");
80  if (!name.compare("phoptimization")) return new PixTestPhOptimization(a, "PhOptimization");
81  if (!name.compare("readback")) return new PixTestReadback(a, "Readback");
82  if (!name.compare("bb")) return new PixTestBBMap(a, "BB");
83  if (!name.compare("bb2")) return new PixTestBB2Map(a, "BB2");
84  if (!name.compare("baremodule")) return new PixTestBareModule(a, "BareModule");
85  if (!name.compare("fulltest")) return new PixTestFullTest(a, "FullTest");
86  return 0;
87 }