YANE-Framework 1.1.0
Public Member Functions | Static Public Attributes | Protected Attributes

yane::NetworkedControl::IOInterfaceLocal Class Reference

Class for connecting components in a distributed plant - sensor - controller - actuator setting with a simulated network connection.

Inheritance diagram for yane::NetworkedControl::IOInterfaceLocal:
[legend]
Collaboration diagram for yane::NetworkedControl::IOInterfaceLocal:
[legend]

List of all members.

Public Member Functions

 IOInterfaceLocal (yane::NetworkedControl::ModelHandlerLocal *modelhandler, int packetlength, double samplingTime)
 Constructor.
virtual bool isConnected ()
 Function to return whether network connection has been established.
yane::Model::Modelmodel ()
 Function to return the used class yane::Model::Model pointer.
virtual void readActor (yane::NetworkedControl::T_ACTORPACKET *response)
 Function to read actuator responds from network connection.
virtual void readInput (yane::NetworkedControl::T_INPUTPACKET *indata, double *data)
 Function to read sensor input from network connection.
virtual double samplingTime ()
 Function to return the sampling period.
virtual int sequenceLength ()
 Function to return the length of the sent control sequence.
void setSamplingInstant (int seq)
 Function to set the current sampling instant.
void triggerProcessToImplementControl (double currentSamplingInstant, double nextSamplingInstant)
 Function to trigger the plant to apply the control.
virtual void writeOutput (yane::NetworkedControl::T_OUTPUTPACKET *outdata, double *data)
 Function to send output from controller to network connection.
 ~IOInterfaceLocal ()

Static Public Attributes

static const int ACTORERRORCODE = 0x2EE878B8
 Actuator error code.
static const int ACTORSUCCESSCODE = 0x7E004BC2
 Actuator success code.
static const int INPUTCODE = 0x9A10092F
 Input error code.
static const int OUTPUTCODE = 0xF02891C2
 Output error code.

Protected Attributes

yane::Model::Model_model
 Pointer of the used class yane::Model::Model model.
yane::NetworkedControl::ModelHandlerLocal * _modelhandler
 Pointer of the simulated model handler.
double _samplingTime
 Sampling period.
int _seq
 Current sampling instant.
int _sequenceLength
 Length of the control sequence.
double _t
 Current sampling time.
double * _x
 Pointer of the state vector.

Constructor & Destructor Documentation

yane::NetworkedControl::IOInterfaceLocal::IOInterfaceLocal ( yane::NetworkedControl::ModelHandlerLocal *  modelhandler,
int  packetlength,
double  samplingTime 
)

Constructor

Parameters:
modelhandlerPointer of the simulated model handler
packetlengthLength of the control sequence
samplingTimeSampling period
yane::NetworkedControl::IOInterfaceLocal::~IOInterfaceLocal ( )

Destructor


Member Function Documentation

bool yane::NetworkedControl::IOInterfaceLocal::isConnected ( ) [virtual]

Function to return whether network connection has been established

Implements yane::NetworkedControl::IOInterface.

LIB_EXPORT yane::Model::Model * yane::NetworkedControl::IOInterface::model ( ) [inherited]

Function to return the used class yane::Model::Model pointer

void yane::NetworkedControl::IOInterfaceLocal::readActor ( yane::NetworkedControl::T_ACTORPACKET response) [virtual]

Function to read actuator responds from network connection

Parameters:
responseActuator responds packet

Implements yane::NetworkedControl::IOInterface.

void yane::NetworkedControl::IOInterfaceLocal::readInput ( yane::NetworkedControl::T_INPUTPACKET indata,
double *  data 
) [virtual]

Function to read sensor input from network connection

Parameters:
indataSensor input packet
dataAdditional data information

Implements yane::NetworkedControl::IOInterface.

double yane::NetworkedControl::IOInterfaceLocal::samplingTime ( ) [virtual]

Function to return the sampling period

Implements yane::NetworkedControl::IOInterface.

int yane::NetworkedControl::IOInterfaceLocal::sequenceLength ( ) [virtual]

Function to return the length of the sent control sequence

Implements yane::NetworkedControl::IOInterface.

void yane::NetworkedControl::IOInterfaceLocal::setSamplingInstant ( int  seq)

Function to set the current sampling instant

Parameters:
seqCurrent sampling instant
void yane::NetworkedControl::IOInterfaceLocal::triggerProcessToImplementControl ( double  currentSamplingInstant,
double  nextSamplingInstant 
)

Function to trigger the plant to apply the control

Parameters:
currentSamplingInstantTime instant to start the implementation of the control
nextSamplingInstantTime instant to stop the implementation of the control
void yane::NetworkedControl::IOInterfaceLocal::writeOutput ( yane::NetworkedControl::T_OUTPUTPACKET outdata,
double *  data 
) [virtual]

Function to send output from controller to network connection

Parameters:
outdataOutput data package
dataAdditional data information

Implements yane::NetworkedControl::IOInterface.