fdhwlib  2.0.25
PbusImp Class Reference

#include <pbusimp.h>

Inheritance diagram for PbusImp:
Pbus1394 PbusPCI PbusPCIDMA PbusProxy PbusSim PbusTemplate

List of all members.

Public Member Functions

Static Public Attributes


Detailed Description

Virtual base class for the different Pbus interfaces.

Definition at line 27 of file pbusimp.h.


Constructor & Destructor Documentation

PbusImp::PbusImp ( )
virtual PbusImp::~PbusImp ( ) [virtual]

Member Function Documentation

virtual int PbusImp::checkIR ( ) [virtual]

Reimplemented in Pbus1394, PbusSim, and PbusProxy.

virtual void PbusImp::clearBlock ( unsigned long  addr,
unsigned long  data,
unsigned long  n,
unsigned long  incr = 1 
) [virtual]

Clear a continuous block of data.

The function protects a loop of rawWrite calls.The function can be overloaded using dedicated block transfer operation.

Reimplemented in PbusProxy.

virtual void PbusImp::cont ( ) [virtual]

Continues the access to the microEnable.

virtual void PbusImp::debugMsg ( const char *  msg,
  ... 
) [virtual]
virtual void PbusImp::endDebugOutput ( ) [virtual]
virtual int PbusImp::free ( int  host = 0) [virtual]
virtual int PbusImp::get ( std::string  item,
std::string *  value 
) [virtual]
virtual char* PbusImp::getHostName ( int  tel) [virtual]

Reimplemented in PbusProxy.

virtual unsigned long PbusImp::getIRvector ( ) [virtual]

Reimplemented in Pbus1394, PbusSim, and PbusProxy.

virtual const char* PbusImp::getLibName ( ) [virtual]
virtual const char* PbusImp::getMode ( ) [virtual]
virtual int PbusImp::getModeId ( ) [virtual]
virtual int PbusImp::getNTelescopes ( ) [virtual]

Get the number of available telescopes.

Reimplemented in PbusProxy.

virtual unsigned long PbusImp::getPCTime ( ) [virtual]

Reimplemented in PbusProxy.

virtual unsigned long PbusImp::getState ( ) [virtual]

Reimplemented in Pbus1394, PbusSim, and PbusProxy.

virtual unsigned long PbusImp::getState ( unsigned long  addr) [virtual]

Reimplemented in Pbus1394, and PbusProxy.

virtual int PbusImp::getTelescope ( ) [virtual]

Get the id of the selected telescope.

This parameter is used only in PbusIP mode.

Reimplemented in PbusProxy.

virtual const char* PbusImp::getVersion ( ) [virtual]
virtual int PbusImp::init ( char *  inifile,
int  host = 0 
) [virtual]

Initilaization of the Pbus interface.

The function will throw an error if the interface is not avaialble The missing or powered-off FD Electronic will cause a warning but no error.

Reimplemented in PbusTemplate, Pbus1394, PbusSim, PbusProxy, PbusPCI, and PbusPCIDMA.

virtual void PbusImp::initDebugOutput ( ) [virtual]

This procedure initializes the debug output.

The output file has to be specified using #define FDEBUG filename. The filenames "stdout" and "stderr" use the predefined output stream. To avoid debug output omit the define pragma or specify the filename /dev/null

If necessary specify a second debug stream to have another debug level.

How long does the debug output take? (100 000 loops)

 Timing:     CPU [s]    RT  [s]   one loop [us]
 /dev/null   0.250   0.257        0.1 ..0.17
 log-file    0.290   0.298        0.5 ..0.58
 do nothing  0.24    0.24         0
  *
virtual bool PbusImp::isConnected ( int  id = 0) [virtual]

Return information about the connection to the electronic.

Parameters:
idNumber if the telescope requested. 0 (default) will select the current telescope. With all menable or test based connections there is only this one possible.

Reimplemented in PbusProxy.

virtual unsigned long PbusImp::rawRead ( unsigned long  addr) [virtual]

Read data from the electronics via a special interface.

Re-implement this function for every interface.

Reimplemented in PbusTemplate, Pbus1394, PbusSim, PbusProxy, PbusPCI, and PbusPCIDMA.

virtual void PbusImp::rawWrite ( unsigned long  addr,
unsigned long  data 
) [virtual]

Write data to the electronics via a special interface.

Re-implement this function for every interface.

Reimplemented in PbusTemplate, Pbus1394, PbusSim, PbusProxy, PbusPCI, and PbusPCIDMA.

virtual unsigned long PbusImp::read ( unsigned long  addr) [virtual]

Read with single access.

The function protects the rawRead call with the semaphore. Needs normally not to be overloaded.

Reimplemented in PbusProxy.

virtual void PbusImp::readBlock ( unsigned long  addr,
unsigned long *  data,
unsigned long  n,
unsigned long  incr = 1 
) [virtual]

Read data a continuous block of data.

The function protects a loop of rawRead calls. Normally the function is overloaded using dedicated block transfer operation.

Reimplemented in PbusTemplate, Pbus1394, PbusSim, PbusProxy, PbusPCI, and PbusPCIDMA.

virtual unsigned long PbusImp::readIRvector ( ) [virtual]

Reimplemented in PbusSim, and PbusProxy.

virtual void PbusImp::readRegisterBlock ( unsigned long  addr,
unsigned long *  data,
unsigned long  nPix,
unsigned long  incrPix,
unsigned long  nSlots = 1,
unsigned long  incrSlots = 0 
) [virtual]

Read a block of registers with a single command.

In contrast to the readBlock for memory access the registers are normally no neighbors in the address space. To take the matrix structure of the camera image into account it is possible to specify two spacings.

Parameters:
addrBase address = addr of pixel (0,0)
dataArray to take the nPix * nSlots register values
nPixNumber of pixel in the first dimension (rows)
incrPixSpacing in the first dimension (rows)
nSlotsNumber of pixel in the second dimension (slots)
incrSlotsSpacing in the second dimension (slots)

Reimplemented in Pbus1394, and PbusProxy.

virtual void PbusImp::reset ( ) [virtual]

Reset of the Pbus access layer.

Reimplemented in PbusTemplate, Pbus1394, PbusSim, PbusProxy, PbusPCI, and PbusPCIDMA.

virtual void PbusImp::selectTelescope ( int  id) [virtual]

Select a telescope to connect to.

This parameter is used only in PbusIP mode.

Reimplemented in PbusProxy.

virtual int PbusImp::set ( std::string  item,
std::string  value 
) [virtual]

Reimplemented in PbusPCI, PbusPCIDMA, and PbusProxy.

virtual void PbusImp::setBitsToHigh ( unsigned long  addr,
unsigned long  mask 
) [virtual]

Read-Modify-Write with single access.

The function protects the rawRead and rawWrite calls with the semaphore. Needs normally not to be overloaded.

Reimplemented in PbusProxy.

virtual void PbusImp::setBitsToLow ( unsigned long  addr,
unsigned long  mask 
) [virtual]

Read-Modify-Write with single access.

The function protects the rawRead and rawWrite calls with the semaphore. Needs normally not to be overloaded.

Reimplemented in PbusProxy.

virtual void PbusImp::shutdown ( ) [virtual]

Reimplemented in PbusProxy.

virtual int PbusImp::startBackgroundLoop ( char *  host,
int  telId 
) [virtual]
virtual int PbusImp::startBackgroundLoop ( int  eyeId,
char *  host,
int  telId 
) [virtual]

Reimplemented in PbusProxy.

virtual void PbusImp::stop ( ) [virtual]

Stops the all access to the microEnable by requesting the semaphore.

To resume operation use the function cont() in the same process. The functions stop() and cont() are intended to reach a defined state of the system to terminate processes using the microEnable and leave the semaphore in a defined state. A monitor task may use stop, maintain the process table and continue afterwards.

virtual void PbusImp::vdebugMsg ( const char *  msg,
va_list  va 
) [virtual]
virtual int PbusImp::waitForIR ( int  timeout) [virtual]

Reimplemented in Pbus1394, PbusSim, and PbusProxy.

virtual void PbusImp::write ( unsigned long  addr,
unsigned long  data 
) [virtual]

Write with single access.

The function protects the rawWrite call with the semaphore. Needs normally not to be overloaded.

Reimplemented in PbusProxy.

virtual void PbusImp::writeBits ( unsigned long  addr,
unsigned long  data,
unsigned long  mask,
int  shift 
) [virtual]

Read-Modify-Write with single access.

The function protects the rawRead and rawWrite calls with the semaphore. Needs normally not to be overloaded.

Reimplemented in PbusProxy.

virtual void PbusImp::writeBlock ( unsigned long  addr,
unsigned long *  data,
unsigned long  n,
unsigned long  incr = 1 
) [virtual]

Write a continuous block of data.

The function protects a loop of rawWrite calls.The function can be overloaded using dedicated block transfer operation.

Reimplemented in PbusProxy, PbusPCI, and PbusPCIDMA.

virtual void PbusImp::writeIRvector ( unsigned long  vector) [virtual]

Reimplemented in PbusSim, and PbusProxy.


Member Data Documentation

int PbusImp::debugLevel [static]

Debug level (0 normal, 1 some more debug output.

Definition at line 220 of file pbusimp.h.

FILE* PbusImp::fdebug [static]

Definition at line 222 of file pbusimp.h.

char PbusImp::libName[256] [static]

Definition at line 228 of file pbusimp.h.

Semaphore field to control the access of different processes using the Pbus library.

Definition at line 233 of file pbusimp.h.

bool PbusImp::mounted [static]

Definition at line 226 of file pbusimp.h.

unsigned long PbusImp::nBlockAccess [static]

Counter for block transfers.

Definition at line 261 of file pbusimp.h.

unsigned long PbusImp::nBlockErrors [static]

Counter for transmisson errors.

Definition at line 264 of file pbusimp.h.

bool PbusImp::newLine [static]

Definition at line 224 of file pbusimp.h.

bool PbusImp::running [static]

Definition at line 243 of file pbusimp.h.

CMutex PbusImp::s_sock [static]

MFC Mutex variable to make the windows version of the Pbus class thread safe.

This is necessary for any graphical programm like the diagnositc tool mirror.exe by S. Menchikov.

Todo:
Warning: If the define pragma USE_MF_LOCAL_SYNC is checked there will be memory leackages? MFC Synchronization is more or less a secret to me?!

Definition at line 256 of file pbusimp.h.

bool PbusImp::useSemaphore [static]

Control the usage of the semaphores in Simulation mode.

It is necessary to disbale the semaphores before making a Pbus access from inside another Pbus command.

Definition at line 241 of file pbusimp.h.


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