MasterScan
Lab_Matlab_control Master Branch
|
Composes topsConcurrent objects and runs them concurrently.
topsConcurrentComposite objects may contain topsConcurrent objects and run them concurrently. When a topsConcurrentComposite run()s, it invokes runBriefly() sequentially and repeatedly for each of its component objects. The topsConcurrentComposite will stop running as soon as one of its children has isRunning equal to false.
Properties and Events | |
Property | childIsRunning |
logical array reflecting isRunning for each child object | |
Property | runBrieflyCount |
count of child runBriefly() invocations during the current run() | |
Property | runBrieflyString = 'runBriefly count' |
string name for topsDataLog entries about runBriefly invokations | |
![]() | |
Property | children = {} |
cell array of topsRunnable (or subclass) objects | |
![]() | |
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 | topsConcurrentComposite (varargin) |
Constuct with name optional. More... | |
addChild (self, child) | |
Add a topsConcurrent child beneath this object. More... | |
run (self) | |
Interleave runBriefly() behavior of child objects. More... | |
runChildren (self) | |
Do a little flow control with each child object. More... | |
startChildren (self) | |
Prepare each child object to do flow control. More... | |
finishChildren (self) | |
Let each child object finish doing flow control. More... | |
finish (self) | |
Log action and finish doing flow control. More... | |
![]() | |
self | topsRunnableComposite (varargin) |
Constuct with name optional. More... | |
fig | gui (self) |
Open a GUI to view object details. More... | |
addChild (self, child) | |
Add a child beneath this object. More... | |
removeChild (self, child) | |
Remove a child beneath this object. More... | |
selector | isChild (self, child) |
Check if child is there. | |
![]() | |
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 topsConcurrentComposite | ( | varargin | ) |
Constuct with name optional.
name | optional name for this object |
If name is provided, assigns name to this object.
addChild | ( | self | , |
child | |||
) |
Add a topsConcurrent child beneath this object.
child | a topsConcurrent to add beneath this object. |
Extends the addChild() method of topsRunnableComposite to verify that child is a topsConcurrent (or subclass) object.
run | ( | self | ) |
Interleave runBriefly() behavior of child objects.
Calls start() for each child object, sets each child's caller to this object, then calls runBriefly() repeatedly and sequentially for each child, until at least one child has isRunning equal to false, then calls finish() for each child and sets each child's caller to be empty.
The since all the child objects should runBriefly() the same number of times and in an interleaved fashion, they should all appear to run() concurrently.
runChildren | ( | self | ) |
Do a little flow control with each child object.
Calls runBriefly() once, sequentually, for each child object.
If any of the child objects has isRunning equal to false, this topsConcurrentComposite object will set its own isRunning to false (and therefore it should stop running).
startChildren | ( | self | ) |
Prepare each child object to do flow control.
Calls start() once, sequentually, for each child object. Sets the caller of each child to this object.
finishChildren | ( | self | ) |
Let each child object finish doing flow control.
Calls finish() once, sequentually, for each child object. Sets the caller of each child to be empty.
finish | ( | self | ) |
Log action and finish doing flow control.
Extends the finish() method of topsRunnable to also log the count of runBriefly() invocations.