Building Controls Virtual Test Bed
bacnet.actor.BACnetReader Class Reference

This actor reads from BACnet devices. More...

Inheritance diagram for bacnet.actor.BACnetReader:
Collaboration diagram for bacnet.actor.BACnetReader:

Public Member Functions

 BACnetReader (CompositeEntity container, String name) throws IllegalActionException, NameDuplicationException
 Construct an actor with the given container and name. More...
 
Object clone (Workspace workspace) throws CloneNotSupportedException
 Override base class defined in BACnet.java. More...
 
void initialize () throws IllegalActionException
 Initialize section, initialize variables, check possible errors. More...
 
void sendToken () throws IllegalActionException
 Sends the error signal to the errorSignal port, the error message to the errorMessage port, the console output to the consoleArr, and the values read from BACnet to the proValArr port. More...
 
void fire () throws IllegalActionException
 Read BACnet property based on the configuration file

Exceptions
IllegalActionExceptionIf globalwi binary cannot be found or If I/O errors occur while connecting to BACnet device or If Platoform is Mac or If I/O errors occur while reading properties from device or if reading property process is interrupted.
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< BACnetObjectTypereadXMLConfigurationFile () 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< BACnetCompletePropertyreadDevicePropertyArray () 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 proValArr
 The port that sends the array of property value. More...
 
TypedIOPort trigger
 The port that fires BACnetReader. More...
 
- 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...
 

Protected Member Functions

void setSchemaFileName ()
 Sets the schema file name. More...
 
void setTriggerState () throws IllegalActionException
 Set trigger state. More...
 
- Protected Member Functions inherited from bacnet.util.BACnet
abstract void setSchemaFileName ()
 Abstract class that sets the schema file name. More...
 

Protected Attributes

boolean fireReader
 Boolean state to trigger BACnetReader. More...
 
- 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< BACnetCompletePropertyprop_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...
 

Additional Inherited Members

- 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...
 

Detailed Description

This actor reads from BACnet devices.

During initialization, it validates the input. At each time step, it outputs the values read from BACnet devices. There is also an error port that can be used to check for error messages.

Author
Zhengwei Li

Definition at line 119 of file BACnetReader.java.

Constructor & Destructor Documentation

bacnet.actor.BACnetReader.BACnetReader ( 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 129 of file BACnetReader.java.

References bacnet.actor.BACnetReader.proValArr, and bacnet.actor.BACnetReader.trigger.

Referenced by bacnet.actor.BACnetReader.clone().

Member Function Documentation

Object bacnet.actor.BACnetReader.clone ( Workspace  workspace) throws CloneNotSupportedException
inline

Override base class defined in BACnet.java.

Parameters
workspaceThe workspace for the new object.
Returns
A new actor.
Exceptions
CloneNotSupportedExceptionIf a derived class contains an attribute that cannot be cloned.

Definition at line 156 of file BACnetReader.java.

References bacnet.actor.BACnetReader.BACnetReader().

void bacnet.actor.BACnetReader.fire ( ) throws IllegalActionException
inline

Read BACnet property based on the configuration file

Exceptions
IllegalActionExceptionIf globalwi binary cannot be found or If I/O errors occur while connecting to BACnet device or If Platoform is Mac or If I/O errors occur while reading properties from device or if reading property process is interrupted.

Definition at line 207 of file BACnetReader.java.

References bacnet.actor.BACnetReader.fireReader, bacnet.util.BACnet.prepareTokensToSend(), bacnet.util.BACnet.removeToken(), bacnet.actor.BACnetReader.sendToken(), and bacnet.actor.BACnetReader.setTriggerState().

void bacnet.actor.BACnetReader.initialize ( ) throws IllegalActionException
inline

Initialize section, initialize variables, check possible 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 172 of file BACnetReader.java.

References bacnet.actor.BACnetReader.fireReader, bacnet.util.BACnet.proc_arr, and bacnet.util.BACnet.prop_arr.

void bacnet.actor.BACnetReader.sendToken ( ) throws IllegalActionException
inline

Sends the error signal to the errorSignal port, the error message to the errorMessage port, the console output to the consoleArr, and the values read from BACnet to the proValArr port.

This function is called by fire()

Definition at line 193 of file BACnetReader.java.

References bacnet.util.BACnet.propval_tok.

Referenced by bacnet.actor.BACnetReader.fire().

void bacnet.actor.BACnetReader.setSchemaFileName ( )
inlineprotected

Sets the schema file name.

This class assigns the variable schemaFileName

Definition at line 229 of file BACnetReader.java.

References bacnet.util.BACnet.bcvtbhome, bacnet.util.BACnet.FS, and bacnet.util.BACnet.schemaFileName.

void bacnet.actor.BACnetReader.setTriggerState ( ) throws IllegalActionException
inlineprotected

Set trigger state.

This class set trigger state according to trigger port

Definition at line 238 of file BACnetReader.java.

References bacnet.actor.BACnetReader.fireReader, and bacnet.actor.BACnetReader.trigger.

Referenced by bacnet.actor.BACnetReader.fire().

Member Data Documentation

boolean bacnet.actor.BACnetReader.fireReader
protected
TypedIOPort bacnet.actor.BACnetReader.proValArr

The port that sends the array of property value.

Definition at line 144 of file BACnetReader.java.

Referenced by bacnet.actor.BACnetReader.BACnetReader().

TypedIOPort bacnet.actor.BACnetReader.trigger

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