com.azalient.api.b.control
Interface IController

All Superinterfaces:
IRecord, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW

public interface IController
extends StoreRecordRW

A Controller is used to control traffic signals at a signalised intersection.
A controller can be positioned as appropriate for viewing by the user.
A controller holds references to groups, phases and loops that are used for traffic control.

A controller controls a single intersection, but an intersection can contain any number of nodes, separated by links.


Field Summary
static IController[] ZERO
           
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Method Summary
 IUndoable addGroup(IUndoStack us, IGroup group)
           
 IUndoable addLoop(IUndoStack us, ILoop loop)
           
 IUndoable addPhase(IUndoStack us, IPhase phase)
           
 IControllerLogic controllerLogic()
           
 void controllerLogic(IControllerLogic cl)
           
 boolean controlsPeds()
          Returns true if this controller controls pedestrians
 IPhase currentPhase()
          Returns the current running phase
 void currentPhase(IPhase phase)
          Set the current phase to the given phase
 IPlan currentPlan()
          Returns the current signal plan, defining the phase order, offset time and split times (the green times for each phase)
 void currentPlan(IPlan plan)
          Set the current signal plan
 IUndoable delGroup(IUndoStack us, IGroup group)
           
 IUndoable delLoop(IUndoStack us, ILoop loop)
           
 IUndoable delPhase(IUndoStack us, IPhase phase)
           
 void delPhases()
           
 boolean externalControl()
          Returns true if this controller takes group or phase change messages from an external controller (e.g.
 void externalControl(boolean b)
          Set to true if this controller takes group or phase change messages from an external controller (e.g.
 void externalControllerTakesOver(IExternalController controller)
           
 IGroup group(int index)
          Return the group with the given index, or null, if no group exists with that index
 IGroup[] groups()
          Returns an array of all groups on this intersection
 IIntersection intersection()
          The intersection controlled by this controller
 boolean isRunning(int phase)
          Returns true if the [1.N] numbered phase is currently running
 ILoop[] loops()
          Return an array of the loops connected to this controller
 IXyz ne()
          The north-east corner of the box used to draw the phases and groups
 IPhase phase(int index0)
          Returns the phase with the given index [0..N-1]
 IPhase phaseFromCurrentGroups()
          Return the phase that matches the currently active groups (used when an external controller is setting groups directly )
 IPhase[] phases()
          Returns an array of all phases on the intersection
 boolean selected()
          Returns true if the controller display is selected
 void startNextPhase()
           
 IXyz sw()
          The south-west corner of the box used to draw the phases and groups
 void sw(IXyz p)
          Move the south-west corner of the box to the given point
 void turnsChanged()
           
 
Methods inherited from interface com.azalient.api.file.StoreRecordRW
canRename, rename, store
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable, set
 
Methods inherited from interface com.azalient.api.a.tables.IRecord
name
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile
 

Field Detail

ZERO

static final IController[] ZERO
Method Detail

sw

IXyz sw()
The south-west corner of the box used to draw the phases and groups


sw

void sw(IXyz p)
Move the south-west corner of the box to the given point


ne

IXyz ne()
The north-east corner of the box used to draw the phases and groups


intersection

IIntersection intersection()
The intersection controlled by this controller


controlsPeds

boolean controlsPeds()
Returns true if this controller controls pedestrians


externalControl

boolean externalControl()
Returns true if this controller takes group or phase change messages from an external controller (e.g. SCATS)


externalControl

void externalControl(boolean b)
Set to true if this controller takes group or phase change messages from an external controller (e.g. SCATS)


externalControllerTakesOver

void externalControllerTakesOver(IExternalController controller)
Internal - Not recommended for use. Public as a side-effect of implementation method
Pass in an external controller interface which will take over control of the intersection

controllerLogic

IControllerLogic controllerLogic()
Internal - Not recommended for use. Public as a side-effect of implementation method
Return a reference to the controller logic object

controllerLogic

void controllerLogic(IControllerLogic cl)
Internal - Not recommended for use. Public as a side-effect of implementation method
Set the controller logic on this controller

groups

IGroup[] groups()
Returns an array of all groups on this intersection


phases

IPhase[] phases()
Returns an array of all phases on the intersection


phase

IPhase phase(int index0)
Returns the phase with the given index [0..N-1]


currentPlan

void currentPlan(IPlan plan)
Set the current signal plan


currentPlan

IPlan currentPlan()
Returns the current signal plan, defining the phase order, offset time and split times (the green times for each phase)


startNextPhase

void startNextPhase()
Internal - Not recommended for use. Public as a side-effect of implementation method
Start the next phase running

currentPhase

IPhase currentPhase()
Returns the current running phase


phaseFromCurrentGroups

IPhase phaseFromCurrentGroups()
Return the phase that matches the currently active groups (used when an external controller is setting groups directly )


currentPhase

void currentPhase(IPhase phase)
Set the current phase to the given phase


isRunning

boolean isRunning(int phase)
Returns true if the [1.N] numbered phase is currently running


loops

ILoop[] loops()
Return an array of the loops connected to this controller


group

IGroup group(int index)
Return the group with the given index, or null, if no group exists with that index


addGroup

IUndoable addGroup(IUndoStack us,
                   IGroup group)
Internal - Not recommended for use. Public as a side-effect of implementation method

delGroup

IUndoable delGroup(IUndoStack us,
                   IGroup group)
Internal - Not recommended for use. Public as a side-effect of implementation method

addPhase

IUndoable addPhase(IUndoStack us,
                   IPhase phase)
Internal - Not recommended for use. Public as a side-effect of implementation method

delPhase

IUndoable delPhase(IUndoStack us,
                   IPhase phase)
Internal - Not recommended for use. Public as a side-effect of implementation method

delPhases

void delPhases()
Internal - Not recommended for use. Public as a side-effect of implementation method

addLoop

IUndoable addLoop(IUndoStack us,
                  ILoop loop)
Internal - Not recommended for use. Public as a side-effect of implementation method

delLoop

IUndoable delLoop(IUndoStack us,
                  ILoop loop)
Internal - Not recommended for use. Public as a side-effect of implementation method

selected

boolean selected()
Returns true if the controller display is selected


turnsChanged

void turnsChanged()
Internal - Not recommended for use. Public as a side-effect of implementation method
Fire a notification that the array of turns has been changed