Skip to content

Commit

Permalink
44.0.0-beta11
Browse files Browse the repository at this point in the history
  • Loading branch information
jflamy committed Sep 20, 2023
1 parent 2eed2d5 commit 84bc20b
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trigger:
parameters:
- name: Revision
type: string
default: 44.0.0-beta10
default: 44.0.0-beta11
- name: SkipTests
type: string
default: 'false'
Expand Down
1 change: 1 addition & 0 deletions owlcms/frontend/components/ResultsMedals.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class ResultsMedals extends LitElement {
// WAIT INTRO_COUNTDOWN LIFT_COUNTDOWN CURRENT_ATHLETE INTERRUPTION SESSION_DONE CEREMONY
mode: {},
decisionVisible: { type: Boolean }, // sub-mode of CURRENT_ATHLETE
darkMode: {},

// dynamic styling
teamWidthClass: {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package app.owlcms.apputils.queryparameters;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;

import org.slf4j.LoggerFactory;

import app.owlcms.data.agegroup.AgeGroup;
Expand All @@ -10,6 +14,8 @@
public interface ResultsParameters {

final Logger logger = (Logger) LoggerFactory.getLogger(ResultsParameters.class);
DecimalFormatSymbols symbolsEN_US = DecimalFormatSymbols.getInstance(Locale.US);
DecimalFormat formatEN_US = new DecimalFormat("0.000", symbolsEN_US);

public boolean isVideo();
public void setVideo(boolean video);
Expand All @@ -25,5 +31,4 @@ public interface ResultsParameters {

public void setAgeGroupPrefix(String agp);
public String getAgeGroupPrefix();

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*******************************************************************************/
package app.owlcms.displays.scoreboard;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
Expand All @@ -31,6 +30,7 @@

import app.owlcms.apputils.SoundUtils;
import app.owlcms.apputils.queryparameters.DisplayParameters;
import app.owlcms.apputils.queryparameters.ResultsParameters;
import app.owlcms.components.elements.AthleteTimerElement;
import app.owlcms.components.elements.BreakTimerElement;
import app.owlcms.components.elements.DecisionElement;
Expand Down Expand Up @@ -113,7 +113,7 @@ public class Results extends LitTemplate
private Double teamWidth;
private boolean leadersDisplay;
private boolean recordsDisplay;
private final DecimalFormat df = new DecimalFormat("0.000");

private boolean video;
private boolean downSilenced;

Expand Down Expand Up @@ -296,7 +296,7 @@ public final boolean isVideo() {
public void pushEmSize() {
String formattedEm = null;
if (emFontSize != null) {
formattedEm = df.format(emFontSize);
formattedEm = ResultsParameters.formatEN_US.format(emFontSize);
this.getElement().setProperty("sizeOverride", " --tableFontSize:" + formattedEm + "rem;");
// logger.trace("%%%%% board changing em size={} from {}",emFontSize,LoggerUtils.whereFrom());
}
Expand All @@ -306,7 +306,7 @@ public void pushEmSize() {
public void pushTeamWidth() {
String formattedTW = null;
if (teamWidth != null) {
formattedTW = df.format(teamWidth);
formattedTW = ResultsParameters.formatEN_US.format(teamWidth);
this.getElement().setProperty("twOverride", "--nameWidth: 1fr; --clubWidth:" + formattedTW + "em;");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*******************************************************************************/
package app.owlcms.displays.scoreboard;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
Expand Down Expand Up @@ -77,7 +76,6 @@ public class ResultsMedals extends Results implements ResultsParameters {
private boolean snatchCJTotalMedals;
private AgeGroup ageGroup;
private boolean teamFlags;
DecimalFormat df = new DecimalFormat("0.000");
private AgeDivision ageDivision;
private String ageGroupPrefix;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import app.owlcms.data.category.Category;
import app.owlcms.data.competition.Competition;
import app.owlcms.fieldofplay.FieldOfPlay;
import app.owlcms.nui.displays.scoreboards.ResultsRankingsPage;
import ch.qos.logback.classic.Logger;
import elemental.json.Json;
import elemental.json.JsonArray;
Expand All @@ -30,7 +29,7 @@ public class ResultsRankings extends ResultsMedals implements ResultsParameters

final private Logger logger = (Logger) LoggerFactory.getLogger(ResultsMedals.class);

public ResultsRankings(ResultsRankingsPage page) {
public ResultsRankings() {
super();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ final public void setDownSilenced(boolean silent) {

@Override
final public void setEmFontSize(Double emFontSize) {
//logger.trace("**** setEmFontSize={}", emFontSize);
// clamp the value to something still visible
if (emFontSize != null && emFontSize <= 0.1) {
emFontSize = 0.1D;
}
this.emFontSize = emFontSize;
((DisplayParameters) this.board).setEmFontSize(emFontSize);
pushEmSize();
Expand Down Expand Up @@ -294,6 +297,9 @@ final public void setSilenced(boolean silent) {

@Override
final public void setTeamWidth(Double tw) {
if (tw != null && tw <= 0.0) {
tw = 0.0D;
}
((DisplayParameters) this.board).setTeamWidth(tw);
this.teamWidth = tw;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package app.owlcms.nui.displays.scoreboards;

import java.text.DecimalFormat;

import org.slf4j.LoggerFactory;

import com.vaadin.flow.component.Component;
Expand All @@ -11,6 +9,7 @@
import com.vaadin.flow.router.HasDynamicTitle;

import app.owlcms.apputils.queryparameters.DisplayParametersReader;
import app.owlcms.apputils.queryparameters.ResultsParameters;
import app.owlcms.displays.options.DisplayOptions;
import app.owlcms.nui.displays.AbstractDisplayPage;
import app.owlcms.nui.displays.SoundEntries;
Expand All @@ -30,7 +29,7 @@ public abstract class AbstractResultsDisplayPage extends AbstractDisplayPage
implements SoundEntries, DisplayParametersReader, HasDynamicTitle, SafeEventBusRegistration {

Logger logger = (Logger) LoggerFactory.getLogger(AbstractResultsDisplayPage.class);
private final DecimalFormat df = new DecimalFormat("0.000");

private static final int DEBOUNCE = 50;
private long now;
private long lastShortcut;
Expand Down Expand Up @@ -109,17 +108,21 @@ public Double getTeamWidth() {
@Override
public void pushEmSize() {
String formattedEm = null;
if (getEmFontSize() != null) {
formattedEm = df.format(getEmFontSize());
Double emFontSize = getEmFontSize();
if (emFontSize != null) {
emFontSize = emFontSize <= 0.0 ? 0.0 : emFontSize;
formattedEm = ResultsParameters.formatEN_US.format(emFontSize);
getBoard().getElement().setProperty("sizeOverride", " --tableFontSize:" + formattedEm + "rem;");
}
}

@Override
public void pushTeamWidth() {
String formattedTW = null;
if (getTeamWidth() != null) {
formattedTW = df.format(getTeamWidth());
Double teamWidth2 = getTeamWidth();
if (teamWidth2 != null) {
teamWidth2 = teamWidth2 <= 0.0 ? 0.0 : teamWidth2;
formattedTW = ResultsParameters.formatEN_US.format(teamWidth2);
getBoard().getElement().setProperty("twOverride", "--nameWidth: 1fr; --clubWidth:" + formattedTW + "em;");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public String getPageTitle() {
protected void init() {
var board = new ResultsRankingOrder();
this.setBoard(board);
board.setLeadersDisplay(true);
board.setRecordsDisplay(true);
this.addComponent(board);
this.ui = UI.getCurrent();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.vaadin.flow.router.QueryParameters;
import com.vaadin.flow.router.Route;

import app.owlcms.apputils.queryparameters.SoundParameters;
import app.owlcms.apputils.queryparameters.DisplayParameters;
import app.owlcms.apputils.queryparameters.SoundParameters;
import app.owlcms.data.config.Config;
import app.owlcms.displays.scoreboard.ResultsMedals;
import app.owlcms.init.OwlcmsSession;
Expand All @@ -34,8 +34,6 @@ public String getPageTitle() {
protected void init() {
var board = new ResultsMedals();
this.setBoard(board);
board.setLeadersDisplay(true);
board.setRecordsDisplay(true);
this.addComponent(board);

setDefaultParameters(QueryParameters.simple(Map.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.vaadin.flow.router.QueryParameters;
import com.vaadin.flow.router.Route;

import app.owlcms.apputils.queryparameters.SoundParameters;
import app.owlcms.apputils.queryparameters.DisplayParameters;
import app.owlcms.apputils.queryparameters.SoundParameters;
import app.owlcms.data.config.Config;
import app.owlcms.displays.scoreboard.ResultsRankingOrder;
import app.owlcms.init.OwlcmsSession;
Expand All @@ -17,6 +17,7 @@
@SuppressWarnings("serial")
@Route("displays/resultsRankingOrder")

@Deprecated
public class ResultsRankingOrderPage extends AbstractResultsDisplayPage {

Logger logger = (Logger) LoggerFactory.getLogger(ResultsRankingOrderPage.class);
Expand All @@ -27,15 +28,13 @@ public ResultsRankingOrderPage() {

@Override
public String getPageTitle() {
return getTranslation("Scoreboard.RankingOrder") + OwlcmsSession.getFopNameIfMultiple();
return getTranslation("Scoreboard.RankingOrder") + OwlcmsSession.getFopNameIfMultiple()+"X";
}

@Override
protected void init() {
var board = new ResultsRankingOrder();
this.setBoard(board);
board.setLeadersDisplay(true);
board.setRecordsDisplay(true);
this.addComponent(board);

setDefaultParameters(QueryParameters.simple(Map.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.vaadin.flow.router.QueryParameters;
import com.vaadin.flow.router.Route;

import app.owlcms.apputils.queryparameters.SoundParameters;
import app.owlcms.apputils.queryparameters.DisplayParameters;
import app.owlcms.apputils.queryparameters.SoundParameters;
import app.owlcms.data.config.Config;
import app.owlcms.displays.scoreboard.ResultsRankings;
import ch.qos.logback.classic.Logger;
Expand All @@ -21,10 +21,8 @@ public class ResultsRankingsPage extends ResultsMedalsPage {
Logger logger = (Logger) LoggerFactory.getLogger(ResultsRankingsPage.class);

public ResultsRankingsPage() {
var board = new ResultsRankings(this);
var board = new ResultsRankings();
this.setBoard(board);
board.setLeadersDisplay(true);
board.setRecordsDisplay(true);
this.addComponent(board);

setDefaultParameters(QueryParameters.simple(Map.of(
Expand Down
5 changes: 2 additions & 3 deletions src/main/markdown/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
> Version 44 is a technical migration release. It updates the code to the current version of the user interface framework ([Vaadin 24](http://vaadin.com)). A clean-up of the code was performed at the same time, and several small annoyances were fixed as a result.
>
**44.0.0-beta10**
**44.0.0-beta11**

- Public displays now switch to medals during ceremonies
- Video displays are operational. Issue with video medals in beta09 fixed.
- Fix: in countries where the decimal separator is the comma, the scoreboards are no longer garbled when editing the team width or font size (injecting numbers with commas broke the style sheet).
- Known issues: see this [list of known small issues](https://github.com/jflamy/owlcms4/issues/734)


Expand Down

0 comments on commit 84bc20b

Please sign in to comment.