Table of Contents

Class: MainWindow sam/MainWindow.py

Responsible for creating and handling events from the main window GUI.

Purpose: Shows the main window GUI and handles the user events associated with it.

Used by: Controller

Uses: FileSelection, Model, AboutDialog, Selector, AnalysisPlugins OutputPlugins, CustomError, ErrorHandler, Logger

Attributes: None

SRS Refs: 3.2.1.1, 3.2.1.2, 3.2.1.3, 3.2.1.5, 3.2.1.6, 3.2.1.8, 3.2.1.9, 3.2.1.10, 4.3.4.5, 5.2.1, 5.2.3

Author: mayadm

Date: 11/7/02

Methods   
__init__
about
clearStreams
doAnalysis
doOutput
extractInfo
fileOpen
handleAnalysis
handleExit
handleSelected
loadLog
selectAllStreams
show
startHelp
toggleResolving
  __init__ 
__init__ ( self )

Purpose: Creates a new instance of the class MainWindow. If the environment variable RAMI_SAM_SHARE is set, the glade file containing MainWindow's widget tree is looked for in that directory, otherwise looked for in the current directory.

Used by: Controller

Uses: None

Input: None

Output: New instance of the class MainWindow

Preconditions: None

Postconditions: None

SRS Refs: None

Author: mayadm

Date: 11/7/02

  about 
about ( self,  *args )

Purpose: Handles the user clicking on the "about" item from the Help menu. Creates and shows the about dialog box to the user.

Used by: MainWindow

Uses: AboutDialog

Input: *args : unused arguments

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 5.2.3

Author: mayadm

Date: 15/5/02

  clearStreams 
clearStreams ( self,  *args )

Purpose: Unselects all the streams in the streams list.

Used by: MainWindow

Uses: None

Input: *args: miscellaneous unused arguments

Output: None

Preconditions: None

Postconditions: None

Author: mayadm

SRS Refs: 5.2.3

Date: 23/10/02

  doAnalysis 
doAnalysis (
        self,
        table,
        analysis,
        )

Purpose: Given a Table of data ready to be analysed, and a list of analyses (in the form of Plugin objects) to perform (must be a singleton list), runs the analysis plugin associated with the id of the Plugin. Returns a new Table containing the analysed data.

Used by: MainWindow

Uses: ErrorHandler

Input: table : Table, analysis : Plugin[]

Output: doAnalysis : Table

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.8

Author: mayadm

Date: 15/7/02

  doOutput 
doOutput (
        self,
        table,
        output,
        )

Purpose: Given a Table of data ready to be outputted, and a list of outputs (in the form of Plugin objects) to perform (must be a singleton list), runs the output plugin associated with the id of the Plugin.

Uses: ErrorHandler

Input: table : Table, output : Plugin[]

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.6, 3.2.1.8

Author: mayadm

Date: 15/7/02

  extractInfo 
extractInfo (
        self,
        fields,
        streams,
        )

Purpose: Given a list of Fields and a list of Streams contained in the NETLOG file, extracts the information needed from the NETLOG file selected, and returns this information as a Table.

Used by: MainWindow

Uses: None

Input: fields : Field[], streams : Stream[]

Output: extractInfo : Table

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.8

Author: mayadm

Date: 15/7/02

  fileOpen 
fileOpen ( self,  *args )

Purpose: Handles the user clicking on either the "open_button1" button or the "open1" item from the file menu. Creates a FileSelection class (and sets it to be modal). Waits for the user to either enter a filename or exit/cancel from FileSelection's mainloop. If the user has selected a filename, the fields and streams from the selected file are obtained. If there are any CustomErrors or IOErrors encountered while getting fields and streams, these are caught and the error message is displayed to the user, who must acknowledge the error before selecting another file. Once a valid file has been selected, the fields and streams contained in it are displayed in the lists on screen, and the analysis and output lists are enabled for selection (after first being cleared of any already selected items).

Used by: MainWindow

Uses: FileSelection, ErrorHandler, gtk

Input: *args : unused arguments

Output: None

Preconditions: The main window widget is called "mainwindow".

Postconditions: None

SRS Refs: 3.2.1.1, 3.2.1.2, 3.2.1.5

Author: mayadm

Date: 11/7/02

  handleAnalysis 
handleAnalysis ( self,  *args )

Purpose: Handles the user clicking on the run button. Extracts the information on the selected fields and streams from the NETLOG file selected, gets the analysis done on this information then gets the output done. If any CustomErrors are raised in parsing the NETLOG file or during analysis/output, these are caught and the error message displayed to the user, who must acknowledge before continuing.

Used by: MainWindow

Uses: ErrorHandler

Input: *args : unused arguments

Output: None

Preconditions: The name of the main window widget is "mainwindow" in the glade file.

Postconditions: None

SRS Refs: 3.2.1.8

Author: mayadm

Date: 15/7/02

  handleExit 
handleExit ( self,  *args )

Purpose: Handles the user closing the window or selecting "exit1" from the File menu. Calls gtk.mainquit().

Uses: gtk

Input: *args : unused arguments

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.10

Author: mayadm

Date: 16/8/02

  handleSelected 
handleSelected (
        self,
        obj,
        *args,
        )

Purpose: Handles the user clicking on any of the 4 lists (data, stream, output, analysis). Checks which object has caused the event, then changes the corresponding Selector's selected items. Also checks if an item selected causes another item (in another list) to be greyed out. Checks whether at least one of each list has been selected - if yes, then enables the "graph_button1" button, otherwise it disables the "graph_button1" button.

Used by: MainWindow

Uses: FileSelection

Input: obj : GtkList, *args : unused arguments

Output: None

Preconditions: The GtkLists in the widget_tree are named "stream_list", "analysis_list", "data_list", and "output_list". The graph button is named "graph_button1".

Postconditions: None

SRS Refs: 3.2.1.2, 3.2.1.3, 3.2.1.5, 3.2.1.6, 3.2.1.8

Author: mayadm

Date: 16/7/02

  loadLog 
loadLog ( self,  *args )

Purpose: Checks first that the user is root, and warns the user if they are not. Then creates an instance of the Logger class so that logging can be initiated. Runs a mainloop().

Used by: MainWindow

Uses: gtk

Input: *args: miscellaneous unused arguments

Output: None

Preconditions: None

Postconditions: None

Author: lljy

SRS Refs: 3.2.1.9

Date: 27/8/02

  selectAllStreams 
selectAllStreams ( self,  *args )

Purpose: Selects all the streams in the streams list.

Used by: MainWindow

Uses: None

Input: *args: miscellaneous unused arguments

Output: None

Preconditions: None

Postconditions: None

Author: mayadm

SRS Refs: 5.2.3

Date: 23/10/02

  show 
show ( self )

Purpose: Shows the main window GUI and hooks up the handlers for all the widgets. Sets up the four selector lists and displays them, greying out the Analysis and Output lists (since no streams or data have been loaded in). Also greys out the "graph_button1" button (since the user has not selected a data/stream/analysis/output type yet and therefore cannot Run the analysis).

Used by: Controller

Uses: gtk, Selector, AnalysisPlugins, OutputPlugins

Input: None

Output: None

Preconditions: The name of the main window widget in the glade file is "mainwindow". The name of the 4 lists are "analysis_list", "stream_list", "data_list", "output_list". The name of the graph button is "graph_button1". The handlers in the glade file are those given below in the dictionary.

Postconditions: None

SRS Refs: 3.2.1.8, 5.2.1, 5.2.3

Author: mayadm

Date: 11/7/02

  startHelp 
startHelp ( self,  *args )

Purpose: Opens online help in Galeon. If help is not constructed from source files, attempts to construct it. If the environment variable RAMI_SAM_DOCS is set, looks for help files there, otherwise in the current directory.

Used by: MainWindow

Uses: os

Input: *args: miscellaneous unused arguments

Output: None

Preconditions: None

Postconditions: None

Author: lljy

SRS Refs: 4.3.4.5

Date: 28/9/02

  toggleResolving 
toggleResolving ( self,  *args )

Purpose: Toggles resolving of ip address into domain names for all the streams currently loaded.

Used by: MainWindow

Uses: None

Input: *args : unused input arguments

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 5.2.3

Author: lljy

Date: 28/10/02


Table of Contents

This document was automatically generated on Wed Oct 30 23:04:21 2002 by HappyDoc version 2.0