[chronojump] At importer also show progress of jumps, races
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] At importer also show progress of jumps, races
- Date: Wed, 10 Jun 2020 11:20:15 +0000 (UTC)
commit c0d2dc5e4570f629be11dcfd4b294fadc874c53a
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Jun 10 13:18:44 2020 +0200
At importer also show progress of jumps, races
src/chronojump-importer/chronojump_importer.py | 5 +++-
src/gui/chronojumpImporter.cs | 40 +++++++++++++++++++-------
2 files changed, 33 insertions(+), 12 deletions(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index e3373766..e969436c 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -497,6 +497,7 @@ class ImportSession:
return persons77
def _import_jumps(self):
+ self._print_status(self, "jumps")
# Imports JumpType table
jump_types = self.source_db.read(table_name="JumpType",
where_condition="Session.uniqueID={}".format(self.source_session),
@@ -538,6 +539,7 @@ class ImportSession:
self.destination_db.write(table=jump, matches_columns=self.destination_db.column_names("Jump",
skip_columns=["uniqueID", "personID"]))
def _import_runs(self):
+ self._print_status(self, "runs")
# Imports RunTypes table
run_types = self.source_db.read(table_name="RunType",
where_condition="Run.sessionID={}".format(self.source_session),
@@ -574,9 +576,10 @@ class ImportSession:
run_interval.update_session_ids(self.new_session_id)
run_interval.update_ids("type", run_interval_types, "old_name", "new_name")
self.destination_db.write(table=run_interval,
- matches_columns=self.destination_db.column_names("RunInterval",
skip_columns=["uniqueID", "personID", "sessionID"]))
+ matches_columns=self.destination_db.column_names("RunInterval",
skip_columns=["uniqueID", "personID", "sessionID"])) #TODO
def _import_pulse(self):
+ #self._print_status(self, "pulses")
# Imports PulseTypes table
pulse_types = self.source_db.read(table_name="PulseType",
where_condition="Session.uniqueID={}".format(self.source_session),
diff --git a/src/gui/chronojumpImporter.cs b/src/gui/chronojumpImporter.cs
index 7f880263..b3b28a1a 100644
--- a/src/gui/chronojumpImporter.cs
+++ b/src/gui/chronojumpImporter.cs
@@ -114,17 +114,7 @@ public partial class ChronoJumpWindow
string statusDir = Util.GetDatabaseTempImportDir() + Path.DirectorySeparatorChar +
"status" + Path.DirectorySeparatorChar;
- //files are created on this order
- if(File.Exists(statusDir + "persons.txt"))
- message = "Importing persons";
- if(File.Exists(statusDir + "encoder.txt"))
- message = "Importing encoder files";
- if(File.Exists(statusDir + "forceSensor.txt"))
- message = "Importing forceSensor files";
- if(File.Exists(statusDir + "runEncoder.txt"))
- message = "Importing race analyzer files";
- if(File.Exists(statusDir + "allData.txt"))
- message = "All data imported, finishing";
+ message = getRealtimeMessage(statusDir, message);
app1s_ImportPulse(message);
@@ -133,6 +123,34 @@ public partial class ChronoJumpWindow
return true;
}
+ private string getRealtimeMessage(string statusDir, string message)
+ {
+ // files are created in opposite order as shown here
+
+ if(File.Exists(statusDir + "allData.txt"))
+ return "All data imported, finishing";
+
+ if(File.Exists(statusDir + "runEncoder.txt"))
+ return "Importing race analyzer files";
+
+ if(File.Exists(statusDir + "forceSensor.txt"))
+ return "Importing forceSensor files";
+
+ if(File.Exists(statusDir + "encoder.txt"))
+ return "Importing encoder files";
+
+ if(File.Exists(statusDir + "runs.txt"))
+ return "Importing races";
+
+ if(File.Exists(statusDir + "jumps.txt"))
+ return "Importing jumps";
+
+ if(File.Exists(statusDir + "persons.txt"))
+ return "Importing persons";
+
+ return message;
+ }
+
private void importSessionFromDatabaseEnd()
{
if (importerResult.success)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]