com.azalient.api.b.control
Interface IPlan

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

public interface IPlan
extends StoreRecordRW, IDeletable, IDescribed

A numbered phase plan describing the running order of a set of phases and an offset to the first phase from some global time zero.


Field Summary
static String IX_PLAN_SEPARATOR
           
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Method Summary
 IUndoable addPhase(IUndoStack us, int index, IPhase phase)
           
 IUndoable addPhase(IUndoStack us, IPhase phase)
           
 IController controller()
          The signal controller to which this plan belongs
 double cycleTime()
          The cycle time, in seconds.
 void cycleTime(double t)
          Set the cycle time, in seconds.
 IUndoable delPhase(IUndoStack us, IPhase phase)
           
 Double greenTime(IPhase phase)
          Return the green time, in seconds, for the given phase in this plan.
 void greenTime(IPhase phase, double green)
          Set the green time, in seconds, for the given phase in this plan
 Double[] greenTimes()
          The green times for the phases in this plan, in the same order as the phases
 IPhase phaseAfter(IPhase phase)
          return the phase after the given phase in the plan.
 double phaseOffset()
          The offset time, in seconds.
 void phaseOffset(double offset)
          Set the offset time, in seconds.
 IPhase[] phases()
          The phases to which this plan applies, in the order in which they will be applied
 int planIndex()
          The index number of this plan.
 ITerm term()
          Returns the term for this plan.
 void term(ITerm term)
          Set the term to which this plan applies.
 
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
 
Methods inherited from interface com.azalient.api.ui.clipboard.IDeletable
delete, deleted, name
 
Methods inherited from interface com.azalient.api.a.tables.IDescribed
description
 

Field Detail

IX_PLAN_SEPARATOR

static final String IX_PLAN_SEPARATOR
See Also:
Constant Field Values
Method Detail

controller

IController controller()
The signal controller to which this plan belongs


planIndex

int planIndex()
The index number of this plan. The index is unique, but plans do not need to be sequentially indexed.


phases

IPhase[] phases()
The phases to which this plan applies, in the order in which they will be applied


greenTimes

Double[] greenTimes()
The green times for the phases in this plan, in the same order as the phases


cycleTime

double cycleTime()
The cycle time, in seconds. If this is zero, then green times are absolute, otherwise, green times are percentages


cycleTime

void cycleTime(double t)
Set the cycle time, in seconds. If this is zero, then green times are absolute, otherwise, green times are percentages


phaseOffset

double phaseOffset()
The offset time, in seconds.


phaseOffset

void phaseOffset(double offset)
Set the offset time, in seconds.


phaseAfter

IPhase phaseAfter(IPhase phase)
return the phase after the given phase in the plan. Return null if the given phase is not in the plan


term

void term(ITerm term)
Set the term to which this plan applies. See term()


term

ITerm term()
Returns the term for this plan. If this is null, then the plan applies at all times. You can set up two or more plans to switch on at certain times of the day, by setting a different term for each plan. Each second, the controller will check if the term for any plan has just started, and if so, it will make that plan the current one. It will retain a "stack" of existing plans, so if the top-most plan's term ends that plan will be "popped" from the stack and the most recently applied plan will be applied.


greenTime

void greenTime(IPhase phase,
               double green)
Set the green time, in seconds, for the given phase in this plan


greenTime

Double greenTime(IPhase phase)
Return the green time, in seconds, for the given phase in this plan. Returns null if the given phase is not in this plan


addPhase

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

addPhase

IUndoable addPhase(IUndoStack us,
                   int index,
                   IPhase phase)
Internal - Not recommended for use. Public as a side-effect of implementation method
Add a phase to this plan, at the given index in the order of phases

delPhase

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