optickaCore base class inherited by other opticka classes.
More...
optickaCore base class inherited by other opticka classes.
Introduction
optickaCore is derived from handle and provides shared infrastructure for Opticka classes.
Main methods:
optickaCore(varargin): class constructor; parses name-value inputs, sets defaults, creates dateStamp/uuid, and initialises paths/fonts.
parseArgs(args, allowedProperties): safely applies allowed construction properties from a struct or name-value pairs.
findAttributes(attrName, attrValue): queries class properties by metadata attributes (used for UI auto-generation and inspection).
clone(): creates a deep copy of the object and nested Opticka objects.
getALF(subject, lab, create): builds or resolves ALF-style save paths and session identifiers.
makeReport(rpt): generates or appends an HTML report with object state and related manager summaries.
Copyright ©2014-2026 Ian Max Andolina — released: LGPL3, see LICENCE.md
|
| function | optickaCore (in varargin) |
| | Class constructor.
|
| |
| function get | fullName (in me) |
| |
| function | getALF (in me, in subject, in lab, in create) |
| | get the ALF path
|
| |
| function | makeReport (in me, in rpt) |
| | Generate a detailed report for the opticka object.
|
| |
| 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) |
| | Return the declared default value for a class property.
|
| |
| 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 | initialiseSaveFile (in me, in varargin) |
| | just get date fragment for backwards compatibility
|
| |
| function | checkPaths (in me) |
| | checks the paths are valid
|
| |
|
| static function | initialiseGlobals (in doReset, in doOpen) |
| |
| static function | makeArgs (in args) |
| | Converts cell args to structure array.
|
| |
| static function | addDefaults (in args, in defs) |
| | regularises and adds 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.
|
| |
|
| Property | name |
| | object name
|
| |
| Property | comment |
| | comment
|
| |
| Property | verbose |
| | verbose logging, subclasses must assign this. This is normally logical true/false
|
| |
| Property | optickaVersion |
| | version number
|
| |
| 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.
|
| |
|
| 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.
|
| |
|
| 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::optickaCore |
( |
in |
varargin | ) |
|
Class constructor.
The class constructor for optickaCore.
- Parameters
-
| args | are passed as name-value pairs or a structure of properties which is parsed. |
- Returns
- instance of class.
◆ addArgs()
| function optickaCore::addArgs |
( |
in |
me, |
|
|
in |
args |
|
) |
| |
|
protected |
◆ addDefaults()
| optickaCore::addDefaults |
( |
in |
args, |
|
|
in |
defs |
|
) |
| |
|
static |
regularises and adds default options to arg input
- Parameters
-
| args | input structure from varargin |
| defs | extra default settings |
- Returns
- args structure
◆ checkPaths()
| optickaCore::checkPaths |
( |
in |
me | ) |
|
checks the paths are valid
◆ checkSuperclasses()
| function optickaCore::checkSuperclasses |
( |
in |
List | ) |
|
◆ clone()
| 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.
- Returns
- obj_out cloned object
◆ editProperties()
| optickaCore::editProperties |
( |
in |
me, |
|
|
in |
properties |
|
) |
| |
method to modify a set of properties
- Parameters
-
| properties | - cell or struct of properties to modify |
◆ findAttributes()
| function optickaCore::findAttributes |
( |
in |
me, |
|
|
in |
attrName, |
|
|
in |
attrValue |
|
) |
| |
◆ findAttributesandType()
| 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.
- Parameters
-
| attrName | attribute name, i.e. GetAccess, Transient |
| attrValue | value of that attribute, i.e. public, true |
| type | logical, notlogical, string or number |
- Returns
- list of properties that match that attribute
◆ findPropertyDefault()
| value optickaCore::findPropertyDefault |
( |
in |
me, |
|
|
in |
propName |
|
) |
| |
Return the declared default value for a class property.
Accepts either an object instance or a class name in me, then inspects MATLAB metaclass information to locate propName.
- Parameters
-
| me | object instance or class name to inspect. |
| propName | property name whose default value is requested. |
- Returns
- value default value declared for the property, or empty if the property is not found.
◆ fullName()
| function get optickaCore::fullName |
( |
in |
me | ) |
|
◆ getALF()
| optickaCore::getALF |
( |
in |
me, |
|
|
in |
subject, |
|
|
in |
lab, |
|
|
in |
create |
|
) |
| |
get the ALF path
- Returns
- path - the path to use
-
sessionID - session number
-
dateID - YYYY-MM-DD-HH-MM-SS,
-
name - [date]-[id]-[subject]
-
key - [lab]/subjects/[subject]/[date]/[sessionID]/
◆ getFonts()
| optickaCore::getFonts |
( |
in |
me | ) |
|
|
protected |
set paths for object
Checks OS and assigns a sans and mono font.
- Parameters
-
◆ getKeys()
| optickaCore::getKeys |
( |
in |
device | ) |
|
|
static |
PTB Get key presses, stops key bouncing.
◆ getType()
| function optickaCore::getType |
( |
in |
me, |
|
|
in |
in |
|
) |
| |
|
protected |
◆ hasKey()
| optickaCore::hasKey |
( |
in |
in, |
|
|
in |
key |
|
) |
| |
|
static |
check if a struct / object has a propery / field
- Parameters
-
◆ initialiseGlobals()
| static function optickaCore::initialiseGlobals |
( |
in |
doReset, |
|
|
in |
doOpen |
|
) |
| |
|
static |
◆ initialiseSaveFile()
| optickaCore::initialiseSaveFile |
( |
in |
me, |
|
|
in |
varargin |
|
) |
| |
just get date fragment for backwards compatibility
◆ logOutput()
| function optickaCore::logOutput |
( |
in |
me, |
|
|
in |
in, |
|
|
in |
message, |
|
|
in |
override |
|
) |
| |
|
protected |
Give a metaproperty return the likely property class.
- Parameters
-
| me | this instance object |
| in | metaproperty |
- Returns
- out class name
◆ makeArgs()
| optickaCore::makeArgs |
( |
in |
args | ) |
|
|
static |
Converts cell args to structure array.
- Parameters
-
- Returns
- args as a structure
◆ makeReport()
| rpt optickaCore::makeReport |
( |
in |
me, |
|
|
in |
rpt |
|
) |
| |
Generate a detailed report for the opticka object.
Creates an HTML report using MATLAB's Report Generator toolbox. The report includes detailed information about the object and its components.
- Parameters
-
| me | this instance object |
| rpt | optional existing Report object to append to (creates new if empty) |
- Returns
- rpt generated Report object
Handles different object types including:
Requires MATLAB Report Generator toolbox.
◆ parseArgs()
| optickaCore::parseArgs |
( |
in |
me, |
|
|
in |
args, |
|
|
in |
allowedProperties |
|
) |
| |
|
protected |
Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
- Parameters
-
| args | input structure |
| allowedProperties | properties possible to set on construction |
◆ salutation()
| function optickaCore::salutation |
( |
in |
me, |
|
|
in |
varargin |
|
) |
| |
|
protected |
Prints messages dependent on verbosity.
Prints messages dependent on verbosity
- Parameters
-
| 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 |
◆ setPaths()
| function optickaCore::setPaths |
( |
in |
me | ) |
|
|
protected |
Sets properties from a structure or normal arguments pairs, ignores invalid or non-allowed properties.
- Parameters
-
◆ setProp()
| 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.
- Parameters
-
| property | — the property to change |
| value | — the value to change it to |
◆ toStructure()
| out optickaCore::toStructure |
( |
in |
me | ) |
|
|
protected |
Converts properties to a structure.
- Parameters
-
| me | this instance object |
| tmp | is whether to use the temporary or permanent properties |
- Returns
- out the structure
◆ className
| Property optickaCore::className |
|
protected |
◆ cloning
| Property optickaCore::cloning |
|
protected |
are we cloning this from another object
◆ comment
| Property optickaCore::comment |
◆ dateStamp
| Property optickaCore::dateStamp |
clock() dateStamp set on construction
◆ fullName
| get optickaCore::fullName |
The fullName is the object name combined with its uuid and class name.
concatenate the name with a uuid at get.
- Parameters
-
return name the concatenated name
◆ fullName_
| Property optickaCore::fullName_ |
|
protected |
◆ monoFont
| Property optickaCore::monoFont |
|
protected |
◆ mversion
| Property optickaCore::mversion |
|
protected |
Matlab version number, this is transient so it is not saved.
◆ name
| Property optickaCore::name |
◆ optickaVersion
| Property optickaCore::optickaVersion |
◆ paths
| Property optickaCore::paths |
◆ sansFont
| Property optickaCore::sansFont |
|
protected |
◆ savePrefix
| Property optickaCore::savePrefix |
|
protected |
save prefix generated from clock time
◆ uuid
| Property optickaCore::uuid |
◆ verbose
| Property optickaCore::verbose |
verbose logging, subclasses must assign this. This is normally logical true/false
The documentation for this class was generated from the following file: