Caplin Trader 5.1.0

Class: module:ct-trading/workbench/model/StateMachineMonitor

module:ct-trading/workbench/model/StateMachineMonitor(oStateModel)

new module:ct-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:ct-trading/statemachine/State}

Returns the current state.

Returns:
Type
module:ct-trading/statemachine/State

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

Returns the state model.

Returns:
Type
module:ct-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 deleted module:ct-trading/workbench/ui/StateModelVisualiser, it is not needed any more for the module:ct-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: