[chronojump] Import RunEncoder triggers UNTESTED, check import encoder triggers



commit 5ce1bb743919c068a8ddccef9480c7aae6040d9b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jan 27 18:18:55 2020 +0100

    Import RunEncoder triggers UNTESTED, check import encoder triggers

 src/chronojump-importer/chronojump_importer.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index 609c2e63..4379844b 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -667,7 +667,7 @@ class ImportSession:
                                   avoids_duplicate_column=None,
                                   matches_columns=None)
 
-        # Imports trigger (can be encoder or forceSensor, but right now only encoder is programmed)
+        # Imports trigger (can be encoder, forceSensor or raceanalyzer. Right now force sensor is not 
programmed)
         trigger = self.source_db.read(table_name="trigger",
                                       where_condition="mode='ENCODER' AND 
Encoder.sessionID={}".format(self.source_session),
                                       join_clause="LEFT JOIN Encoder ON Encoder.uniqueID=trigger.modeID")
@@ -748,6 +748,16 @@ class ImportSession:
         self.destination_db.write(table=runEncoder,
                                   matches_columns=self.destination_db.column_names("runEncoder", 
skip_columns=["uniqueID", "personID", "sessionID", "exerciseID"]))
 
+        # Imports trigger (can be encoder, forceSensor or raceanalyzer. Right now force sensor is not 
programmed)
+        trigger = self.source_db.read(table_name="trigger",
+                where_condition="mode='RACEANALYZER' AND 
RunEncoder.sessionID={}".format(self.source_session),
+                join_clause="LEFT JOIN RunEncoder ON RunEncoder.uniqueID=trigger.modeID")
+
+        trigger.update_ids("modeID", runEncoder, "uniqueID", "new_uniqueID")
+        self.destination_db.write(table=trigger, matches_columns=None)
+        # TODO: check that this write does not erase previous write of encoder trigger
+
+
         if(DEBUGTOFILE):
             debugFile.write(" end _import_runEncoder\n")
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]