Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/us/mn/state/dot/tms/server/BeaconImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Iterator;
import java.sql.ResultSet;
import java.sql.SQLException;
import us.mn.state.dot.sonar.SonarException;
Expand Down Expand Up @@ -361,7 +362,19 @@ public int getState() {
/** Choose the planned action */
@Override
public PlannedAction choosePlannedAction() {
PlannedAction pa = super.choosePlannedAction();
// Same as in DeviceImpl, but doesn't remove actions if condition is false
// Specific handling necessary to allow plan to undeploy
PlannedAction pa = null;
Iterator<PlannedAction> it =
planned_actions.descendingIterator();
while (it.hasNext()) {
pa = it.next();
if (checkPlannedAction(pa))
break;
else
pa = null;
}

if (!planned_actions.isEmpty()) {
BeaconState bs = (pa != null)
? BeaconState.FLASHING_REQ
Expand Down