fdhwlib
2.0.25
|
#include <pbusproxy.h>
Pbus interface via pbusdaemon.
TODO: Implement hotplug interface - see festatusd! If a telescope is not connected try to connect before giving up!
Definition at line 35 of file pbusproxy.h.
PbusProxy::PbusProxy | ( | ) |
PbusProxy::~PbusProxy | ( | ) |
int PbusProxy::checkIR | ( | ) | [virtual] |
Reimplemented from PbusImp.
void PbusProxy::clearBlock | ( | unsigned long | addr, |
unsigned long | data, | ||
unsigned long | n, | ||
unsigned long | incr | ||
) | [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 from PbusImp.
void PbusProxy::connect | ( | std::string | ipaddr, |
int | port | ||
) |
int PbusProxy::free | ( | int | host = 0 | ) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::get | ( | std::string | item, |
std::string * | value | ||
) | [virtual] |
Reimplemented from PbusImp.
char* PbusProxy::getHostName | ( | int | tel | ) | [virtual] |
Reimplemented from PbusImp.
unsigned long PbusProxy::getIRvector | ( | ) | [virtual] |
Reimplemented from PbusImp.
const char* PbusProxy::getLibName | ( | ) | [virtual] |
Reimplemented from PbusImp.
const char* PbusProxy::getMode | ( | ) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::getModeId | ( | ) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::getNTelescopes | ( | ) | [virtual] |
Get the number of telescopes.
Reimplemented from PbusImp.
unsigned long PbusProxy::getPCTime | ( | ) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::getRemote | ( | std::string | item, |
std::string * | value | ||
) |
Get Pbus parameter from the connected telescope.
unsigned long PbusProxy::getState | ( | ) | [virtual] |
Reimplemented from PbusImp.
unsigned long PbusProxy::getState | ( | unsigned long | addr | ) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::getTelescope | ( | ) | [virtual] |
Get the id of the selected telescope.
This parameter is used only in PbusIP mode.
Reimplemented from PbusImp.
unsigned long PbusProxy::getTimeout | ( | ) |
Get the actual timeout value in orders of ms.
int PbusProxy::init | ( | char * | inifile, |
int | host = 0 |
||
) | [virtual] |
Initialize the connection to the electronic.
inifile | name of the inifile. The connection parameters can be found in the section [PbusProxy] |
host | Controls the layer/host that shoud be initialized. Default (host=0) is to initialize all telescopes of the local Pbus layer listed in the inifile. With host=1 the Pbus layer of pbusdaemon is initialized. It is necessary to have a connection to the pbusdaemon for this purpose. The selection host=2 will initialize only the selected telescope of the local Pbus layer |
Reimplemented from PbusImp.
bool PbusProxy::isConnected | ( | int | id = 0 | ) | [virtual] |
Return information about the connection to the electronic.
id | Number 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 from PbusImp.
unsigned long PbusProxy::rawRead | ( | unsigned long | addr | ) | [virtual] |
Read data from the electronics via a special interface.
Re-implement this function for every interface.
Reimplemented from PbusImp.
void PbusProxy::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 from PbusImp.
unsigned long PbusProxy::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 from PbusImp.
void PbusProxy::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 from PbusImp.
unsigned long PbusProxy::readIRvector | ( | ) | [virtual] |
Reimplemented from PbusImp.
void PbusProxy::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.
addr | Base address = addr of pixel (0,0) |
data | Array to take the nPix * nSlots register values |
nPix | Number of pixel in the first dimension (rows) |
incrPix | Spacing in the first dimension (rows) |
nSlots | Number of pixel in the second dimension (slots) |
incrSlots | Spacing in the second dimension (slots) |
Reimplemented from PbusImp.
void PbusProxy::remoteCall | ( | short | cmdid, |
unsigned long * | args, | ||
short | argc, | ||
unsigned long * | data, | ||
short | ndata, | ||
unsigned long * | ackn, | ||
short | len | ||
) |
void PbusProxy::selectTelescope | ( | int | id | ) | [virtual] |
Select a telescope to connect to.
This parameter is used only in PbusIP mode.
Reimplemented from PbusImp.
int PbusProxy::set | ( | std::string | item, |
std::string | value | ||
) | [virtual] |
Reimplemented from PbusImp.
void PbusProxy::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 from PbusImp.
void PbusProxy::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 from PbusImp.
int PbusProxy::setRemote | ( | std::string | item, |
std::string | value | ||
) |
Set Pbus parameter in the connected telescope.
void PbusProxy::setTimeout | ( | unsigned long | mstimeout | ) |
Set time of the socket communication in orders of ms.
void PbusProxy::shutdown | ( | ) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::startBackgroundLoop | ( | int | eyeId, |
char * | host, | ||
int | telId | ||
) | [virtual] |
Reimplemented from PbusImp.
int PbusProxy::waitForIR | ( | int | timeout | ) | [virtual] |
Reimplemented from PbusImp.
void PbusProxy::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 from PbusImp.
void PbusProxy::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 from PbusImp.
void PbusProxy::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 from PbusImp.
void PbusProxy::writeIRvector | ( | unsigned long | vector | ) | [virtual] |
Reimplemented from PbusImp.
bool PbusProxy::connected[PBUS_IP_MAX] [static] |
Flags that indicates connected sockets.
Definition at line 154 of file pbusproxy.h.
SimpleSocket* PbusProxy::sock[PBUS_IP_MAX] [static] |
Interface to the pbus daemon.
Connection to other telescopes?!
Definition at line 151 of file pbusproxy.h.
int PbusProxy::telescopeId [static] |
Number of the telescope.
Definition at line 157 of file pbusproxy.h.
int PbusProxy::test [private] |
Definition at line 172 of file pbusproxy.h.
struct timeval PbusProxy::timeout [private] |
Timeout for the socket connection.
Definition at line 170 of file pbusproxy.h.