Skip to content

Commit

Permalink
prevent decision change after decision is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
jflamy committed Aug 4, 2023
1 parent 44e0821 commit 2c6365f
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions owlcms/src/main/java/app/owlcms/fieldofplay/FieldOfPlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -794,18 +794,22 @@ public synchronized void handleFOPEvent(FOPEvent e) {
doWeightChange((WeightChange) e);
} else if (e instanceof ForceTime) {
doForceTime((ForceTime) e);
} else if (e instanceof DecisionFullUpdate && isClockStoppedDecisionsAllowed()) {
// after a break from jury, decisions can be entered even though the clock is
// not running
updateRefereeDecisions((DecisionFullUpdate) e);
uiShowUpdateOnJuryScreen(e);
} else if (e instanceof DecisionUpdate && isClockStoppedDecisionsAllowed()) {
// after a break from jury, decisions can be entered even though the clock is
// not running
updateRefereeDecisions((DecisionUpdate) e);
uiShowUpdateOnJuryScreen(e);
} else {
unexpectedEventInState(e, CURRENT_ATHLETE_DISPLAYED);
}
// else if (e instanceof DecisionFullUpdate && isClockStoppedDecisionsAllowed()) {
// // after a break from jury, decisions can be entered even though the clock is
// // not running
// updateRefereeDecisions((DecisionFullUpdate) e);
// uiShowUpdateOnJuryScreen(e);
// } else if (e instanceof DecisionUpdate && isClockStoppedDecisionsAllowed()) {
// // after a break from jury, decisions can be entered even though the clock is
// // not running
// updateRefereeDecisions((DecisionUpdate) e);
// uiShowUpdateOnJuryScreen(e);
// }
else {
pushOutUIEvent(new UIEvent.Notification(this.getCurAthlete(), e.getOrigin(), e, state,
UIEvent.Notification.Level.ERROR));
// unexpectedEventInState(e, CURRENT_ATHLETE_DISPLAYED);
}
break;

Expand Down Expand Up @@ -922,12 +926,13 @@ public synchronized void handleFOPEvent(FOPEvent e) {
simulateDecision((ExplicitDecision) e);
// showExplicitDecision(((ExplicitDecision) e), e.origin);
} else if (e instanceof DecisionFullUpdate) {
// decision coming from decision display or attempt board
updateRefereeDecisions((DecisionFullUpdate) e);
uiShowUpdateOnJuryScreen(e);
// late update
pushOutUIEvent(new UIEvent.Notification(this.getCurAthlete(), e.getOrigin(), e, state,
UIEvent.Notification.Level.ERROR));
} else if (e instanceof DecisionUpdate) {
updateRefereeDecisions((DecisionUpdate) e);
uiShowUpdateOnJuryScreen(e);
// late update
pushOutUIEvent(new UIEvent.Notification(this.getCurAthlete(), e.getOrigin(), e, state,
UIEvent.Notification.Level.ERROR));
} else if (e instanceof WeightChange) {
recomputeLiftingOrder(true, ((WeightChange) e).isResultChange()); // &&&&&&&&&&&&&&&&&&&&&
// weightChangeDoNotDisturb((WeightChange) e);
Expand Down Expand Up @@ -1918,8 +1923,8 @@ private void pushOutDone() {

private void pushOutSnatchDone() {
Competition cCur = Competition.getCurrent();
logger.debug("Snatch Done {}",cCur.isAutomaticCJBreak());
logger.debug("Snatch Done {}", cCur.isAutomaticCJBreak());

int millisRemaining = 10 * 60 * 1000;
if (!cCur.isAutomaticCJBreak()) {
// UIEvent.SnatchDone event = new UIEvent.SnatchDone(this.getGroup(), null, LoggerUtils.whereFrom());
Expand All @@ -1934,7 +1939,7 @@ private void pushOutSnatchDone() {
millisRemaining = (cCur.getShorterBreakDuration() != null ? cCur.getShorterBreakDuration() : 10) * 60 * 1000;
} else if (cCur.getLongerBreakMax() != null && liftingOrder.size() < cCur.getLongerBreakMax()) {
millisRemaining = (cCur.getLongerBreakDuration() != null ? cCur.getLongerBreakDuration() : 10) * 60 * 1000;
}
}
if (millisRemaining <= 0) {
return;
}
Expand Down Expand Up @@ -1990,7 +1995,7 @@ private void recomputeCurrentLeaders(List<Athlete> rankedAthletes) {
Category category = getCurAthlete().getCategory();

TreeSet<Athlete> medalists = getMedals().get(category);
//logger.debug("medals {}", medalists);
// logger.debug("medals {}", medalists);
List<Athlete> snatchMedalists = medalists.stream().filter(a -> {
int r = a.getSnatchRank();
return r <= 3 && r > 0;
Expand Down Expand Up @@ -2691,8 +2696,8 @@ private void uiDisplayCurrentAthleteAndTime(boolean currentDisplayAffected, FOPE
private boolean allFirstCJ() {
// check that all athletes are at first CJ
boolean firstCJ = true;
for (Athlete a: liftingOrder) {
logger.debug("{}{} {}",this.getLoggingName(), a.getShortName(),a.getAttemptsDone());
for (Athlete a : liftingOrder) {
logger.debug("{}{} {}", this.getLoggingName(), a.getShortName(), a.getAttemptsDone());
if (a.getAttemptsDone() != 3) {
firstCJ = false;
break;
Expand Down

0 comments on commit 2c6365f

Please sign in to comment.