use of us.mn.state.dot.tms.LaneAction in project iris by mnit-rtmc.
the class PlanDispatcher method createPhaseSet.
/**
* Create a set of phases for an action plan
*/
private TreeSet<PlanPhase> createPhaseSet(final ActionPlan ap) {
final TreeSet<PlanPhase> phases = new TreeSet<PlanPhase>(comparator);
Iterator<DmsAction> dit = DmsActionHelper.iterator();
while (dit.hasNext()) {
DmsAction da = dit.next();
if (da.getActionPlan() == ap)
phases.add(da.getPhase());
}
Iterator<BeaconAction> bit = BeaconActionHelper.iterator();
while (bit.hasNext()) {
BeaconAction ba = bit.next();
if (ba.getActionPlan() == ap)
phases.add(ba.getPhase());
}
Iterator<CameraAction> cit = CameraActionHelper.iterator();
while (cit.hasNext()) {
CameraAction ca = cit.next();
if (ca.getActionPlan() == ap)
phases.add(ca.getPhase());
}
Iterator<LaneAction> lit = LaneActionHelper.iterator();
while (lit.hasNext()) {
LaneAction la = lit.next();
if (la.getActionPlan() == ap)
phases.add(la.getPhase());
}
Iterator<MeterAction> mit = MeterActionHelper.iterator();
while (mit.hasNext()) {
MeterAction ma = mit.next();
if (ma.getActionPlan() == ap)
phases.add(ma.getPhase());
}
return phases;
}
use of us.mn.state.dot.tms.LaneAction in project iris by mnit-rtmc.
the class LaneActionJob method perform.
/**
* Perform all lane actions
*/
@Override
public void perform() {
Iterator<LaneAction> it = LaneActionHelper.iterator();
while (it.hasNext()) {
LaneAction la = it.next();
ActionPlan ap = la.getActionPlan();
if (ap.getActive())
performLaneAction(la, ap.getPhase());
}
}
use of us.mn.state.dot.tms.LaneAction in project iris by mnit-rtmc.
the class LaneActionModel method createColumns.
/**
* Create the columns in the model
*/
@Override
protected ArrayList<ProxyColumn<LaneAction>> createColumns() {
ArrayList<ProxyColumn<LaneAction>> cols = new ArrayList<ProxyColumn<LaneAction>>(2);
cols.add(new ProxyColumn<LaneAction>("lane_marking", 160) {
public Object getValueAt(LaneAction la) {
return la.getLaneMarking();
}
});
cols.add(new ProxyColumn<LaneAction>("action.plan.phase", 100) {
public Object getValueAt(LaneAction la) {
return la.getPhase();
}
public boolean isEditable(LaneAction la) {
return canWrite(la);
}
public void setValueAt(LaneAction la, Object value) {
if (value instanceof PlanPhase)
la.setPhase((PlanPhase) value);
}
protected TableCellEditor createCellEditor() {
JComboBox<PlanPhase> cbx = new JComboBox<PlanPhase>();
cbx.setModel(new IComboBoxModel<PlanPhase>(phase_mdl));
return new DefaultCellEditor(cbx);
}
});
return cols;
}
use of us.mn.state.dot.tms.LaneAction in project iris by mnit-rtmc.
the class PlanDispatcher method countLanes.
/**
* Get a count a lane markings controlled by an action plan
*/
private int countLanes(ActionPlan p) {
HashSet<LaneMarking> plan_lanes = new HashSet<LaneMarking>();
Iterator<LaneAction> lit = LaneActionHelper.iterator();
while (lit.hasNext()) {
LaneAction la = lit.next();
if (la.getActionPlan() == p)
plan_lanes.add(la.getLaneMarking());
}
return plan_lanes.size();
}
Aggregations