TwiceAsNice  2019-02-18
Public Member Functions | List of all members
Basda::MPIACoreCard Class Reference

This is the base class of the MPIA in-house electronic cards with the core commands. More...

#include <Card.h>

Inheritance diagram for Basda::MPIACoreCard:
Inheritance graph
Collaboration diagram for Basda::MPIACoreCard:
Collaboration graph

Public Member Functions

 MPIACoreCard (std::string _name, Nice::JointPtr _config, Basda::MPIACoreProtocolPtr _protocol)
 Constructor. More...
 
 ~MPIACoreCard ()
 Destructor. More...
 
std::string version ()
 The methods returns the current version string of the MPIA in-house electronic. More...
 
std::vector< unsigned int > getRegistration ()
 The methods returns all registered module and card that are registered at the MPIA in-house electronic. More...
 
void reset ()
 Resets the MPIA in-house electronic software and hardware. More...
 
void setXonXoff (const ValueSwitch::Constant _enable)
 Enables/disables the XOnXOff protocol. More...
 
bool getXonXoff ()
 Returns the status of the XOnXOff protocol. More...
 
void setSerialRate (const ValueSerialRate::Constant _baudRate)
 Sets the baud rate of the serial interface. More...
 
unsigned int getSerialRate ()
 Returns the current baud rate. More...
 
void setCANRate (const ValueCanRate::Constant _canRate)
 Sets the CAN rate of the CAN bus. More...
 
unsigned int getCANRate ()
 Returns the current CAN rate. More...
 
void setEventFlag (const ValueSwitch::Constant _eventMode)
 Sets the event message flag. More...
 
bool getEventFlag ()
 Returns the current event message flags. More...
 
void setInfoFlag (const ValueSwitch::Constant _infoMode)
 Sets the event message flag. More...
 
bool getInfoFlag ()
 Returns the current event message flags. More...
 
void setIPAddress (const std::string _ip)
 Sets the IP address of the MPIA in-house electronic. More...
 
std::string getIPAddress ()
 Returns the current IP address. More...
 
void setGateAddress (const std::string _gate)
 Sets the gate address of the MPIA in-house electronic. More...
 
std::string getGateAddress ()
 Returns the current gate address. More...
 
void setMaskAddress (const std::string _mask)
 Sets the mask address of the MPIA in-house electronic. More...
 
std::string getMaskAddress ()
 Returns the current mask address. More...
 
void setLinkTimeout (const unsigned int _timeout)
 Sets the Ethernet connection timeout. More...
 
int getLinkTimeout ()
 Returns the Ethernet connection timeout. More...
 
void waitForEvent ()
 Waits until an event is received in a certain time (timeout). More...
 
std::string getFatalError ()
 Returns the fatal error message. More...
 
void resetFatalError ()
 Resets the fatal error. More...
 
 MPIACoreCard (std::string _name, Nice::JointPtr _config, Basda::MPIACoreProtocolPtr _protocol)
 Constructor. More...
 
 ~MPIACoreCard ()
 Destructor. More...
 
std::string version ()
 The methods returns the current version string of the MPIA in-house electronic. More...
 
std::vector< unsigned int > getRegistration ()
 The methods returns all registered module and card that are registered at the MPIA in-house electronic. More...
 
void reset ()
 Resets the MPIA in-house electronic software and hardware. More...
 
void setXonXoff (const ValueSwitch::Constant _enable)
 Enables/disables the XOnXOff protocol. More...
 
bool getXonXoff ()
 Returns the status of the XOnXOff protocol. More...
 
void setSerialRate (const ValueSerialRate::Constant _baudRate)
 Sets the baud rate of the serial interface. More...
 
unsigned int getSerialRate ()
 Returns the current baud rate. More...
 
void setCANRate (const ValueCanRate::Constant _canRate)
 Sets the CAN rate of the CAN bus. More...
 
unsigned int getCANRate ()
 Returns the current CAN rate. More...
 
void setEventFlag (const ValueSwitch::Constant _eventMode)
 Sets the event message flag. More...
 
bool getEventFlag ()
 Returns the current event message flags. More...
 
void setInfoFlag (const ValueSwitch::Constant _infoMode)
 Sets the event message flag. More...
 
bool getInfoFlag ()
 Returns the current event message flags. More...
 
void setIPAddress (const std::string _ip)
 Sets the IP address of the MPIA in-house electronic. More...
 
std::string getIPAddress ()
 Returns the current IP address. More...
 
void setGateAddress (const std::string _gate)
 Sets the gate address of the MPIA in-house electronic. More...
 
std::string getGateAddress ()
 Returns the current gate address. More...
 
void setMaskAddress (const std::string _mask)
 Sets the mask address of the MPIA in-house electronic. More...
 
std::string getMaskAddress ()
 Returns the current mask address. More...
 
void setLinkTimeout (const unsigned int _timeout)
 Sets the Ethernet connection timeout. More...
 
int getLinkTimeout ()
 Returns the Ethernet connection timeout. More...
 
void waitForEvent ()
 Waits until an event is received in a certain time (timeout). More...
 
std::string getFatalError ()
 Returns the fatal error message. More...
 
void resetFatalError ()
 Resets the fatal error. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Basda::MPIACore
 MPIACore (std::string _name, Nice::JointPtr _config, const MPIACoreProtocolPtr _protocol)
 
 ~MPIACore ()
 
template<typename Type >
Type checkAttribute (const std::string &_node, const std::string &_attributeName, const Type &_default)
 
template<typename RT >
std::vector< RT > getVector (const std::string &_str)
 This is a generic method to convert a data string to a vector. More...
 
std::string name ()
 
 MPIACore (std::string _name, Nice::JointPtr _config, const MPIACoreProtocolPtr _protocol)
 
 ~MPIACore ()
 
template<typename Type >
Type checkAttribute (const std::string &_node, const std::string &_attributeName, const Type &_default)
 
template<typename RT >
std::vector< RT > getVector (const std::string &_str)
 This is a generic method to convert a data string to a vector. More...
 
std::string name ()
 
- Static Protected Member Functions inherited from Basda::MPIACore
template<typename RT >
static RT getValue (const std::string &_str)
 This is a generic method to convert a data string to a number. More...
 
template<typename RT >
static RT getValue (const std::string &_str)
 This is a generic method to convert a data string to a number. More...
 
- Protected Attributes inherited from Basda::MPIACore
std::string m_name
 
std::string m_address
 member of the connection address More...
 
unsigned int m_cardNo
 member of the card number More...
 
unsigned int m_moduleNo
 member of the module number More...
 
HandlerPtr m_handler
 
MPIACoreProtocolPtr m_protocol
 member of the protocol to communicate with the MPIA in-house electronic. More...
 
Nice::JointPtr m_config
 member of the root of the configuration tree More...
 
bool m_warning
 

Detailed Description

This is the base class of the MPIA in-house electronic cards with the core commands.

The MPIA electronic rack is a generic framework that supports different insertion cards. These insertion cards are backplates for the on-board modules and provide general functionalities as well as keep the general configuration like the network settings. This class represents the generic MPIA in-house electronic card with the functionalities that are supported by all MPIA in-house electronic cards. It has to extend with the specific MPIA in-house electronic card functionalities.

Author
Frank Kittmann
Version
09.06.16
Date
2009.06.16
See also
Basda::MPIACore
Basda::MPIACoreCard

Constructor & Destructor Documentation

◆ MPIACoreCard() [1/2]

Basda::MPIACoreCard::MPIACoreCard ( std::string  _name,
Nice::JointPtr  _config,
Basda::MPIACoreProtocolPtr  _protocol 
)

Constructor.

This constructor register itself at the protocol and reserve the MPIA in-house electronic card. It enables the event mode and switch the info mode off. Only one card object will be created for each MPIA in-house electronic card.

◆ ~MPIACoreCard() [1/2]

Basda::MPIACoreCard::~MPIACoreCard ( )

Destructor.

◆ MPIACoreCard() [2/2]

Basda::MPIACoreCard::MPIACoreCard ( std::string  _name,
Nice::JointPtr  _config,
Basda::MPIACoreProtocolPtr  _protocol 
)

Constructor.

This constructor register itself at the protocol and reserve the MPIA in-house electronic card. It enables the event mode and switch the info mode off. Only one card object will be created for each MPIA in-house electronic card.

◆ ~MPIACoreCard() [2/2]

Basda::MPIACoreCard::~MPIACoreCard ( )

Destructor.

Member Function Documentation

◆ getCANRate() [1/2]

unsigned int Basda::MPIACoreCard::getCANRate ( )

Returns the current CAN rate.

The indexes of the baud rates are

  • 0 = 125000 baud
  • 1 = 250000 baud
  • 2 = 500000 baud
  • 3 = 800000 baud
  • 4 = 1000000 baud
Returns
the index of the baud rate of the CAN bus

◆ getCANRate() [2/2]

unsigned int Basda::MPIACoreCard::getCANRate ( )

Returns the current CAN rate.

The indexes of the baud rates are

  • 0 = 125000 baud
  • 1 = 250000 baud
  • 2 = 500000 baud
  • 3 = 800000 baud
  • 4 = 1000000 baud
Returns
the index of the baud rate of the CAN bus

◆ getEventFlag() [1/2]

bool Basda::MPIACoreCard::getEventFlag ( )

Returns the current event message flags.

Returns
the status of the event message flag

◆ getEventFlag() [2/2]

bool Basda::MPIACoreCard::getEventFlag ( )

Returns the current event message flags.

Returns
the status of the event message flag

◆ getFatalError() [1/2]

std::string Basda::MPIACoreCard::getFatalError ( )

Returns the fatal error message.

If a fatal error occur the MoCon firmware is executing a software reset immediately. An additional message will be added to the MoCon version string. After that reset all firmware commands over 100 are blocked until the error will be reset with the command resetFatalError()

Returns
the fatal error message
See also
resetFatalError

◆ getFatalError() [2/2]

std::string Basda::MPIACoreCard::getFatalError ( )

Returns the fatal error message.

If a fatal error occur the MoCon firmware is executing a software reset immediately. An additional message will be added to the MoCon version string. After that reset all firmware commands over 100 are blocked until the error will be reset with the command resetFatalError()

Returns
the fatal error message
See also
resetFatalError

◆ getGateAddress() [1/2]

std::string Basda::MPIACoreCard::getGateAddress ( )

Returns the current gate address.

Returns
the current gate address

◆ getGateAddress() [2/2]

std::string Basda::MPIACoreCard::getGateAddress ( )

Returns the current gate address.

Returns
the current gate address

◆ getInfoFlag() [1/2]

bool Basda::MPIACoreCard::getInfoFlag ( )

Returns the current event message flags.

Returns
the status of the info message flag

◆ getInfoFlag() [2/2]

bool Basda::MPIACoreCard::getInfoFlag ( )

Returns the current event message flags.

Returns
the status of the info message flag

◆ getIPAddress() [1/2]

std::string Basda::MPIACoreCard::getIPAddress ( )

Returns the current IP address.

Returns
the current IP address

◆ getIPAddress() [2/2]

std::string Basda::MPIACoreCard::getIPAddress ( )

Returns the current IP address.

Returns
the current IP address

◆ getLinkTimeout() [1/2]

int Basda::MPIACoreCard::getLinkTimeout ( )

Returns the Ethernet connection timeout.

Returns
the Ethernet connection timeout

◆ getLinkTimeout() [2/2]

int Basda::MPIACoreCard::getLinkTimeout ( )

Returns the Ethernet connection timeout.

Returns
the Ethernet connection timeout

◆ getMaskAddress() [1/2]

std::string Basda::MPIACoreCard::getMaskAddress ( )

Returns the current mask address.

Returns
the current gate address

◆ getMaskAddress() [2/2]

std::string Basda::MPIACoreCard::getMaskAddress ( )

Returns the current mask address.

Returns
the current gate address

◆ getRegistration() [1/2]

std::vector< unsigned int > Basda::MPIACoreCard::getRegistration ( )

The methods returns all registered module and card that are registered at the MPIA in-house electronic.

Returns
the vector with the registered module and card numbers

◆ getRegistration() [2/2]

std::vector<unsigned int> Basda::MPIACoreCard::getRegistration ( )

The methods returns all registered module and card that are registered at the MPIA in-house electronic.

Returns
the vector with the registered module and card numbers

◆ getSerialRate() [1/2]

unsigned int Basda::MPIACoreCard::getSerialRate ( )

Returns the current baud rate.

The indexes of the baud rates are

  • 0 = 9600 baud
  • 1 = 19200 baud
  • 2 = 38400 baud
  • 3 = 57600 baud
  • 4 = 115200 baud
Returns
the index of the baud rate of the RS232 interface

◆ getSerialRate() [2/2]

unsigned int Basda::MPIACoreCard::getSerialRate ( )

Returns the current baud rate.

The indexes of the baud rates are

  • 0 = 9600 baud
  • 1 = 19200 baud
  • 2 = 38400 baud
  • 3 = 57600 baud
  • 4 = 115200 baud
Returns
the index of the baud rate of the RS232 interface

◆ getXonXoff() [1/2]

bool Basda::MPIACoreCard::getXonXoff ( )

Returns the status of the XOnXOff protocol.

Returns
true if XOnXOff is enabled, false if XOnXOff is disabled

◆ getXonXoff() [2/2]

bool Basda::MPIACoreCard::getXonXoff ( )

Returns the status of the XOnXOff protocol.

Returns
true if XOnXOff is enabled, false if XOnXOff is disabled

◆ reset() [1/2]

void Basda::MPIACoreCard::reset ( )

Resets the MPIA in-house electronic software and hardware.

If this method is called the electronic card software will be reseted. That leads to a disconnection. The connection and the registration has to be done again.

◆ reset() [2/2]

void Basda::MPIACoreCard::reset ( )

Resets the MPIA in-house electronic software and hardware.

If this method is called the electronic card software will be reseted. That leads to a disconnection. The connection and the registration has to be done again.

◆ resetFatalError() [1/2]

void Basda::MPIACoreCard::resetFatalError ( )

Resets the fatal error.

It is necessary to execute a software reset to get all command functionality back.

See also
getFatalError

◆ resetFatalError() [2/2]

void Basda::MPIACoreCard::resetFatalError ( )

Resets the fatal error.

It is necessary to execute a software reset to get all command functionality back.

See also
getFatalError

◆ setCANRate() [1/2]

void Basda::MPIACoreCard::setCANRate ( const ValueCanRate::Constant  _canRate)

Sets the CAN rate of the CAN bus.

Parameters
_canRatethe index of the baud rate of the CAN bus
See also
MPIA/Core/CommandIDs.h - ValueCanRate

◆ setCANRate() [2/2]

void Basda::MPIACoreCard::setCANRate ( const ValueCanRate::Constant  _canRate)

Sets the CAN rate of the CAN bus.

Parameters
_canRatethe index of the baud rate of the CAN bus
See also
MPIA/Core/CommandIDs.h - ValueCanRate

◆ setEventFlag() [1/2]

void Basda::MPIACoreCard::setEventFlag ( const ValueSwitch::Constant  _eventMode)

Sets the event message flag.

Parameters
_eventModeif true the MPIA in-house electronic will send event messages
See also
MPIA/Core/CommandIDs.h - ValueSwitch

◆ setEventFlag() [2/2]

void Basda::MPIACoreCard::setEventFlag ( const ValueSwitch::Constant  _eventMode)

Sets the event message flag.

Parameters
_eventModeif true the MPIA in-house electronic will send event messages
See also
MPIA/Core/CommandIDs.h - ValueSwitch

◆ setGateAddress() [1/2]

void Basda::MPIACoreCard::setGateAddress ( const std::string  _gate)

Sets the gate address of the MPIA in-house electronic.

Parameters
_gatethe gate address e.g. 192.168.3.1

◆ setGateAddress() [2/2]

void Basda::MPIACoreCard::setGateAddress ( const std::string  _gate)

Sets the gate address of the MPIA in-house electronic.

Parameters
_gatethe gate address e.g. 192.168.3.1

◆ setInfoFlag() [1/2]

void Basda::MPIACoreCard::setInfoFlag ( const ValueSwitch::Constant  _infoMode)

Sets the event message flag.

Parameters
_infoModeif true the MPIA in-house electronic will send info messages
See also
MPIA/Core/CommandIDs.h - ValueSwitch

◆ setInfoFlag() [2/2]

void Basda::MPIACoreCard::setInfoFlag ( const ValueSwitch::Constant  _infoMode)

Sets the event message flag.

Parameters
_infoModeif true the MPIA in-house electronic will send info messages
See also
MPIA/Core/CommandIDs.h - ValueSwitch

◆ setIPAddress() [1/2]

void Basda::MPIACoreCard::setIPAddress ( const std::string  _ip)

Sets the IP address of the MPIA in-house electronic.

Parameters
_ipthe IP address e.g. 192.168.3.33

◆ setIPAddress() [2/2]

void Basda::MPIACoreCard::setIPAddress ( const std::string  _ip)

Sets the IP address of the MPIA in-house electronic.

Parameters
_ipthe IP address e.g. 192.168.3.33

◆ setLinkTimeout() [1/2]

void Basda::MPIACoreCard::setLinkTimeout ( const unsigned int  _timeout)

Sets the Ethernet connection timeout.

Parameters
_timeoutthe timeout in seconds (5 - 3600)

◆ setLinkTimeout() [2/2]

void Basda::MPIACoreCard::setLinkTimeout ( const unsigned int  _timeout)

Sets the Ethernet connection timeout.

Parameters
_timeoutthe timeout in seconds (5 - 3600)

◆ setMaskAddress() [1/2]

void Basda::MPIACoreCard::setMaskAddress ( const std::string  _mask)

Sets the mask address of the MPIA in-house electronic.

Parameters
_maskthe mask address e.g. 255.255.252.1

◆ setMaskAddress() [2/2]

void Basda::MPIACoreCard::setMaskAddress ( const std::string  _mask)

Sets the mask address of the MPIA in-house electronic.

Parameters
_maskthe mask address e.g. 255.255.252.1

◆ setSerialRate() [1/2]

void Basda::MPIACoreCard::setSerialRate ( const ValueSerialRate::Constant  _baudRate)

Sets the baud rate of the serial interface.

Parameters
_baudRatethe index of the baud rate of the serial interface
See also
MPIA/Core/CommandIDs.h - ValueSerialRate

◆ setSerialRate() [2/2]

void Basda::MPIACoreCard::setSerialRate ( const ValueSerialRate::Constant  _baudRate)

Sets the baud rate of the serial interface.

Parameters
_baudRatethe index of the baud rate of the serial interface
See also
MPIA/Core/CommandIDs.h - ValueSerialRate

◆ setXonXoff() [1/2]

void Basda::MPIACoreCard::setXonXoff ( const ValueSwitch::Constant  _enable)

Enables/disables the XOnXOff protocol.

Parameters
_enabletrue to enable to XOnXOff protocol; false disables the XOnXOff protocol
See also
MPIA/Core/CommandIDs.h - ValueSwitch

◆ setXonXoff() [2/2]

void Basda::MPIACoreCard::setXonXoff ( const ValueSwitch::Constant  _enable)

Enables/disables the XOnXOff protocol.

Parameters
_enabletrue to enable to XOnXOff protocol; false disables the XOnXOff protocol
See also
MPIA/Core/CommandIDs.h - ValueSwitch

◆ version() [1/2]

std::string Basda::MPIACoreCard::version ( )

The methods returns the current version string of the MPIA in-house electronic.

The version will be stored in the property:

  • VAR.FIRMWARE.VERSION
Parameters
_configthe root of the configuration tree

◆ version() [2/2]

std::string Basda::MPIACoreCard::version ( )

The methods returns the current version string of the MPIA in-house electronic.

The version will be stored in the property:

  • VAR.FIRMWARE.VERSION
Parameters
_configthe root of the configuration tree

◆ waitForEvent() [1/2]

void Basda::MPIACoreCard::waitForEvent ( )

Waits until an event is received in a certain time (timeout).

◆ waitForEvent() [2/2]

void Basda::MPIACoreCard::waitForEvent ( )

Waits until an event is received in a certain time (timeout).


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