Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
|
optickaCore base class inherited by other opticka classes. More...
optickaCore base class inherited by other opticka classes.
optickaCore is itself derived from handle. It provides methods to find attributes with specific parameters (used in autogenerating UI panels), clone the object, parse arguments safely on construction and add default properties such as paths, dateStamp, uuid and name/comment management.
Copyright ©2014-2024 Ian Max Andolina — released: LGPL3, see LICENCE.md
Public Member Functions | |
function | optickaCore (in varargin) |
Class constructor. | |
function get | fullName (in me) |
function | getALF (in me, in subject, in sessionPrefix, in lab, in create) |
function | findAttributes (in me, in attrName, in attrValue) |
function | findAttributesandType (in me, in attrName, in attrValue, in type) |
find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical. | |
function | findPropertyDefault (in me, in propName) |
function | clone (in me) |
Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore. | |
function | checkSuperclasses (in List) |
function | editProperties (in me, in properties) |
method to modify a set of properties | |
function | setProp (in me, in property, in value) |
method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine. | |
function | initialiseGlobals (in me, in doReset, in doOpen) |
function | initialiseSaveFile (in me) |
Initialise Save prefix. | |
function | checkPaths (in me) |
checks the paths are valid | |
Static Public Member Functions | |
static function | makeArgs (in args) |
Converts cell args to structure array. | |
static function | addDefaults (in args, in defs) |
add default options to arg input | |
static function | hasKey (in in, in key) |
check if a struct / object has a propery / field | |
static function | getKeys (in device) |
PTB Get key presses, stops key bouncing. | |
Public Attributes | |
Property | name |
object name | |
Property | comment |
comment | |
Property | verbose |
verbose logging, subclasses must assign this. This is normally logical true/false | |
Property | dateStamp |
clock() dateStamp set on construction | |
Property | uuid |
universal ID | |
Property | paths |
storage of various paths | |
Property | fullName |
The fullName is the object name combined with its uuid and class name. | |
Protected Member Functions | |
function | parseArgs (in me, in args, in allowedProperties) |
Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties. | |
function | addArgs (in me, in args) |
function | setPaths (in me) |
Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties. | |
function | getFonts (in me) |
set paths for object | |
function | toStructure (in me) |
Converts properties to a structure. | |
function | getType (in me, in in) |
function | logOutput (in me, in in, in message, in override) |
Give a metaproperty return the likely property class. | |
function | salutation (in me, in varargin) |
Prints messages dependent on verbosity. | |
Protected Attributes | |
Property | cloning |
are we cloning this from another object | |
Property | mversion |
Matlab version number, this is transient so it is not saved. | |
Property | sansFont |
sans font | |
Property | monoFont |
monoFont | |
Property | className |
class name | |
Property | savePrefix |
save prefix generated from clock time | |
Property | fullName_ |
cached full name | |
optickaCore::optickaCore | ( | in | varargin | ) |
Class constructor.
The class constructor for optickaCore.
args | are passed as name-value pairs or a structure of properties which is parsed. |
|
protected |
|
static |
add default options to arg input
args | input structure from varargin |
defs | extra default settings |
optickaCore::checkPaths | ( | in | me | ) |
checks the paths are valid
function optickaCore::checkSuperclasses | ( | in | List | ) |
obj_out optickaCore::clone | ( | in | me | ) |
Use this syntax to make a deep copy of the object, i.e. OBJ_OUT has the same field values, but will not behave as a handle-copy of me anymore.
optickaCore::editProperties | ( | in | me, |
in | properties | ||
) |
method to modify a set of properties
properties | - cell or struct of properties to modify |
function optickaCore::findAttributes | ( | in | me, |
in | attrName, | ||
in | attrValue | ||
) |
list optickaCore::findAttributesandType | ( | in | me, |
in | attrName, | ||
in | attrValue, | ||
in | type | ||
) |
find properties of object with specific attributes, for example all properties whose GetAcccess attribute is public and type is logical.
attrName | attribute name, i.e. GetAccess, Transient |
attrValue | value of that attribute, i.e. public, true |
type | logical, notlogical, string or number |
function optickaCore::findPropertyDefault | ( | in | me, |
in | propName | ||
) |
function get optickaCore::fullName | ( | in | me | ) |
function optickaCore::getALF | ( | in | me, |
in | subject, | ||
in | sessionPrefix, | ||
in | lab, | ||
in | create | ||
) |
|
protected |
set paths for object
Checks OS and assigns a sans and mono font.
|
static |
PTB Get key presses, stops key bouncing.
|
protected |
|
static |
check if a struct / object has a propery / field
value | name |
function optickaCore::initialiseGlobals | ( | in | me, |
in | doReset, | ||
in | doOpen | ||
) |
optickaCore::initialiseSaveFile | ( | in | me | ) |
Initialise Save prefix.
just get date fragment
|
protected |
Give a metaproperty return the likely property class.
me | this instance object |
in | metaproperty |
|
static |
Converts cell args to structure array.
args | input data |
|
protected |
Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
args | input structure |
allowedProperties | properties possible to set on construction |
|
protected |
Prints messages dependent on verbosity.
Prints messages dependent on verbosity
me | this instance object |
in | the calling function or main info |
message | additional message that needs printing to command window |
override | force logging if true even if verbose is false |
|
protected |
Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
args | input structure |
optickaCore::setProp | ( | in | me, |
in | property, | ||
in | value | ||
) |
method to fast change a particular value. This is useful for use in anonymous functions, like in the state machine.
property | — the property to change |
value | — the value to change it to |
|
protected |
Converts properties to a structure.
me | this instance object |
tmp | is whether to use the temporary or permanent properties |
|
protected |
class name
|
protected |
are we cloning this from another object
Property optickaCore::comment |
comment
Property optickaCore::dateStamp |
clock() dateStamp set on construction
get optickaCore::fullName |
The fullName is the object name combined with its uuid and class name.
concatenate the name with a uuid at get.
return name the concatenated name
|
protected |
cached full name
|
protected |
monoFont
|
protected |
Matlab version number, this is transient so it is not saved.
Property optickaCore::name |
object name
Property optickaCore::paths |
storage of various paths
|
protected |
sans font
|
protected |
save prefix generated from clock time
Property optickaCore::uuid |
universal ID
Property optickaCore::verbose |
verbose logging, subclasses must assign this. This is normally logical true/false