Cern
LibTmsApi 2.3.0
Tms::TmsProcess Class Reference

This interface provides functions to capture data from the TMS as a whole. More...

#include <TmsC.h>

Inheritance diagram for Tms::TmsProcess:
BoapClientObject BSocket

Public Member Functions

 TmsProcess (BString name="")
 
BError getVersion (BString &version)
 Gets the software version.
 
BError getCycleInfo (BUInt32 &cycleNumber, BString &cycleType)
 Gets the current cycle number and type.
 
BError getCycleInformation (BUInt32 cycleNumber, CycleInformation &cycleInformation)
 Gets information on given cycle number.
 
BError getCycleTypeInformation (BString cycleType, CycleTypeInformation &cycleTypeInformation)
 Gets information on given cycle Type.
 
BError getData (DataInfo dataInfo, Data &data)
 This function returns a set of data from the data present in the data cache or directly from the Pick-Up processing engines. The DataInfo object describes the data required. The call will return the required data along with an error object indicating success or an error condition as appropriate. The call will block until data is ready.
 
BError addEventServer (BString name)
 This call adds an event server to call on events such as the "dataEvent" generated by the requestData(0 call as well as error events. The Client will use this to notify the TmsServer of its local TmsEvent object.
 
BError requestData (DataInfo dataInfo)
 This adds a request for some data. The DataInfo object defines the data required. This request can be made at any time. If the data is present in cache the data will be available immediately, if not the system will await the data from a subsequent processing cycle. When the data is available a "data" event will be sent to the client. Not that it is not necessary to use requestData. The client can call getData() directly although this call will block until the data is actually ready.
 
- Public Member Functions inherited from BoapClientObject
 BoapClientObject (BString name="")
 
virtual ~BoapClientObject ()
 
BError connectService (BString name)
 Connects to the named service.
 
BError disconnectService ()
 Disconnects from the named service.
 
BString getServiceName ()
 Get the name of the service.
 
BError ping (BUInt32 &apiVersion)
 Pings the connection and finds the remotes version number.
 
BError setConnectionPriority (BoapPriority priority)
 Sets the connection priority.
 
void setMaxLength (BUInt32 maxLength)
 Sets the maximum packet length.
 
void setTimeout (int timeout)
 Sets the timeout in micro seconds. -1 is wait indefinitely.
 
 BoapClientObject (BString name)
 
BError connectService (BString name)
 
- Public Member Functions inherited from BSocket
 BSocket ()
 
 BSocket (int fd)
 
 BSocket (NType type)
 
 BSocket (int domain, int type, int protocol)
 
 ~BSocket ()
 
BError init (int domain, int type, int protocol)
 
BError init (NType type)
 
void setFd (int fd)
 
int getFd ()
 
BError bind (const BSocketAddress &add)
 
BError connect (const BSocketAddress &add)
 
BError shutdown (int how)
 
BError close ()
 
BError listen (int backlog=5)
 
BError accept (int &fd)
 
BError accept (int &fd, BSocketAddress &address)
 
BError send (const void *buf, BSize nbytes, BSize &nbytesSent, int flags=0)
 
BError sendTo (const BSocketAddress &address, const void *buf, BSize nbytes, BSize &nbytesSent, int flags=0)
 
BError recv (void *buf, BSize maxbytes, BSize &nbytesRecv, int flags=0)
 
BError recvFrom (BSocketAddress &address, void *buf, BSize maxbytes, BSize &nbytesRecv, int flags=0)
 
BError recvWithTimeout (void *buf, BSize maxbytes, BSize &nbytesRecv, int timeout, int flags=0)
 
BError recvFromWithTimeout (BSocketAddress &address, void *buf, BSize maxbytes, BSize &nbytesRecv, int timeout, int flags=0)
 
BError setSockOpt (int level, int optname, void *optval, unsigned int optlen)
 
BError getSockOpt (int level, int optname, void *optval, unsigned int *optlen)
 
BError setReuseAddress (int on)
 
BError setBroadCast (int on)
 
BError setPriority (Priority priority)
 
BError getMTU (uint32_t &mtu)
 
BError getAddress (BSocketAddress &address)
 

Additional Inherited Members

- Public Types inherited from BSocket
enum  NType { STREAM , DGRAM }
 
enum  Priority { PriorityLow , PriorityNormal , PriorityHigh }
 
- Protected Member Functions inherited from BoapClientObject
BError pingLocked (BUInt32 &apiVersion)
 
BError checkApiVersion ()
 
BError performCall (BoapPacket &tx, BoapPacket &rx)
 Performs a RPC call to the named service.
 
BError performSend (BoapPacket &tx)
 Performs a send to the named service.
 
BError performRecv (BoapPacket &rx)
 Performs a receive.
 
virtual BError handleReconnect (BError err)
 Handle a reconnect performing autorisaztion if required.
 
BError performSend (BoapPacket &tx)
 
BError performRecv (BoapPacket &rx)
 
BError performCall (BoapPacket &tx, BoapPacket &rx)
 
- Protected Attributes inherited from BoapClientObject
BString oname
 
BUInt32 oapiVersion
 
BoapPriority opriority
 
BoapService oservice
 
int oconnected
 
BUInt32 omaxLength
 
BoapPacket otx
 
BoapPacket orx
 
BMutex olock
 
int otimeout
 
int oreconnect
 Handle an automatic reconnect on timeout.
 

Detailed Description

This interface provides functions to capture data from the TMS as a whole.

Constructor & Destructor Documentation

◆ TmsProcess()

Tms::TmsProcess::TmsProcess ( BString  name = "")
Parameters
nameThe name of the TmsProcess BOAP object to connect to.

The BOAP object name has the general form: "//HostName/ObjectName"

Member Function Documentation

◆ addEventServer()

BError Tms::TmsProcess::addEventServer ( BString  name)

This call adds an event server to call on events such as the "dataEvent" generated by the requestData(0 call as well as error events. The Client will use this to notify the TmsServer of its local TmsEvent object.

Parameters
nameThe BOAP object name to add.

Adds an event server that gets called on certain TmsServer events such as data ready, CYCLE_START, CYCLE_STOP and errors.

◆ getCycleInfo()

BError Tms::TmsProcess::getCycleInfo ( BUInt32 cycleNumber,
BString cycleType 
)

Gets the current cycle number and type.

Parameters
cycleNumberThe current cycle number is returned here
cycleTypeThe current cycle type is returned here.

This function returns the current TMS cycle number being processed and the type of the cycle.

◆ getCycleInformation()

BError Tms::TmsProcess::getCycleInformation ( BUInt32  cycleNumber,
CycleInformation cycleInformation 
)

Gets information on given cycle number.

Parameters
cycleNumberThe current cycle number to get information on
cycleInformationThe returned cycle information

This function provides information on the given cycle. It interrogates the first PUPE channel and returns the Cycle information based on the internal state of that channel. The main information returned includes the cycle type and a list of all of the Cycle Periods captured and the times and ammount of data in each.

◆ getCycleTypeInformation()

BError Tms::TmsProcess::getCycleTypeInformation ( BString  cycleType,
CycleTypeInformation cycleTypeInformation 
)

Gets information on given cycle Type.

◆ getData()

BError Tms::TmsProcess::getData ( DataInfo  dataInfo,
Data data 
)

This function returns a set of data from the data present in the data cache or directly from the Pick-Up processing engines. The DataInfo object describes the data required. The call will return the required data along with an error object indicating success or an error condition as appropriate. The call will block until data is ready.

Parameters
dataInfoInformation on the type of data required.
dataThe raw data is returned in this object.

This is the main user function used by clients of the TMS system. It is used to return portions of the acquired data. The fields of the dataInfo parameter define which data is required and are defined in the DataInfo class documentation.

The call will check to see if the data for the cycle number requested is still present in the PUPE memory. The PUPE memory has enough storage for about 3 seconds worth of data (3 processing cycles). If the data has gone the call will return the error "ErrorDataGone". If the system has not processed the requested cycle, but will do so within 256 seconds, the call will block awaiting the data.

If the channel number is given as 0 the call will interrogate each of the Pick-Up channels and return the combined data from all of them. Note that this could take significant time and may not be possible if the parameter numValues is large. Within the Data structure returned there is an array of error values, one per channel. If an error occurs on any set of the channels the call will return the first error that occurred and the complete list of errors in the errors array. The actual data will be returned for all channels that did not have an error. Those channels that had anb error will have data values of 0 returned.

If the bunch number is given as 0, then the system will return the data for all of the bunches.

The data will be returned in the following order, where B - Bunch, C - Channel:
[C1.B1, C1.B2, C1.B3, C1.B4], [C1.B1, C1.B2, C1.B3, C1.B4], ...
[C2.B1, C2.B2, C2.B3, C2.B4], [C2.B1, C2.B2, C2.B3, C2.B4], ...
That is the data is ordered by bunch, then sample, then channel. See the TMS Software documentation manual for more details of this functions operation.

◆ getVersion()

BError Tms::TmsProcess::getVersion ( BString version)

Gets the software version.

Parameters
versionA string variable filled in with the version number string.

◆ requestData()

BError Tms::TmsProcess::requestData ( DataInfo  dataInfo)

This adds a request for some data. The DataInfo object defines the data required. This request can be made at any time. If the data is present in cache the data will be available immediately, if not the system will await the data from a subsequent processing cycle. When the data is available a "data" event will be sent to the client. Not that it is not necessary to use requestData. The client can call getData() directly although this call will block until the data is actually ready.

Parameters
dataInfoInformation on the type of data required.

This calls sets up a request for data. The dataInfo parameter works in the same manner as the "getData" call, defining the portion of data required. This call will return immediatly. Assuming the client has informed the TMS system of an event server object using the "addEventServer" call, then the client will receive the "dataEvent" event when the data become available. The client can then fetch the data using the conventional "getData" call. In the current version of the software the "requestData" call simply sends a message when the data for the requested cycle is ready. In future implementations the TMS system could actually fetch the data automatically from the PUPE boards and store it in memory ready for later retrieval by the getData call.


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