[chronojump] Exhibition upload data not by sessions: by school, group
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Exhibition upload data not by sessions: by school, group
- Date: Sun, 24 Feb 2019 23:55:09 +0000 (UTC)
commit f99ea8ead44b219a9533df8c74cbf782aa85b75b
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Feb 25 00:54:31 2019 +0100
Exhibition upload data not by sessions: by school, group
src/gui/chronojump.cs | 4 ++--
src/gui/exhibition.cs | 5 ++++-
src/json.cs | 11 +++++++----
3 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 536de00a..2a748ad9 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4505,7 +4505,7 @@ public partial class ChronoJumpWindow
if(! execute_auto_doing)
sensitiveGuiYesEvent();
- if(configChronojump.Exhibition)
+ if(configChronojump.Exhibition && configChronojump.ExhibitionStationType ==
ExhibitionTest.testTypes.JUMP)
uploadExhibitionTest(ExhibitionTest.testTypes.JUMP,
Convert.ToDouble(Util.GetHeightInCentimeters(currentJump.Tv.ToString())));
}
else if( currentEventExecute.ChronopicDisconnected )
@@ -4949,7 +4949,7 @@ public partial class ChronoJumpWindow
//put correct time value in eventWindow (put the time from chronopic and not onTimer
soft chronometer)
event_execute_LabelTimeValue = currentRun.Time;
- if(configChronojump.Exhibition)
+ if(configChronojump.Exhibition && configChronojump.ExhibitionStationType ==
ExhibitionTest.testTypes.RUN)
uploadExhibitionTest(ExhibitionTest.testTypes.RUN, currentRun.Time);
}
else if( currentEventExecute.ChronopicDisconnected )
diff --git a/src/gui/exhibition.cs b/src/gui/exhibition.cs
index 285dfe0e..3af39da4 100644
--- a/src/gui/exhibition.cs
+++ b/src/gui/exhibition.cs
@@ -136,7 +136,10 @@ public partial class ChronoJumpWindow
private void uploadExhibitionTest(ExhibitionTest.testTypes tt, double result)
{
Json js = new Json();
- ExhibitionTest et = new ExhibitionTest(currentSession.UniqueID, currentPerson.UniqueID, tt,
result);
+ ExhibitionTest et = new ExhibitionTest(Convert.ToInt32(spin_exhibition_school.Value),
+ Convert.ToInt32(spin_exhibition_group.Value),
+ currentPerson.UniqueID, tt, result);
+
if( ! js.UploadExhibitionTest (et))
{
LogB.Error(js.ResultMessage);
diff --git a/src/json.cs b/src/json.cs
index 02e01e4c..c7e815f2 100644
--- a/src/json.cs
+++ b/src/json.cs
@@ -950,7 +950,8 @@ public class Json
// Creates the json object
JsonObject json = new JsonObject();
- json.Add("sessionID", et.sessionID);
+ json.Add("schoolID", et.schoolID);
+ json.Add("groupID", et.groupID);
json.Add("personID", et.personID);
json.Add("testType", et.testType.ToString());
json.Add("result", et.resultToJson);
@@ -1396,7 +1397,8 @@ public class StationCount
//eg. YOMO
public class ExhibitionTest
{
- public int sessionID; //includes school and class-group
+ public int schoolID;
+ public int groupID;
public int personID;
public enum testTypes { JUMP, RUN, INERTIAL, FORCE_ROPE, FORCE_SHOT };
public testTypes testType;
@@ -1409,9 +1411,10 @@ public class ExhibitionTest
* on inertial is mean power of the maximum repetiton
*/
- public ExhibitionTest(int sessionID, int personID, testTypes testType, double result)
+ public ExhibitionTest(int schoolID, int groupID, int personID, testTypes testType, double result)
{
- this.sessionID = sessionID;
+ this.schoolID = schoolID;
+ this.groupID = groupID;
this.personID = personID;
this.testType = testType;
this.result = result;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]