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)
Remove all analyses.
source code
 
delete_analysis(self, index)
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)
Launch a wizard to select the new analysis.
source code
 
new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, 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_pipe(self, pipe)
Find the page holding the data pipe and return its page index.
source code
str or None
page_name_from_pipe(self, pipe)
Find the page holding the data pipe 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)

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 print outs 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)

source code 

Launch a wizard to select the new analysis.

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

new_analysis(self, analysis_type=None, analysis_name=None, pipe_name=None, 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', or 'mf'.
  • analysis_name (str) - The name of the analysis to initialise.
  • 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_pipe(self, pipe)

source code 

Find the page holding the data pipe and return its page index.

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

page_name_from_pipe(self, pipe)

source code 

Find the page holding the data pipe and return its name.

Parameters:
  • pipe (str) - The data pipe 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.