Building Controls Virtual Test Bed
|
This actor writes to BACnet devices. More...
Public Member Functions | |
BACnetWriter (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 it is called in fire() More... | |
ArrayList< BACnetCompleteProperty > | addPropertyValue (Token[] inp) throws IllegalActionException |
Replace the property value in BACnetCompleteProperty 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 BACnet devices. More... | |
Public Member Functions inherited from bacnet.util.BACnet | |
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 | input |
Parameter | input_tokenConsumptionRate |
Public Attributes inherited from bacnet.util.BACnet | |
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 ArrayList < BACnetCompleteProperty > | prop_add_arr |
BACnetCompleteProperty after adding the value from Ptolemy. More... | |
Static Public Attributes inherited from bacnet.util.BACnet | |
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 bacnet.util.BACnet | |
abstract void | setSchemaFileName () |
Abstract class that sets the schema file name. More... | |
Additional Inherited Members | |
Protected Attributes inherited from bacnet.util.BACnet | |
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... | |
This actor writes to BACnet devices.
During initialization, it validates the input. At each time step, it sends its input token to BACnet devices. The response of the BACnet 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.
Definition at line 124 of file BACnetWriter.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 134 of file BACnetWriter.java.
References bacnet.actor.BACnetWriter.input, and bacnet.actor.BACnetWriter.input_tokenConsumptionRate.
|
inline |
Replace the property value in BACnetCompleteProperty with tokens from Ptolemy.
This function is called by fire()
IllegalActionException | if input token is missing |
Definition at line 229 of file BACnetWriter.java.
References i.
Referenced by bacnet.actor.BACnetWriter.fire().
|
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()
IllegalActionException | if the number of input tokens is different from the number of properties |
Definition at line 193 of file BACnetWriter.java.
References bacnet.util.BACnet.LS.
Referenced by bacnet.actor.BACnetWriter.initialize().
|
inline |
consume token, store the token in an array it is called in fire()
IllegalActionException | if input token cannot be read |
Definition at line 215 of file BACnetWriter.java.
References i, and bacnet.actor.BACnetWriter.input.
Referenced by bacnet.actor.BACnetWriter.fire().
|
inline |
At each timestep write properties to BACnet devices.
IllegalActionException | If platform is Mac OS X or If write property binary cannot be found or If erros occur while reading response from BACnet device or If process of wrting properties are interrupted |
Definition at line 281 of file BACnetWriter.java.
References bacnet.actor.BACnetWriter.addPropertyValue(), bacnet.actor.BACnetWriter.consumeToken(), bacnet.util.BACnet.prepareTokensToSend(), bacnet.util.BACnet.proc_arr, bacnet.actor.BACnetWriter.prop_add_arr, bacnet.util.BACnet.removeToken(), and bacnet.util.BACnet.sendToken().
|
inline |
Initialize variables and check for errors.
IllegalActionException | if 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 259 of file BACnetWriter.java.
References bacnet.actor.BACnetWriter.checkNumberOfInput(), and bacnet.util.BACnet.validateAttributes().
|
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.
IllegalActionException | If it is thrown accessing the port. |
Definition at line 164 of file BACnetWriter.java.
References i, bacnet.actor.BACnetWriter.input, and required.
|
inlineprotected |
Sets the schema file name.
This class assigns the variable schemaFileName
Definition at line 308 of file BACnetWriter.java.
References bacnet.util.BACnet.bcvtbhome, bacnet.util.BACnet.FS, and bacnet.util.BACnet.schemaFileName.
TypedIOPort bacnet.actor.BACnetWriter.input |
Definition at line 320 of file BACnetWriter.java.
Referenced by bacnet.actor.BACnetWriter.BACnetWriter(), bacnet.actor.BACnetWriter.consumeToken(), and bacnet.actor.BACnetWriter.prefire().
Parameter bacnet.actor.BACnetWriter.input_tokenConsumptionRate |
Definition at line 324 of file BACnetWriter.java.
Referenced by bacnet.actor.BACnetWriter.BACnetWriter().
|
static |
BACnetCompleteProperty after adding the value from Ptolemy.
Definition at line 329 of file BACnetWriter.java.
Referenced by bacnet.actor.BACnetWriter.fire().