mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-02 02:13:55 +00:00
fixed live button enablement
This commit is contained in:
1 parent
33e1fd4622
commit
b9af09ba5d
1 file changed
+8
-3
+8
-3
@@ -94,7 +94,9 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
|
||||
if (raceTimesInfo.startOfTracking != null && raceTimesInfo.timePointOfNewestEvent != null) {
|
||||
// we set here the min and max of the time slider, the start and end of the race as well as the known
|
||||
// leg markers
|
||||
setLiveGenerallyPossible(isLiveModeToBeMadePossible());
|
||||
boolean liveModeToBeMadePossible = isLiveModeToBeMadePossible();
|
||||
setLiveGenerallyPossible(liveModeToBeMadePossible);
|
||||
setJumpToLiveEnablement(liveModeToBeMadePossible && timer.getPlayMode() != PlayModes.Live);
|
||||
boolean timerAlreadyInitialized = getMin() != null && getMax() != null && sliderBar.getCurrentValue() != null;
|
||||
initMinMax(raceTimesInfo);
|
||||
if (!timerAlreadyInitialized) {
|
||||
@@ -113,8 +115,11 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
|
||||
long livePlayDelayInMillis = timer.getLivePlayDelayInMillis();
|
||||
long eventTimeoutTolerance = 30 * 1000; // 30s
|
||||
long liveTimePointInMillis = System.currentTimeMillis() - livePlayDelayInMillis;
|
||||
return (liveTimePointInMillis < lastRaceTimesInfo.timePointOfNewestEvent.getTime() + eventTimeoutTolerance
|
||||
&& liveTimePointInMillis > lastRaceTimesInfo.startOfTracking.getTime());
|
||||
return lastRaceTimesInfo != null &&
|
||||
lastRaceTimesInfo.timePointOfNewestEvent != null &&
|
||||
liveTimePointInMillis < lastRaceTimesInfo.timePointOfNewestEvent.getTime() + eventTimeoutTolerance &&
|
||||
lastRaceTimesInfo.startOfTracking != null &&
|
||||
liveTimePointInMillis > lastRaceTimesInfo.startOfTracking.getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user