Directly handles parsing NETLOG files and their headers.
Purpose: Parses both the NETLOG header and the NETLOG
file itself.
Used by: Model
Uses: CustomError, Field, Numeric.array
Attributes: None
SRS Refs: 3.2.1.1, 3.2.1.2, 3.2.1.5, 3.2.1.8
Author: rihoward
Date: 10/7/02
|
Methods
|
|
__init__
getFields
parse
|
|
|
__init__
|
__init__ ( self, filename )
Purpose: Creates a new instance of the class NetLogInput,
given a filename of the file to be parsed. Used by: Model
Uses: None
Input: filename : string
Output: New instance of the NetLogInput class
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.1
Author: rihoward
Date: 10/7/02
|
|
|
getFields
|
getFields ( self )
Purpose: Parses the header of a NETLOG file for the fields
contained in it, returning a list of Field
objects. May raise CustomErrors if the file is not
valid. Used by: Model
Uses: CustomError
Input: None
Output: getFields : Field[]
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.1, 3.2.1.2
Author: rihoward
Date: 10/7/02
|
Exceptions
|
|
CustomError, "Badly formed header in NETLOG file"
CustomError, "File not NETLOG 1.0 or missing header"
IOError, "File specified is not a file or does not exist."
|
|
|
|
parse
|
parse (
self,
fields,
streams,
)
Purpose: Given a list of fields and a list of streams,
parses the NETLOG file for the selected fields
and streams, outputting the data as a
Numeric.array. (Can raise a CustomError if there is
no data for a particular field.) If there is no
data for all streams passed, returns None Used by: Model
Uses: Numeric.array
Input: fields : Field[],
streams : Stream[]
Output: parse : Numeric.array
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.5, 3.2.1.5a, 3.2.1.5b, 3.2.1.8
Author: rihoward
Date: 9/7/02
|
|