mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
Merge branch 'ubilabs--rcapp--bug-3119' into ubilabs--rcapp--master
This commit is contained in:
commit
256cb78ef1
19 files changed
+261
-142
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ package com.sap.sailing.domain.common.racelog;
|
||||
*
|
||||
*/
|
||||
public enum RaceLogRaceStatus {
|
||||
UNKNOWN(0), UNSCHEDULED(1), SCHEDULED(2), STARTPHASE(3), RUNNING(4), FINISHING(5), FINISHED(6);
|
||||
UNKNOWN(0), UNSCHEDULED(1), PRESCHEDULED(2), SCHEDULED(3), STARTPHASE(4), RUNNING(5), FINISHING(6), FINISHED(7);
|
||||
|
||||
/** the order number represents the natural order of the states */
|
||||
private int orderNumber;
|
||||
|
||||
+15
-10
@@ -63,15 +63,17 @@ public class DependentStartTimeFinderTest {
|
||||
|
||||
@Test
|
||||
public void testDependentStartTimeUpdate() {
|
||||
final MillisecondsDurationImpl cAfterB = new MillisecondsDurationImpl(5000);
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000)));
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB));
|
||||
|
||||
StartTimeFinder finder = new StartTimeFinder(raceLogResolver, raceLogC);
|
||||
// Tests for correct behaviour, when race depending on has no start time set
|
||||
assertNull(finder.analyze().getStartTime());
|
||||
|
||||
final MillisecondsDurationImpl bAfterA = new MillisecondsDurationImpl(6000);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(6000)));
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA));
|
||||
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogB);
|
||||
StartTimeFinderResult result = finder.analyze();
|
||||
@@ -79,7 +81,7 @@ public class DependentStartTimeFinderTest {
|
||||
List<SimpleRaceLogIdentifier> expectedDependingOnRaces = new ArrayList<>();
|
||||
expectedDependingOnRaces.add(new SimpleRaceLogIdentifierImpl("A", "", ""));
|
||||
assertNull(result.getStartTime());
|
||||
assertNull(result.getStartTimeDiff());
|
||||
assertEquals(bAfterA, result.getStartTimeDiff());
|
||||
assertEquals(expectedDependingOnRaces, result.getRacesDependingOn());
|
||||
// assertEquals(5000, result.getStartTimeDiff().asMillis());
|
||||
|
||||
@@ -92,7 +94,7 @@ public class DependentStartTimeFinderTest {
|
||||
|
||||
result = finder.analyze();
|
||||
assertNull(result.getStartTime());
|
||||
assertNull(result.getStartTimeDiff());
|
||||
assertEquals(cAfterB, result.getStartTimeDiff());
|
||||
assertEquals(expectedDependingOnRaces, result.getRacesDependingOn());
|
||||
|
||||
MillisecondsTimePoint now = MillisecondsTimePoint.now();
|
||||
@@ -128,27 +130,30 @@ public class DependentStartTimeFinderTest {
|
||||
|
||||
@Test
|
||||
public void testDependentStartTimeCycle() {
|
||||
final MillisecondsDurationImpl cAfterB = new MillisecondsDurationImpl(6000);
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(6000)));
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB));
|
||||
|
||||
final MillisecondsDurationImpl bAfterA = new MillisecondsDurationImpl(7000);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(7000)));
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA));
|
||||
|
||||
final MillisecondsDurationImpl aAfterC = new MillisecondsDurationImpl(8000);
|
||||
raceLogA.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("C", "", ""), new MillisecondsDurationImpl(8000)));
|
||||
new SimpleRaceLogIdentifierImpl("C", "", ""), aAfterC));
|
||||
|
||||
// Check that all resolve to null in case of a cycle
|
||||
StartTimeFinder finder = new StartTimeFinder(raceLogResolver, raceLogC);
|
||||
assertNull(finder.analyze().getStartTime());
|
||||
assertNull(finder.analyze().getStartTimeDiff());
|
||||
assertEquals(cAfterB, finder.analyze().getStartTimeDiff());
|
||||
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogB);
|
||||
assertNull(finder.analyze().getStartTime());
|
||||
assertNull(finder.analyze().getStartTimeDiff());
|
||||
assertEquals(bAfterA, finder.analyze().getStartTimeDiff());
|
||||
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogA);
|
||||
assertNull(finder.analyze().getStartTime());
|
||||
assertNull(finder.analyze().getStartTimeDiff());
|
||||
assertEquals(aAfterC, finder.analyze().getStartTimeDiff());
|
||||
|
||||
// Check that all resolve correctly after changing some element in cycle
|
||||
MillisecondsTimePoint now = MillisecondsTimePoint.now();
|
||||
|
||||
+3
-4
@@ -24,8 +24,7 @@ public class DependentStartTimeResolver {
|
||||
return internalResolve(event, dependingOnRaces);
|
||||
}
|
||||
|
||||
StartTimeFinderResult internalResolve(RaceLogDependentStartTimeEvent event,
|
||||
Iterable<SimpleRaceLogIdentifier> dependingOnRaces) {
|
||||
StartTimeFinderResult internalResolve(RaceLogDependentStartTimeEvent event,Iterable<SimpleRaceLogIdentifier> dependingOnRaces) {
|
||||
SimpleRaceLogIdentifier identifier = event.getDependentOnRaceIdentifier();
|
||||
Duration startTimeDifference = event.getStartTimeDifference();
|
||||
RaceLog raceLog = raceLogResolver.resolve(identifier);
|
||||
@@ -41,9 +40,9 @@ public class DependentStartTimeResolver {
|
||||
result = new StartTimeFinderResult(extendedDependingOnRaces, null, null);
|
||||
} else {
|
||||
StartTimeFinder dependentStartTimeFinder = new StartTimeFinder(raceLogResolver, raceLog);
|
||||
StartTimeFinderResult resultOfDependentRace = dependentStartTimeFinder
|
||||
.analyze(extendedDependingOnRaces);
|
||||
StartTimeFinderResult resultOfDependentRace = dependentStartTimeFinder.analyze(extendedDependingOnRaces);
|
||||
if (resultOfDependentRace.getStartTime() == null) {
|
||||
resultOfDependentRace.setStartTimeDiff(startTimeDifference);
|
||||
result = resultOfDependentRace;
|
||||
} else {
|
||||
result = new StartTimeFinderResult(resultOfDependentRace.getRacesDependingOn(),
|
||||
|
||||
+3
-4
@@ -44,15 +44,14 @@ public class RaceStatusAnalyzer extends RaceLogAnalyzer<RaceLogRaceStatus> {
|
||||
|
||||
@Override
|
||||
protected RaceLogRaceStatus performAnalysis() {
|
||||
ArrayListNavigableSet<RaceLogRaceStatusEvent> statusEvents = new ArrayListNavigableSet<RaceLogRaceStatusEvent>(RaceLogRaceStatusEventComparator.INSTANCE);
|
||||
ArrayListNavigableSet<RaceLogRaceStatusEvent> statusEvents = new ArrayListNavigableSet<>(RaceLogRaceStatusEventComparator.INSTANCE);
|
||||
for(RaceLogEvent event: getPassEvents()) {
|
||||
if(event instanceof RaceLogRaceStatusEvent) {
|
||||
statusEvents.add((RaceLogRaceStatusEvent) event);
|
||||
}
|
||||
}
|
||||
for (RaceLogRaceStatusEvent event : statusEvents.descendingSet()) {
|
||||
RaceLogRaceStatusEvent statusEvent = (RaceLogRaceStatusEvent) event;
|
||||
statusEvent.accept(eventDispatcher);
|
||||
event.accept(eventDispatcher);
|
||||
return eventDispatcher.nextStatus;
|
||||
}
|
||||
|
||||
@@ -79,7 +78,7 @@ public class RaceStatusAnalyzer extends RaceLogAnalyzer<RaceLogRaceStatus> {
|
||||
|
||||
private void setRaceLogStatusBasedOnStartTime(TimePoint startTime) {
|
||||
if (startTime == null) {
|
||||
nextStatus = RaceLogRaceStatus.UNKNOWN;
|
||||
nextStatus = RaceLogRaceStatus.PRESCHEDULED;
|
||||
return;
|
||||
}
|
||||
TimePoint now = clock.now();
|
||||
|
||||
+5
-1
@@ -10,7 +10,7 @@ import com.sap.sse.common.Util;
|
||||
public class StartTimeFinderResult {
|
||||
private final Iterable<SimpleRaceLogIdentifier> racesDependingOn;
|
||||
private final TimePoint startTime;
|
||||
private final Duration startTimeDiff;
|
||||
private Duration startTimeDiff;
|
||||
|
||||
public StartTimeFinderResult(Iterable<SimpleRaceLogIdentifier> racesDependingOn, TimePoint startTime, Duration startTimeDiff) {
|
||||
this.startTime = startTime;
|
||||
@@ -34,6 +34,10 @@ public class StartTimeFinderResult {
|
||||
return startTimeDiff;
|
||||
}
|
||||
|
||||
public void setStartTimeDiff(Duration startTimeDiff) {
|
||||
this.startTimeDiff = startTimeDiff;
|
||||
}
|
||||
|
||||
public boolean isDependentStartTime() {
|
||||
return racesDependingOn != null && !Util.isEmpty(racesDependingOn);
|
||||
}
|
||||
|
||||
+1
@@ -224,5 +224,6 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
@Override
|
||||
public void forceUpdate() {
|
||||
super.update();
|
||||
registerListenerOnDependentRaceIfDependentStartTime();
|
||||
}
|
||||
}
|
||||
+8
-2
@@ -178,7 +178,10 @@ public class ReadonlyRaceStateImpl implements ReadonlyRaceState, RaceLogChangedL
|
||||
// We known that recreateRacingProcedure calls update() when done, therefore this RaceState
|
||||
// will be fully initialized after this line
|
||||
recreateRacingProcedure();
|
||||
registerListenerOnDependentRaceIfDependentStartTime();
|
||||
}
|
||||
|
||||
protected void registerListenerOnDependentRaceIfDependentStartTime() {
|
||||
// Check wether the latest known StartTimeEvent is a non-dependent or dependent start time in case of a
|
||||
// dependent startTime setup listeners
|
||||
this.raceLog.lockForRead();
|
||||
@@ -333,11 +336,14 @@ public class ReadonlyRaceStateImpl implements ReadonlyRaceState, RaceLogChangedL
|
||||
if (raceStateToObserve != null) {
|
||||
// Remove previous listeners
|
||||
raceStateToObserve.removeChangedListener(raceStateToObserveListener);
|
||||
raceStateToObserve = null;
|
||||
}
|
||||
RaceLogDependentStartTimeEvent dependentStartTimeEvent = (RaceLogDependentStartTimeEvent) event;
|
||||
RaceLog resolvedRaceLog = raceLogResolver.resolve(dependentStartTimeEvent.getDependentOnRaceIdentifier());
|
||||
raceStateToObserve = ReadonlyRaceStateImpl.create(raceLogResolver, resolvedRaceLog);
|
||||
raceStateToObserve.addChangedListener(raceStateToObserveListener);
|
||||
if (resolvedRaceLog != null) {
|
||||
raceStateToObserve = ReadonlyRaceStateImpl.create(raceLogResolver, resolvedRaceLog);
|
||||
raceStateToObserve.addChangedListener(raceStateToObserveListener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
|
||||
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9875"/>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sse.security.ui.UserManagement"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/security/ui/Login.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sse.security.ui"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" javaProject="com.sap.sse.security.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.googlecode.java-diff-utils/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.json.simple/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.operationaltransformation/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.replication/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining.shared/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sse.security.ui"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.common/src" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -workDir "${project_loc:com.sap.sse.security.ui}/.tmp/gwt-work" -war "${project_loc:com.sap.sse.security.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort auto -startupUrl /security/ui/Login.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation -startupUrl /security/ui/UserManagement.html com.sap.sse.security.ui.UserManagement"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sse.security.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx3072m"/>
|
||||
</launchConfiguration>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
|
||||
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT" value="9875"/>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sse.security.ui.UserManagement"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.google.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/security/ui/Login.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sse.security.ui"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" javaProject="com.sap.sse.security.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.googlecode.java-diff-utils/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.json.simple/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.operationaltransformation/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.replication/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining.shared/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.osgi/lib/gwt-user.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sse.security.ui"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.common/src" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -workDir "${project_loc:com.sap.sse.security.ui}/.tmp/gwt-work" -war "${project_loc:com.sap.sse.security.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort auto -startupUrl /security/ui/Login.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation -startupUrl /security/ui/UserManagement.html com.sap.sse.security.ui.UserManagement"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sse.security.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx3072m"/>
|
||||
</launchConfiguration>
|
||||
@@ -82,9 +82,9 @@
|
||||
android:id="@+id/has_dependent_races"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="?link_24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="5dp"
|
||||
android:src="?link_24dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
@@ -111,14 +111,13 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textAppearance="?textXSmall"
|
||||
android:drawableLeft="?arrow_down"
|
||||
android:textAppearance="?textXSmall"
|
||||
tools:text="01:12"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/race_name"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
@@ -128,10 +127,26 @@
|
||||
android:layout_marginStart="@dimen/default_margin"
|
||||
android:layout_toLeftOf="@id/additional_info"
|
||||
android:layout_toStartOf="@id/additional_info"
|
||||
android:orientation="vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textNormal"
|
||||
tools:text="Race 3"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/race_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textNormal"
|
||||
tools:text="Race 3"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/depends_on"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textXSmall"
|
||||
android:visibility="gone"
|
||||
tools:text="5 minutes after ABC"
|
||||
tools:visibility="visible"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
|
||||
+3
@@ -31,5 +31,8 @@ public class ManagedRacesDataHandler extends DataHandler<Collection<ManagedRace>
|
||||
for (ManagedRace race : data) {
|
||||
race.calculateRaceState();
|
||||
}
|
||||
for (ManagedRace race : data) {
|
||||
race.getState().forceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
-13
@@ -53,22 +53,9 @@ public class ManagedRacesDataParser implements DataParser<Collection<ManagedRace
|
||||
RaceGroup group = deserializer.deserialize(json);
|
||||
addManagedRaces(managedRaces, group);
|
||||
}
|
||||
|
||||
forceRaceStateUpdate(managedRaces);
|
||||
|
||||
return managedRaces;
|
||||
}
|
||||
|
||||
private void forceRaceStateUpdate(Collection<ManagedRace> managedRaces) {
|
||||
for (ManagedRace managedRace : managedRaces) {
|
||||
managedRace.calculateRaceState();
|
||||
}
|
||||
|
||||
for (ManagedRace managedRace : managedRaces) {
|
||||
managedRace.getState().forceUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private void addManagedRaces(Collection<ManagedRace> target, RaceGroup raceGroup) {
|
||||
for (SeriesWithRows series : raceGroup.getSeries()) {
|
||||
for (RaceRow raceRow : series.getRaceRows()) {
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class ManagedRaceImpl implements ManagedRace {
|
||||
|
||||
@Override
|
||||
public RaceLog getRaceLog() {
|
||||
return state.getRaceLog();
|
||||
return state == null ? null : state.getRaceLog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+43
-14
@@ -20,6 +20,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.android.shared.util.ViewHolder;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.StartTimeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.StartTimeFinderResult;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceState;
|
||||
@@ -30,6 +31,7 @@ import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.racecommittee.app.AppConstants;
|
||||
import com.sap.sailing.racecommittee.app.R;
|
||||
import com.sap.sailing.racecommittee.app.data.AndroidRaceLogResolver;
|
||||
import com.sap.sailing.racecommittee.app.data.DataManager;
|
||||
import com.sap.sailing.racecommittee.app.domain.ManagedRace;
|
||||
import com.sap.sailing.racecommittee.app.ui.adapters.racelist.RaceFilter.FilterSubscriber;
|
||||
import com.sap.sailing.racecommittee.app.ui.utils.FlagsResources;
|
||||
@@ -38,6 +40,7 @@ import com.sap.sailing.racecommittee.app.utils.RaceHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.ThemeHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.TimeUtils;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> implements FilterSubscriber {
|
||||
@@ -58,6 +61,7 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
private TextView race_finished;
|
||||
private LinearLayout race_scheduled;
|
||||
private TextView race_unscheduled;
|
||||
private TextView depends_on;
|
||||
private ImageView current_flag;
|
||||
private TextView race_name;
|
||||
private TextView flag_timer;
|
||||
@@ -197,8 +201,28 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
race_finished.setText(mResources.getString(R.string.race_finished, dateFormat.format(state.getFinishedTime().asDate())));
|
||||
}
|
||||
if (state.getStartTime() == null && state.getFinishedTime() == null) {
|
||||
race_scheduled.setVisibility(View.GONE);
|
||||
race_unscheduled.setVisibility(View.VISIBLE);
|
||||
switch (race.getRace().getStatus()) {
|
||||
case PRESCHEDULED:
|
||||
race_scheduled.setVisibility(View.GONE);
|
||||
race_unscheduled.setVisibility(View.GONE);
|
||||
if (depends_on != null) {
|
||||
StartTimeFinder stf = new StartTimeFinder(new AndroidRaceLogResolver(), race.getRace().getRaceLog());
|
||||
StartTimeFinderResult result = stf.analyze();
|
||||
if (result != null && result.isDependentStartTime()) {
|
||||
SimpleRaceLogIdentifier identifier = Util.get(result.getRacesDependingOn(), 0);
|
||||
ManagedRace tmp = DataManager.create(getContext()).getDataStore().getRace(identifier);
|
||||
depends_on.setText(getContext()
|
||||
.getString(R.string.minutes_after_long, result.getStartTimeDiff().asMinutes(), RaceHelper
|
||||
.getRaceName(tmp, " / ")));
|
||||
depends_on.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
race_scheduled.setVisibility(View.GONE);
|
||||
race_unscheduled.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
if (race_name != null) {
|
||||
race_name.setTextColor(ThemeHelper.getColor(getContext(), R.attr.white));
|
||||
@@ -249,6 +273,7 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
boat_class = ViewHolder.get(layout, R.id.boat_class);
|
||||
fleet_series = ViewHolder.get(layout, R.id.fleet_series);
|
||||
has_dependent_races = ViewHolder.get(layout, R.id.has_dependent_races);
|
||||
depends_on = ViewHolder.get(layout, R.id.depends_on);
|
||||
}
|
||||
|
||||
private void resetValues(View layout) {
|
||||
@@ -280,6 +305,10 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
if (has_dependent_races != null) {
|
||||
has_dependent_races.setVisibility(View.GONE);
|
||||
}
|
||||
if (depends_on != null) {
|
||||
depends_on.setTextColor(ThemeHelper.getColor(getContext(), R.attr.sap_light_gray));
|
||||
depends_on.setVisibility(View.GONE);
|
||||
}
|
||||
setMarker(0);
|
||||
}
|
||||
}
|
||||
@@ -321,20 +350,20 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
if (isNext != 0) {
|
||||
flag = FlagsResources.getFlagDrawable(getContext(), currentFlag.name(), FLAG_SIZE);
|
||||
switch (isNext) {
|
||||
case 1:
|
||||
if (nextPole.isDisplayed()) {
|
||||
case 1:
|
||||
if (nextPole.isDisplayed()) {
|
||||
arrow = BitmapHelper.getAttrDrawable(getContext(), R.attr.arrow_up);
|
||||
} else {
|
||||
arrow = BitmapHelper.getAttrDrawable(getContext(), R.attr.arrow_down);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
arrow = BitmapHelper.getAttrDrawable(getContext(), R.attr.arrow_up);
|
||||
} else {
|
||||
arrow = BitmapHelper.getAttrDrawable(getContext(), R.attr.arrow_down);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
arrow = BitmapHelper.getAttrDrawable(getContext(), R.attr.arrow_up);
|
||||
break;
|
||||
|
||||
default:
|
||||
ExLog.i(getContext(), TAG, "unknown flag");
|
||||
default:
|
||||
ExLog.i(getContext(), TAG, "unknown flag");
|
||||
}
|
||||
timer = TimeUtils.formatDuration(now, poleState.getNextStateValidFrom());
|
||||
}
|
||||
|
||||
+21
-2
@@ -1,5 +1,13 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -20,10 +28,16 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.*;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AbsListView.OnScrollListener;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView.OnItemSelectedListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.BaseRaceStateChangedListener;
|
||||
@@ -44,7 +58,12 @@ import com.sap.sailing.racecommittee.app.ui.adapters.racelist.RaceListDataTypeRa
|
||||
import com.sap.sailing.racecommittee.app.ui.comparators.RaceListDataTypeComparator;
|
||||
import com.sap.sailing.racecommittee.app.ui.comparators.RegattaSeriesFleetComparator;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.dialogs.ProtestTimeDialogFragment;
|
||||
import com.sap.sailing.racecommittee.app.utils.*;
|
||||
import com.sap.sailing.racecommittee.app.utils.BitmapHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.RaceHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.StringHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.ThemeHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.TickListener;
|
||||
import com.sap.sailing.racecommittee.app.utils.TickSingleton;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceListFragment extends LoggableFragment implements OnItemClickListener, OnItemSelectedListener, TickListener, OnScrollListener {
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ public abstract class RaceInfoFragmentChooser {
|
||||
switch (managedRace.getStatus()) {
|
||||
case UNSCHEDULED:
|
||||
return createInfoFragment(StartTimeFragment.newInstance(StartTimeFragment.MODE_1), managedRace);
|
||||
case PRESCHEDULED:
|
||||
case SCHEDULED:
|
||||
case STARTPHASE:
|
||||
return createInfoFragment(context, getStartphaseFragment(), managedRace);
|
||||
|
||||
+24
-1
@@ -1,11 +1,16 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments.panels;
|
||||
|
||||
import android.content.*;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.android.shared.util.ViewHolder;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
@@ -131,9 +136,22 @@ public class FlagPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mRecallFlags, View.VISIBLE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.VISIBLE);
|
||||
|
||||
uncheckMarker(mCourseFlags);
|
||||
break;
|
||||
|
||||
case PRESCHEDULED:
|
||||
changeVisibility(mPostponeFlags, View.VISIBLE);
|
||||
changeVisibility(mAbandonFlags, View.GONE);
|
||||
changeVisibility(mRecallFlags, View.GONE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.GONE);
|
||||
|
||||
uncheckMarker(mAbandonFlags);
|
||||
uncheckMarker(mCourseFlags);
|
||||
uncheckMarker(mMoreFlags);
|
||||
break;
|
||||
|
||||
case SCHEDULED:
|
||||
case STARTPHASE:
|
||||
changeVisibility(mPostponeFlags, View.VISIBLE);
|
||||
@@ -141,6 +159,7 @@ public class FlagPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mRecallFlags, View.GONE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.GONE);
|
||||
|
||||
uncheckMarker(mAbandonFlags);
|
||||
uncheckMarker(mRecallFlags);
|
||||
uncheckMarker(mMoreFlags);
|
||||
@@ -154,6 +173,7 @@ public class FlagPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mRecallFlags, View.VISIBLE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.VISIBLE);
|
||||
|
||||
uncheckMarker(mCourseFlags);
|
||||
break;
|
||||
|
||||
@@ -165,6 +185,7 @@ public class FlagPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mRecallFlags, View.GONE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.GONE);
|
||||
|
||||
uncheckMarker(mRecallFlags);
|
||||
uncheckMarker(mCourseFlags);
|
||||
uncheckMarker(mMoreFlags);
|
||||
@@ -178,6 +199,7 @@ public class FlagPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mRecallFlags, View.VISIBLE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.VISIBLE);
|
||||
|
||||
uncheckMarker(mCourseFlags);
|
||||
break;
|
||||
|
||||
@@ -187,6 +209,7 @@ public class FlagPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mRecallFlags, View.GONE);
|
||||
changeVisibility(mCourseFlags, View.GONE);
|
||||
changeVisibility(mMoreFlags, View.GONE);
|
||||
|
||||
uncheckMarker(mPostponeFlags);
|
||||
uncheckMarker(mAbandonFlags);
|
||||
uncheckMarker(mRecallFlags);
|
||||
|
||||
+13
-1
@@ -1,6 +1,10 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments.panels;
|
||||
|
||||
import android.content.*;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -8,6 +12,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.android.shared.util.ViewHolder;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
@@ -168,6 +173,13 @@ public class SetupPanelFragment extends BasePanelFragment {
|
||||
changeVisibility(mWindLock, View.GONE);
|
||||
break;
|
||||
|
||||
case PRESCHEDULED:
|
||||
changeVisibility(mStartProcedureLock, View.GONE);
|
||||
changeVisibility(mStartModeLock, View.GONE);
|
||||
changeVisibility(mCourseLock, View.GONE);
|
||||
changeVisibility(mWindLock, View.GONE);
|
||||
break;
|
||||
|
||||
case SCHEDULED:
|
||||
changeVisibility(mStartProcedureLock, View.GONE);
|
||||
changeVisibility(mStartModeLock, View.GONE);
|
||||
|
||||
+44
-30
@@ -17,6 +17,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.android.shared.util.ViewHolder;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.StartTimeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.StartTimeFinderResult;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
@@ -24,10 +25,14 @@ import com.sap.sailing.domain.abstractlog.race.state.impl.BaseRaceStateChangedLi
|
||||
import com.sap.sailing.racecommittee.app.AppConstants;
|
||||
import com.sap.sailing.racecommittee.app.R;
|
||||
import com.sap.sailing.racecommittee.app.data.AndroidRaceLogResolver;
|
||||
import com.sap.sailing.racecommittee.app.data.DataManager;
|
||||
import com.sap.sailing.racecommittee.app.domain.ManagedRace;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.raceinfo.StartTimeFragment;
|
||||
import com.sap.sailing.racecommittee.app.utils.RaceHelper;
|
||||
import com.sap.sailing.racecommittee.app.utils.TickSingleton;
|
||||
import com.sap.sailing.racecommittee.app.utils.TimeUtils;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public class TimePanelFragment extends BasePanelFragment {
|
||||
@@ -153,6 +158,11 @@ public class TimePanelFragment extends BasePanelFragment {
|
||||
StartTimeFinderResult result = stf.analyze();
|
||||
if (result != null) {
|
||||
mLinkedRace = result.isDependentStartTime();
|
||||
if (mLinkedRace && mHeaderTime != null) {
|
||||
SimpleRaceLogIdentifier identifier = Util.get(result.getRacesDependingOn(), 0);
|
||||
ManagedRace race = DataManager.create(getActivity()).getDataStore().getRace(identifier);
|
||||
mHeaderTime.setText(getString(R.string.minutes_after_long, result.getStartTimeDiff().asMinutes(), RaceHelper.getRaceName(race, " / ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,33 +182,37 @@ public class TimePanelFragment extends BasePanelFragment {
|
||||
|
||||
private void checkStatus() {
|
||||
switch (getRace().getStatus()) {
|
||||
case UNSCHEDULED:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
case UNSCHEDULED:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
|
||||
case SCHEDULED:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
case PRESCHEDULED:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
|
||||
case STARTPHASE:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
case SCHEDULED:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
|
||||
case RUNNING:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
case STARTPHASE:
|
||||
changeVisibility(mTimeLock, View.GONE);
|
||||
break;
|
||||
|
||||
case FINISHING:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
case RUNNING:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
|
||||
case FINISHED:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
case FINISHING:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
|
||||
default:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
case FINISHED:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
|
||||
default:
|
||||
changeVisibility(mTimeLock, View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,17 +240,17 @@ public class TimePanelFragment extends BasePanelFragment {
|
||||
private void toggleFragment() {
|
||||
sendIntent(AppConstants.INTENT_ACTION_TOGGLE, AppConstants.INTENT_ACTION_EXTRA, AppConstants.INTENT_ACTION_TOGGLE_TIME);
|
||||
switch (toggleMarker(container, markerId)) {
|
||||
case 0:
|
||||
sendIntent(AppConstants.INTENT_ACTION_SHOW_MAIN_CONTENT);
|
||||
break;
|
||||
case 0:
|
||||
sendIntent(AppConstants.INTENT_ACTION_SHOW_MAIN_CONTENT);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
replaceFragment(StartTimeFragment.newInstance(StartTimeFragment.MODE_TIME_PANEL));
|
||||
break;
|
||||
case 1:
|
||||
replaceFragment(StartTimeFragment.newInstance(StartTimeFragment.MODE_TIME_PANEL));
|
||||
break;
|
||||
|
||||
default:
|
||||
ExLog.i(getActivity(), TAG, "Unknown return value");
|
||||
break;
|
||||
default:
|
||||
ExLog.i(getActivity(), TAG, "Unknown return value");
|
||||
break;
|
||||
}
|
||||
disableToggle(container, markerId);
|
||||
}
|
||||
|
||||
+3
-1
@@ -217,7 +217,9 @@ public class StartTimeFragment extends BaseFragment
|
||||
case MODE_TIME_PANEL:
|
||||
if (getRace() != null && getRaceState() != null) {
|
||||
mStartTime = getRaceState().getStartTime();
|
||||
time.setTime(mStartTime.asDate());
|
||||
if (mStartTime != null) {
|
||||
time.setTime(mStartTime.asDate());
|
||||
}
|
||||
}
|
||||
View frame = ViewHolder.get(getView(), R.id.header);
|
||||
if (frame != null) {
|
||||
|
||||
Reference in new issue
Block a user