Handles the parsing of NETLOG and STREAMSLOG files.
Purpose: Handles the input data details - parsing of NETLOG and
STREAMSLOG files, hence abstracting these input details
away from MainWindow.
Used by: MainWindow
Uses: NetLogInput, StreamsLogInput, Stream, Table, CustomError
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
|
|
__convertFilename
__init__
generateTable
getAvailableFields
getStreams
|
|
|
__convertFilename
|
__convertFilename ( self, name )
Purpose: Changes the NETLOG filename (in the form name.nlog)
to the corresponding STREAMSLOG file name (in the
form name.slog). If the given filename is not of
the form name.nlog, an IOError is raised. Used by: Model
Uses: None
Input: name : string
Output: __convertFilename : string
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.1
Author: rihoward
Date: 10/7/02
|
Exceptions
|
|
IOError, "Error: no STREAMSLOG (.slog) file found:" + slogfilename
|
|
|
|
__init__
|
__init__ ( self, filename )
Purpose: Creates a new instance of the class Model, given
a filename of the NETLOG file. Gets the fields from
this NETLOG file, and if there is a stream field,
it will also parse the STREAMSLOG file to get
the streams. Used by: MainWindow
Uses: NetLogInput, StreamsLogInput, Stream
Input: filename : string
Output: New instance of the Model class
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.1, 3.2.1.2, 3.2.1.5
Author: rihoward
Date: 10/7/02
|
|
|
generateTable
|
generateTable (
self,
sel_fields,
sel_streams,
)
Purpose: Given a list of selected fields and a list of
selected streams, gets the parsing of the NETLOG
file done, returning a Table object containing all
information needed about the selected fields and
streams in the NETLOG file. Provides an interface
between the MainWindow class and the
NetLogInput class, which involves testing the
fields input and changing the streams input. Can
raise a CustomError if there is no data for all
streams selected (if there is data for at least
one stream, then the streams with no data are
ignored) Used by: MainWindow
Uses: Table, CustomError
Input: sel_fields : Field[],
sel_streams : Stream[]
Output: generateTable : Table
Preconditions: None
Postconditions: The selected fields has had "time" added at the
start of the list, since time is needed for all
tables.
SRS Refs: 3.2.1.8
Author: rihoward
Date: 10/7/02
|
Exceptions
|
|
CustomError, "There is no data for any of the streams selected"
|
|
|
|
getAvailableFields
|
getAvailableFields ( self )
Purpose: Filters out the fields that shouldn't be
selected by the user: stream and time. Used by: MainWindow
Uses: None
Input: None
Output: getAvailableFields : Field[]
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.2
Author: mayadm
Date: 24/7/02
|
|
|
getStreams
|
getStreams ( self )
Purpose: Returns a list of the Streams to be displayed to
the user. Used by: MainWindow
Uses: None
Input: None
Output: getStreams : Stream[]
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.5
Author: mayadm
Date: 25/7/02
|
|