Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
optickaCore Class Reference

optickaCore base class inherited by other opticka classes. More...

Detailed Description

optickaCore base class inherited by other opticka classes.

Introduction

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

Inheritance diagram for optickaCore:

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
 

Constructor & Destructor Documentation

◆ optickaCore()

optickaCore::optickaCore ( in  varargin)

Class constructor.

The class constructor for optickaCore.

Parameters
argsare passed as name-value pairs or a structure of properties which is parsed.
Returns
instance of class.

Member Function Documentation

◆ addArgs()

function optickaCore::addArgs ( in  me,
in  args 
)
protected

◆ addDefaults()

optickaCore::addDefaults ( in  args,
in  defs 
)
static

add default options to arg input

Parameters
argsinput structure from varargin
defsextra 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
attrNameattribute name, i.e. GetAccess, Transient
attrValuevalue of that attribute, i.e. public, true
typelogical, notlogical, string or number
Returns
list of properties that match that attribute

◆ findPropertyDefault()

function optickaCore::findPropertyDefault ( in  me,
in  propName 
)

◆ fullName()

function get optickaCore::fullName ( in  me)

◆ getALF()

function optickaCore::getALF ( in  me,
in  subject,
in  sessionPrefix,
in  lab,
in  create 
)

◆ 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
valuename

◆ initialiseGlobals()

function optickaCore::initialiseGlobals ( in  me,
in  doReset,
in  doOpen 
)

◆ initialiseSaveFile()

optickaCore::initialiseSaveFile ( in  me)

Initialise Save prefix.

just get date fragment

Returns
path - the path to use
dateid - YYYY-MM-DD-HH-MM-SS

◆ logOutput()

function optickaCore::logOutput ( in  me,
in  in,
in  message,
in  override 
)
protected

Give a metaproperty return the likely property class.

Parameters
methis instance object
inmetaproperty
Returns
out class name

◆ makeArgs()

optickaCore::makeArgs ( in  args)
static

Converts cell args to structure array.

Parameters
argsinput data
Returns
args as a structure

◆ 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
argsinput structure
allowedPropertiesproperties 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
methis instance object
inthe calling function or main info
messageadditional message that needs printing to command window
overrideforce 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
argsinput structure

◆ 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
methis instance object
tmpis whether to use the temporary or permanent properties
Returns
out the structure

Member Data Documentation

◆ className

Property optickaCore::className
protected

class name

◆ cloning

Property optickaCore::cloning
protected

are we cloning this from another object

◆ comment

Property optickaCore::comment

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

cached full name

◆ monoFont

Property optickaCore::monoFont
protected

monoFont

◆ mversion

Property optickaCore::mversion
protected

Matlab version number, this is transient so it is not saved.

◆ name

Property optickaCore::name

object name

◆ paths

Property optickaCore::paths

storage of various paths

◆ sansFont

Property optickaCore::sansFont
protected

sans font

◆ savePrefix

Property optickaCore::savePrefix
protected

save prefix generated from clock time

◆ uuid

Property optickaCore::uuid

universal ID

◆ 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: