[chronojump] PersonShowAllEvents show de forceSensor tests
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] PersonShowAllEvents show de forceSensor tests
- Date: Thu, 26 Sep 2019 10:26:13 +0000 (UTC)
commit ed25708dd921453144fe30688fb3a65620f15947
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Sep 26 12:26:03 2019 +0200
PersonShowAllEvents show de forceSensor tests
src/gui/person.cs | 7 ++++---
src/sqlite/person.cs | 27 +++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 94a71989..29bd76d6 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -2596,7 +2596,7 @@ public class PersonShowAllEventsWindow
createTreeView(treeview_person_show_all_events);
store = new TreeStore( typeof (string), typeof (string), typeof (string), typeof (string),
typeof (string), typeof(string), typeof(string), typeof(string),
typeof(string), typeof(string),
- typeof (string), typeof(string));
+ typeof (string), typeof (string), typeof(string));
treeview_person_show_all_events.Model = store;
fillTreeView(treeview_person_show_all_events,store, currentPerson.UniqueID);
}
@@ -2654,7 +2654,7 @@ public class PersonShowAllEventsWindow
if(myText != "") {
store = new TreeStore( typeof (string), typeof (string), typeof (string), typeof
(string),
typeof (string), typeof(string), typeof(string), typeof(string),
typeof(string), typeof(string),
- typeof (string), typeof(string));
+ typeof (string), typeof (string), typeof(string));
treeview_person_show_all_events.Model = store;
string [] myStringFull = myText.Split(new char[] {':'});
@@ -2688,6 +2688,7 @@ public class PersonShowAllEventsWindow
tv.AppendColumn ( Catalog.GetString ("MultiChronopic"), new CellRendererText(), "text",
count++);
tv.AppendColumn ( Catalog.GetString ("Encoder sets"), new CellRendererText(), "text",
count++);
tv.AppendColumn ( Catalog.GetString ("Encoder repetitions"), new CellRendererText(), "text",
count++);
+ tv.AppendColumn ( Catalog.GetString ("Force sensor"), new CellRendererText(), "text",
count++);
}
protected void fillTreeView (Gtk.TreeView tv, TreeStore store, int personID) {
@@ -2698,7 +2699,7 @@ public class PersonShowAllEventsWindow
string [] myStr = myEvent.Split(new char[] {':'});
store.AppendValues (myStr[0], myStr[1], myStr[2], myStr[3], myStr[4], myStr[5],
- myStr[6], myStr[7], myStr[8], myStr[9], myStr[10], myStr[11]);
+ myStr[6], myStr[7], myStr[8], myStr[9], myStr[10], myStr[11],
myStr[12]);
}
}
diff --git a/src/sqlite/person.cs b/src/sqlite/person.cs
index 41915901..ee202994 100644
--- a/src/sqlite/person.cs
+++ b/src/sqlite/person.cs
@@ -293,6 +293,7 @@ finishForeach:
ArrayList arrayMCs = new ArrayList(2);
ArrayList arrayEncS = new ArrayList(2);
ArrayList arrayEncC = new ArrayList(2);
+ ArrayList arrayForce = new ArrayList(2);
string tps = Constants.PersonSessionTable;
@@ -417,7 +418,18 @@ finishForeach:
arrayEncC.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
}
reader.Close();
-
+
+ //forceSensor
+ dbcmd.CommandText = "SELECT sessionID, count(*) FROM " + Constants.ForceSensorTable + " WHERE
personID = " + personID +
+ " GROUP BY sessionID ORDER BY sessionID";
+ LogB.SQL(dbcmd.CommandText.ToString());
+
+ reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ arrayForce.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+ }
+ reader.Close();
+
Sqlite.Close();
@@ -433,6 +445,7 @@ finishForeach:
string tempMCs;
string tempEncS;
string tempEncC;
+ string tempForce;
bool found; //using found because a person can be loaded in a session
//but whithout having done any event yet
@@ -448,6 +461,7 @@ finishForeach:
tempMCs = "";
tempEncS = "";
tempEncC = "";
+ tempForce = "";
found = false;
foreach (string myJumps in arrayJumps) {
@@ -531,6 +545,15 @@ finishForeach:
}
}
+ foreach (string f in arrayForce) {
+ string [] myStr = f.Split(new char[] {':'});
+ if(myStrSession[0] == myStr[0]) {
+ tempForce = myStr[1];
+ found = true;
+ break;
+ }
+ }
+
//if has events, write it's data
if (found) {
@@ -539,7 +562,7 @@ finishForeach:
tempJumpsRj + ":" + tempRuns + ":" + //jumpsRj,
Runs
tempRunsInterval + ":" + tempRTs + ":" +
//runsInterval, Reaction times
tempPulses + ":" + tempMCs + ":" + //pulses,
MultiChronopic
- tempEncS + ":" + tempEncC //encoder
signal, encoder curve
+ tempEncS + ":" + tempEncC + ":" + tempForce //encoder
signal, encoder curve, forceSensor
);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]