mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-21 19:50:01 +00:00
bug4029 Implemented progress for sensor fixed during master data import
This commit is contained in:
1 parent
7c062f643d
commit
94c7e9a326
5 files changed
+17
-1
No files matched your search
+6
@@ -58,6 +58,12 @@ public enum DataImportSubProgress {
|
||||
return messages.importWindTracks();
|
||||
}
|
||||
},
|
||||
IMPORT_SENSOR_FIXES {
|
||||
@Override
|
||||
public String getMessage(CommonStringMessages messages) {
|
||||
return messages.importSensorFixes();
|
||||
}
|
||||
},
|
||||
UPDATE_EVENT_LEADERBOARD_GROUP_LINKS {
|
||||
@Override
|
||||
public String getMessage(CommonStringMessages messages) {
|
||||
|
||||
+1
@@ -12,6 +12,7 @@ public interface CommonStringMessages {
|
||||
String importWait();
|
||||
String importLeaderboardGroups();
|
||||
String importWindTracks();
|
||||
String importSensorFixes();
|
||||
String updateEventLeaderboardGroupLinks();
|
||||
|
||||
}
|
||||
+1
@@ -1561,6 +1561,7 @@ importInit=Initializing Import
|
||||
importWait=Waiting for other data import operations to finish
|
||||
importLeaderboardGroups=Importing leaderboard groups
|
||||
importWindTracks=Importing wind tracks
|
||||
importSensorFixes=Importing sensor fixes
|
||||
updateEventLeaderboardGroupLinks=Updating Event-LeaderboardGroup links
|
||||
strategySimulatorTitle=Strategy Simulator
|
||||
controlSettings=Control settings
|
||||
|
||||
+1
@@ -1547,6 +1547,7 @@ importInit=Import wird initialisiert
|
||||
importWait=Warten, bis andere Datenimport-Vorgänge angeschlossen sind
|
||||
importLeaderboardGroups=Ranglisten-Gruppen werden importiert
|
||||
importWindTracks=Windmessungen werden importiert
|
||||
importSensorFixes=Sensor-Fixes werden importiert
|
||||
updateEventLeaderboardGroupLinks=Verbindungen zwischen Veranstaltungen und Ranglisten-Gruppen werden aktualisiert
|
||||
strategySimulatorTitle=Strategie-Simulator
|
||||
controlSettings=Einstellungen
|
||||
|
||||
+8
-1
@@ -125,6 +125,9 @@ public class ImportMasterDataOperation extends
|
||||
progress.setOverAllProgressPct(0.5);
|
||||
progress.setCurrentSubProgressPct(0);
|
||||
createWindTracks(toState);
|
||||
progress.setCurrentSubProgress(DataImportSubProgress.IMPORT_SENSOR_FIXES);
|
||||
progress.setOverAllProgressPct(0.8);
|
||||
progress.setCurrentSubProgressPct(0);
|
||||
importRaceLogTrackingGPSFixes(toState);
|
||||
if (masterData.getDeviceConfigurations() != null) {
|
||||
importDeviceConfigurations(toState);
|
||||
@@ -396,7 +399,7 @@ public class ImportMasterDataOperation extends
|
||||
}
|
||||
i++;
|
||||
progress.setCurrentSubProgressPct((double) i / numOfWindTracks);
|
||||
progress.setOverAllProgressPct(0.5 + (0.5) * ((double) i / numOfWindTracks));
|
||||
progress.setOverAllProgressPct(0.5 + (0.3) * ((double) i / numOfWindTracks));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,6 +409,8 @@ public class ImportMasterDataOperation extends
|
||||
Map<DeviceIdentifier, Set<Timed>> raceLogTrackingFixes = masterData.getRaceLogTrackingFixes();
|
||||
if (raceLogTrackingFixes != null) {
|
||||
SensorFixStore store = toState.getSensorFixStore();
|
||||
int i = 0;
|
||||
final int numberOfDevices = raceLogTrackingFixes.size();
|
||||
for (Entry<DeviceIdentifier, Set<Timed>> entry : raceLogTrackingFixes.entrySet()) {
|
||||
DeviceIdentifier device = entry.getKey();
|
||||
final Collection<Timed> fixesToAddAsBatch = new ArrayList<>(BATCH_SIZE_FOR_IMPORTING_FIXES);
|
||||
@@ -426,6 +431,8 @@ public class ImportMasterDataOperation extends
|
||||
if (!fixesToAddAsBatch.isEmpty()) {
|
||||
storeFixes(store, device, fixesToAddAsBatch);
|
||||
}
|
||||
i++;
|
||||
progress.setCurrentSubProgressPct(0.8 + (0.2) * ((double) i / numberOfDevices));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user