diff --git a/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java b/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java index 1de3b4337ee..540193145d4 100755 --- a/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java +++ b/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java @@ -99,7 +99,9 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements * reported by the threads. The function that calculates the total progress is: * *
-     *   total_progress = sum(progress(thread_i)) / sum(weight(thread_i))
+ * total_progress = sum(progress(thread_i)) / sum(weight(thread_i)) + * + * * The weight is also the maximum individual progress that a thread can send: if a thread has a weight = 10 its * progress only can be between 0 and 10, e.g,: *

@@ -113,35 +115,81 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements * The total progress that you receive is: * *

-     *   total_progress = 0 + 0 / 10 + 1 = 0 / 11 = 0
+ * total_progress = 0 + 0 / 10 + 1 = 0 / 11 = 0 + * * * Then, the "Course thread" retrieves the course from the server and it sends a new progress message to the system: * *
-     *   Course thread -> weight = 1, progress = 1  ---> total_progress = 0 + 1 /  10 + 1 = 1 / 11 = 0.090909091
+ * Course thread -> weight = 1, progress = 1 ---> total_progress = 0 + 1 / 10 + 1 = 1 / 11 = 0.090909091 + * * * Then, the "Competitor positions thread" goes to the server and it checks that there is a high number of positions * for the competitors. It decides to change its weight: * *
-     *   Competitor positions thread -> weight = 50, progress = 0 --> total_progress = 0 + 1 / 50 + 1 = 1 / 51 = 0.019607843
+ * Competitor positions thread -> weight = 50, progress = 0 --> total_progress = 0 + 1 / 50 + 1 = 1 / 51 = 0.019607843 + * * * Then, the "Competitor positions thread" starts to retrieve positions and it sends several messages updating the * progress: * * * This example shows that is possible to receive more that 3 values of the progress lower than one already - * received. It happens because the weight of the threads changes."

+ * received. It happens because the weight of the threads changes." + *

* - * We assume that there won't be more than six threads in TTCM receiving data for the same race. + * We assume that there won't be more than eight threads in TTCM receiving data for the same race, based on Jorge's + * statement from 2014-02-06: "One thread per subscription where the subscriptions are: + *

+ * Potentially, you can create 8 threads per TTCM (connecting only with one single race)." */ - static final Integer MAX_STORED_PACKET_HOP_ALLOWANCE = 6; + static final Integer MAX_STORED_PACKET_HOP_ALLOWANCE = 8; private final Event tractracEvent; private final com.sap.sailing.domain.base.Regatta regatta; @@ -269,7 +317,7 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements // check if there is a directory configured where stored data files can be cached // only cache files for races in REPLAY state - if (raceStatus.equals(TracTracConnectionConstants.REPLAY_STATUS)) { + if (raceStatus != null && raceStatus.equals(TracTracConnectionConstants.REPLAY_STATUS)) { storedURI = checkForCachedStoredData(storedURI); } @@ -315,8 +363,9 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements } private URI checkForCachedStoredData(URI storedURI){ - if (System.getProperty("tractrac.mtb.cache.dir") != null) { - final String directory = System.getProperty("tractrac.mtb.cache.dir"); + final String CACHE_DIR_PROPERTY = "tractrac.mtb.cache.dir"; + if (System.getProperty(CACHE_DIR_PROPERTY) != null) { + final String directory = System.getProperty(CACHE_DIR_PROPERTY); if (new File(directory).exists()) { final String[] pathFragments = storedURI.getPath().split("\\/"); final String mtbFileName = pathFragments[pathFragments.length-1]; diff --git a/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889).launch b/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889).launch index d017174feb0..58ccb8d7909 100755 --- a/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889).launch +++ b/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889).launch @@ -22,10 +22,10 @@ - + - +