[chronojump] uploadEncoderData sends resistance (for gravitatoy)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] uploadEncoderData sends resistance (for gravitatoy)
- Date: Wed, 17 May 2017 10:24:38 +0000 (UTC)
commit d6c472f686b70a7b13e52e2729aac128af2ba6a5
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed May 17 12:23:59 2017 +0200
uploadEncoderData sends resistance (for gravitatoy)
src/gui/chronojump.cs | 38 ++++++++++++++++++++++++++------------
src/gui/encoder.cs | 1 +
src/json.cs | 5 +++--
3 files changed, 30 insertions(+), 14 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index f385c7f..dbbad4c 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -535,8 +535,6 @@ public partial class ChronoJumpWindow
//new DialogMessage(Constants.MessageTypes.INFO, UtilGtk.ScreenHeightFitted(false).ToString()
);
//UtilGtk.ResizeIfNeeded(stats_window);
- //app1.Maximize(); //this was for starting at fullscreen
-
report = new Report(-1); //when a session is loaded or created, it will change the
report.SessionID value
//TODO: check what happens if a session it's deleted
//i think report it's deactivated until a new session is created or loaded,
@@ -636,12 +634,6 @@ public partial class ChronoJumpWindow
label_version_hidden.Text = buildVersion;
LogB.Information("Build version:" + buildVersion);
- /*
- LeastSquares ls = new LeastSquares();
- ls.Test();
- LogB.Information(string.Format("coef = {0} {1} {2}", ls.Coef[0], ls.Coef[1], ls.Coef[2]));
- */
-
restTime = new RestTime();
updatingRestTimes = true;
GLib.Timeout.Add(1000, new GLib.TimeoutHandler(updateRestTimes)); //each s, better than 5s
for don't have problems sorting data on treeview
@@ -651,13 +643,35 @@ public partial class ChronoJumpWindow
* start a ping in other thread
* http://www.mono-project.com/docs/gui/gtksharp/responsive-applications/
* Gtk.Application.Invoke
+ * but only start it if not on Compujump
*/
- pingThread = new Thread (new ThreadStart (pingAtStart));
- pingThread.Start();
+ if( ! configChronojump.Compujump)
+ {
+ pingThread = new Thread (new ThreadStart (pingAtStart));
+ pingThread.Start();
+ }
- //moveStartTestInitial();
+ testNewStuff();
+ }
+ private void testNewStuff()
+ {
+ //uncomment it to tests the method for add suffixes _copy2, _copy3 to encoderConfiguration
//SqliteEncoderConfiguration.IfNameExistsAddSuffixDoTests();
+
+ //Start window with moving widgets. Disabled
+ //moveStartTestInitial();
+
+ //uploadEncoderData test
+ //Json js = new Json();
+ //js.UploadEncoderData();
+
+ //LeastSquares test
+ /*
+ LeastSquares ls = new LeastSquares();
+ ls.Test();
+ LogB.Information(string.Format("coef = {0} {1} {2}", ls.Coef[0], ls.Coef[1], ls.Coef[2]));
+ */
}
@@ -2092,7 +2106,7 @@ public partial class ChronoJumpWindow
cp2016.SerialPortsCloseIfNeeded(true);
//exit start ping if has not ended
- if(pingThread.IsAlive)
+ if(pingThread != null && pingThread.IsAlive)
{
LogB.Information("Closing ping thread");
//pingThread.Abort();
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 3e80344..47af31a 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -5975,6 +5975,7 @@ public partial class ChronoJumpWindow
bool success = js.UploadEncoderData(
currentPerson.UniqueID,
1,
+
Util.ConvertToPoint(findMass(Constants.MassType.DISPLACED)), //this is only for gravitatory
UtilGtk.ComboGetActive(combo_encoder_exercise_capture),
Util.ConvertToPoint(meanPowerHighest),
repsAbove50pBest);
diff --git a/src/json.cs b/src/json.cs
index 8304376..4fbb9e6 100644
--- a/src/json.cs
+++ b/src/json.cs
@@ -369,9 +369,9 @@ public class Json
public bool UploadEncoderData()
{
- return UploadEncoderData(1, 1, "lateral", "8100", 8);
+ return UploadEncoderData(1, 1, "40.2", "lateral", "8100.5", 8);
}
- public bool UploadEncoderData(int personId, int machineId, string exerciseName, string
meanPowerBestRep, int repsAbove50pBest )
+ public bool UploadEncoderData(int personId, int machineId, string resistance, string exerciseName,
string meanPowerBestRep, int repsAbove50pBest )
{
// Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create (serverUrl + "/uploadEncoderData");
@@ -387,6 +387,7 @@ public class Json
JsonObject json = new JsonObject();
json.Add("personId", personId);
json.Add("machineId", machineId);
+ json.Add("resistance", resistance);
json.Add("exerciseName", exerciseName);
json.Add("meanPowerBestRep", meanPowerBestRep);
json.Add("repsAbove50pBest", repsAbove50pBest);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]