MasterScan
Lab_Matlab_control Master Branch
|
Superclass for flow-control classes.
The topsRunnable superclass provides a common interface for Tower of Psych classes that manage flow control. They organize function calls and log what they call. Some can combine with each other to make complex control structures.
Any topsRunnable can be run(), to begin execution. Sometimes its caller will be set to another topsRunnable, which invoked run() on it.
Properties and Events | |
Property | startFevalable = {} |
optional fevalable cell array to invoke just before running | |
Property | finishFevalable = {} |
optional fevalable cell array to invoke just after running | |
Property | isRunning = false |
true or false, whether this object is currently busy running | |
Property | caller |
topsRunnable that invoked run() on this object, or empty | |
Property | startString = 'start' |
string used for topsDataLog entry just before run() | |
Property | finishString = 'finish' |
string used for topsDataLog entry just after run() | |
![]() | |
Property | name = '' |
a string name to indentify the object | |
Property | clockFunction =@topsClock |
clock function, to standardize | |
Methods | |
self | topsRunnable (varargin) |
Constuct with name optional. More... | |
run (self) | |
Do flow control. More... | |
g | gui (self) |
Show heirarchy of topsRunnable[Composite] objects. | |
start (self) | |
Log action and prepare to do flow control. More... | |
finish (self) | |
Log, action and finish doing flow control. More... | |
logAction (self, actionName, actionData) | |
Log an event of interest with topsDataLog. More... | |
logFeval (self, fevalName, fevalable) | |
Log a function call with topsDataLog. More... | |
![]() | |
self | topsFoundation (name) |
Constuct with name optional. More... | |
fig | gui (self) |
Open a GUI to view object details. More... | |
p | guiPanel (self, varargin) |
Make a topsDetailPanel with details about this object. More... | |
Additional Inherited Members | |
![]() | |
static c index | cellAdd (c, item, index) |
Add an item to a cell array. More... | |
static selector | cellContains (c, item) |
Does a cell array conatin an item? More... | |
static c | cellRemoveItem (c, item) |
Remove an item from a cell array. More... | |
static c | cellRemoveElement (c, index) |
Remove indexed elements from a cell array. More... | |
static index selector | findStructName (s, name) |
Where is the given name in the given struct array? More... | |
self topsRunnable | ( | varargin | ) |
Constuct with name optional.
name | optional name for this object |
If name is provided, assigns name to this object.
run | ( | self | ) |
start | ( | self | ) |
Log action and prepare to do flow control.
Subclasses should extend start() to do initialization before running.
finish | ( | self | ) |
Log, action and finish doing flow control.
Subclasses should extend finish() to do clean up after running.
logAction | ( | self | , |
actionName | , | ||
actionData | |||
) |
Log an event of interest with topsDataLog.
actionName | string name for any event of interest |
actionData | optional data to log along with actionName |
logAction is a convenient way to note in topsDataLog that some event of interest has occurred. The log entry will contain the name of this topsRunnable object, concatenated with actionName. It will store actionData, if given.
logFeval | ( | self | , |
fevalName | , | ||
fevalable | |||
) |
Log a function call with topsDataLog.
fevalName | string name to give to a function call |
fevalable | fevalable cell array specifying a function call |
logFeval is a convenient way to note in topsDataLog that some function call of interest has occurred, and then call the function. The log entry will contain the name of this topsRunnable object, concatenated with fevalName. It will convert the function handle from the first element of fevalable to a string and store the string.
The log entry will not store any of the arguments from the second or later elements of fevalable. This is because the arguments may be handle objects, and Matlab does a bad job of storing large collections of handle objects–both in memory and in .mat files.
After making a new entry in topsDataLog, logFeval also invokes fevalable with the feval() function.