MasterScan  Lab_Matlab_control Master Branch
List of all members | Properties and Events | Methods | Static Methods
topsFoundation Class Reference

Overview

Superclass for all of the fundamental Tower of Psych classes.

The topsFoundation superclass provides a common interface for Tower of Psych classes. This includes naming, cell array manipulation, and generating graphical interfaces.

Inheritance diagram for topsFoundation:
Inheritance graph
[legend]

Properties and Events

Property name = ''
 a string name to indentify the object
 
Property clockFunction =@topsClock
 clock function, to standardize
 

Methods

self topsFoundation (name)
 Constuct with name optional. More...
 
fig gui (self)
 Open a GUI to view object details. More...
 
guiPanel (self, varargin)
 Make a topsDetailPanel with details about this object. More...
 

Static Methods

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...
 

Constructor

◆ topsFoundation()

self topsFoundation ( name  )

Constuct with name optional.

Parameters
nameoptional name for this object

If name is provided, assigns name to this object.

Methods

◆ gui()

fig gui ( self  )

Open a GUI to view object details.

Opens a new GUI with components suitable for viewing objects of this class. Returns a topsFigure object which contains the GUI.

◆ guiPanel()

p guiPanel ( self  ,
varargin   
)

Make a topsDetailPanel with details about this object.

Parameters
parentGUIa topsGUI to contain the new panel
positionoptional normalized [x y w h] where to locate the new panel within parentGUI

Subclasses may overrride to return a specific topsDetailPanel subclass, or let topsFoundataion generate a generic topsValuePanel.

◆ cellAdd()

static c index cellAdd ( ,
item  ,
index   
)
static

Add an item to a cell array.

Parameters
ca cell array
itemany item to add to the cell array c
indexoptional index where to insert item

add() inserts item into c at the given index. If no index is given, add() appends item to the end of c.

Returns the modified cell array c. May also return the index into c where item was inserted.

◆ cellContains()

static selector cellContains ( ,
item   
)
static

Does a cell array conatin an item?

Parameters
ca cell array
itemany item that might be in c

Returns a logical array the same size as c, which is true where elements of c are equal to item.

cellContains() compares items for equality using Matlab's built-in eq() when it can, or else isequal().

◆ cellRemoveItem()

static c cellRemoveItem ( ,
item   
)
static

Remove an item from a cell array.

Parameters
ca cell array
iteman item to remove from c

Removes all elements of c that are equal to the given item.

Returns the modified cell array, c.

◆ cellRemoveElement()

static c cellRemoveElement ( ,
index   
)
static

Remove indexed elements from a cell array.

Parameters
ca cell array
indexindex of the element or elements to remove

Removes the indexed element or elements of c.

Returns the modified cell array, c.

◆ findStructName()

static index selector findStructName ( ,
name   
)
static

Where is the given name in the given struct array?

Parameters
sa struct array with a "name" field
a"name" value that might be in the struct array

Assumes that s is a struct array with a "name" field. Searches the elements of s for the given name. Returns the index of the first occurence of name. If name was not found, returns numel(s) plus 1. Returns as a second output a logical selector for the elements of s, set to true where name was found.


The documentation for this class was generated from the following file: