/* * DB 1.20 -> 1.21 * "Fixing loosing of encoder videoURL after recalculate" * each encoder signal can have saved some encoder curves * both are records on encoder table * connection between them is found in encoderSignalCurve table. * Problem since chronojump 1.4.9 and maybe earlier is on recalculate: videoURL is deleted on signal * but hopefully not in curve * Now this problem has been fixed in new code and it does not get deleted. * * Following method: is to restore signals that lost their videoURL value */ public static void FixLostVideoURLAfterEncoderRecalculate() { dbcmd.CommandText = "SELECT eSignal.uniqueID, eCurve.videoURL " + "FROM encoder AS eSignal, encoder AS eCurve, encoderSignalCurve " + "WHERE eSignal.signalOrCurve = \"signal\" AND eCurve.signalOrCurve = \"curve\" " + "AND eSignal.videoURL = \"\" AND eCurve.videoURL != \"\" " + "AND encoderSignalCurve.signalID = eSignal.uniqueID " + "AND encoderSignalCurve.curveID = eCurve.uniqueID"; LogB.SQL(dbcmd.CommandText.ToString()); SqliteDataReader reader = dbcmd.ExecuteReader(); IDNameList idnamelist = new IDNameList(); while (reader.Read()) { idnamelist.Add(new IDName( Convert.ToInt32(reader[0].ToString()), //encoder signal uniqueID (this signal has lost his videoURL) reader[1].ToString() //videoURL of encoder curve )); } reader.Close(); foreach (IDName idname in idnamelist.l) { dbcmd.CommandText = "UPDATE encoder SET videoURL = \"" + idname.Name + "\" " + "WHERE uniqueID = " + idname.UniqueID.ToString(); LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); } }
protected internal static void addChronojumpProfileAndBilateral() { string [] jumps = SqliteJumpType.SelectJumpTypes(true, "", "", false); IDNameList jList = new IDNameList(jumps, ':'); List <ExecuteAutoSQL> eaSQLlist = new List <ExecuteAutoSQL> { new ExecuteAutoSQL(-1, "Chronojump profile", ExecuteAuto.ModeTypes.BY_PERSONS, "Complete profile using jumps", new List <int> { jList.FindID("SJ"), jList.FindID("SJl"), jList.FindID("CMJ"), jList.FindID("ABK"), jList.FindID("DJa") }, new List <int> { }, new List <int> { } ), new ExecuteAutoSQL(-1, "Bilateral profile by persons", ExecuteAuto.ModeTypes.BY_PERSONS, "Bilateral / Unilateral tests", new List <int> { jList.FindID("slCMJright"), jList.FindID("slCMJleft"), jList.FindID("CMJ"), jList.FindID("slCMJleft"), jList.FindID("CMJ"), jList.FindID("slCMJright"), jList.FindID("CMJ"), jList.FindID("slCMJleft"), jList.FindID("slCMJright"), }, new List <int> { }, new List <int> { } ), new ExecuteAutoSQL(-1, "Bilateral profile by sets", ExecuteAuto.ModeTypes.BY_SETS, "Bilateral / Unilateral tests", new List <int> { jList.FindID("slCMJright"), jList.FindID("slCMJleft"), jList.FindID("CMJ") }, new List <int> { jList.FindID("CMJ"), jList.FindID("slCMJleft"), jList.FindID("slCMJright") }, new List <int> { jList.FindID("slCMJleft"), jList.FindID("CMJ"), jList.FindID("slCMJright") } ) }; foreach (IDName idName in jList.l) { LogB.SQL(idName.ToString()); } foreach (ExecuteAutoSQL eaSQL in eaSQLlist) { Insert(true, eaSQL); } }
public IDNameIDDoubleListOfLists(IDNameList lname, ArrayList ldoublelistoflists) { this.lname = lname; this.ldoublelistoflists = ldoublelistoflists; }
protected internal static void addChronojumpProfileAndBilateral() { string [] jumps = SqliteJumpType.SelectJumpTypes(true, "", "", false); IDNameList jList = new IDNameList(jumps,':'); List <ExecuteAutoSQL> eaSQLlist = new List<ExecuteAutoSQL> { new ExecuteAutoSQL( -1, "Chronojump profile", ExecuteAuto.ModeTypes.BY_PERSONS, "Complete profile using jumps", new List<int> { jList.FindID("SJ"), jList.FindID("SJl"), jList.FindID("CMJ"), jList.FindID("ABK"), jList.FindID("DJa") }, new List<int>{}, new List<int>{} ), new ExecuteAutoSQL( -1, "Bilateral profile by persons", ExecuteAuto.ModeTypes.BY_PERSONS, "Bilateral / Unilateral tests", new List<int> { jList.FindID("slCMJright"), jList.FindID("slCMJleft"), jList.FindID("CMJ"), jList.FindID("slCMJleft"), jList.FindID("CMJ"), jList.FindID("slCMJright"), jList.FindID("CMJ"), jList.FindID("slCMJleft"), jList.FindID("slCMJright"), }, new List<int>{}, new List<int>{} ), new ExecuteAutoSQL( -1, "Bilateral profile by sets", ExecuteAuto.ModeTypes.BY_SETS, "Bilateral / Unilateral tests", new List<int> { jList.FindID("slCMJright"), jList.FindID("slCMJleft"), jList.FindID("CMJ") }, new List<int> { jList.FindID("CMJ"), jList.FindID("slCMJleft"), jList.FindID("slCMJright") }, new List<int> { jList.FindID("slCMJleft"), jList.FindID("CMJ"), jList.FindID("slCMJright") } ) }; foreach(IDName idName in jList.l) { LogB.SQL(idName.ToString()); } foreach(ExecuteAutoSQL eaSQL in eaSQLlist) { Insert(true, eaSQL); } }
protected static IDNameList fillIDNameList(string selectStr) { //select personID and jump type 'SJ' mean dbcmd.CommandText = selectStr; LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); SqliteDataReader reader = dbcmd.ExecuteReader(); IDNameList list = new IDNameList(); while(reader.Read()) { IDName idname = new IDName( Convert.ToInt32(reader[0].ToString()), reader[1].ToString()); LogB.SQL(idname.ToString()); list.Add(new IDName( Convert.ToInt32(reader[0].ToString()), reader[1].ToString() )); } reader.Close(); return list; }
/* * DB 1.20 -> 1.21 * "Fixing loosing of encoder videoURL after recalculate" * each encoder signal can have saved some encoder curves * both are records on encoder table * connection between them is found in encoderSignalCurve table. * Problem since chronojump 1.4.9 and maybe earlier is on recalculate: videoURL is deleted on signal * but hopefully not in curve * Now this problem has been fixed in new code and it does not get deleted. * * Following method: is to restore signals that lost their videoURL value */ public static void FixLostVideoURLAfterEncoderRecalculate() { dbcmd.CommandText = "SELECT eSignal.uniqueID, eCurve.videoURL " + "FROM encoder AS eSignal, encoder AS eCurve, encoderSignalCurve " + "WHERE eSignal.signalOrCurve = \"signal\" AND eCurve.signalOrCurve = \"curve\" " + "AND eSignal.videoURL = \"\" AND eCurve.videoURL != \"\" " + "AND encoderSignalCurve.signalID = eSignal.uniqueID " + "AND encoderSignalCurve.curveID = eCurve.uniqueID"; LogB.SQL(dbcmd.CommandText.ToString()); SqliteDataReader reader = dbcmd.ExecuteReader(); IDNameList idnamelist = new IDNameList(); while(reader.Read()) { idnamelist.Add(new IDName( Convert.ToInt32(reader[0].ToString()), //encoder signal uniqueID (this signal has lost his videoURL) reader[1].ToString() //videoURL of encoder curve )); } reader.Close(); foreach(IDName idname in idnamelist.l) { dbcmd.CommandText = "UPDATE encoder SET videoURL = \"" + idname.Name + "\" " + "WHERE uniqueID = " + idname.UniqueID.ToString(); LogB.SQL(dbcmd.CommandText.ToString()); dbcmd.ExecuteNonQuery(); } }
public IDNameIDDoubleListOfLists(IDNameList lname, ArrayList ldoublelistoflists) { this.lname = lname; this.ldoublelistoflists = ldoublelistoflists; }