MasterScan
Lab_Matlab_control Master Branch
|
Superclass for flow-control classes that may operate concurrently.
The topsConcurrent superclass provides a common interface for Tower of Psych classes that manage flow control, and may work concurrently with one another.
In addition to being able to run(), topsConcurrent objects can also runBriefly(), which means to carry out a small part of their normal run() behavior, and then return as soon as possible. runBriefly() behaviors can be interleaved to acheive concurrent operation of multiple topsConcurrent objects within a single Matlab instance.
Multiple topsConcurrent objects can be aggregated within a single topsConcurrentComposite object. This makes allows the aggregated objects to be treated like a single topsRunnable object.
Properties and Events | |
Property | runBrieflyString = 'runBriefly' |
string used for topsDataLog entry just before runBriefly() | |
![]() | |
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 | topsConcurrent (varargin) |
Constuct with name optional. More... | |
run (self, duration) | |
Do flow control. More... | |
runBriefly (self) | |
Do a little flow control and return as soon as possible. More... | |
![]() | |
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 topsConcurrent | ( | varargin | ) |
Constuct with name optional.
name | optional name for this object |
If name is provided, assigns name to this object.
run | ( | self | , |
duration | |||
) |
Do flow control.
duration | how long in seconds to keep running |
topsConcurrent redefines the run() method of topsRunnable. It uses start(), finish(), and repeated calls to runBriefly() to accomplish run() behaviors. By default, run() takes over flow-control from the caller until isRunning becomes false. If duration is provided, runs until isRunning becomes false, or duration elapses, then sets isRunning to false.
runBriefly | ( | self | ) |
Do a little flow control and return as soon as possible.
Subclasses should redefine runBriefly() to do specific run() behaviors, a little at a time, and return as soon as possible.