Package gui :: Package analyses :: Class Analysis_controller
[hide private]
[frames] | no frames]

Class Analysis_controller

source code

Class for controlling all aspects of analyses.

Instance Methods [hide private]
 
__init__(self, gui)
Initialise the analysis controller.
source code
data.gui.Analyses instance
analysis_data_loop(self)
Loop over the analyses, yielding the data objects.
source code
wx.Frame object
analysis_loop(self)
Loop over the analyses, yielding the page objects.
source code
str
current_data(self)
Return the data container of the current analysis from the relax data store.
source code
str
current_analysis_name(self)
Return the name of the current analysis.
source code
str
current_analysis_type(self)
Return the type of the current analysis.
source code
 
delete_all(self, reset=False)
Remove all analyses.
source code
 
delete_analysis(self, index, reset=False)
Delete the analysis tab and data store corresponding to the index.
source code
wx.Frame object or None
get_page_from_name(self, name)
Return the page corresponding to the given name.
source code
 
load_from_store(self)
Recreate the analyses from the relax data store.
source code
 
menu_close(self, event)
Close the currently opened analysis.
source code
 
menu_close_all(self, event)
Close all analyses.
source code
 
menu_new(self, event, destroy=True)
Launch a wizard to select the new analysis.
source code
 
new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], index=None)
Initialise a new analysis.
source code
 
on_page_changing(self, event)
Block page changing if needed.
source code
 
on_page_changed(self, event)
Handle page changes.
source code
int or None
page_index_from_bundle(self, bundle)
Find the analysis associated with the data pipe bundle and return its page index.
source code
str or None
page_name_from_bundle(self, bundle)
Find the analysis associated with the bundle and return its name.
source code
 
pipe_deletion(self)
Remove analysis tabs for which the associated data pipe has been deleted.
source code
 
pipe_switch(self, pipe=None)
Switch the page to the given or current data pipe.
source code
 
post_reset(self)
Post relax data store reset event handler.
source code
 
set_init_state(self)
Revert to the initial state.
source code
 
switch_page(self, index)
Switch to the given page.
source code
Method Details [hide private]

__init__(self, gui)
(Constructor)

source code 

Initialise the analysis controller.

Parameters:
  • gui (wx object) - The gui object.

analysis_data_loop(self)

source code 

Loop over the analyses, yielding the data objects.

Returns: data.gui.Analyses instance
The analysis data object from the relax data store.

analysis_loop(self)

source code 

Loop over the analyses, yielding the page objects.

Returns: wx.Frame object
The page object.

current_data(self)

source code 

Return the data container of the current analysis from the relax data store.

Returns: str
The data container of the current analysis.

current_analysis_name(self)

source code 

Return the name of the current analysis.

Returns: str
The name of the current analysis.

current_analysis_type(self)

source code 

Return the type of the current analysis.

Returns: str
The type of the current analysis.

delete_analysis(self, index, reset=False)

source code 

Delete the analysis tab and data store corresponding to the index.

The order of these operations is very important due to the notification of observer objects and the updates, synchronisations, etc. that follow. If the program debugging mode is on, then printouts at each stage will occur to allow the following of the code and observer object notifications.

Parameters:
  • index (int) - The index of the analysis to delete.

get_page_from_name(self, name)

source code 

Return the page corresponding to the given name.

Returns: wx.Frame object or None
The page which matches the given name, or nothing otherwise.

menu_close(self, event)

source code 

Close the currently opened analysis.

Parameters:
  • event (wx event) - The wx event.

menu_close_all(self, event)

source code 

Close all analyses.

Parameters:
  • event (wx event) - The wx event.

menu_new(self, event, destroy=True)

source code 

Launch a wizard to select the new analysis.

Parameters:
  • event (wx event) - The wx event.
  • destroy (bool) - A flag which if True will cause the analysis wizard to be destroyed. This is used for the test suite.

new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, pipe_bundle=None, uf_exec=[], index=None)

source code 

Initialise a new analysis.

Parameters:
  • analysis_type (str) - The type of analysis to initialise. This can be one of 'noe', 'r1', 'r2', 'mf' or 'relax_disp'.
  • analysis_name (str) - The name of the analysis to initialise.
  • pipe_name (str) - The name of the original data pipe to create for the analysis.
  • pipe_bundle (str) - The name of the data pipe bundle to associate with this analysis.
  • uf_exec (list of methods) - The list of user function on_execute methods returned from the new analysis wizard.
  • index (None or int) - The index of the analysis in the relax data store (set to None if no data currently exists).

on_page_changing(self, event)

source code 

Block page changing if needed.

Parameters:
  • event (wx event) - The wx event.

on_page_changed(self, event)

source code 

Handle page changes.

Parameters:
  • event (wx event) - The wx event.

page_index_from_bundle(self, bundle)

source code 

Find the analysis associated with the data pipe bundle and return its page index.

Parameters:
  • bundle (str) - The data pipe bundle to find the page of.
Returns: int or None
The page index.

page_name_from_bundle(self, bundle)

source code 

Find the analysis associated with the bundle and return its name.

Parameters:
  • bundle (str) - The data pipe bundle to find the page of.
Returns: str or None
The page name.

pipe_switch(self, pipe=None)

source code 

Switch the page to the given or current data pipe.

Parameters:
  • pipe (str or None) - The pipe associated with the page to switch to. If not supplied, the current data pipe will be used.

switch_page(self, index)

source code 

Switch to the given page.

Parameters:
  • index (int) - The index of the page to switch to.