Building Controls Virtual Test Bed
adInterfaceMCC.actor.ADInterfaceMCCWriter Class Reference

This actor writes to ADInterfaceMCC devices. More...

Inheritance diagram for adInterfaceMCC.actor.ADInterfaceMCCWriter:
Collaboration diagram for adInterfaceMCC.actor.ADInterfaceMCCWriter:

Public Member Functions

 ADInterfaceMCCWriter (CompositeEntity container, String name) throws IllegalActionException,NameDuplicationException
 Construct an actor with the given container and name. More...
 
boolean prefire () throws IllegalActionException
 Return true if the number of available tokens on the input port is at least the declared consumption rate for the port. More...
 
void checkNumberOfInput () throws IllegalActionException
 Check if the number of input tokens of the actor is equal to the number of properties read from the configuration file. More...
 
Token[] consumeToken () throws IllegalActionException
 consume token, store the token in an array. More...
 
ArrayList
< ADInterfaceMCCObjectType
addPropertyValue (Token[] inp) throws IllegalActionException
 Replace the property value in ADInterfaceMCCObjectType with tokens from Ptolemy. More...
 
void initialize () throws IllegalActionException
 Initialize variables and check for errors. More...
 
void fire () throws IllegalActionException
 At each timestep write properties to ADInterfaceMCC devices. More...
 
- Public Member Functions inherited from adInterfaceMCC.util.ADInterfaceMCC
 ADInterfaceMCC (CompositeEntity container, String name) throws NameDuplicationException, IllegalActionException
 Construct an actor with the given container and name. More...
 
Object clone (Workspace workspace) throws CloneNotSupportedException
 Clone the actor into the specified workspace. More...
 
void attributeChanged (Attribute attribute) throws IllegalActionException
 Override the base class to determine which argument is being used. More...
 
void initialize () throws IllegalActionException
 Initialization section, initialize variables and check possible errors. More...
 
void checkConfFileExists () throws IllegalActionException
 Check if configuration file exists. More...
 
void setConfigurationFilePath () throws IllegalActionException
 Set configuration file path. More...
 
void checkSchemaFileExists () throws IllegalActionException
 Check if schema file exists. More...
 
ArrayList
< ADInterfaceMCCObjectType
readXMLConfigurationFile () throws IllegalActionException
 Read the xml configuration file, store the elements to ADInterfaceMCCObjectType ArrayList. More...
 
void storeDataInLastTimeStep ()
 Store response from last time step. More...
 
void executeProcess (ArrayList< ProcessBuilder > process_arr) throws IllegalActionException
 Execute Processes, store results to consoleoutput_arr and exitvalue-arr. More...
 
Token[] transformArrayListString (ArrayList< String > data_str)
 Transform String Arraylist to Token Arrays. More...
 
Token[] transformArrayListDouble (ArrayList< String > data_str)
 
void prepareTokensToSend () throws IllegalActionException
 Get tokens to send for the next timestep. More...
 
void sendToken () throws IllegalActionException
 Sends the error signal to the errorSignal port, the error message to the errorMessage port, and the console output to the consoleArr. More...
 
void validateAttributes () throws IllegalActionException
 Validate application tag. More...
 
void validateSyntax () throws IllegalActionException
 Validate xml configuration file syntax. More...
 
void removeToken () throws IllegalActionException
 Remove tokens in previous time step. More...
 

Public Attributes

TypedIOPort input
 
Parameter input_tokenConsumptionRate
 
- Public Attributes inherited from adInterfaceMCC.util.ADInterfaceMCC
TypedIOPort errorMessage
 The errorMessage port. More...
 
TypedIOPort errorSignal
 The port that outputs the error signal. More...
 
Parameter continueWhenError
 Parameter to control whether to continue if there was an error message. More...
 
FileParameter configurationFile
 Parameter to specify the path for configuraton file. More...
 

Static Public Attributes

static ArrayList
< ADInterfaceMCCObjectType
prop_add_arr
 ADInterfaceMCCObjectType after adding the value from Ptolemy. More...
 
- Static Public Attributes inherited from adInterfaceMCC.util.ADInterfaceMCC
static final String FS = System.getProperty("file.separator")
 File seperator. More...
 
static final String LS = System.getProperty("line.separator")
 Line Seperator. More...
 
static final String bcvtbhome = System.getenv("BCVTB_HOME")
 String that points to root directory of the BCVTB. More...
 
static final String osName = System.getProperty("os.name")
 Name of the operating system. More...
 

Protected Member Functions

void setSchemaFileName ()
 Sets the schema file name. More...
 
- Protected Member Functions inherited from adInterfaceMCC.util.ADInterfaceMCC
abstract void setSchemaFileName ()
 Abstract class that sets the schema file name. More...
 

Additional Inherited Members

- Protected Attributes inherited from adInterfaceMCC.util.ADInterfaceMCC
TypedIOPort consoleArr
 The port that send response from console. More...
 
Parameter errorMessage_tokenProductionRate
 The rate parameter for the errorMessage port. More...
 
Parameter errorMessage_tokenInitProduction
 The rate parameter for the errorMessage port that declares the initial production. More...
 
boolean _continueWhenError
 Parameter to control whether to continue if there was an error message. More...
 
String configurationFilePath
 String of configuration file path. More...
 
String schemaFileName
 Schema file path. More...
 
ArrayList
< ADInterfaceMCCObjectType
prop_arr
 Arraylist containing ADInterfaceMCCObjectType read from configuration file. More...
 
ArrayList< ProcessBuilder > proc_arr
 Arraylist containing processes to be executed in console. More...
 
Token[] propval_tok
 Token array of property values. More...
 
ArrayList< String > consout_arr
 ArrayList containing strings of response from device for ad reading and writing process. More...
 
Token[] consout_tok
 Token array of console outputs. More...
 
ArrayList< Integer > exitval_arr
 ArrayList containing strings process exit values for each process. More...
 
ADInterfaceMCCDeviceManager adDevMan
 The ADInterfaceMCC device manager. More...
 

Detailed Description

This actor writes to ADInterfaceMCC devices.

During initialization, it validates the input. At each time step, it sends its input token to ADInterfaceMCC devices. The response of the ADInterfaceMCC devices is sent to the output port of this actor. There is also an error port that can be used to check for error messages.

Author
Thierry Nouidui based on Bacnet Implementation

Definition at line 106 of file ADInterfaceMCCWriter.java.

Constructor & Destructor Documentation

adInterfaceMCC.actor.ADInterfaceMCCWriter.ADInterfaceMCCWriter ( CompositeEntity  container,
String  name 
) throws IllegalActionException,NameDuplicationException
inline

Construct an actor with the given container and name.

Parameters
containerThe container.
nameThe name of this actor.
Exceptions
IllegalActionExceptionIf the actor cannot be contained by the proposed container.
NameDuplicationExceptionIf the container already has an actor with this name.

Definition at line 116 of file ADInterfaceMCCWriter.java.

References adInterfaceMCC.actor.ADInterfaceMCCWriter.input, and adInterfaceMCC.actor.ADInterfaceMCCWriter.input_tokenConsumptionRate.

Member Function Documentation

ArrayList<ADInterfaceMCCObjectType> adInterfaceMCC.actor.ADInterfaceMCCWriter.addPropertyValue ( Token[]  inp) throws IllegalActionException
inline

Replace the property value in ADInterfaceMCCObjectType with tokens from Ptolemy.

This function is called by fire().

Exceptions
IllegalActionExceptionif input token is missing.

Definition at line 219 of file ADInterfaceMCCWriter.java.

References i, and adInterfaceMCC.util.ADInterfaceMCC.prop_arr.

Referenced by adInterfaceMCC.actor.ADInterfaceMCCWriter.fire().

void adInterfaceMCC.actor.ADInterfaceMCCWriter.checkNumberOfInput ( ) throws IllegalActionException
inline

Check if the number of input tokens of the actor is equal to the number of properties read from the configuration file.

This function is called by initialize().

Exceptions
IllegalActionExceptionif the number of input tokens is different from the number of properties.

Definition at line 175 of file ADInterfaceMCCWriter.java.

References i, adInterfaceMCC.util.ADInterfaceMCC.LS, and adInterfaceMCC.util.ADInterfaceMCC.prop_arr.

Referenced by adInterfaceMCC.actor.ADInterfaceMCCWriter.initialize().

Token [] adInterfaceMCC.actor.ADInterfaceMCCWriter.consumeToken ( ) throws IllegalActionException
inline

consume token, store the token in an array.

it is called in fire().

Exceptions
IllegalActionExceptionif input token cannot be read.

Definition at line 205 of file ADInterfaceMCCWriter.java.

References i, and adInterfaceMCC.actor.ADInterfaceMCCWriter.input.

Referenced by adInterfaceMCC.actor.ADInterfaceMCCWriter.fire().

void adInterfaceMCC.actor.ADInterfaceMCCWriter.fire ( ) throws IllegalActionException
inline

At each timestep write properties to ADInterfaceMCC devices.

Exceptions
IllegalActionExceptionIf platform is Mac OS X or If write property binary cannot be found or If erros occur while reading response from ADInterfaceMCC device or If process of wrting properties are interrupted.

Definition at line 277 of file ADInterfaceMCCWriter.java.

References adInterfaceMCC.actor.ADInterfaceMCCWriter.addPropertyValue(), adInterfaceMCC.actor.ADInterfaceMCCWriter.consumeToken(), adInterfaceMCC.util.ADInterfaceMCC.prepareTokensToSend(), adInterfaceMCC.util.ADInterfaceMCC.proc_arr, adInterfaceMCC.actor.ADInterfaceMCCWriter.prop_add_arr, adInterfaceMCC.util.ADInterfaceMCC.removeToken(), and adInterfaceMCC.util.ADInterfaceMCC.sendToken().

void adInterfaceMCC.actor.ADInterfaceMCCWriter.initialize ( ) throws IllegalActionException
inline

Initialize variables and check for errors.

Exceptions
IllegalActionExceptionif configuration file syntax is not correct or if object type in configuration file is not part of standard or if property name in configuration file is not part of standard or if device specified in configuration file cannot be connected.

Definition at line 255 of file ADInterfaceMCCWriter.java.

References adInterfaceMCC.actor.ADInterfaceMCCWriter.checkNumberOfInput(), and adInterfaceMCC.util.ADInterfaceMCC.validateAttributes().

boolean adInterfaceMCC.actor.ADInterfaceMCCWriter.prefire ( ) throws IllegalActionException
inline

Return true if the number of available tokens on the input port is at least the declared consumption rate for the port.

Otherwise return false.

Exceptions
IllegalActionExceptionIf it is thrown accessing the port.
Returns
True if there are enough tokens.

Definition at line 146 of file ADInterfaceMCCWriter.java.

References i, adInterfaceMCC.actor.ADInterfaceMCCWriter.input, and required.

void adInterfaceMCC.actor.ADInterfaceMCCWriter.setSchemaFileName ( )
inlineprotected

Sets the schema file name.

This class assigns the variable schemaFileName

Definition at line 304 of file ADInterfaceMCCWriter.java.

References adInterfaceMCC.util.ADInterfaceMCC.bcvtbhome, adInterfaceMCC.util.ADInterfaceMCC.FS, and adInterfaceMCC.util.ADInterfaceMCC.schemaFileName.

Member Data Documentation

Parameter adInterfaceMCC.actor.ADInterfaceMCCWriter.input_tokenConsumptionRate
ArrayList<ADInterfaceMCCObjectType> adInterfaceMCC.actor.ADInterfaceMCCWriter.prop_add_arr
static

ADInterfaceMCCObjectType after adding the value from Ptolemy.

Definition at line 325 of file ADInterfaceMCCWriter.java.

Referenced by adInterfaceMCC.actor.ADInterfaceMCCWriter.fire().


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