mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-18 02:00:58 +00:00
added no wind data message to wind bot widget
This commit is contained in:
1 parent
0d4bca5d4e
commit
d01d3a0ee6
14 files changed
+123
-146
No files matched your search
+53
-69
@@ -1,13 +1,11 @@
|
||||
package com.sap.sailing.dashboards.gwt.client.dashboardpanel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Document;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
@@ -56,21 +54,15 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
@UiField
|
||||
Carousel carousel;
|
||||
|
||||
@UiField
|
||||
HTMLPanel leftwindbotcontainer;
|
||||
|
||||
@UiField
|
||||
HTMLPanel rightwindbotcontainer;
|
||||
@UiField(provided = true)
|
||||
WindBotWidget leftWindBotWidget;
|
||||
|
||||
@UiField(provided = true)
|
||||
WindBotWidget rightWindBotWidget;
|
||||
|
||||
@UiField(provided = true)
|
||||
StartlineAdvantagesByWindWidget startlineAdvantagesByWindComponent;
|
||||
|
||||
@UiField
|
||||
public DivElement windloadinghintleft;
|
||||
|
||||
@UiField
|
||||
public DivElement windloadinghintright;
|
||||
|
||||
@UiField
|
||||
public HTMLPanel bottombar;
|
||||
|
||||
@@ -83,7 +75,6 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
@UiField(provided = true)
|
||||
public StartlineAdvantageByGeometryWidget startlineAdvantageByGeometryWidget;
|
||||
|
||||
private List<WindBotWidget> windBotComponents;
|
||||
private StringMessages stringConstants;
|
||||
DashboardClientFactory dashboardClientFactory;
|
||||
private static final Logger logger = Logger.getLogger(DashboardPanel.class.getName());
|
||||
@@ -91,7 +82,8 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
public DashboardPanel(DashboardClientFactory dashboardClientFactory) {
|
||||
DashboardPanelResources.INSTANCE.style().ensureInjected();
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
windBotComponents = new ArrayList<WindBotWidget>();
|
||||
leftWindBotWidget = new WindBotWidget(dashboardClientFactory);
|
||||
rightWindBotWidget = new WindBotWidget(dashboardClientFactory);
|
||||
startanalysisComponent = new StartAnalysisWidget(this.dashboardClientFactory);
|
||||
startlineAdvantagesByWindComponent = new StartlineAdvantagesByWindWidget(this.dashboardClientFactory);
|
||||
startlineAdvantageByGeometryWidget = new StartlineAdvantageByGeometryWidget(this.dashboardClientFactory);
|
||||
@@ -99,8 +91,6 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
initLogos();
|
||||
windcharthint.getElement().setInnerText(stringConstants.dashboardWindChartHint());
|
||||
windloadinghintleft.setInnerHTML(stringConstants.dashboardWindBotLoadingText()+"<br>"+stringConstants.dashboardWindBotLoadingMessage());
|
||||
windloadinghintright.setInnerHTML(stringConstants.dashboardWindBotLoadingText()+"<br>"+stringConstants.dashboardWindBotLoadingMessage());
|
||||
loadAndAddEventLogo(dashboardClientFactory.getSailingService());
|
||||
initAndAddWrongOrientationNotification();
|
||||
registerForDashboardFiveSecondsTimer(dashboardClientFactory);
|
||||
@@ -128,47 +118,19 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
Document.get().getBody().appendChild(wrongDeviceOrientationNotification.getElement());
|
||||
}
|
||||
|
||||
private void initWindBotComponents(List<String> windBotIDs,
|
||||
WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
int windBotAddedCounterTOConsiderForPanels = 0;
|
||||
leftwindbotcontainer.clear();
|
||||
removeWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
windBotComponents.clear();
|
||||
for (String windBotID : windBotIDs) {
|
||||
if (windBotAddedCounterTOConsiderForPanels == 0) {
|
||||
WindBotWidget leftwindBotComponent = new WindBotWidget(windBotID, dashboardClientFactory);
|
||||
leftwindbotcontainer.add(leftwindBotComponent);
|
||||
windBotComponents.add(leftwindBotComponent);
|
||||
windloadinghintleft.getStyle().setOpacity(0.0);
|
||||
} else if (windBotAddedCounterTOConsiderForPanels == 1) {
|
||||
WindBotWidget rightwindBotComponent = new WindBotWidget(windBotID, dashboardClientFactory);
|
||||
rightwindbotcontainer.add(rightwindBotComponent);
|
||||
windBotComponents.add(rightwindBotComponent);
|
||||
windloadinghintright.getStyle().setOpacity(0.0);
|
||||
}
|
||||
windBotAddedCounterTOConsiderForPanels++;
|
||||
if (windloadinghintleft.getStyle().getOpacity() != "0.0"
|
||||
|| windloadinghintright.getStyle().getOpacity() != "0.0") {
|
||||
windloadinghintleft.setInnerHTML(stringConstants.dashboardWindBotNotAvailable());
|
||||
windloadinghintright.setInnerHTML(stringConstants.dashboardWindBotNotAvailable());
|
||||
}
|
||||
}
|
||||
addWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
}
|
||||
|
||||
private void addWindBotComponentsAsDataRetrieverListener(WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
for (WindBotWidget windBotComponent : windBotComponents) {
|
||||
logger.log(Level.INFO, "Registering WindBotDataRetrieverListener");
|
||||
windBotDataRetrieverProvider.addWindBotDataRetrieverListener(windBotComponent);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeWindBotComponentsAsDataRetrieverListener(
|
||||
WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
for (WindBotWidget windBotComponent : windBotComponents) {
|
||||
windBotDataRetrieverProvider.removeWindBotDataRetrieverListener(windBotComponent);
|
||||
}
|
||||
}
|
||||
// private void addWindBotComponentsAsDataRetrieverListener(WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
// for (WindBotWidget windBotComponent : windBotComponents) {
|
||||
// logger.log(Level.INFO, "Registering WindBotDataRetrieverListener");
|
||||
// windBotDataRetrieverProvider.addWindBotDataRetrieverListener(windBotComponent);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void removeWindBotComponentsAsDataRetrieverListener(
|
||||
// WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
// for (WindBotWidget windBotComponent : windBotComponents) {
|
||||
// windBotDataRetrieverProvider.removeWindBotDataRetrieverListener(windBotComponent);
|
||||
// }
|
||||
// }
|
||||
|
||||
private void setHeaderText(String raceName) {
|
||||
this.header.getElement().setInnerText(raceName);
|
||||
@@ -207,19 +169,41 @@ public class DashboardPanel extends Composite implements NumberOfWindBotsChangeL
|
||||
}
|
||||
|
||||
@Override
|
||||
public void numberOfWindBotsReceivedChanged(List<String> windBotIDs,
|
||||
WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
if(windBotIDs != null) {
|
||||
logger.log(Level.INFO, "Number of available windbots changed to "+windBotIDs.size());
|
||||
public void numberOfWindBotsReceivedChanged(List<String> windBotIDs, WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
if (windBotIDs != null) {
|
||||
logger.log(Level.INFO, "Number of available windbots changed to " + windBotIDs.size());
|
||||
for (int i = 0; i < windBotIDs.size(); i++) {
|
||||
if (i == 0) {
|
||||
leftWindBotWidget.setWindBotId(windBotIDs.get(i));
|
||||
windBotDataRetrieverProvider.addWindBotDataRetrieverListener(leftWindBotWidget);
|
||||
}
|
||||
if (i == 1) {
|
||||
rightWindBotWidget.setWindBotId(windBotIDs.get(i));
|
||||
windBotDataRetrieverProvider.addWindBotDataRetrieverListener(rightWindBotWidget);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Number of available windbots changed. WindBots List is null");
|
||||
}
|
||||
initWindBotComponents(windBotIDs, windBotDataRetrieverProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void numberOfWindBotsReceivedIsZero() {
|
||||
windloadinghintleft.setInnerText(stringConstants.dashboardWindBotNotAvailable());
|
||||
windloadinghintright.setInnerText(stringConstants.dashboardWindBotNotAvailable());
|
||||
}
|
||||
//
|
||||
// private void initWindBotComponents(List<String> windBotIDs,
|
||||
// WindBotDataRetrieverProvider windBotDataRetrieverProvider) {
|
||||
// int windBotAddedCounterTOConsiderForPanels = 0;
|
||||
// removeWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
// windBotComponents.clear();
|
||||
// for (String windBotID : windBotIDs) {
|
||||
// if (windBotAddedCounterTOConsiderForPanels == 0) {
|
||||
// WindBotWidget leftwindBotComponent = new WindBotWidget(windBotID, dashboardClientFactory);
|
||||
// leftwindbotcontainer.add(leftwindBotComponent);
|
||||
// windBotComponents.add(leftwindBotComponent);
|
||||
// } else if (windBotAddedCounterTOConsiderForPanels == 1) {
|
||||
// WindBotWidget rightwindBotComponent = new WindBotWidget(windBotID, dashboardClientFactory);
|
||||
// rightwindbotcontainer.add(rightwindBotComponent);
|
||||
// windBotComponents.add(rightwindBotComponent);
|
||||
// }
|
||||
// windBotAddedCounterTOConsiderForPanels++;
|
||||
// }
|
||||
// addWindBotComponentsAsDataRetrieverListener(windBotDataRetrieverProvider);
|
||||
// }
|
||||
}
|
||||
+7
-14
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:client="urn:import:com.sap.sailing.dashboards.gwt.client"
|
||||
xmlns:windbot="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.windbot"
|
||||
xmlns:startlineadvantagegeometry="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.course"
|
||||
xmlns:startlineadvantagewind="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startlineadvantage.wind"
|
||||
xmlns:startanalysis="urn:import:com.sap.sailing.dashboards.gwt.client.widgets.startanalysis"
|
||||
@@ -17,38 +18,30 @@
|
||||
<mgwtcarousel:Carousel ui:field="carousel">
|
||||
<mgwtpanel:Panel styleName="{resources.style.page}">
|
||||
<g:HTMLPanel ui:field="leftwindbotcontainer" styleName="{resources.style.collumn} {resources.style.left}">
|
||||
<div class="{resources.style.windloadinghint}">
|
||||
<div ui:field="windloadinghintleft" class="{resources.style.windloadinghinttext}"></div>
|
||||
</div>
|
||||
<windbot:WindBotWidget ui:field="leftWindBotWidget"></windbot:WindBotWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="rightwindbotcontainer"
|
||||
styleName="{resources.style.collumn} {resources.style.right}">
|
||||
<div class="{resources.style.windloadinghint}">
|
||||
<div ui:field="windloadinghintright" class="{resources.style.windloadinghinttext}"></div>
|
||||
</div>
|
||||
<g:HTMLPanel ui:field="rightwindbotcontainer" styleName="{resources.style.collumn} {resources.style.right}">
|
||||
<windbot:WindBotWidget ui:field="rightWindBotWidget"></windbot:WindBotWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="windcharthint" styleName="{resources.style.windcharthint}"></g:HTMLPanel>
|
||||
</mgwtpanel:Panel>
|
||||
<mgwtpanel:Panel styleName="{resources.style.page}">
|
||||
<g:HTMLPanel styleName="{resources.style.collumn} {resources.style.startanalysiscollumn}">
|
||||
<startanalysis:StartAnalysisWidget
|
||||
ui:field="startanalysisComponent"></startanalysis:StartAnalysisWidget>
|
||||
<startanalysis:StartAnalysisWidget ui:field="startanalysisComponent"></startanalysis:StartAnalysisWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.style.collumn} {resources.style.collumnthree}">
|
||||
<g:HTMLPanel styleName="{resources.style.startline_advantage_by_geometry_container}">
|
||||
<startlineadvantagegeometry:StartlineAdvantageByGeometryWidget ui:field="startlineAdvantageByGeometryWidget"></startlineadvantagegeometry:StartlineAdvantageByGeometryWidget>
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel styleName="{resources.style.startline_advantage_by_wind_container}">
|
||||
<startlineadvantagewind:StartlineAdvantagesByWindWidget
|
||||
ui:field="startlineAdvantagesByWindComponent"></startlineadvantagewind:StartlineAdvantagesByWindWidget>
|
||||
<startlineadvantagewind:StartlineAdvantagesByWindWidget ui:field="startlineAdvantagesByWindComponent"></startlineadvantagewind:StartlineAdvantagesByWindWidget>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</mgwtpanel:Panel>
|
||||
</mgwtcarousel:Carousel>
|
||||
</g:layer>
|
||||
<g:layer left="0%" bottom="0%" right="0%" height="30pt">
|
||||
<g:HTMLPanel ui:field="bottombar" styleName="{resources.style.bar}">
|
||||
</g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="bottombar" styleName="{resources.style.bar}"></g:HTMLPanel>
|
||||
</g:layer>
|
||||
</g:LayoutPanel>
|
||||
|
||||
|
||||
-1
@@ -4,5 +4,4 @@ import java.util.List;
|
||||
|
||||
public interface NumberOfWindBotsChangeListener {
|
||||
public void numberOfWindBotsReceivedChanged(List<String> windBotIDs, WindBotDataRetrieverProvider windBotDataRetrieverProvider);
|
||||
public void numberOfWindBotsReceivedIsZero();
|
||||
}
|
||||
-9
@@ -76,7 +76,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
}
|
||||
notifyWindBotDataRetrieverListeners(result);
|
||||
} else {
|
||||
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
|
||||
logger.log(Level.INFO, "WindInfoForRaceDTO is not containing wind from windbots");
|
||||
}
|
||||
} else {
|
||||
@@ -115,12 +114,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyListenersAboutNumberOfWindBotsReceivedIsZero() {
|
||||
for (NumberOfWindBotsChangeListener numberOfWindBotsChangeListener : numberOfWindBotsChangeListeners) {
|
||||
numberOfWindBotsChangeListener.numberOfWindBotsReceivedIsZero();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWindBotDataRetrieverListener(WindBotDataRetrieverListener windBotDataRetrieverListener) {
|
||||
windBotDataRetrieverListeners.add(windBotDataRetrieverListener);
|
||||
@@ -156,7 +149,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
logger.log(Level.INFO, "Received RegattaAndRaceIdentifier from race that takes wind fixes now");
|
||||
loadWindBotData(finaloldTime, finalNewTime, raceId);
|
||||
} else {
|
||||
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
|
||||
logger.log(Level.INFO, "Can´t load wind data because RegattaAndRaceIdentifier for race which takes wind is null");
|
||||
}
|
||||
}
|
||||
@@ -164,7 +156,6 @@ public class WindBotDataRetriever implements PollsLiveDataEvery5Seconds, WindBot
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
notifyListenersAboutNumberOfWindBotsReceivedIsZero();
|
||||
logger.log(Level.INFO, "Failed to received RegattaAndRaceIdentifier from race that takes wind fixes now");
|
||||
logger.log(Level.INFO, caught.getMessage());
|
||||
}
|
||||
|
||||
+23
-27
@@ -3,11 +3,12 @@ package com.sap.sailing.dashboards.gwt.client.widgets.header;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.HasWidgets;
|
||||
@@ -19,18 +20,20 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
*/
|
||||
public class DashboardWidgetHeaderAndNoDataMessage extends Composite implements HasWidgets {
|
||||
|
||||
private static DashboardWidgetHeaderAndNoDataMessageUiBinder uiBinder = GWT.create(DashboardWidgetHeaderAndNoDataMessageUiBinder.class);
|
||||
private static DashboardWidgetHeaderAndNoDataMessageUiBinder uiBinder = GWT
|
||||
.create(DashboardWidgetHeaderAndNoDataMessageUiBinder.class);
|
||||
private static final int EXTRA_WIDTH_MESSAGE = 10;
|
||||
|
||||
interface DashboardWidgetHeaderAndNoDataMessageUiBinder extends UiBinder<Widget, DashboardWidgetHeaderAndNoDataMessage> {
|
||||
|
||||
interface DashboardWidgetHeaderAndNoDataMessageUiBinder extends
|
||||
UiBinder<Widget, DashboardWidgetHeaderAndNoDataMessage> {
|
||||
}
|
||||
|
||||
|
||||
@UiField
|
||||
HTMLPanel header;
|
||||
|
||||
|
||||
@UiField
|
||||
DivElement noDataMessageHeader;
|
||||
|
||||
|
||||
@UiField
|
||||
DivElement noDataMessage;
|
||||
|
||||
@@ -38,34 +41,27 @@ public class DashboardWidgetHeaderAndNoDataMessage extends Composite implements
|
||||
DashboardWidgetHeaderAndNoDataMessageResources.INSTANCE.gss().ensureInjected();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
|
||||
public void setHeaderText(String headerText) {
|
||||
this.header.getElement().setInnerHTML(headerText);
|
||||
}
|
||||
|
||||
public void showNoDataMessageWithHeaderAndMessage(String header, String message) {
|
||||
noDataMessageHeader.setInnerText(header);
|
||||
noDataMessage.setInnerText(message);
|
||||
noDataMessage.getStyle().setWidth(noDataMessageHeader.getClientWidth()+EXTRA_WIDTH_MESSAGE, Unit.PX);
|
||||
|
||||
|
||||
public void showNoDataMessageWithHeaderAndMessage(final String header, final String message) {
|
||||
Scheduler.get().scheduleDeferred(new Command() {
|
||||
public void execute() {
|
||||
noDataMessageHeader.setInnerText(header);
|
||||
noDataMessage.setInnerText(message);
|
||||
noDataMessage.getStyle().setWidth(noDataMessageHeader.getClientWidth() + EXTRA_WIDTH_MESSAGE, Unit.PX);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void hideNoDataMessage() {
|
||||
noDataMessageHeader.setInnerHTML("");
|
||||
noDataMessage.setInnerHTML("");
|
||||
}
|
||||
|
||||
public void adaptSizeOfNoDataMessageDiv() {
|
||||
// Scheduler.get().scheduleDeferred(new Command() {
|
||||
// public void execute () {
|
||||
double widthOfNoDataMessageHeader = Double.parseDouble(noDataMessageHeader.getStyle().getWidth());
|
||||
Window.alert("asdfasdfasfd");
|
||||
Window.alert("widthOfNoDataMessageHeader "+widthOfNoDataMessageHeader);
|
||||
noDataMessage.getStyle().setWidth(widthOfNoDataMessageHeader, Unit.PX);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void add(Widget w) {
|
||||
throw new UnsupportedOperationException("The method add(Widget w) is not supported.");
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
@require 'theme';
|
||||
|
||||
.wind_bot_component{
|
||||
.wind_bot_widget{
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: LIGHT_GREY;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
|
||||
+24
-8
@@ -53,7 +53,7 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
}
|
||||
|
||||
@UiField
|
||||
public HTMLPanel windBotComponent;
|
||||
HTMLPanel contentContainer;
|
||||
|
||||
@UiField(provided = true)
|
||||
DashboardWidgetHeaderAndNoDataMessage dashboardWidgetHeaderAndNoDataMessage;
|
||||
@@ -103,11 +103,10 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
private String windBotId;
|
||||
private StringMessages stringConstants;
|
||||
|
||||
public WindBotWidget(String windBotId, DashboardClientFactory dashboardClientFactory) {
|
||||
public WindBotWidget(DashboardClientFactory dashboardClientFactory) {
|
||||
WindBotWidgetResources.INSTANCE.gss().ensureInjected();
|
||||
this.dashboardClientFactory = dashboardClientFactory;
|
||||
dashboardWidgetHeaderAndNoDataMessage = new DashboardWidgetHeaderAndNoDataMessage();
|
||||
this.windBotId = windBotId;
|
||||
stringConstants = StringMessages.INSTANCE;
|
||||
movingAverageSpeed = new MovingAverage(500);
|
||||
movingAverageDirection = new MovingAverage(500);
|
||||
@@ -116,14 +115,29 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
trueWindSpeedVerticalWindChart = new VerticalWindChart("#008FFF", "#6ADBFF");
|
||||
trueWindDirectionVerticalWindChart = new VerticalWindChart("#008FFF", "#6ADBFF");
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(stringConstants.dashboardWindBot()+" "+ windBotId);
|
||||
hideContentContainer();
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(stringConstants.dashboardWindBot());
|
||||
dashboardWidgetHeaderAndNoDataMessage.showNoDataMessageWithHeaderAndMessage(stringConstants.dashboardNoWindBotAvailableHeader(), stringConstants.dashboardNoWindBotAvailableMessage());
|
||||
totalWindSpeedHeader.setInnerHTML(stringConstants.dashboardTrueWindSpeed());
|
||||
totalWindDirectionHeader.setInnerHTML(stringConstants.dashboardTrueWindDirection());
|
||||
trueWindSpeedVerticalWindChart.addVerticalWindChartClickListener(trueWindSpeedLiveAverageComponent);
|
||||
trueWindDirectionVerticalWindChart.addVerticalWindChartClickListener(trueWindDirectionLiveAverageComponent);
|
||||
trueWindSpeedVerticalWindChart.addVerticalWindChartClickListener(trueWindSpeedLiveAverageComponent);
|
||||
trueWindDirectionVerticalWindChart.addVerticalWindChartClickListener(trueWindDirectionLiveAverageComponent);
|
||||
}
|
||||
|
||||
public WindTrackInfoDTO getWindTrackInfoDTOFromAndWindBotID(WindInfoForRaceDTO windInfoForRaceDTO, String id) {
|
||||
|
||||
public void setWindBotId(String windBotId) {
|
||||
this.windBotId = windBotId;
|
||||
dashboardWidgetHeaderAndNoDataMessage.setHeaderText(stringConstants.dashboardWindBot() + " " + windBotId);
|
||||
}
|
||||
|
||||
private void showContentContainer(){
|
||||
contentContainer.getElement().getStyle().setOpacity(1.0);
|
||||
}
|
||||
|
||||
private void hideContentContainer(){
|
||||
contentContainer.getElement().getStyle().setOpacity(0.0);
|
||||
}
|
||||
|
||||
private WindTrackInfoDTO getWindTrackInfoDTOFromAndWindBotID(WindInfoForRaceDTO windInfoForRaceDTO, String id) {
|
||||
WindTrackInfoDTO windTrackInfo = null;
|
||||
for (WindSource windSource : windInfoForRaceDTO.windTrackInfoByWindSource.keySet()) {
|
||||
if (windSource.getType().equals(WindSourceType.EXPEDITION) && windSource.getId() != null) {
|
||||
@@ -147,6 +161,7 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
logger.log(Level.INFO, "WindInfoForRaceDTO contains WindTrackInfoDTO for Windbot id " + windBotId);
|
||||
if (windTrackInfoDTO.windFixes != null) {
|
||||
if (windTrackInfoDTO.windFixes.size() > 0) {
|
||||
dashboardWidgetHeaderAndNoDataMessage.hideNoDataMessage();
|
||||
logger.log(Level.INFO, "Upating UI with Wind Fixes for WindBot id " + windBotId);
|
||||
SplitScheduler.get().schedule(new ScheduledCommand() {
|
||||
|
||||
@@ -176,6 +191,7 @@ public class WindBotWidget extends Composite implements HasWidgets, WindBotDataR
|
||||
updateLocationPointerCompass(windTrackInfoDTO);
|
||||
}
|
||||
});
|
||||
showContentContainer();
|
||||
} else {
|
||||
logger.log(Level.INFO, "WindTrackInfoDTO.windFixes is empty");
|
||||
}
|
||||
|
||||
+3
-1
@@ -8,8 +8,9 @@
|
||||
|
||||
<ui:with field="resources" type="com.sap.sailing.dashboards.gwt.client.widgets.windbot.WindBotWidgetResources"/>
|
||||
|
||||
<g:HTMLPanel ui:field="windBotComponent" styleName="{resources.gss.wind_bot_component}">
|
||||
<g:HTMLPanel styleName="{resources.gss.wind_bot_widget}">
|
||||
<header:DashboardWidgetHeaderAndNoDataMessage ui:field="dashboardWidgetHeaderAndNoDataMessage"></header:DashboardWidgetHeaderAndNoDataMessage>
|
||||
<g:HTMLPanel ui:field="contentContainer">
|
||||
<compass:LocationPointerCompass ui:field="locationPointerCompass"></compass:LocationPointerCompass>
|
||||
<div ui:field="totalWindSpeedHeader" class="{resources.gss.live_average_header} {resources.gss.left}"></div>
|
||||
<div ui:field="totalWindDirectionHeader" class="{resources.gss.live_average_header} {resources.gss.right}"></div>
|
||||
@@ -31,5 +32,6 @@
|
||||
<windchart:VerticalWindChart ui:field="trueWindDirectionVerticalWindChart"
|
||||
styleName="{resources.gss.windchart}"></windchart:VerticalWindChart>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+1
-1
@@ -16,7 +16,7 @@ public interface WindBotWidgetResources extends ClientBundle {
|
||||
WindBotComponentGss gss();
|
||||
|
||||
public interface WindBotComponentGss extends CssResource {
|
||||
String wind_bot_component();
|
||||
String wind_bot_widget();
|
||||
String live_average_header();
|
||||
String live_average_container();
|
||||
String left();
|
||||
|
||||
+2
-3
@@ -1258,9 +1258,8 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
|
||||
String valueDescending();
|
||||
String sortBy();
|
||||
|
||||
String dashboardWindBotLoadingText();
|
||||
String dashboardWindBotLoadingMessage();
|
||||
String dashboardWindBotNotAvailable();
|
||||
String dashboardNoWindBotAvailableHeader();
|
||||
String dashboardNoWindBotAvailableMessage();
|
||||
String dashboardWindBot();
|
||||
String dashboardTrueWindSpeed();
|
||||
String dashboardTrueWindDirection();
|
||||
|
||||
+2
-3
@@ -1221,9 +1221,8 @@ groupName=Group Name
|
||||
valueAscending=Value (Ascending)
|
||||
valueDescending=Value (Descending)
|
||||
sortBy=Sort by
|
||||
dashboardWindBotLoadingText=Waiting for wind bot data...
|
||||
dashboardWindBotLoadingMessage=Depending on your connection this operation might take some minutes to complete the first time. It can also take some time if there is no data available right now.
|
||||
dashboardWindBotNotAvailable=Wind bot not available.
|
||||
dashboardNoWindBotAvailableHeader=Wind Bot is not available.
|
||||
dashboardNoWindBotAvailableMessage=To receive live wind data from wind measurement units, ensure that the wind bot is switched on and connected to the SAP Sailing Analytics.
|
||||
dashboardWindBot=Wind Bot
|
||||
dashboardTrueWindSpeed=TWS
|
||||
dashboardTrueWindDirection=TWD
|
||||
|
||||
+2
-3
@@ -1212,9 +1212,8 @@ groupName=Gruppename
|
||||
valueAscending=Wert (Aufsteigend)
|
||||
valueDescending=Wert (Absteigend)
|
||||
sortBy=Sortiert nach
|
||||
dashboardWindBotLoadingText=Lade Windmesser Daten ...
|
||||
dashboardWindBotLoadingMessage=Je nach Qualität Ihrer Verbindung kann dieser Vorgang ein paar Minuten dauern.
|
||||
dashboardWindBotNotAvailable=Keine Verbindung zu Windmesser.
|
||||
dashboardNoWindBotAvailableHeader=Wind Bot nicht verfügbar.
|
||||
dashboardNoWindBotAvailableMessage=Um live Daten von Wind Messgeräten zu empfangen, muss der Wind Bot mit der SAP Sailing Analytics verknüpft sein.
|
||||
dashboardWindBot=Windmesser
|
||||
dashboardTrueWindSpeed=Wind Geschwindigkeit
|
||||
dashboardTrueWindDirection=Wind Richtung
|
||||
|
||||
+2
-3
@@ -1155,9 +1155,8 @@ groupName=Group Name
|
||||
valueAscending=Value (Ascending)
|
||||
valueDescending=Value (Descending)
|
||||
sortBy=Sort by
|
||||
dashboardWindBotLoadingText=Loading wind bot data ...
|
||||
dashboardWindBotLoadingMessage=Depending on your connection this operation might take some minutes to complete the first time.
|
||||
dashboardWindBotNotAvailable=Wind bot not available.
|
||||
dashboardNoWindBotAvailableHeader=Wind Bot not available.
|
||||
dashboardNoWindBotAvailableMessage=To receive live wind data from wind measurement units, ensure that the wind bot is switched on and connected to the SAP Sailing Analytics.
|
||||
dashboardWindBot=Wind Bot
|
||||
dashboardTrueWindSpeed=TWS
|
||||
dashboardTrueWindDirection=TWD
|
||||
|
||||
+2
-3
@@ -984,7 +984,6 @@ overallStandings=总排名
|
||||
setClosingTimePoint=Set Timepoint that closes open time range
|
||||
registeredCompetitors=Registered Competitors
|
||||
timePointMustBeBeforeEndOfTracking=Time point must be before end of tracking.
|
||||
dashboardWindBotNotAvailable=Wind bot not available.
|
||||
untracked=Untracked
|
||||
scoringSchemeWinnerGetsEightAndInterpolation=High Point System, Winner 8 Points, Interpolated
|
||||
export=Export
|
||||
@@ -1255,8 +1254,8 @@ eventsCount[one]={0,number} event
|
||||
competitorsCount={0,number} competitors
|
||||
courseAreaName=Course area: {0}
|
||||
competitorsCount[one]={0,number} competitor�
|
||||
dashboardWindBotLoadingText=Loading wind bot data ...
|
||||
dashboardWindBotLoadingMessage=Depending on your connection this operation might take some minutes to complete the first time.
|
||||
dashboardNoWindBotAvailableHeader=Wind Bot not available.
|
||||
dashboardNoWindBotAvailableMessage=To receive live wind data from wind measurement units, ensure that the wind bot is switched on and connected to the SAP Sailing Analytics.
|
||||
dashboardNoStartlineAdvantagesByWindAvailableHeader=No Startline Advantages available.
|
||||
dashboardNoStartlineAdvantagesByWindAvailableMessage=For calculating the startline advantage there needs to be a course set by the race commitee.
|
||||
dashboardNoStartlineAdvantagesByGeometryAvailableHeader=No Startline Advantage available.
|
||||
|
||||
Reference in new issue
Block a user