mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-20 12:45:35 +00:00
changed icon, removed possible null pointers and made small changed to bottomnotification and startanalysis map
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
<!doctype html>
|
||||
<!-- The DOCTYPE declaration above will set the -->
|
||||
<!-- browser's rendering engine into -->
|
||||
<!-- "Standards Mode". Replacing this declaration -->
|
||||
<!-- with a "Quirks Mode" doctype may lead to some -->
|
||||
<!-- differences in layout. -->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<meta http-equiv="REFRESH" content="0; url=http://www.sapsailing.com/browser-info.html">
|
||||
<![endif]-->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<link href='src/main/resources/images/dashboardicon.png'
|
||||
rel='apple-touch-startup-image'>
|
||||
<link href='src/main/resources/images/dashboardicon.png' rel='apple-touch-icon'>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="src/main/resources/images/dashboardicon.png" />
|
||||
|
||||
<link href='images/dashboardicon.png' rel='apple-touch-icon'>
|
||||
|
||||
<title>ESS Dashboard</title>
|
||||
|
||||
@@ -19,7 +21,7 @@
|
||||
<script type="text/javascript"
|
||||
src="com.sap.sailing.dashboards.gwt.RibDashboard/com.sap.sailing.dashboards.gwt.RibDashboard.nocache.js"></script>
|
||||
|
||||
<!-- Disables vertical scrolling whole website over edge on apple browsers -->
|
||||
<!-- Disables scrolling whole website vertically over edge on apple browsers -->
|
||||
<script type="text/javascript">
|
||||
document.ontouchmove = function(event){
|
||||
event.preventDefault();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
+1
-1
@@ -2,7 +2,7 @@ package com.sap.sailing.dashboards.gwt.client.bottomnotification;
|
||||
|
||||
public enum BottomNotificationType {
|
||||
|
||||
NEW_STARTANALYSIS_AVAILABLE("New Start Analysis available.", "#F0AB00", "#000000", true);
|
||||
NEW_STARTANALYSIS_AVAILABLE("New start analysis available", "#F0AB00", "#000000", true);
|
||||
|
||||
private String message;
|
||||
private String backgroundColorAsHex;
|
||||
|
||||
+18
-15
@@ -107,17 +107,21 @@ public class StartAnalysisSimpleMap extends AbsolutePanel implements TailFactory
|
||||
|
||||
Map<CompetitorDTO, List<GPSFixDTO>> gpsFixesForCompetitors = new HashMap<CompetitorDTO, List<GPSFixDTO>>();
|
||||
for (StartAnalysisCompetitorDTO startAnalysisCompetitorDTO : startAnalysisDTO.startAnalysisCompetitorDTOs) {
|
||||
gpsFixesForCompetitors.put(startAnalysisCompetitorDTO.competitorDTO,
|
||||
startAnalysisCompetitorDTO.gpsFixDTOs);
|
||||
if (startAnalysisCompetitorDTO.gpsFixDTOs != null && !startAnalysisCompetitorDTO.gpsFixDTOs.isEmpty()) {
|
||||
gpsFixesForCompetitors.put(startAnalysisCompetitorDTO.competitorDTO,
|
||||
startAnalysisCompetitorDTO.gpsFixDTOs);
|
||||
}
|
||||
}
|
||||
return gpsFixesForCompetitors;
|
||||
}
|
||||
|
||||
|
||||
private Map<CompetitorDTO, GPSFixDTO> createGPSPositionForCompetitors(StartAnalysisDTO startAnalysisDTO) {
|
||||
Map<CompetitorDTO, GPSFixDTO> gpsPositionForCompetitors = new HashMap<CompetitorDTO, GPSFixDTO>();
|
||||
for (StartAnalysisCompetitorDTO startAnalysisCompetitorDTO : startAnalysisDTO.startAnalysisCompetitorDTOs) {
|
||||
gpsPositionForCompetitors.put(startAnalysisCompetitorDTO.competitorDTO,
|
||||
startAnalysisCompetitorDTO.gpsFixDTOs.get(startAnalysisCompetitorDTO.gpsFixDTOs.size()-1));
|
||||
if (startAnalysisCompetitorDTO.gpsFixDTOs != null && !startAnalysisCompetitorDTO.gpsFixDTOs.isEmpty()) {
|
||||
gpsPositionForCompetitors.put(startAnalysisCompetitorDTO.competitorDTO,
|
||||
startAnalysisCompetitorDTO.gpsFixDTOs.get(startAnalysisCompetitorDTO.gpsFixDTOs.size() - 1));
|
||||
}
|
||||
}
|
||||
return gpsPositionForCompetitors;
|
||||
}
|
||||
@@ -148,16 +152,15 @@ public class StartAnalysisSimpleMap extends AbsolutePanel implements TailFactory
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawLinesFromStartLineToFirstMark(List<MarkDTO> startlineMarks, MarkDTO firstMark){
|
||||
|
||||
private void drawLinesFromStartLineToFirstMark(List<MarkDTO> startlineMarks, MarkDTO firstMark) {
|
||||
if (map != null && startlineMarks != null && firstMark != null) {
|
||||
if (startlineMarks.size() == 2) {
|
||||
LatLng startLinePoint1 = LatLng.newInstance(startlineMarks.get(0).position.latDeg,
|
||||
startlineMarks.get(0).position.lngDeg);
|
||||
LatLng startLinePoint2 = LatLng.newInstance(startlineMarks.get(1).position.latDeg,
|
||||
startlineMarks.get(1).position.lngDeg);
|
||||
LatLng firstMarkPoint = LatLng.newInstance(firstMark.position.latDeg,
|
||||
firstMark.position.lngDeg);
|
||||
LatLng firstMarkPoint = LatLng.newInstance(firstMark.position.latDeg, firstMark.position.lngDeg);
|
||||
|
||||
PolylineOptions options = PolylineOptions.newInstance();
|
||||
options.setGeodesic(true);
|
||||
@@ -168,14 +171,14 @@ public class StartAnalysisSimpleMap extends AbsolutePanel implements TailFactory
|
||||
MVCArray<LatLng> pointsAsArray1 = MVCArray.newInstance();
|
||||
pointsAsArray1.insertAt(0, startLinePoint1);
|
||||
pointsAsArray1.insertAt(1, firstMarkPoint);
|
||||
|
||||
|
||||
MVCArray<LatLng> pointsAsArray2 = MVCArray.newInstance();
|
||||
pointsAsArray2.insertAt(0, startLinePoint2);
|
||||
pointsAsArray2.insertAt(1, firstMarkPoint);
|
||||
|
||||
Polyline startMarkFirstMark1 = Polyline.newInstance(options);
|
||||
Polyline startMarkFirstMark2 = Polyline.newInstance(options);
|
||||
|
||||
|
||||
startMarkFirstMark1.setPath(pointsAsArray1);
|
||||
startMarkFirstMark2.setPath(pointsAsArray2);
|
||||
|
||||
@@ -194,10 +197,10 @@ public class StartAnalysisSimpleMap extends AbsolutePanel implements TailFactory
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void drawFirstMark(MarkDTO firstMark){
|
||||
CourseMarkOverlay courseMarkOverlay = createCourseMarkOverlay(
|
||||
RaceMapOverlaysZIndexes.COURSEMARK_ZINDEX, firstMark);
|
||||
|
||||
private void drawFirstMark(MarkDTO firstMark) {
|
||||
CourseMarkOverlay courseMarkOverlay = createCourseMarkOverlay(RaceMapOverlaysZIndexes.COURSEMARK_ZINDEX,
|
||||
firstMark);
|
||||
courseMarkOverlay.addToMap();
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -23,6 +23,9 @@ import com.sap.sailing.dashboards.gwt.shared.dto.startanalysis.StartAnalysisDTO;
|
||||
public class StartlineAnalysisCard extends Composite implements HasWidgets, StartAnalysisPageChangeListener {
|
||||
|
||||
private StartAnalysisSimpleMap simpleMap;
|
||||
|
||||
private final double WIND_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 185;
|
||||
private final double GEOMETRIC_LINE_ADVANTAGE_DIV_WIDTH_IN_PT = 210;
|
||||
|
||||
private static StartlineAnalysisCardUiBinder uiBinder = GWT.create(StartlineAnalysisCardUiBinder.class);
|
||||
|
||||
@@ -101,9 +104,19 @@ public class StartlineAnalysisCard extends Composite implements HasWidgets, Star
|
||||
.setInnerHTML(NumberFormat.getFormat("#0.0").format(startAnalysisDTO.startAnalysisWindLineInfoDTO.windDirectionInDegrees) + "°");
|
||||
startanalysis_card_wind_data_speed
|
||||
.setInnerHTML(NumberFormat.getFormat("#0.0").format(startAnalysisDTO.startAnalysisWindLineInfoDTO.windSpeedInKnots) + " kts");
|
||||
setLineAdvantageDivWidth(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType);
|
||||
startanalysis_card_line_advantage.setInnerHTML(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType.getDisplayName()+": "+NumberFormat.getFormat("#0.0").format(startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvantage)+" m");
|
||||
}
|
||||
}
|
||||
|
||||
private void setLineAdvantageDivWidth(StartlineAdvantageType startlineAdvantageType) {
|
||||
if (startAnalysisDTO.startAnalysisWindLineInfoDTO.startLineAdvantage.startLineAdvatageType
|
||||
.equals(StartlineAdvantageType.GEOMETRIC)) {
|
||||
startanalysis_card_line_advantage.getStyle().setWidth(GEOMETRIC_LINE_ADVANTAGE_DIV_WIDTH_IN_PT, Unit.PT);
|
||||
} else {
|
||||
startanalysis_card_line_advantage.getStyle().setWidth(WIND_LINE_ADVANTAGE_DIV_WIDTH_IN_PT, Unit.PT);
|
||||
}
|
||||
}
|
||||
|
||||
private void addMap(final int cardID) {
|
||||
Timer timer = new Timer()
|
||||
|
||||
+1
-1
@@ -177,10 +177,10 @@ public class StartlineAnalysisComponent extends Composite implements HasWidgets
|
||||
if (displayedStartAnalysisCompetitorDifferentToRequestedOne()) {
|
||||
removeAllStartAnalysisCards();
|
||||
}
|
||||
addNewStartAnalysisCards(result);
|
||||
if (result.size() != starts.size()) {
|
||||
showNotificationForNewStartAnalysis();
|
||||
}
|
||||
addNewStartAnalysisCards(result);
|
||||
settingsButtonWithSelectionIndicationLabel
|
||||
.setSelectionIndicationTextOnLabel(result.get(0).competitor.getName());
|
||||
}
|
||||
|
||||
+3
-5
@@ -61,15 +61,15 @@ public class StartAnalysisDTOFactory extends AbstractStartAnalysisCreationValida
|
||||
Waypoint secondWaypoint = trackedRace.getRace().getCourse().getFirstLeg().getTo();
|
||||
List<MarkPassing> markPassingsInOrder = convertMarkpPassingsIteratorToList(trackedRace.getMarkPassingsInOrder(secondWaypoint).iterator());
|
||||
|
||||
boolean isCompetitorBetweenFirstThree = false;
|
||||
boolean isCompetitorOneOfFirstThree = false;
|
||||
for (int i = 0; i < MINIMUM_NUMBER_COMPETITORS_FOR_STARTANALYSIS; i++) {
|
||||
competitors.add(createStartAnalysisCompetitorDTO(trackedRace, i + 1,
|
||||
markPassingsInOrder.get(i).getCompetitor()));
|
||||
if (markPassingsInOrder.get(i).getCompetitor().equals(competitor)) {
|
||||
isCompetitorBetweenFirstThree = true;
|
||||
isCompetitorOneOfFirstThree = true;
|
||||
}
|
||||
}
|
||||
if (!isCompetitorBetweenFirstThree) {
|
||||
if (!isCompetitorOneOfFirstThree) {
|
||||
int rankOfCompetitorWhilePassingSecondWaypoint = getRankOfCompetitorWhilePassingSecondWaypoint(competitor, trackedRace);
|
||||
competitors.add(createStartAnalysisCompetitorDTO(trackedRace, rankOfCompetitorWhilePassingSecondWaypoint, competitor));
|
||||
}
|
||||
@@ -131,7 +131,6 @@ public class StartAnalysisDTOFactory extends AbstractStartAnalysisCreationValida
|
||||
|
||||
private StartAnalysisRankingTableEntryDTO createStartAnalysisRankTableEntryDTOWithRankAndStartTimepoint(
|
||||
Competitor competitor, int rank, TrackedRace trackedRace) {
|
||||
logger.log(Level.INFO, "createStartAnalysisRankTableEntryDTOWithRankAndStartTimepoint");
|
||||
StartAnalysisRankingTableEntryDTO tableentry = new StartAnalysisRankingTableEntryDTO();
|
||||
tableentry.rankAtFirstMark = rank;
|
||||
tableentry.teamName = competitor.getName();
|
||||
@@ -331,7 +330,6 @@ public class StartAnalysisDTOFactory extends AbstractStartAnalysisCreationValida
|
||||
|
||||
private StartAnalysisCompetitorDTO createStartAnalysisCompetitorDTO(TrackedRace trackedRace, int rank,
|
||||
Competitor competitor) {
|
||||
logger.log(Level.INFO, "createStartAnalysisCompetitorDTO => "+competitor.getName());
|
||||
StartAnalysisCompetitorDTO startAnalysisCompetitorDTOsForRace = new StartAnalysisCompetitorDTO();
|
||||
startAnalysisCompetitorDTOsForRace.competitorDTO = baseDomainFactory.getCompetitorStore().convertToCompetitorDTO(competitor);
|
||||
startAnalysisCompetitorDTOsForRace.rankingTableEntryDTO = createRankTableEntry(trackedRace, rank, competitor);
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user