Cat
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
TestUSB Class Reference

#include <include/TestUSB.h>

Inheritance diagram for TestUSB:
Processus Object Attrib

Classes

class  TestUSB
 

Public Member Functions

 TestUSB ()
 Standard constructor. More...
 
virtual ~TestUSB ()
 
virtual StatusCode initialize ()
 Destructor. More...
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
- Public Member Functions inherited from Processus
 Processus ()
 Standard constructor. More...
 
virtual ~Processus ()
 Destructor. More...
 
StatusCode startProcessing ()
 
StatusCode endProcessing ()
 
void clean ()
 
void setStorage (std::string storage)
 
Datadata ()
 
std::vector< double > data (unsigned int row)
 
std::vector< double > data (std::string name)
 
Histo1Dhist1d (unsigned int row)
 
Histo2Dhist2d (unsigned int row)
 
void addDataStream (std::string name, std::string title)
 
void addHisto1d (TH1D *h)
 
void addHisto2d (TH2D *h)
 
StatusCode dataFill (int i, double val)
 
StatusCode dataFill (std::string name, double val)
 
std::string storage ()
 
void setElement (Element *element)
 
Elementelement ()
 
void incNErrors ()
 
void setNErrors (unsigned int)
 
unsigned int nErrors ()
 
TFile * rootFile ()
 
void openRootFile ()
 
void closeRootFile ()
 
void startChrono ()
 
void setLogMsg (std::string logMsg)
 
std::string logMsg ()
 
void setState (int state)
 
double elapsedTime ()
 
double elapsedTime (time_t start)
 
- Public Member Functions inherited from Object
 Object ()
 Standard constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string name () const
 
std::string type ()
 
unsigned char id ()
 
std::string title ()
 
void msgSvc (int level, std::string msg, std::string name)
 
void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void error (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void error (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 
void setName (std::string name)
 
void setType (std::string type)
 
void setId (unsigned char id)
 
void setTitle (std::string title)
 
void setDllName (std::string dllName)
 
std::string dllName ()
 
- Public Member Functions inherited from Attrib
 Attrib ()
 Standard constructor. More...
 
virtual ~Attrib ()
 Destructor. More...
 
bool is (int attribut)
 
void add (int attribut)
 
void remove (int attribut)
 
std::string attributs ()
 

Public Attributes

 p7 = fig.add_subplot(2,3,6)
 

plot examples

p6=fig.add_subplot(4,3,6) p6.set_title('axes title') p6.set_xlabel('xlabel') p6.set_ylabel('ylabel') p6.text(3, 8, 'boxed italics text in data coords', style='italic', bbox={'facecolor':'red', 'alpha':0.5, 'pad':10}) p6.text(2, 6, r'an equation: $E=mc^2$', fontsize=15) p6.text(3, 2, unicode('unicode: Institut f\374r Festk\366rperphysik', 'latin-1')) p6.text(0.95, 0.01, 'colored text in axes coords', verticalalignment='bottom', horizontalalignment='right', transform=p6.transAxes, color='green', fontsize=15) p6.plot([2], [1], 'o') p6.annotate('annotate', xy=(2, 1), xytext=(3, 4), arrowprops=dict(facecolor='black', shrink=0.05)) p6.axis([0, 10, 0, 10]) More...
 
 h7 = obj.hist1d(0)
 
 color
 

Protected Member Functions

TestUSBclone ()
 

Private Attributes

FEB_v1m_board
 
Registerm_reg
 
TRandom * m_rnd
 

Additional Inherited Members

- Public Types inherited from Processus
enum  states { ERR =-1, NOT_OK, OK }
 
- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from Processus
Elementm_element
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Author
Frederic Machefert
Date
2010-01-07

Definition at line 20 of file TestUSB.h.

Constructor & Destructor Documentation

◆ TestUSB()

Standard constructor.

Definition at line 23 of file TestUSB.cpp.

References Object::setName(), Object::setTitle(), and Object::setType().

Referenced by clone().

24 {
25  setName ( "TestUSB" );
26  setType ( "FEB_v1" );
27  setTitle( "USB interface test" );
28 }
void setName(std::string name)
Definition: Object.h:51
void setType(std::string type)
Definition: Object.h:52
void setTitle(std::string title)
Definition: Object.h:54

◆ ~TestUSB()

virtual TestUSB::~TestUSB ( )
inlinevirtual

Definition at line 25 of file TestUSB.h.

References execute(), finalize(), and initialize().

25 {};

Member Function Documentation

◆ clone()

TestUSB* TestUSB::clone ( )
inlineprotectedvirtual

processus termination virtual function

Implements Processus.

Definition at line 32 of file TestUSB.h.

References TestUSB().

32  {
33  return new TestUSB (*this);
34  };
TestUSB()
Standard constructor.
Definition: TestUSB.cpp:23

◆ execute()

StatusCode TestUSB::execute ( )
virtual

processus execution virtual function

Implements Processus.

Definition at line 60 of file TestUSB.cpp.

References Processus::dataFill(), IOdata::dataU8(), IOobject::io(), m_reg, m_rnd, IOobject::read(), IOdata::setU8(), StatusCode::SUCCESS, and IOobject::write().

Referenced by ~TestUSB().

60  {
61  int value = 65536.*m_rnd->Uniform();
62  dataFill(0, value);
63  m_reg->io()->setU8(0,value&0xFF);
64  m_reg->io()->setU8(1,(value>>8)&0xFF);
65  m_reg->write();
66  m_reg->read();
67  int tmp = (m_reg->io()->dataU8(0))+((m_reg->io()->dataU8(1))<<8) ;
68  dataFill(1, tmp);
69  if (tmp!=value){
70  dataFill(2, value);
71  dataFill(3, tmp);
72  }
73  return StatusCode::SUCCESS;
74 }
virtual StatusCode write()
Definition: IOobject.h:80
StatusCode setU8(unsigned long int, U8)
Definition: IOdata.cpp:43
virtual StatusCode read()
Definition: IOobject.h:73
U8 * dataU8()
Definition: IOdata.h:214
Register * m_reg
Definition: TestUSB.h:38
StatusCode dataFill(int i, double val)
Definition: Processus.h:175
TRandom * m_rnd
Definition: TestUSB.h:39
IOdata * io()
Definition: IOobject.h:66

◆ finalize()

StatusCode TestUSB::finalize ( )
virtual

processus termination virtual function

Implements Processus.

Definition at line 79 of file TestUSB.cpp.

References StatusCode::SUCCESS.

Referenced by ~TestUSB().

79  {
80  return StatusCode::SUCCESS;
81 }

◆ initialize()

StatusCode TestUSB::initialize ( )
virtual

Destructor.

Implements Processus.

Definition at line 33 of file TestUSB.cpp.

References Processus::addDataStream(), Processus::element(), m_board, m_reg, m_rnd, FEB_v1::seqPga(), SeqPGA::setupReg(), StatusCode::SUCCESS, and Object::warning().

Referenced by ~TestUSB().

33  {
34  m_board=dynamic_cast<FEB_v1*>( element() );
35 
36  if (!m_board){
37  warning("TestUSB","No FEB_v1 board found. Interrupt." );
38  return false;
39  }
40 
41  SeqPGA* seqPga = m_board->seqPga();
42  if (!seqPga){
43  warning("TestUSB","No SeqPga found. Interrupt." );
44  return false;
45  }
46 
47  m_reg=seqPga->setupReg();
48  m_rnd =new TRandom();
49 
50  addDataStream("Input","Input value");
51  addDataStream("Output","Output value");
52  addDataStream("Errors","Error input value");
53  addDataStream("Errors","Error output value");
54  return StatusCode::SUCCESS;
55 }
void addDataStream(std::string name, std::string title)
Definition: Processus.h:153
Definition: FEB_v1.h:21
Register * setupReg()
Definition: SeqPGA.h:91
SeqPGA * seqPga()
Definition: FEB_v1.h:63
Register * m_reg
Definition: TestUSB.h:38
Element * element()
Definition: Processus.h:231
TRandom * m_rnd
Definition: TestUSB.h:39
void warning(std::string mymsg)
Definition: Object.h:39
Definition: SeqPGA.h:23
FEB_v1 * m_board
Definition: TestUSB.h:34

Member Data Documentation

◆ color

TestUSB.color

Definition at line 149 of file TestUSB.py.

◆ h7

TestUSB.h7 = obj.hist1d(0)

Definition at line 147 of file TestUSB.py.

◆ m_board

FEB_v1* TestUSB::m_board
private

Definition at line 34 of file TestUSB.h.

Referenced by initialize().

◆ m_reg

Register* TestUSB::m_reg
private

Definition at line 38 of file TestUSB.h.

Referenced by execute(), and initialize().

◆ m_rnd

TRandom* TestUSB::m_rnd
private

Definition at line 39 of file TestUSB.h.

Referenced by execute(), and initialize().

◆ p7

TestUSB.p7 = fig.add_subplot(2,3,6)

plot examples

p6=fig.add_subplot(4,3,6) p6.set_title('axes title') p6.set_xlabel('xlabel') p6.set_ylabel('ylabel') p6.text(3, 8, 'boxed italics text in data coords', style='italic', bbox={'facecolor':'red', 'alpha':0.5, 'pad':10}) p6.text(2, 6, r'an equation: $E=mc^2$', fontsize=15) p6.text(3, 2, unicode('unicode: Institut f\374r Festk\366rperphysik', 'latin-1')) p6.text(0.95, 0.01, 'colored text in axes coords', verticalalignment='bottom', horizontalalignment='right', transform=p6.transAxes, color='green', fontsize=15) p6.plot([2], [1], 'o') p6.annotate('annotate', xy=(2, 1), xytext=(3, 4), arrowprops=dict(facecolor='black', shrink=0.05)) p6.axis([0, 10, 0, 10])

Definition at line 146 of file TestUSB.py.


The documentation for this class was generated from the following files: