Skip to content

Commit

Permalink
Fix penalty timer to cause box trip to show as ended in plt UI when t…
Browse files Browse the repository at this point in the history
…imer ends

In the newest version of CRG, need to also set the IS_CURRENT value of the BoxTrip to be false when a penalty timer ends, otherwise the box in the plt UI stays red.
  • Loading branch information
katpet committed Dec 18, 2024
1 parent 0359a5d commit c2b3727
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void endBox() {
numPenalties = 1;
if(f.getCurrentBoxTrip() != null) {
f.getCurrentBoxTrip().end();
f.getCurrentBoxTrip().delete();
f.getCurrentBoxTrip().setIsCurrent(false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ public void execute(Command prop, Source source) {
public void restart() {
set(WALLTIME_START, ScoreBoardClock.getInstance().getCurrentWalltime());
set(PERIOD_NUMBER, game.getCurrentPeriodNumber());
set(IS_CURRENT, true);
}

@Override
Expand Down Expand Up @@ -534,6 +535,10 @@ public int getPenaltyCount() {
public void setPenaltyCount(int count) {
set(PENALTY_COUNT, count);
}
@Override
public void setIsCurrent(Boolean isCurrent) {
set(IS_CURRENT, isCurrent);
}

private Game game;
private Clock storedClock = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public interface BoxTrip extends ScoreBoardEventProvider {
public int getPeriodNumber();
public int getPenaltyCount();
public void setPenaltyCount(int count);
public void setIsCurrent(Boolean isCurrent);

public static Collection<Property<?>> props = new ArrayList<>();

Expand Down

0 comments on commit c2b3727

Please sign in to comment.