Package gui :: Package components :: Module free_file_format :: Class Free_file_format
[hide private]
[frames] | no frames]

Class Free_file_format

source code

GUI element for the free file format.

This is used for specifying the columns used for the molecule name, residue name and number, spin name and number and data and error columns.

Instance Methods [hide private]
 
__init__(self, parent=None, element_type='default', sizer=None, divider=None, padding=10, spacer=3, height_element=27, data_cols=False, save=True, reset=True)
Build the free format file settings widget.
source code
 
_build_default(self)
Build the default GUI element.
source code
 
_build_mini(self)
Build the mini GUI element.
source code
dict
GetValue(self)
Return the free file format settings as a keyword dictionary.
source code
 
SetValue(self, key, value)
Special method for setting the value of the GUI element corresponding to the key.
source code
list of str or None
from_string(self, string=None)
Convert the free file format variables to string format.
source code
 
open_window(self, event)
Open the free file format editing window.
source code
 
reset(self, event)
Reset the free file format widget contents to the original values.
source code
 
save(self, event)
Save the free file format widget contents into the relax data store.
source code
 
set_vals(self)
Set the free file format widget contents to the values from the relax data store.
source code
str
to_string(self, spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None)
Convert the free file format variables to string format.
source code
Class Variables [hide private]
  size_square_button = (33, 33)
Method Details [hide private]

__init__(self, parent=None, element_type='default', sizer=None, divider=None, padding=10, spacer=3, height_element=27, data_cols=False, save=True, reset=True)
(Constructor)

source code 

Build the free format file settings widget.

Parameters:
  • parent (wx object) - The parent wx GUI element.
  • element_type (str) - The type of GUI element to create. The value of 'default' creates the large GUI element with a row for each column and for the separator. If 'mini' is supplied, the single row element will be used.
  • sizer (wx.Sizer instance) - The sizer to put the GUI element into.
  • divider (int) - The position of the divider.
  • padding (int) - The size of the padding between the wx.StaticBoxSizer border and the internal elements, in pixels.
  • spacer (int) - The horizontal spacing between the elements, in pixels.
  • height_element (int) - The height in pixels of the GUI element. This is only used for the mini format.
  • data_cols (bool) - A flag which if True causes the data and error column elements to be displayed.
  • save (bool) - A flag which if True will cause the save button to be displayed.
  • reset (bool) - A flag which if True will cause the reset button to be displayed.

GetValue(self)

source code 

Return the free file format settings as a keyword dictionary.

Returns: dict
The dictionary of free file format settings.

SetValue(self, key, value)

source code 

Special method for setting the value of the GUI element corresponding to the key.

Parameters:
  • key (str) - The key corresponding to the desired GUI element. This can be one of ['spin_id_col', 'mol_name_col', 'res_num_col', 'res_name_col', 'spin_num_col', 'spin_name_col', 'data_col', 'error_col', 'sep'].
  • value (unknown) - The value that the specific GUI element's SetValue() method expects.

from_string(self, string=None)

source code 

Convert the free file format variables to string format.

Parameters:
  • string (str) - The string to convert.
Returns: list of str or None
The spin ID column, molecule name column, residue number column, residue number column, spin number column, spin name column, data column (if active), error column (if active), and column separator.

open_window(self, event)

source code 

Open the free file format editing window.

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

reset(self, event)

source code 

Reset the free file format widget contents to the original values.

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

save(self, event)

source code 

Save the free file format widget contents into the relax data store.

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

to_string(self, spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None)

source code 

Convert the free file format variables to string format.

Parameters:
  • spin_id_col (int or None) - The column containing the spin ID strings (used by the generic intensity file format). If supplied, the mol_name_col, res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be none.
  • mol_name_col (int or None) - The column containing the molecule name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • res_name_col (int or None) - The column containing the residue name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • res_num_col (int or None) - The column containing the residue number information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • spin_name_col (int or None) - The column containing the spin name information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • spin_num_col (int or None) - The column containing the spin number information (used by the generic intensity file format). If supplied, spin_id_col must be None.
  • sep (str or None) - The column separator which, if None, defaults to whitespace.
Returns: str
The string representation of the free file format settings.