ESO IToolA
Python Reference Guide

ITSession.py
Class ITSession


Class ITSession

ITSession object is responsible for coordinating tasks in the IToolA.


Summary
object ITSession()
           Create an ITSession object.
 ITSlitFitWindow,boolean createSlitFitWindow(id, title="", newWindow=False)
           Create a new/open slit fitting window.
 ITSlitSelectWindow createSlitSelectWindow(id)
           Create a new/open slit selection window with data of id.
 boolean isFitWindowOpen(id)
           The status of the window with id.
 - registerEvent(event, callbackDef)
           Register an event handler for event.
 

Detail

Session()

Session()
Create an ITSession object.

Note! Usually ITManager is responsible for creating a session object.

Returns:
object - Session object.
Example:


createSlitFitWindow()

ITSession.createSlitFitWindow(id, title = "", newWindow=False)
Create a new/open slit fitting window with an id.

If newWindow=True then open a new fitting window.

If newWindow=False then use the current (if it exists) else create a new.

Parameters:
id - string - ID for the window.
title - string - Title for the window.
newWindow - boolean - Force a new window.
Returns:
ITSlitFitWindow - Window object.
boolean - True=New Window object was created; False otherwise.
Example:
itm = ITManager()
session = itm.getSession()
slitName = session.getSlitName(slitId)
fitWin,newWindow = session.createSlitFitWindow(str(slitId), slitName, False )


createSlitSelectWindow()

ITSession.createSlitSelectWindow(id)
Create a new/open slit selection window with the name/id 'id'.

Parameters:
id - string - ID for the window.
Returns:
ITSlitSelectWindow - Window object.
Example:
itm = ITManager()
session = itm.getSession()
selectWin = session.createSlitSelectWindow('ids')
selectWin.show()


isFitWindowOpen()

ITSession.isFitWindowOpen(id)
The status of the window with id.

Parameters:
id - string - ID of the window.
Returns:
boolean - True=The window has been created and it is open; False otherwise.
Example:


registerEvent()

ITSession.registerEvent(event, callbackDef)
Register an event handler for event.

Parameters:
event - numeric - Event.
callbackDef - function - Callback function for the event.
Example:
itm = ITManager()
...
session = itm.getSession() 
session.registerEvent(ITEvent.EVENT_SELECTWIN_SLITSELECTED,slitSelectedFunc) ... def slitSelectedFunc(self, slitId): # This is an event handler