Actin®  Version 5.2.0
Software for Robotics Simulation and Control
EcDigitalIOXmlItem Class Reference

HW implimentation base class. More...

#include <ecDigitalIOXmlItem.h>

Inheritance diagram for EcDigitalIOXmlItem:
EcXmlCompoundType EcXmlObject

Public Types

enum  EcIOItemType {
  BOOLEAN_INPUT = 0,
  BOOLEAN_OUTPUT = 1,
  REAL_INPUT = 2,
  REAL_OUTPUT = 3
}
 IO Item (channel) types.
 
- Public Types inherited from EcXmlCompoundType
enum  {
  READONLYCOMPONENT = 0,
  READONLYATTRIBUTE
}
 special-descriptor codes More...
 

Public Member Functions

 ECXMLOBJECT (EcDigitalIOXmlItem)
 
virtual void registerComponents () EC_OVERRIDE
 An XML object that holds a compound set of XML data. More...
 
virtual void setErrorString (EcString error)
 Set the run time error string for this item. More...
 
virtual EcString getErrorString ()
 Get the run time error string for this item.
 
virtual EcBoolean hasError ()
 Return true if the error string isn't empty.
 
virtual EcString getName ()
 Get name of the item.
 
virtual void setName (EcString newValue)
 Set name of the item. More...
 
virtual EcString getDescription ()
 Get item description.
 
virtual void setDescription (EcString newValue)
 Set item description. More...
 
virtual EcString getUuid ()
 Get uuid of the item.
 
virtual void setUuid (EcString newValue)
 Set uuid of the item. More...
 
virtual EcU32 getType ()
 Get type of digital IO.
 
virtual void setType (EcU32 newValue)
 Set type of digital IO. More...
 
virtual EcString getTypeString ()
 Get the type information as a readable string.
 
virtual EcReal value ()
 Get digital value.
 
virtual void setValue (EcReal newValue)
 Set digital value. More...
 
virtual EcReal convertedValue ()
 Get value as a float.
 
virtual void setValueWithConversion (EcReal newValue)
 Set value as a float. More...
 
virtual EcReal getOffset ()
 Get offset to convert to float.
 
virtual void setOffset (EcReal newValue)
 Set offset to convert to float. More...
 
virtual EcReal getScale ()
 Get scale to convert to float.
 
virtual void setScale (EcReal newValue)
 Set scale to convert to float. More...
 
virtual EcBoolean isOnDemand ()
 Is this on demand or polled?
 
virtual EcU32 delayRateUSecs ()
 Delay rate in micro seconds, 0 is on demand.
 
virtual void setDelayRateUSecs (EcU32 delay)
 Set the delay rate in micro seconds, 0 is on demand. More...
 
virtual EcBoolean needsUpdate (EcReal now)
 This needs a periodic update. More...
 
virtual EcReal timeStamp ()
 Get the time stamp.
 
virtual void setTimeStamp (EcReal value)
 Set the time stamp. More...
 
virtual EcReal cached ()
 Get the time stamp.
 
virtual void setCached (EcReal value)
 Set the time stamp. More...
 
virtual void update (EcReal value, EcReal time=-1)
 Update the cached value and the time. More...
 
virtual EcDigitalIOImplBasegetImpl ()
 Get the implimentation.
 
virtual void setImpl (EcDigitalIOImplBase *impl)
 Set the implimentation, also configures it. More...
 
virtual void prepareXML (const EcToken &token) const
 
virtual EcBoolean write (EcXmlWriter &stream) const EC_OVERRIDE
 An XML object that holds a compound set of XML data. More...
 
- Public Member Functions inherited from EcXmlCompoundType
 ECDECLARE_BIGFOUR (EcXmlCompoundType)
 
virtual EcBoolean xmlInit () EC_OVERRIDE
 xmlInitialize
 
virtual EcBoolean read (EcXmlReader &stream) EC_OVERRIDE
 read object from an XML stream
 
virtual EcBoolean readAttributes (EcXmlReader &stream)
 read object attributes from an XML stream
 
virtual EcBoolean readElements (EcXmlReader &stream)
 read object elements from an XML stream
 
virtual EcBoolean writeAttributes (EcXmlWriter &stream) const
 write object attributes to an XML stream
 
virtual EcBoolean writeElements (EcXmlWriter &stream) const
 write object elements to an XML stream
 
virtual EcBoolean writeSchema (EcXmlSchema &stream) const EC_OVERRIDE
 write schema
 
virtual EcBoolean writeSchemaAttributes (EcXmlSchema &stream) const
 write schema attributes
 
virtual EcBoolean writeSchemaElements (EcXmlSchema &stream) const
 write schema elements
 
virtual void registerComponent (const EcToken &token, EcXmlObject *obj)
 register a single component More...
 
virtual void registerComponent (EcXmlObject *obj)
 register a single component More...
 
virtual void registerComponentReadOnly (const EcToken &token, EcXmlObject *obj)
 register a single component as read-only More...
 
virtual const EcXmlComponentMapcomponentMap () const
 get a reference to the component map
 
virtual void registerAttributeComponent (const EcToken &AttribToken, EcXmlObject *Obj)
 register a single attribute component More...
 
virtual void registerAttributeComponentReadOnly (const EcToken &AttribToken, EcXmlObject *Obj)
 register a single attribute component read-only More...
 
virtual const EcXmlComponentMapattributeComponentMap ()
 get a reference to the component attribute map
 
virtual const EcXmlSpecialDescriptorMapspecialDescriptorMap ()
 get a reference to the special-descriptor map
 
virtual void registerComponentDescriptor (const EcToken &xmlToken, const EcToken &descriptorToken, const EcString &descriptorString)
 register an XML token-string descriptor More...
 
virtual const EcXmlTokenStringDescriptorMapMaptokenStringDescriptorMap ()
 get a reference to the XML token-string descriptor map
 
virtual EcBoolean hasChildren () const
 return EcTrue if there are children components or EcFalse if an empty element.
 
virtual EcBoolean hasAttributes () const
 return EcTrue if there are attributes in the element.
 
- Public Member Functions inherited from EcXmlObject
 ECDECLARE_BIGFOUR (EcXmlObject)
 
virtual EcXmlObjectclone () const =0
 clone
 
virtual EcBoolean readAttribute (EcXmlReader &stream)
 read this attribute from an XML stream
 
virtual EcBoolean createSchema (const EcString &filename, const EcToken &objectName=EcXml::EcDefaultToken) const
 create schema
 
virtual EcBoolean xmlInitialized () const
 get XML initialized flag. This bit is set on initialization.
 
virtual void setXmlInitialized (EcBoolean val=EcTrue)
 set XML initialized flag. This bit is set on initialization.
 
virtual EcBoolean specified () const
 get specified flag. This bit is set upon reading from an XML file.
 
virtual void setSpecified (EcBoolean val=EcTrue)
 set specified flag. This bit is set upon reading from an XML file.
 
virtual EcBoolean isBasicType () const
 Return true/false for basic type.
 
virtual EcBoolean equalsDefault () const
 tests equality of XML object with default
 
virtual EcBoolean equality (const EcXmlObject *other) const =0
 equality - a virtual equality to an EcXmlObject pointer
 
virtual EcXmlObjectnewObject () const =0
 creates new object - a virtual new to an EcXmlObject pointer
 
virtual const EcTokentoken () const =0
 gets the xml token used for writing out.
 

Static Public Member Functions

static EcString generateUuidStr ()
 Generate a uuid string.
 

Protected Attributes

EcDigitalIOImplBasem_pImpl
 The IO read/write implimentation.
 
EcXmlString m_Name
 Name of the item.
 
EcXmlString m_Description
 Item description.
 
EcXmlString m_Uuid
 Uuid of the item.
 
EcXmlU32 m_Type
 Type of digital IO.
 
EcXmlReal m_Offset
 Offset to convert to float.
 
EcXmlReal m_Scale
 Scale to convert to float.
 
EcXmlEmbeddedString m_Config
 Type specific configuration.
 
EcXmlU32 m_DelayUSec
 0=on demand, else micro seconds.
 
EcString m_LastError
 Last error.
 
EcReal m_LastTime
 Last time of IO.
 
EcReal m_Cached
 Cached value.
 
- Protected Attributes inherited from EcXmlCompoundType
EcXmlComponentMapm_pComponentMap
 
EcXmlComponentMapm_pAttributeComponentMap
 
EcXmlSpecialDescriptorMapm_pSpecialDescriptorMap
 
EcXmlTokenStringDescriptorMapMapm_pComponentMapTokenStringDescriptor
 
- Protected Attributes inherited from EcXmlObject
EcU8 m_State
 the state of the object - eight boolean flags
 

Additional Inherited Members

- Protected Member Functions inherited from EcXmlCompoundType
virtual EcBoolean readValueFromToken (const EcToken &token, EcXmlReader &stream)
 
virtual EcBoolean readValueFromSpecialToken (const EcToken &token, EcXmlReader &stream)
 read value from unregistered token
 
virtual EcBoolean readAttributeFromToken (const EcToken &token, EcXmlReader &stream)
 
virtual EcXmlComponentMapnewComponentMap () const
 allocate a new componentMap
 
virtual EcXmlSpecialDescriptorMapnewSpecialDescriptorMap ()
 allocate a new specialDescriptorsMap
 
virtual EcXmlTokenStringDescriptorMapMapnewTokenStringDescriptorMap ()
 allocate a new tokenStringDescriptorsMap
 
virtual void createComponentMap () const
 create component map
 
virtual void createAttributeComponentMap ()
 create attribute component map
 
virtual void createSpecialDescriptorMap ()
 create special-descriptors map
 
virtual void createTokenStringDescriptorMap ()
 create token-string descriptor map
 
virtual EcBoolean isReadOnlyComponent (const EcToken token) const
 check to see if the token corresponds to a read-only component
 
virtual EcBoolean isReadOnlyAttribute (const EcToken token) const
 check to see if the token corresponds to a read-only attribute
 
virtual EcXmlObjectlibraryAttribute ()
 
- Static Protected Attributes inherited from EcXmlObject
static const EcU8 m_theXmlInitializedBit
 the bit used to describe xml initialization
 
static const EcU8 m_theSpecifiedBit
 the bit used to describe specification
 

Detailed Description

HW implimentation base class.

Describes a single digital IO item.

A digital IO has the following conceptual properties:

  • It is digital, thus it has an unsigned integer representation, either as a pattern that represents a float or an integer, or a bool.
  • It is something that gets configured.
  • It has a type that determines bool/integer/float and read/write.
  • It has a name & UUID and description so it can be accessed within a set.
  • It has a sense of rate (or on demand), either bundling reads or even writes.

Most data items are serialized, except for error, time stamps and cacheing.

The actual IO is performed by the Impl class which is assigned by the class that sets things up.

Definition at line 51 of file ecDigitalIOXmlItem.h.

Member Function Documentation

virtual EcBoolean EcDigitalIOXmlItem::needsUpdate ( EcReal  now)
virtual

This needs a periodic update.

Parameters
nowTime now.
virtual void EcDigitalIOXmlItem::prepareXML ( const EcToken token) const
virtual

Prepare XML, done after setting up with an implimentation object that was configured programatically, it sets the mutable m_Config.

Parameters
tokenToken to use.
virtual void EcDigitalIOXmlItem::registerComponents ( )
virtual

An XML object that holds a compound set of XML data.

EcXmlCompoundType holds a compound set of XML data. This class can serve as a base class for user defined XML objects. It can have any number of XML child components.

Implements EcXmlCompoundType.

virtual void EcDigitalIOXmlItem::setCached ( EcReal  value)
virtual

Set the time stamp.

Parameters
valueValue.
virtual void EcDigitalIOXmlItem::setDelayRateUSecs ( EcU32  delay)
virtual

Set the delay rate in micro seconds, 0 is on demand.

Parameters
delayMicroseconds.
virtual void EcDigitalIOXmlItem::setDescription ( EcString  newValue)
virtual

Set item description.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setErrorString ( EcString  error)
virtual

Set the run time error string for this item.

Parameters
errorError text, "" to clear.
virtual void EcDigitalIOXmlItem::setImpl ( EcDigitalIOImplBase impl)
virtual

Set the implimentation, also configures it.

Parameters
implImplimentation.
virtual void EcDigitalIOXmlItem::setName ( EcString  newValue)
virtual

Set name of the item.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setOffset ( EcReal  newValue)
virtual

Set offset to convert to float.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setScale ( EcReal  newValue)
virtual

Set scale to convert to float.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setTimeStamp ( EcReal  value)
virtual

Set the time stamp.

Parameters
valueValue.
virtual void EcDigitalIOXmlItem::setType ( EcU32  newValue)
virtual

Set type of digital IO.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setUuid ( EcString  newValue)
virtual

Set uuid of the item.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setValue ( EcReal  newValue)
virtual

Set digital value.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::setValueWithConversion ( EcReal  newValue)
virtual

Set value as a float.

Parameters
newValueNew value.
virtual void EcDigitalIOXmlItem::update ( EcReal  value,
EcReal  time = -1 
)
virtual

Update the cached value and the time.

Parameters
valueNew cached value.
timeNew time or -1 to advance by the delay.
virtual EcBoolean EcDigitalIOXmlItem::write ( EcXmlWriter stream) const
virtual

An XML object that holds a compound set of XML data.

EcXmlCompoundType holds a compound set of XML data. This class can serve as a base class for user defined XML objects. It can have any number of XML child components.

Reimplemented from EcXmlCompoundType.


The documentation for this class was generated from the following file:
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.