mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 06:40:53 +00:00
refined wind setting and display
This commit is contained in:
1 parent
da821709f6
commit
94e389de0e
5 files changed
+28
-10
No files matched your search
@@ -71,16 +71,24 @@ public class WindPanel extends FormPanel implements EventDisplayer, RaceSelectio
|
||||
trackedEventsModel.getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
|
||||
@Override
|
||||
public void onSelectionChange(SelectionChangeEvent selectionChangeEvent) {
|
||||
selectedEventAndRace = null;
|
||||
for (EventDAO event : eventsList.getList()) {
|
||||
for (RegattaDAO regatta : event.regattas) {
|
||||
for (RaceDAO race : regatta.races) {
|
||||
if (trackedEventsModel.getSelectionModel().isSelected(race)) {
|
||||
selectedEventAndRace = new Pair<EventDAO, RaceDAO>(event, race);
|
||||
showWind(event, race);
|
||||
if (race.currentlyTracked) {
|
||||
showWind(event, race);
|
||||
} else {
|
||||
clearWindDisplay(); // no wind known for untracked race
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedEventAndRace == null) {
|
||||
clearWindDisplay();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -95,6 +103,7 @@ public class WindPanel extends FormPanel implements EventDisplayer, RaceSelectio
|
||||
@Override
|
||||
public void onSuccess(WindInfoForRaceDAO result) {
|
||||
showWindForRace(result);
|
||||
windSettingPanel.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,6 +113,11 @@ public class WindPanel extends FormPanel implements EventDisplayer, RaceSelectio
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void clearWindDisplay() {
|
||||
grid.setWidget(1, 0, null);
|
||||
windSettingPanel.setEnabled(false);
|
||||
}
|
||||
|
||||
private void showWindForRace(WindInfoForRaceDAO result) {
|
||||
grid.setWidget(1, 0, null);
|
||||
@@ -135,8 +149,8 @@ public class WindPanel extends FormPanel implements EventDisplayer, RaceSelectio
|
||||
speedInKnotsColumn.setSortable(true);
|
||||
windDirectionInDegColumn.setSortable(true);
|
||||
CellTable<WindDAO> windTable = new CellTable<WindDAO>(/* pageSize */ 100);
|
||||
windTable.addColumn(timeColumn, "Name");
|
||||
windTable.addColumn(speedInKnotsColumn, "Tracking Started");
|
||||
windTable.addColumn(timeColumn, "Time");
|
||||
windTable.addColumn(speedInKnotsColumn, "Speed (kn)");
|
||||
windTable.addColumn(windDirectionInDegColumn, "From (deg)");
|
||||
ListDataProvider<WindDAO> windList = new ListDataProvider<WindDAO>(e.getValue().windFixes);
|
||||
windList.addDataDisplay(windTable);
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.sap.sailing.gwt.ui.shared.RaceDAO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindDAO;
|
||||
|
||||
public class WindSettingPanel extends FormPanel {
|
||||
private final Button setWindButton;
|
||||
|
||||
public WindSettingPanel(final SailingServiceAsync sailingService, final ErrorReporter errorReporter,
|
||||
final RaceSelectionProvider raceSelectionProvider, final WindShower windShower) {
|
||||
@@ -37,7 +38,7 @@ public class WindSettingPanel extends FormPanel {
|
||||
grid.setWidget(4, 0, new Label("Longitude (optional)"));
|
||||
final DoubleBox lngDegBox = new DoubleBox();
|
||||
grid.setWidget(4, 1, lngDegBox);
|
||||
Button setWindButton = new Button("Set");
|
||||
setWindButton = new Button("Set");
|
||||
grid.setWidget(5, 0, setWindButton);
|
||||
linkEnterToButton(setWindButton, speedInKnotsBox, fromInDegBox, latDegBox, lngDegBox);
|
||||
setWindButton.addClickHandler(new ClickHandler() {
|
||||
@@ -78,4 +79,8 @@ public class WindSettingPanel extends FormPanel {
|
||||
}
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
setWindButton.setEnabled(enabled);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-4
@@ -13,7 +13,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
|
||||
@@ -209,8 +208,6 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
TrackedRace trackedRace = service.getDomainFactory().getTrackedEvent(event).getExistingTrackedRace(race);
|
||||
TimePoint from = new MillisecondsTimePoint(fromAsMilliseconds);
|
||||
TimePoint to = new MillisecondsTimePoint(toAsMilliseconds);
|
||||
JSONObject jsonWindTracks = new JSONObject();
|
||||
jsonWindTracks.put("currentwindsource", trackedRace.getWindSource().toString());
|
||||
Map<String, WindTrackInfoDAO> windTrackInfoDAOs = new HashMap<String, WindTrackInfoDAO>();
|
||||
result.windTrackInfoByWindSourceName = windTrackInfoDAOs;
|
||||
for (WindSource windSource : WindSource.values()) {
|
||||
@@ -228,7 +225,7 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
WindDAO windDAO = new WindDAO();
|
||||
windDAO.trueWindBearingDeg = wind.getBearing().getDegrees();
|
||||
windDAO.trueWindFromDeg = wind.getBearing().reverse().getDegrees();
|
||||
windDAO.trueWindSpeedInKnots = wind.getBearing().getDegrees();
|
||||
windDAO.trueWindSpeedInKnots = wind.getKnots();
|
||||
windDAO.trueWindSpeedInMetersPerSecond = wind.getMetersPerSecond();
|
||||
if (wind.getPosition() != null) {
|
||||
windDAO.position = new PositionDAO(wind.getPosition().getLatDeg(), wind.getPosition().getLngDeg());
|
||||
@@ -238,6 +235,7 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
windDAO.timepoint = wind.getTimePoint().asMillis();
|
||||
Wind estimatedWind = windTrack.getEstimatedWind(wind.getPosition(), wind.getTimePoint());
|
||||
windDAO.dampenedTrueWindBearingDeg = estimatedWind.getBearing().getDegrees();
|
||||
windDAO.dampenedTrueWindFromDeg = estimatedWind.getBearing().reverse().getDegrees();
|
||||
windDAO.dampenedTrueWindSpeedInKnots = estimatedWind.getKnots();
|
||||
windDAO.dampenedTrueWindSpeedInMetersPerSecond = estimatedWind.getMetersPerSecond();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public class WindDAO implements IsSerializable {
|
||||
public Double dampenedTrueWindSpeedInMetersPerSecond;
|
||||
public Double dampenedTrueWindSpeedInKnots;
|
||||
public Double dampenedTrueWindBearingDeg;
|
||||
public Double dampenedTrueWindFromDeg;
|
||||
public PositionDAO position;
|
||||
public Long timepoint;
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
function com_sap_sailing_gwt_ui_AdminConsole(){var O='',vb='" for "gwt:onLoadErrorFn"',tb='" for "gwt:onPropertyErrorFn"',hb='"><\/script>',Y='#',Vb='.cache.html',$='/',Ob='0C8F5763011319D284DC41D4CFB768D2',Pb='349C9D0A56EE5A4AB7610A2E28B4F66C',Qb='6C62904521EC8EE12DA765042129A819',Ub=':',nb='::',bc='<script defer="defer">com_sap_sailing_gwt_ui_AdminConsole.onInjectionDone(\'com.sap.sailing.gwt.ui.AdminConsole\')<\/script>',gb='<script id="',qb='=',Z='?',Rb='BEC4F3F8B89EF2802F217CE589CC9692',sb='Bad handler "',ac='DOMContentLoaded',Sb='F2C0230A09556ECBDDEA83BB4ADF8F2C',Tb='FCD5B88FFF90DAC9778E029276824ED4',ib='SCRIPT',fb='__gwt_marker_com.sap.sailing.gwt.ui.AdminConsole',jb='base',bb='baseUrl',S='begin',R='bootstrap',ab='clear.cache.gif',P='com.sap.sailing.gwt.ui.AdminConsole',db='com.sap.sailing.gwt.ui.AdminConsole.nocache.js',mb='com.sap.sailing.gwt.ui.AdminConsole::',pb='content',X='end',Ib='gecko',Jb='gecko1_8',T='gwt.codesvr=',U='gwt.hosted=',V='gwt.hybrid',Wb='gwt/clean/clean.css',ub='gwt:onLoadErrorFn',rb='gwt:onPropertyErrorFn',ob='gwt:property',_b='head',Mb='hosted.html?com_sap_sailing_gwt_ui_AdminConsole',$b='href',Hb='ie6',Gb='ie8',Fb='ie9',wb='iframe',_='img',xb="javascript:''",Xb='link',Lb='loadExternalRefs',kb='meta',zb='moduleRequested',W='moduleStartup',Eb='msie',lb='name',Bb='opera',yb='position:absolute;width:0;height:0;border:none',Yb='rel',Db='safari',cb='script',Nb='selectingPermutation',Q='startup',Zb='stylesheet',eb='undefined',Kb='unknown',Ab='user.agent',Cb='webkit';var l=window,m=document,n=l.__gwtStatsEvent?function(a){return l.__gwtStatsEvent(a)}:null,o=l.__gwtStatsSessionId?l.__gwtStatsSessionId:null,p,q,r,s=O,t={},u=[],v=[],w=[],x=0,y,z;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:S});if(!l.__gwt_stylesLoaded){l.__gwt_stylesLoaded={}}if(!l.__gwt_scriptsLoaded){l.__gwt_scriptsLoaded={}}function A(){var b=false;try{var c=l.location.search;return (c.indexOf(T)!=-1||(c.indexOf(U)!=-1||l.external&&l.external.gwtOnLoad))&&c.indexOf(V)==-1}catch(a){}A=function(){return b};return b}
|
||||
function com_sap_sailing_gwt_ui_AdminConsole(){var O='',vb='" for "gwt:onLoadErrorFn"',tb='" for "gwt:onPropertyErrorFn"',hb='"><\/script>',Y='#',Vb='.cache.html',$='/',Ob='1B75CCBE6F9FA29B319B9AB7F5A5ABA2',Pb='3E59C25FE069C0BEEAB371A7E95F5ECA',Ub=':',nb='::',bc='<script defer="defer">com_sap_sailing_gwt_ui_AdminConsole.onInjectionDone(\'com.sap.sailing.gwt.ui.AdminConsole\')<\/script>',gb='<script id="',qb='=',Z='?',Qb='AD2666D7B341F02F0332E574FF7B48A2',sb='Bad handler "',Rb='C51217A0549AC0D2753E4119A23E0F68',Sb='D011F79E0BBF7F4C3947203FEC4570E3',ac='DOMContentLoaded',Tb='E1968D957CA2DD10EDAEFB970248F3BE',ib='SCRIPT',fb='__gwt_marker_com.sap.sailing.gwt.ui.AdminConsole',jb='base',bb='baseUrl',S='begin',R='bootstrap',ab='clear.cache.gif',P='com.sap.sailing.gwt.ui.AdminConsole',db='com.sap.sailing.gwt.ui.AdminConsole.nocache.js',mb='com.sap.sailing.gwt.ui.AdminConsole::',pb='content',X='end',Ib='gecko',Jb='gecko1_8',T='gwt.codesvr=',U='gwt.hosted=',V='gwt.hybrid',Wb='gwt/clean/clean.css',ub='gwt:onLoadErrorFn',rb='gwt:onPropertyErrorFn',ob='gwt:property',_b='head',Mb='hosted.html?com_sap_sailing_gwt_ui_AdminConsole',$b='href',Hb='ie6',Gb='ie8',Fb='ie9',wb='iframe',_='img',xb="javascript:''",Xb='link',Lb='loadExternalRefs',kb='meta',zb='moduleRequested',W='moduleStartup',Eb='msie',lb='name',Bb='opera',yb='position:absolute;width:0;height:0;border:none',Yb='rel',Db='safari',cb='script',Nb='selectingPermutation',Q='startup',Zb='stylesheet',eb='undefined',Kb='unknown',Ab='user.agent',Cb='webkit';var l=window,m=document,n=l.__gwtStatsEvent?function(a){return l.__gwtStatsEvent(a)}:null,o=l.__gwtStatsSessionId?l.__gwtStatsSessionId:null,p,q,r,s=O,t={},u=[],v=[],w=[],x=0,y,z;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:S});if(!l.__gwt_stylesLoaded){l.__gwt_stylesLoaded={}}if(!l.__gwt_scriptsLoaded){l.__gwt_scriptsLoaded={}}function A(){var b=false;try{var c=l.location.search;return (c.indexOf(T)!=-1||(c.indexOf(U)!=-1||l.external&&l.external.gwtOnLoad))&&c.indexOf(V)==-1}catch(a){}A=function(){return b};return b}
|
||||
function B(){if(p&&q){var b=m.getElementById(P);var c=b.contentWindow;if(A()){c.__gwt_getProperty=function(a){return G(a)}}com_sap_sailing_gwt_ui_AdminConsole=null;c.gwtOnLoad(y,P,s,x);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:W,millis:(new Date).getTime(),type:X})}}
|
||||
function C(){function e(a){var b=a.lastIndexOf(Y);if(b==-1){b=a.length}var c=a.indexOf(Z);if(c==-1){c=a.length}var d=a.lastIndexOf($,Math.min(c,b));return d>=0?a.substring(0,d+1):O}
|
||||
function f(a){if(a.match(/^\w+:\/\//)){}else{var b=m.createElement(_);b.src=a+ab;a=e(b.src)}return a}
|
||||
@@ -12,6 +12,6 @@ function E(a){var b=t[a];return b==null?null:b}
|
||||
function F(a,b){var c=w;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b}
|
||||
function G(a){var b=v[a](),c=u[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(z){z(a,d,b)}throw null}
|
||||
var H;function I(){if(!H){H=true;var a=m.createElement(wb);a.src=xb;a.id=P;a.style.cssText=yb;a.tabIndex=-1;m.body.appendChild(a);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:W,millis:(new Date).getTime(),type:zb});a.contentWindow.location.replace(s+K)}}
|
||||
v[Ab]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return b.indexOf(Bb)!=-1}())return Bb;if(function(){return b.indexOf(Cb)!=-1}())return Db;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=9}())return Fb;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=8}())return Gb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(a&&a.length==3)return c(a)>=6000}())return Hb;if(function(){return b.indexOf(Ib)!=-1}())return Jb;return Kb};u[Ab]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};com_sap_sailing_gwt_ui_AdminConsole.onScriptLoad=function(){if(H){q=true;B()}};com_sap_sailing_gwt_ui_AdminConsole.onInjectionDone=function(){p=true;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:X});B()};D();C();var J;var K;if(A()){if(l.external&&(l.external.initModule&&l.external.initModule(P))){l.location.reload();return}K=Mb;J=O}n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:Nb});if(!A()){try{F([Hb],Ob);F([Jb],Pb);F([Db],Qb);F([Fb],Rb);F([Gb],Sb);F([Bb],Tb);J=w[G(Ab)];var L=J.indexOf(Ub);if(L!=-1){x=Number(J.substring(L+1));J=J.substring(0,L)}K=J+Vb}catch(a){return}}var M;function N(){if(!r){r=true;if(!__gwt_stylesLoaded[Wb]){var a=m.createElement(Xb);__gwt_stylesLoaded[Wb]=a;a.setAttribute(Yb,Zb);a.setAttribute($b,s+Wb);m.getElementsByTagName(_b)[0].appendChild(a)}B();if(m.removeEventListener){m.removeEventListener(ac,N,false)}if(M){clearInterval(M)}}}
|
||||
v[Ab]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return b.indexOf(Bb)!=-1}())return Bb;if(function(){return b.indexOf(Cb)!=-1}())return Db;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=9}())return Fb;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=8}())return Gb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(a&&a.length==3)return c(a)>=6000}())return Hb;if(function(){return b.indexOf(Ib)!=-1}())return Jb;return Kb};u[Ab]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};com_sap_sailing_gwt_ui_AdminConsole.onScriptLoad=function(){if(H){q=true;B()}};com_sap_sailing_gwt_ui_AdminConsole.onInjectionDone=function(){p=true;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:X});B()};D();C();var J;var K;if(A()){if(l.external&&(l.external.initModule&&l.external.initModule(P))){l.location.reload();return}K=Mb;J=O}n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:Nb});if(!A()){try{F([Jb],Ob);F([Hb],Pb);F([Bb],Qb);F([Db],Rb);F([Fb],Sb);F([Gb],Tb);J=w[G(Ab)];var L=J.indexOf(Ub);if(L!=-1){x=Number(J.substring(L+1));J=J.substring(0,L)}K=J+Vb}catch(a){return}}var M;function N(){if(!r){r=true;if(!__gwt_stylesLoaded[Wb]){var a=m.createElement(Xb);__gwt_stylesLoaded[Wb]=a;a.setAttribute(Yb,Zb);a.setAttribute($b,s+Wb);m.getElementsByTagName(_b)[0].appendChild(a)}B();if(m.removeEventListener){m.removeEventListener(ac,N,false)}if(M){clearInterval(M)}}}
|
||||
if(m.addEventListener){m.addEventListener(ac,function(){I();N()},false)}var M=setInterval(function(){if(/loaded|complete/.test(m.readyState)){I();N()}},50);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:X});n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:S});m.write(bc)}
|
||||
com_sap_sailing_gwt_ui_AdminConsole();
|
||||
Reference in new issue
Block a user