PASettings used by Padaco to initialize, store, and update user preferences. The class is designed for storage and manipulation of the user settings relating to Padaco.
More...
|
static function | loadParametersFromFile (in filename) |
| Returns a structure of parameters parsed from the text file identified by the the input filename. Parameters in the text file are stored per row using the following form: More...
|
|
static function | loadXMLStruct (in xmlFilename) |
| Parses the XML file and returns an array of structs. More...
|
|
static function | loadStruct (in fid, in pstruct) |
| Parses the file with file identifier fid to find structure and substructure value pairs. If pstruct is passed as an input argument then the file substructure and value pairings will be put into it as new or overwriting fields and subfields. If pstruct is not included then a new/original structure is created and returned. fid must be open for this to work. fid is not closed at the end of this function. More...
|
|
static function | tokens2struct (in pstruct, in tok) |
| helper function for loadStruct More...
|
|
static function | str2vec (in str, in delim) |
| Converts a string of space delimited numerics to a vector of numbers. More...
|
|
static function | saveStruct (in fid, in root, in varargin) |
| Saves the root structure to the file with file identifier fid. to display the output to the screen set fid=1 Note: the root node of a structure is not saved as a field to fid. See the second example on how to save the root node if desired. More...
|
|
static function | strcat_with_dot (in root, in varargin) |
| helper function for loadStruct More...
|
|
|
Property | rootpathname |
| Keeps track of the folder that padaco is run from. This is useful when saving the setting's file to make sure it is always saved in the same place and not in another directory (e.g. if the user moves about in MATLAB's editor). More...
|
|
Property | parameters_filename |
| name of text file that stores the toolkit's settings More...
|
|
Property | fieldNames |
| cell of string names corresponding to the struct properties that contain settings {'DATA','VIEW', 'CONTROLLER','BATCH'} More...
|
|
Property | CONTROLLER |
| struct of PAController preferences. More...
|
|
Property | DATA |
| struct of PAData preferences. More...
|
|
Property | VIEW |
| struct of viewer related settings. More...
|
|
Property | BATCH |
| struct of batch processing settings. More...
|
|
Property | StatTool |
| struct of StatTool plot/analysis settings. More...
|
|
PASettings used by Padaco to initialize, store, and update user preferences. The class is designed for storage and manipulation of the user settings relating to Padaco.
- Note
- : This file was originally taken from SEV's CLASS_settings class, by permission of the author Hyatt Moore.
function PASettings::PASettings |
( |
in |
rootpathname, |
|
|
in |
parameters_filename |
|
) |
| |
Class constructor.
Stores the root path and parameters file and invokes initialize method. Default settings are used if no parameters filename is provided or found.
- Parameters
-
rootpathname | Pathname of Padaco execution directory (string) |
parameters_filename | Name of text file to load settings from (string) |
- Returns
- obj Instance of PASettings class.
function PASettings::defaultsEditor |
( |
in |
obj, |
|
|
in |
optional_fieldName |
|
) |
| |
Activates GUI for editing single study mode settings (VIEW,PSD,MUSIC)
- Parameters
-
obj | instance of PASettings class. |
optional_fieldName | (Optional) String indicating which settings to update. Can be
StatTool
VIEW
BATCH
CONTROLLER
|
- Return values
-
wasModified | a boolean value; true if any changes were made to the settings in the GUI and false otherwise. |
function PASettings::initialize |
( |
in |
obj | ) |
|
Constructor helper function. Initializes class either from parameters_filename if such a file exists, or hardcoded default values (i.e. setDefaults).
- Parameters
-
static function PASettings::loadParametersFromFile |
( |
in |
filename | ) |
|
|
static |
Returns a structure of parameters parsed from the text file identified by the the input filename. Parameters in the text file are stored per row using the following form:
- fieldname1 value1
- fieldname2 value2
- .... an optional ':' is allowed after the fieldname such as fieldname: value The parameters is
- Parameters
-
filename | String identifying the filename to load. |
- Return values
-
paramStruct | Structure that contains the listed fields found in the file 'filename' along with their corresponding values |
static function PASettings::loadStruct |
( |
in |
fid, |
|
|
in |
pstruct |
|
) |
| |
|
static |
Parses the file with file identifier fid to find structure and substructure value pairs. If pstruct is passed as an input argument then the file substructure and value pairings will be put into it as new or overwriting fields and subfields. If pstruct is not included then a new/original structure is created and returned. fid must be open for this to work. fid is not closed at the end of this function.
- Parameters
-
fid | file identifier to parse |
pstruct | (optional) If included, pstruct fields will be overwritten if existing, otherwise they will be added and returned. |
- Return values
-
pstruct | return value of tokens2struct call. |
static function PASettings::loadXMLStruct |
( |
in |
xmlFilename | ) |
|
|
static |
Parses the XML file and returns an array of structs.
- Parameters
-
xmlFilename | Name of the XML file to parse (absolute path) |
- Return values
-
xmlStruct | A structure containing the elements and associated attributes of the xml as parsed by xml_read. |
function PASettings::saveParametersToFile |
( |
in |
obj, |
|
|
in |
dataStruct2Save, |
|
|
in |
filename |
|
) |
| |
saves all of the fields in saveStruct to the file filename as a .txt file
- Parameters
-
obj | instance of PASettings class. |
dataStruct2Save | (optional) structure of parameters and values to save to the text file identfied by obj property filename or the input paramater filename. Enter empty (i.e., []) to save all available fields |
filename | (optional) name of file to save parameters to. If it is not included then the save file is taken from the instance variables rootpathname and parameters_filename |
static function PASettings::saveStruct |
( |
in |
fid, |
|
|
in |
root, |
|
|
in |
varargin |
|
) |
| |
|
static |
Saves the root structure to the file with file identifier fid. to display the output to the screen set fid=1 Note: the root node of a structure is not saved as a field to fid. See the second example on how to save the root node if desired.
function PASettings::setDefaults |
( |
in |
obj, |
|
|
in |
fieldNames |
|
) |
| |
sets default values for the class parameters listed in the input argument fieldNames.
- Parameters
-
obj | instance of PASettings. |
fieldNames | (optional) string identifying which of the object's parameters to reset. Multiple field names may be listed using a cell structure to hold additional strings. If no argument is provided or fieldNames is empty then object's fieldNames property is used and all parameter structs are reset to their default values. |
static function PASettings::str2vec |
( |
in |
str, |
|
|
in |
delim |
|
) |
| |
|
static |
Converts a string of space delimited numerics to a vector of numbers.
- Parameters
-
str | A string of numbers. For example str = '0 0 0' |
delim | Optional delimiter to use. Default is white space. |
- Return values
-
vec | A vector of numeric values corresponding the str values. For example if str = '0 0 0' then vec = [0 0 0] |
- Note
- NaN is returned if the entire string cannot be converted to a vector. For example if str = '0 'lkj 0 0' then vec = NaN
static function PASettings::strcat_with_dot |
( |
in |
root, |
|
|
in |
varargin |
|
) |
| |
|
static |
helper function for loadStruct
static function PASettings::tokens2struct |
( |
in |
pstruct, |
|
|
in |
tok |
|
) |
| |
|
static |
helper function for loadStruct
- Parameters
-
pstruct | parent struct by which the tok cell will be converted to |
tok | cell array - the last cell is the value to be assigned while the previous cells are increasing nestings of the structure (i.e. tok{1} is the highest parent structure, tok{2} is the substructure of tok{1} and so and on and so forth until tok{end-1}. tok{end} is the value to be assigned. the tok structure is added as a child to the parent pstruct. |
- Return values
-
pstruct | Input pstruct with any additional tok children added. |
Property PASettings::BATCH |
struct of batch processing settings.
Property PASettings::CONTROLLER |
Property PASettings::DATA |
Property PASettings::fieldNames |
cell of string names corresponding to the struct properties that contain settings {'DATA','VIEW', 'CONTROLLER','BATCH'}
Property PASettings::parameters_filename |
name of text file that stores the toolkit's settings
Property PASettings::rootpathname |
Keeps track of the folder that padaco is run from. This is useful when saving the setting's file to make sure it is always saved in the same place and not in another directory (e.g. if the user moves about in MATLAB's editor).
pathname of Padaco working directory - determined at run time.
Property PASettings::StatTool |
struct of StatTool plot/analysis settings.
Property PASettings::VIEW |
struct of viewer related settings.
The documentation for this class was generated from the following file: