Cat
Python.cpp
Go to the documentation of this file.
1 #include <vector>
2 #include <list>
3 
4 #include "Processus.h"
5 
6 #include "Element.h"
7 //#include "ICPhaser.h"
8 #include "LSDelayChipV1.h"
9 #include "ICECALv3.h"
10 //#include "A3PE.h"
11 //#include "Proto40MHz_v1.h"
12 #include "MSOxxxx.h"
13 
14 #include "A11713B.h"
15 
16 //#include "Acquisition.h"
17 //#include "A3PE_BitFlip.h"
18 
19 #include <boost/python.hpp>
20 #include <boost/python/suite/indexing/vector_indexing_suite.hpp>
21 
22 using namespace boost::python;
23 
25 {
26 
27  class_<LSDelayChipV1, bases <Element> >("LSDelayChipV1")
28 
29  .def("configRegBulkRead" ,&LSDelayChipV1::configRegBulkRead)
30  .def("configRegBulkWrite" ,&LSDelayChipV1::configRegBulkWrite)
31  .def("getConfigReg" ,&LSDelayChipV1::getConfigReg)
32  .def("setConfigReg" ,&LSDelayChipV1::setConfigReg)
33 
34  .def("setConfigRegPhaseADC" ,&LSDelayChipV1::setConfigRegPhaseADC)
35  .def("setConfigRegPhaseTH " ,&LSDelayChipV1::setConfigRegPhaseTH)
36  .def("setConfigRegPhaseINT" ,&LSDelayChipV1::setConfigRegPhaseINT)
37  .def("setConfigRegLVDSOutEn" ,&LSDelayChipV1::setConfigRegLVDSOutEn)
38  .def("setConfigRegDebugMode" ,&LSDelayChipV1::setConfigRegDebugMode)
39  .def("setConfigRegVControlOutEn",&LSDelayChipV1::setConfigRegVControlOutEn)
40  .def("setConfigRegLOCUS" ,&LSDelayChipV1::setConfigRegLOCUS)
41 
42  .def("resetPumps" ,&LSDelayChipV1::setConfigRegVControlOutEn)
43  .def("bypassMisoMosi" ,&LSDelayChipV1::bypassMisoMosi)
44 
45  .def("spiBERTest" ,&LSDelayChipV1::spiBERTest)
46 
47  .def("showConfig" ,&LSDelayChipV1::showConfig)
48  .def("reset" ,&LSDelayChipV1::reset)
49 
50  .def("setAddress",&LSDelayChipV1::setAddress)
51  ;
52 
53 
54  class_<ICECALv3, bases <Element> >("ICECALv3")
55  .def("setAddress" ,&ICECALv3::setAddress)
56  .def("setNRetries" ,&ICECALv3::setNRetries)
57 
58  .def("getDelayLineCh" ,&ICECALv3::getDelayLineCh)
59  .def("setDelayLineCh" ,&ICECALv3::setDelayLineCh)
60  .def("getAnalogCh" ,&ICECALv3::getAnalogCh)
61  .def("setAnalogCh" ,&ICECALv3::setAnalogCh)
62  .def("getMainReg" ,&ICECALv3::getMainReg)
63  .def("setMainReg" ,&ICECALv3::setMainReg)
64 
65  .def("loadConfig" ,&ICECALv3::loadConfig)
66  .def("dumpConfig" ,&ICECALv3::dumpConfig)
67  .def("spiFERTest" ,&ICECALv3::spiFERTest)
68 
69  .def("version" ,&ICECALv3::version)
70  .def("bxidResynchStatus" ,&ICECALv3::bxidResynchStatus)
71  .def("spiAddressScan" ,&ICECALv3::spiAddressScan)
72  ;
73 
74  class_<MSOxxxx, bases <Element> >("MSOxxxx")
75  //Communications:
76  .def("configTCPIP" ,&MSOxxxx::configTCPIP)
77  .def("open" ,&MSOxxxx::open)
78  .def("stop" ,&MSOxxxx::closeConnection)
79  //Debug mode:
80  .def("setDebugMode" ,&MSOxxxx::setDebugMode)
81  //Oscilloscope commands:
82  .def("channelScale" ,&MSOxxxx::channelScale)
83  .def("channelOffset" ,&MSOxxxx::channelOffset)
84  .def("channelDisplay" ,&MSOxxxx::channelDisplay)
85  .def("channelDisplayName" ,&MSOxxxx::channelDisplayName)
86  .def("timeBaseScale" ,&MSOxxxx::timeBaseScale)
87  .def("timeBaseOffset" ,&MSOxxxx::timeBaseOffset)
88  .def("triggerAuto" ,&MSOxxxx::triggerAuto)
89  .def("triggerConfig" ,&MSOxxxx::triggerConfig)
90  .def("labelDisplay" ,&MSOxxxx::labelDisplay)
91  //Measurements:
92  .def("setupJitter" ,&MSOxxxx::setupJitter)
93  .def("setupAvgVoltage" ,&MSOxxxx::setupAvgVoltage)
94  .def("setupDeltaTime" ,&MSOxxxx::setupDeltaTime)
95  .def("getStatistics" ,&MSOxxxx::getStatistics)
96  //Acquisition:
97  .def("waveformCapture" ,&MSOxxxx::waveformCapture)
98  //Tools:
99  .def("id" ,&MSOxxxx::id)
100  .def("run" ,&MSOxxxx::run)
101  .def("stop" ,&MSOxxxx::stop)
102  ;
103 
104  class_<A11713B, bases <Element> >("A11713B")
105 
106  .def("setGpibAddr" ,&A11713B::setGpibAddr)
107  .def("getGpibAddr" ,&A11713B::getGpibAddr)
108  .def("gpibOpen" ,&A11713B::gpibOpen)
109  .def("getDeviceName" ,&A11713B::getDeviceName)
110  .def("setAttenuation" ,&A11713B::setAttenuation)
111  .def("getAttenuation" ,&A11713B::getAttenuation)
112  .def("printConfig" ,&A11713B::printConfig)
113  .def("reset" ,&A11713B::reset)
114  ;
115 }
PyObject * getStatistics(int nMinMeas)
Definition: MSOxxxx.cpp:311
StatusCode triggerConfig(bool slope, int ch, double level)
Definition: MSOxxxx.cpp:221
void setConfigRegVControlOutEn(U8 confRegAddr, bool en)
PyObject * getMainReg()
Definition: ICECALv3.cpp:415
void configRegBulkRead(U8 confRegAddr)
void setConfigRegPhaseTH(U8 confRegAddr, U8 phaseTH)
StatusCode open()
Definition: MSOxxxx.cpp:42
void setAddress(U8 address)
Definition: ICECALv3.h:65
StatusCode channelDisplay(int ch, bool display)
Definition: MSOxxxx.cpp:151
PyObject * getAnalogCh(int ch)
Definition: ICECALv3.cpp:312
void spiAddressScan()
Definition: ICECALv3.cpp:688
PyObject * spiFERTest(long nTest)
Definition: ICECALv3.cpp:577
void setAddress(U8 address)
StatusCode dumpConfig(string configFile, PyObject *chipId)
Definition: ICECALv3.cpp:132
void setNRetries(int nRet)
Definition: ICECALv3.h:66
void setDebugMode(bool debug)
Definition: MSOxxxx.h:51
StatusCode setAnalogCh(int ch, PyObject *)
Definition: ICECALv3.cpp:361
StatusCode setMainReg(PyObject *)
Definition: ICECALv3.cpp:474
void configRegBulkWrite(U8 confRegAddr, U16 confRegData)
StatusCode channelScale(int ch, double value)
Definition: MSOxxxx.cpp:137
bool bxidResynchStatus()
Definition: ICECALv3.cpp:677
StatusCode labelDisplay(bool display)
Definition: MSOxxxx.cpp:355
StatusCode setupAvgVoltage(int ch)
Definition: MSOxxxx.cpp:265
void getConfigReg(U8 confRegAddr)
double version()
Definition: ICECALv3.cpp:660
BOOST_PYTHON_MODULE(libCatBcn)
Definition: Python.cpp:24
void bypassMisoMosi(U16 writeData)
void configTCPIP(string ip, int port)
Definition: MSOxxxx.cpp:34
void setConfigRegLOCUS(U8 confRegAddr, U8 locus)
StatusCode stop()
Definition: MSOxxxx.cpp:397
void closeConnection()
Definition: MSOxxxx.h:48
StatusCode setupJitter(int ch)
Definition: MSOxxxx.cpp:238
StatusCode setDelayLineCh(int ch, PyObject *)
Definition: ICECALv3.cpp:281
void setConfigRegLVDSOutEn(U8 confRegAddr, bool en)
void setConfigReg(U8 confRegAddr, confRegData d)
StatusCode channelOffset(int ch, double value)
Definition: MSOxxxx.cpp:144
PyObject * getDelayLineCh(int ch)
Definition: ICECALv3.cpp:246
void setConfigRegPhaseINT(U8 confRegAddr, U8 phaseINT)
void spiBERTest(U8 confRegAddr, long nFrames)
StatusCode run()
Definition: MSOxxxx.cpp:390
PyObject * waveformCapture(int ch)
Definition: MSOxxxx.cpp:277
PyObject * loadConfig(string configFile)
Definition: ICECALv3.cpp:36
void setConfigRegDebugMode(U8 confRegAddr, bool en)
def reset(path='')
Definition: shell.py:212
void setConfigRegPhaseADC(U8 confRegAddr, U8 phaseADC)
StatusCode setupDeltaTime(int chA, int chB, int edge)
Definition: MSOxxxx.cpp:252
StatusCode timeBaseOffset(double seconds)
Definition: MSOxxxx.cpp:180
StatusCode timeBaseScale(double secsPerDiv)
Definition: MSOxxxx.cpp:173
PyObject * id()
Definition: MSOxxxx.cpp:370
StatusCode channelDisplayName(int ch, string name)
Definition: MSOxxxx.cpp:162
StatusCode triggerAuto()
Definition: MSOxxxx.cpp:214