Caplin Trader 4.8.0

Class: module:caplin/trading/workbench/model/StateMachineMonitor

module:caplin/trading/workbench/model/StateMachineMonitor

Constructor

new module:caplin/trading/workbench/model/StateMachineMonitor(oStateModel)

A Stub class for testing the trade model.
Parameters:
Name Type Description
oStateModel Object the state model.
Implements:

Methods

getAllStates() → {Array}

Returns all the states from the state model.
Returns:
Type
Array

getCurrentState() → {module:caplin/trading/statemachine/State}

Returns the current state.
Returns:
Type
module:caplin/trading/statemachine/State

getStateModel() → {module:caplin/trading/statemachine/StateModel}

Returns the state model.
Returns:
Type
module:caplin/trading/statemachine/StateModel

setStateChangedListener()

Allows the user to register a listener that will be fired any time there is a state change.

setStateMachine(oStateMachine)

Sets the state machine we will be monitoring.
Parameters:
Name Type Description
oStateMachine Object

setStateOrder(pStateOrder)

Sets the order of the states in the state monitor. Use this method only if you are using the module:caplin/trading/workbench/ui/StateModelVisualiser, it is not needed any more for the module:caplin/trading/workbench/TradeStateVisualiser.
Parameters:
Name Type Description
pStateOrder Array an ordered array of the list of the states for the state monitor.

stateChanged()

Implements:
See: