[chronojump-server] task VM calculations use now Vm. Added units on task add



commit 1ebc1b90634eb7fe183534fa1cd79406e1cab26a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Oct 22 12:57:49 2017 +0200

    task VM calculations use now Vm. Added units on task add

 chronojumpserver/api.py                     |   16 ++++++------
 chronojumpserver/js/players.js              |   16 ++++++------
 chronojumpserver/templates/player_list.html |   36 +++++++++++++-------------
 howto_compujump_server.txt                  |    2 +-
 4 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/chronojumpserver/api.py b/chronojumpserver/api.py
index a323772..a12a7a4 100755
--- a/chronojumpserver/api.py
+++ b/chronojumpserver/api.py
@@ -325,15 +325,15 @@ def remove_sprints():
 
     return jsonify(msg="Done")
 
-@app.route('/api/v1/get_max_velocity')
-def get_max_velocity():
+@app.route('/api/v1/get_maximum_mean_velocity')
+def get_maximum_mean_velocity():
     stationId = request.args.get('station_id', 0)
     personId = request.args.get('personId', 0)
     exerciseId = request.args.get('exerciseId', 0)
     resistance = request.args.get('resistance', 0)
     laterality = request.args.get('laterality', '')
 
-    sql = "select max(vmaxBySpeed) from resultEncoder where "
+    sql = "select max(vmeanBySpeed) from resultEncoder where "
     sql += "stationId = %d AND " % int(stationId)
     sql += "exerciseId = %d AND " % int(exerciseId)
     sql += "personId = %d AND " % int(personId)
@@ -341,12 +341,12 @@ def get_max_velocity():
     sql += "laterality = '%s'" % laterality
     print sql
     result = db_session.execute(sql)
-    max_velocity = 0
+    maximum_mean_velocity = 0
     for row in result:
         if row[0] == None:
-            max_velocity = 0
+            maximum_mean_velocity = 0
         else:
-            max_velocity = row[0]
+            maximum_mean_velocity = row[0]
         break
-    print max_velocity
-    return jsonify(max_velocity=max_velocity)
+    print maximum_mean_velocity
+    return jsonify(maximum_mean_velocity=maximum_mean_velocity)
diff --git a/chronojumpserver/js/players.js b/chronojumpserver/js/players.js
index 6a3a058..658f1dc 100755
--- a/chronojumpserver/js/players.js
+++ b/chronojumpserver/js/players.js
@@ -327,13 +327,13 @@ $(document).ready(function() {
         // Show the exercises of this station
         refreshExercises(null);
 
-        // get max_velocity
-        get_max_velocity();
+        // get maximum_mean_velocity
+        get_maximum_mean_velocity();
 
     });
 
     $('#exerciseSelect').on('change', function() {
-        get_max_velocity();
+        get_maximum_mean_velocity();
     })
 
     /* Show or Hide Parameters based on Station Type */
@@ -392,15 +392,15 @@ $(document).ready(function() {
     refreshExercises(null);
 
     $('#taskLoad').change(function() {
-        get_max_velocity()
+        get_maximum_mean_velocity()
     });
 
     $('#taskLaterality').change(function()) {
-        get_max_velocity();
+        get_maximum_mean_velocity();
     }
 
     /* Get max velocity when user selects station, exercice and resistance */
-    function get_max_velocity() {
+    function get_maximum_mean_velocity() {
         var resistance = $('#taskLoad').val();
         var stationId = $('#stationSelect').val();
         var personId = $('#playerId').val();
@@ -414,7 +414,7 @@ $(document).ready(function() {
         console.log("Laterality:" + Laterality);
         if (resistance) {
             $.ajax({
-                url: '/api/v1/get_max_velocity',
+                url: '/api/v1/get_maximum_mean_velocity',
                 method: "GET",
                 data: {
                     station_id: stationId,
@@ -427,7 +427,7 @@ $(document).ready(function() {
                 // Ok, add options in exercise Select
                 // First remove previous options
 
-                if (data.max_velocity > 0 ) {
+                if (data.maximum_mean_velocity > 0 ) {
                     console.log("Enable taskPercentMaxSpeed");
                     $('#taskSpeed').prop('disabled', false);
                     $('#taskpercentMaxSpeed').prop('disabled', false);
diff --git a/chronojumpserver/templates/player_list.html b/chronojumpserver/templates/player_list.html
index e74f3e1..7360f2e 100755
--- a/chronojumpserver/templates/player_list.html
+++ b/chronojumpserver/templates/player_list.html
@@ -60,25 +60,25 @@
                                                                <div class="col-sm-2">
                                                                        <input id="numReps" name="numReps" 
type="number" class="form-control" value="1" min="1"></input>
                                                                </div>
-                                                               <label for="taskLoad" class="col-sm-2 
control-label">Carrega:</label>
+                                                               <label for="taskLoad" class="col-sm-2 
control-label">Carrega (Kg):</label>
                                                                <div class="col-sm-2">
                                                                        <input id="taskLoad" name="taskLoad" 
type="number" class="form-control"  ></input>
                                                                </div>
                                                        </div>
                                                        <div class="form-group taskParameter">
 
-                                                               <label for="taskSpeed" class="col-sm-2 
control-label">Velocitat:</label>
-                                                               <div class="col-sm-2">
-                                                                       <input id="taskSpeed" 
name="taskSpeed" type="number" class="form-control" min="-1" step="0.1" disabled></input>
-                                                               </div>
-                                                               <label for="taskpercentMax" class="col-sm-2 
control-label">Vel. Max:</label>
+                                                               <label for="taskpercentMax" class="col-sm-2 
control-label">Max Vm<br>registrada (m/s):</label>
                                                                <div class="col-sm-2">
                                                                        <input id="taskMaxSpeed" 
name="taskMaxSpeed" type="number" class="form-control" disabled readonly></input>
                                                                </div>
-                                                               <label for="taskpercentMax" class="col-sm-2 
control-label">Vel. Max %:</label>
+                                                               <label for="taskpercentMax" class="col-sm-2 
control-label">Max Vm<br>registrada (%):</label>
                                                                <div class="col-sm-2">
                                                                        <input id="taskpercentMaxSpeed" 
name="taskpercentMaxSpeed" type="number" class="form-control" disabled max="100" min="0"></input>
                                                                </div>
+                                                               <label for="taskSpeed" class="col-sm-2 
control-label">Velocitat (m/s):</label>
+                                                               <div class="col-sm-2">
+                                                                       <input id="taskSpeed" 
name="taskSpeed" type="number" class="form-control" min="-1" step="0.1" disabled></input>
+                                                               </div>
                                                        </div>
                                                        <div class="form-group taskParameter">
                                                                <label for="recipient-name" class="col-sm-2 
control-label">Lateralitat:</label>
@@ -370,7 +370,7 @@ $(document).ready(function() {
         $('#btnDeleteTask').removeClass('show').addClass('hidden');
         $('#btnUpdateTask').removeClass('show').addClass('hidden');
         $('#btnAddTask').removeClass('hidden').addClass('show');
-               get_max_velocity();
+               get_maximum_mean_velocity();
     });
 
     /* To show the model to modify the task */
@@ -424,7 +424,7 @@ $(document).ready(function() {
         $('#btnUpdateTask').removeClass('hidden').addClass('show');
         $('#btnAddTask').removeClass('show').addClass('hidden');
         $('#taskModalForm').modal();
-               get_max_velocity();
+               get_maximum_mean_velocity();
                if (taskLoad > 0) {
                        $('#taskSpeed').prop('disabled', false);
                }
@@ -449,7 +449,7 @@ $(document).ready(function() {
     });
 
     $('#exerciseSelect').on('change', function() {
-        get_max_velocity();
+        get_maximum_mean_velocity();
     });
 
     /* Show or Hide Parameters based on Station Type */
@@ -502,8 +502,8 @@ $(document).ready(function() {
                                        $('#exerciseSelect').val($('#exerciseSelect option:first').val());
                                        //$('#exerciseSelect').val($('#exerciseSelect option:first').val());
                 }
-                               // Calculate max_velocity
-                       get_max_velocity();
+                               // Calculate maximum_mean_velocity
+                       get_maximum_mean_velocity();
             });
         }
     }
@@ -511,15 +511,15 @@ $(document).ready(function() {
 
 
     $('#taskLoad').change(function() {
-        get_max_velocity()
+        get_maximum_mean_velocity()
     });
 
     $('#taskLaterality').change(function() {
-        get_max_velocity();
+        get_maximum_mean_velocity();
     });
 
     /* Get max velocity when user selects station, exercice and resistance */
-    function get_max_velocity() {
+    function get_maximum_mean_velocity() {
         var resistance = $('#taskLoad').val();
         var stationId = $('#stationSelect').val();
         var personId = $('#playerId').val();
@@ -537,7 +537,7 @@ $(document).ready(function() {
         console.log("Laterality:" + laterality);*/
         if (resistance) {
             $.ajax({
-                url: '/api/v1/get_max_velocity',
+                url: '/api/v1/get_maximum_mean_velocity',
                 method: "GET",
                 data: {
                     station_id: stationId,
@@ -550,10 +550,10 @@ $(document).ready(function() {
                 // Ok, add options in exercise Select
                 // First remove previous options
 
-                if (data.max_velocity > 0 ) {
+                if (data.maximum_mean_velocity > 0 ) {
                     //console.log("Enable taskPercentMaxSpeed");
                     $('#taskSpeed').prop('disabled', false);
-                                       $('#taskMaxSpeed').val(data.max_velocity.toFixed(2));
+                                       $('#taskMaxSpeed').val(data.maximum_mean_velocity.toFixed(2));
                                        $('#taskMaxSpeed').prop('disabled', false);
                     $('#taskpercentMaxSpeed').prop('disabled', false);
                 } else {
diff --git a/howto_compujump_server.txt b/howto_compujump_server.txt
index aac9f1f..81f6821 100644
--- a/howto_compujump_server.txt
+++ b/howto_compujump_server.txt
@@ -131,7 +131,7 @@ copy logo_club.png to /srv/api-app/chronojumpserver/static/images
 
 Add stations and exercises on the website serverip:5000
 
-Check RFID is working ok
+Check RFID is working ok, check RFID.cs is compiled
 
 -----------------------
 3b enable FLASK service at boot


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