rcReportGen Class Reference

Run report generator class for the ScriptEngine. More...

List of all members.

Public Member Functions

def __init__
 rcReportGen constructor.
def initialize
 Initialize the run report generator.
def connectDB
 Connect to the database.
def disconnectDB
 Disconnect from the database.
def addField
 Add field to the run report.
def writeReportCSV
 Write the run report as a comma delimited file.
def writeReportXML
 Write the run report as an XML.
def writeReportSQL
 Write the run report to a relational database.
def recordInfo
def readReportXML
 Read and parse the XML run report.
def getReportFields
 Retrieve the run report item names.
def getReportData
 Retrieve the run report item values.
def getReportUnits
 Retrieve the run report item units.
def getTimestamp
 Retrieve the timestamp of the run.
def addShift
 Add a shift summary to the database if it doesn't already exist.
def getShiftInfo
 Find the shift information based on the timestamp t.
def obtainLocalTime
 Convert a GMT date/time to local date/time.
def obtainGMTime
 Convert a local date/time to a GMT date/time.
def convertTimeTuple
 Convert a time tuple to an SQL format.A date/time tuple.


Detailed Description

Run report generator class for the ScriptEngine.

Definition at line 54 of file rcReportGen.py.


Member Function Documentation

def __init__   self,
  fileName = "rcReport.out",
  prefs = None
 

rcReportGen constructor.

Parameters:
fileName Run report file name
prefs Preferences instance

Definition at line 56 of file rcReportGen.py.

def addField   self,
  field,
  data,
  units = UNITS_STRING
 

Add field to the run report.

Parameters:
field Name of the run report item
data Value of the run report item
units Run report item unit

Definition at line 122 of file rcReportGen.py.

def addShift   self,
  tstamp
 

Add a shift summary to the database if it doesn't already exist.

This method finds the shift id that the run belongs to based on tstamp and creates a shift summary if it doesn't already exist. This was done because the web e-logbook does not display the shift if it doesn't contain a shift summary even if it contains runs that belong to that shift.

Parameters:
tstamp Timestamp of the run.
Returns:
True if the shift is created, None otherwise.

Definition at line 328 of file rcReportGen.py.

def connectDB   self,
  dbname
 

Connect to the database.

Returns:
True if connect was successful, False otherwise.

Definition at line 93 of file rcReportGen.py.

def convertTimeTuple   self,
  timeTuple
 

Convert a time tuple to an SQL format.A date/time tuple.

Definition at line 433 of file rcReportGen.py.

def disconnectDB   self  ) 
 

Disconnect from the database.

Definition at line 116 of file rcReportGen.py.

def getReportData   self  ) 
 

Retrieve the run report item values.

Returns:
A list containing run report item values.

Definition at line 307 of file rcReportGen.py.

def getReportFields   self  ) 
 

Retrieve the run report item names.

Returns:
A list containing run report item names.

Definition at line 300 of file rcReportGen.py.

def getReportUnits   self  ) 
 

Retrieve the run report item units.

Returns:
A list containing run report item units.

Definition at line 314 of file rcReportGen.py.

def getShiftInfo   self,
  t
 

Find the shift information based on the timestamp t.

Parameters:
t GMT timestamp of the run
Returns:
A tuple containing the shift id, start time, end time and type.

Definition at line 368 of file rcReportGen.py.

def getTimestamp   self  ) 
 

Retrieve the timestamp of the run.

Returns:
Timestamp of the run.

Definition at line 321 of file rcReportGen.py.

def initialize   self,
  tstamp = None
 

Initialize the run report generator.

Parameters:
tstamp Timestamp of the run

Definition at line 71 of file rcReportGen.py.

def obtainGMTime   self,
  dateTime
 

Convert a local date/time to a GMT date/time.

Parameters:
dateTime Local date/time value in SQL format
Returns:
GMT date/time tuple

Definition at line 420 of file rcReportGen.py.

def obtainLocalTime   self,
  dateTime
 

Convert a GMT date/time to local date/time.

Parameters:
dateTime GMT date/time tuple
Returns:
Local date/time in SQL format

Definition at line 409 of file rcReportGen.py.

def readReportXML   self  ) 
 

Read and parse the XML run report.

Definition at line 260 of file rcReportGen.py.

def recordInfo   self,
  table
 

Definition at line 249 of file rcReportGen.py.

def writeReportCSV   self  ) 
 

Write the run report as a comma delimited file.

Definition at line 136 of file rcReportGen.py.

def writeReportSQL   self  ) 
 

Write the run report to a relational database.

Definition at line 195 of file rcReportGen.py.

def writeReportXML   self  ) 
 

Write the run report as an XML.

Definition at line 160 of file rcReportGen.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:53:28 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO