Building Controls Virtual Test Bed
|
This is an abstract base class for actors that generates an output stream. More...
Public Member Functions | |
BACnet (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 variiables 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< BACnetObjectType > | readXMLConfigurationFile () throws IllegalActionException |
Read the xml configuration file, store the elements to BACnetObjectType ArrayList. More... | |
ArrayList< Integer > | readDeviceArray () throws IllegalActionException |
Read the device array from the configuration file. More... | |
void | checkConnection () throws IllegalActionException |
Check if the connection is lost. More... | |
void | validateDevice () throws IllegalActionException |
validate device specified in configuration file. More... | |
void | validateObjectType () throws IllegalActionException |
Validate Object Type. More... | |
void | validatePropertyName () throws IllegalActionException |
Validate property name. More... | |
void | validateAttributes () throws IllegalActionException |
Validate application tag, priority and index. More... | |
ArrayList< BACnetCompleteProperty > | readDevicePropertyArray () throws IllegalActionException |
Read all properties listed in the configuration file. 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[] | transformArrayList (ArrayList< String > data_str) |
Transform String Arraylist to Token Arrays. More... | |
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 | validateSyntax () throws IllegalActionException |
Validate xml configuration file syntax. More... | |
void | removeToken () throws IllegalActionException |
Remove tokens in previous time step. More... | |
Public Attributes | |
TypedIOPort | errorMessage |
The errorMessage port. More... | |
TypedIOPort | errorSignal |
The port that outputs the error signal. More... | |
Parameter | continueWhenError |
Parameter to control whether to contine if there was an error message. More... | |
FileParameter | configurationFile |
Parameter to specify the path for configuraton file. More... | |
Static Public Attributes | |
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 | |
abstract void | setSchemaFileName () |
Abstract class that sets the schema file name. More... | |
Protected Attributes | |
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 contine if there was an error message. More... | |
String | configurationFilePath |
String of configuration file path. More... | |
String | schemaFileName |
Schema file path. More... | |
ArrayList< BACnetCompleteProperty > | prop_arr |
Arraylist containing BACnetCompleteProperty 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 both 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... | |
BACnetDeviceManager | bacDevMan |
The BACnet device manager. More... | |
Private Member Functions | |
boolean | throwExceptions () |
Returns true if an exception should be thrown, or false if only an error message should be sent to the output port. More... | |
Private Attributes | |
int | _errsig |
signal to indicate whether there is an error, 0 means right, 1 means wrong More... | |
String | _errmsg |
detailed error message More... | |
ArrayList< BACnetObjectType > | bot_arr |
ArrayList containing elements read from configuration file. More... | |
ArrayList< Integer > | devins_arr |
ArrayList containing device instance number read from configuration file. More... | |
ArrayList< Integer > | devcon_arr |
ArrayList containing device instance number that are found in the network. More... | |
ArrayList< String > | propval_arr |
ArrayList containing strings of prperty values read from device. More... | |
ArrayList< String > | propval_arr_temp |
ArrayList temporarily holding property values read from previous time step. More... | |
ArrayList< String > | consout_arr_temp |
ArrayList temporarily holding console outputs read from previous time step. More... | |
int | _firecount |
parameter indicate how many times executeProcess function has been run More... | |
int | nDev |
Number of BACnet devices specified in the configuration file. More... | |
int | nPro |
Number of BACnet properties specified in the configuration file. More... | |
This is an abstract base class for actors that generates an output stream.
It is used by BACnetReader
and BACnetWriter
Definition at line 117 of file BACnet.java.
|
inline |
Construct an actor with the given container and name.
container | The container. |
name | The name of this actor. |
IllegalActionException | If the actor cannot be contained by the proposed container. |
NameDuplicationException | If the container already has an actor with this name. |
Definition at line 128 of file BACnet.java.
References bacnet.util.BACnet.configurationFile, bacnet.util.BACnet.consoleArr, bacnet.util.BACnet.continueWhenError, bacnet.util.BACnet.errorMessage, and bacnet.util.BACnet.errorSignal.
Referenced by bacnet.util.BACnet.clone().
|
inline |
Override the base class to determine which argument is being used.
attribute | The attribute that changed. |
IllegalActionException | If the function is not recognized. |
Definition at line 183 of file BACnet.java.
References bacnet.util.BACnet._continueWhenError, and bacnet.util.BACnet.continueWhenError.
|
inline |
Check if configuration file exists.
This function is called by initialize().
IllegalActionException | if file path is null or configuration file could not be found. |
Definition at line 288 of file BACnet.java.
References bacnet.util.BACnet.LS.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Check if the connection is lost.
This function is called by validateDevice()
IllegalActionException | if connection with BACnetDevice is lost. |
Definition at line 427 of file BACnet.java.
References bacnet.util.BACnet.devcon_arr.
Referenced by bacnet.util.BACnet.validateDevice().
|
inline |
Check if schema file exists.
This function is called in initialize().
IllegalActionException | if schema file couldn't be found. |
Definition at line 324 of file BACnet.java.
References bacnet.util.BACnet.schemaFileName.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Clone the actor into the specified workspace.
This calls the base class and then resets the type constraints.
workspace | The workspace for the new object. |
CloneNotSupportedException | If a derived class contains an attribute that cannot be cloned. |
Definition at line 164 of file BACnet.java.
References bacnet.util.BACnet.BACnet().
|
inline |
Execute Processes, store results to consoleoutput_arr and exitvalue-arr.
This function is called in fire(), (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if error occurs and continueWhenError is false. |
Definition at line 639 of file BACnet.java.
References bacnet.util.BACnet._errmsg, bacnet.util.BACnet._errsig, bacnet.util.BACnet._firecount, i, bacnet.util.BACnet.LS, and bacnet.util.BACnet.throwExceptions().
Referenced by bacnet.util.BACnet.prepareTokensToSend().
|
inline |
Initialization section, initialize variiables and check possible errors.
IllegalActionException | if configuration file couldn't be found or if schema file couldnot be found or if operation system is Mac OS X or if BACnet-stack library hasnot been compiled. |
Definition at line 207 of file BACnet.java.
References bacnet.util.BACnet._errmsg, bacnet.util.BACnet._errsig, bacnet.util.BACnet._firecount, bacnet.util.BACnet.bacDevMan, bacnet.util.BACnet.bot_arr, bacnet.util.BACnet.checkConfFileExists(), bacnet.util.BACnet.checkSchemaFileExists(), bacnet.util.BACnet.consout_arr, bacnet.util.BACnet.consout_arr_temp, bacnet.util.BACnet.devcon_arr, bacnet.util.BACnet.devins_arr, bacnet.util.BACnet.exitval_arr, bacnet.util.BACnet.nDev, bacnet.util.BACnet.nPro, bacnet.util.BACnet.prop_arr, bacnet.util.BACnet.propval_arr, bacnet.util.BACnet.propval_arr_temp, bacnet.util.BACnet.readDeviceArray(), bacnet.util.BACnet.readDevicePropertyArray(), bacnet.util.BACnet.readXMLConfigurationFile(), bacnet.util.BACnet.setConfigurationFilePath(), bacnet.util.BACnet.setSchemaFileName(), bacnet.util.BACnet.validateDevice(), bacnet.util.BACnet.validateObjectType(), bacnet.util.BACnet.validatePropertyName(), and bacnet.util.BACnet.validateSyntax().
|
inline |
Get tokens to send for the next timestep.
This function is called in fire(), (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if erros occur in executeProcess. |
Definition at line 784 of file BACnet.java.
References bacnet.util.BACnet.consout_arr, bacnet.util.BACnet.consout_tok, bacnet.util.BACnet.executeProcess(), bacnet.util.BACnet.proc_arr, bacnet.util.BACnet.propval_arr, bacnet.util.BACnet.propval_tok, bacnet.util.BACnet.storeDataInLastTimeStep(), and bacnet.util.BACnet.transformArrayList().
Referenced by bacnet.actor.BACnetReader.fire(), and bacnet.actor.BACnetWriter.fire().
|
inline |
Read the device array from the configuration file.
This function is called by initialize(). (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter)
IllegalActionException | if error occurs while reading configuration file. |
Definition at line 405 of file BACnet.java.
References bacnet.util.BACnet.bot_arr.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Read all properties listed in the configuration file.
This file is called by initialize() (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if the device or object instance number is not integer. |
Definition at line 572 of file BACnet.java.
References bacnet.util.BACnet.bot_arr, and i.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Read the xml configuration file, store the elements to BACnetObjectType ArrayList.
This function is called by initialize(). (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter)
IllegalActionException | if either SAXException or ParserConfiguration Exception has been caught. |
Definition at line 375 of file BACnet.java.
References bacnet.util.BACnet.configurationFilePath.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Remove tokens in previous time step.
This function is called by the fire()
method of the BACnetReader
and BACnetWriter
.
Definition at line 841 of file BACnet.java.
Referenced by bacnet.actor.BACnetReader.fire(), and bacnet.actor.BACnetWriter.fire().
|
inline |
Sends the error signal to the errorSignal port, the error message to the errorMessage port, and the console output to the consoleArr.
This function is called by fire().
Definition at line 804 of file BACnet.java.
References bacnet.util.BACnet._errmsg, bacnet.util.BACnet._errsig, and bacnet.util.BACnet.consout_tok.
Referenced by bacnet.actor.BACnetWriter.fire().
|
inline |
Set configuration file path.
This function is called by initialize().
Definition at line 314 of file BACnet.java.
References bacnet.util.BACnet.configurationFilePath.
Referenced by bacnet.util.BACnet.initialize().
|
abstractprotected |
Abstract class that sets the schema file name.
The class that implements this function needs to assign the variable schemaFileName
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Store response from last time step.
This function is called in prepareTokensToSend().
Definition at line 603 of file BACnet.java.
References bacnet.util.BACnet.consout_arr, bacnet.util.BACnet.consout_arr_temp, bacnet.util.BACnet.nPro, bacnet.util.BACnet.propval_arr, and bacnet.util.BACnet.propval_arr_temp.
Referenced by bacnet.util.BACnet.prepareTokensToSend().
|
inlineprivate |
Returns true
if an exception should be thrown, or false
if only an error message should be sent to the output port.
true
if an exception should be thrown, or false
if only an error message should be sent to the output port Definition at line 626 of file BACnet.java.
References bacnet.util.BACnet._continueWhenError, and bacnet.util.BACnet._firecount.
Referenced by bacnet.util.BACnet.executeProcess().
|
inline |
Transform String Arraylist to Token Arrays.
This function is called in prepareTokensToSend().
Definition at line 768 of file BACnet.java.
References i.
Referenced by bacnet.util.BACnet.prepareTokensToSend().
|
inline |
Validate application tag, priority and index.
This function is called by initialize(). (See bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if the application tag is not part of the BACnet standard, or the priority or the index is not an integer. |
Definition at line 542 of file BACnet.java.
References i.
Referenced by bacnet.actor.BACnetWriter.initialize().
|
inline |
validate device specified in configuration file.
This function is called in initialize(). (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if device instance is not an integer or cannot be found in the network. |
Definition at line 443 of file BACnet.java.
References bacnet.util.BACnet.checkConnection(), bacnet.util.BACnet.devcon_arr, i, and bacnet.util.BACnet.LS.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Validate Object Type.
This function is called by initialize(). (See bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if one object type in configuration file is not part of the standard or if the object instance number is not integer. |
Definition at line 475 of file BACnet.java.
References bacnet.util.BACnet.bot_arr, and i.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Validate property name.
This function is called by initialize(). (See bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).
IllegalActionException | if property name is not part of the standard. |
Definition at line 515 of file BACnet.java.
References i.
Referenced by bacnet.util.BACnet.initialize().
|
inline |
Validate xml configuration file syntax.
This function is called in initialze().
IllegalActionException | if configuration file couldn't be found or syntax is against the schema file. |
Definition at line 816 of file BACnet.java.
References bacnet.util.BACnet.configurationFilePath, and bacnet.util.BACnet.schemaFileName.
Referenced by bacnet.util.BACnet.initialize().
|
protected |
Parameter to control whether to contine if there was an error message.
Definition at line 885 of file BACnet.java.
Referenced by bacnet.util.BACnet.attributeChanged(), and bacnet.util.BACnet.throwExceptions().
|
private |
detailed error message
Definition at line 879 of file BACnet.java.
Referenced by bacnet.util.BACnet.executeProcess(), bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.sendToken().
|
private |
signal to indicate whether there is an error, 0 means right, 1 means wrong
Definition at line 875 of file BACnet.java.
Referenced by bacnet.util.BACnet.executeProcess(), bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.sendToken().
|
private |
parameter indicate how many times executeProcess function has been run
Definition at line 954 of file BACnet.java.
Referenced by bacnet.util.BACnet.executeProcess(), bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.throwExceptions().
|
protected |
The BACnet device manager.
Definition at line 969 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize().
|
static |
String that points to root directory of the BCVTB.
Definition at line 963 of file BACnet.java.
Referenced by bacnet.actor.BACnetReader.setSchemaFileName(), and bacnet.actor.BACnetWriter.setSchemaFileName().
|
private |
ArrayList containing elements read from configuration file.
Definition at line 901 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize(), bacnet.util.BACnet.readDeviceArray(), bacnet.util.BACnet.readDevicePropertyArray(), and bacnet.util.BACnet.validateObjectType().
FileParameter bacnet.util.BACnet.configurationFile |
Parameter to specify the path for configuraton file.
Definition at line 889 of file BACnet.java.
Referenced by bacnet.util.BACnet.BACnet().
|
protected |
String of configuration file path.
Definition at line 893 of file BACnet.java.
Referenced by bacnet.util.BACnet.readXMLConfigurationFile(), bacnet.util.BACnet.setConfigurationFilePath(), and bacnet.util.BACnet.validateSyntax().
|
protected |
The port that send response from console.
Definition at line 862 of file BACnet.java.
Referenced by bacnet.util.BACnet.BACnet().
|
protected |
ArrayList containing strings of response from device for both reading and writing process.
Definition at line 938 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize(), bacnet.util.BACnet.prepareTokensToSend(), and bacnet.util.BACnet.storeDataInLastTimeStep().
|
private |
ArrayList temporarily holding console outputs read from previous time step.
Definition at line 943 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.storeDataInLastTimeStep().
|
protected |
Token array of console outputs.
Definition at line 947 of file BACnet.java.
Referenced by bacnet.util.BACnet.prepareTokensToSend(), and bacnet.util.BACnet.sendToken().
Parameter bacnet.util.BACnet.continueWhenError |
Parameter to control whether to contine if there was an error message.
Definition at line 882 of file BACnet.java.
Referenced by bacnet.util.BACnet.attributeChanged(), and bacnet.util.BACnet.BACnet().
|
private |
ArrayList containing device instance number that are found in the network.
Definition at line 911 of file BACnet.java.
Referenced by bacnet.util.BACnet.checkConnection(), bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.validateDevice().
|
private |
ArrayList containing device instance number read from configuration file.
Definition at line 906 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize().
TypedIOPort bacnet.util.BACnet.errorMessage |
The errorMessage port.
By default, the type of this errorMessage is constrained to be at least that of the input.
Definition at line 854 of file BACnet.java.
Referenced by bacnet.util.BACnet.BACnet().
|
protected |
The rate parameter for the errorMessage port that declares the initial production.
Definition at line 871 of file BACnet.java.
|
protected |
The rate parameter for the errorMessage port.
Definition at line 866 of file BACnet.java.
TypedIOPort bacnet.util.BACnet.errorSignal |
The port that outputs the error signal.
Definition at line 858 of file BACnet.java.
Referenced by bacnet.util.BACnet.BACnet().
|
protected |
ArrayList containing strings process exit values for each process.
Definition at line 951 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize().
|
static |
File seperator.
Definition at line 957 of file BACnet.java.
Referenced by bacnet.actor.BACnetReader.setSchemaFileName(), and bacnet.actor.BACnetWriter.setSchemaFileName().
|
static |
Line Seperator.
Definition at line 960 of file BACnet.java.
Referenced by bacnet.util.BACnet.checkConfFileExists(), bacnet.actor.BACnetWriter.checkNumberOfInput(), bacnet.util.BACnet.executeProcess(), and bacnet.util.BACnet.validateDevice().
|
private |
Number of BACnet devices specified in the configuration file.
Definition at line 972 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize().
|
private |
Number of BACnet properties specified in the configuration file.
Definition at line 974 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.storeDataInLastTimeStep().
|
static |
Name of the operating system.
Definition at line 966 of file BACnet.java.
|
protected |
Arraylist containing processes to be executed in console.
Definition at line 920 of file BACnet.java.
Referenced by bacnet.actor.BACnetWriter.fire(), bacnet.actor.BACnetReader.initialize(), and bacnet.util.BACnet.prepareTokensToSend().
|
protected |
Arraylist containing BACnetCompleteProperty read from configuration file.
Definition at line 916 of file BACnet.java.
Referenced by bacnet.actor.BACnetReader.initialize(), and bacnet.util.BACnet.initialize().
|
private |
ArrayList containing strings of prperty values read from device.
Definition at line 924 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize(), bacnet.util.BACnet.prepareTokensToSend(), and bacnet.util.BACnet.storeDataInLastTimeStep().
|
private |
ArrayList temporarily holding property values read from previous time step.
Definition at line 929 of file BACnet.java.
Referenced by bacnet.util.BACnet.initialize(), and bacnet.util.BACnet.storeDataInLastTimeStep().
|
protected |
Token array of property values.
Definition at line 933 of file BACnet.java.
Referenced by bacnet.util.BACnet.prepareTokensToSend(), and bacnet.actor.BACnetReader.sendToken().
|
protected |
Schema file path.
Definition at line 897 of file BACnet.java.
Referenced by bacnet.util.BACnet.checkSchemaFileExists(), bacnet.actor.BACnetReader.setSchemaFileName(), bacnet.actor.BACnetWriter.setSchemaFileName(), and bacnet.util.BACnet.validateSyntax().