diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2016-04-10 10:58:39 +0200 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2016-04-10 10:58:39 +0200 |
commit | c88a3c7f2a93d4362472b3d0ce07be34c16563b6 (patch) | |
tree | a3e797caf04ada92caaaae38fbe80b4afca46cc6 /webapp/js/back_up.js | |
parent | 9f145eac0d4675bc7eb8ebd4ff8d48335dab974c (diff) |
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'webapp/js/back_up.js')
-rw-r--r-- | webapp/js/back_up.js | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/webapp/js/back_up.js b/webapp/js/back_up.js index d242506..1badc02 100644 --- a/webapp/js/back_up.js +++ b/webapp/js/back_up.js @@ -9,6 +9,7 @@ var BackUp = function() { var $angleX = $('#angle-x-val'); var $angleY = $('#angle-y-val'); var $angleZ = $('#angle-z-val'); + $notification = $('#notification-div'); var gauge; @@ -17,14 +18,14 @@ var BackUp = function() { 'id': 'chart', 'type': 'angulargauge', 'renderAt': 'fusioncharts-div', - 'width': '1000', + 'width': '800', 'height': '500', 'dataFormat': 'json', 'dataSource': { 'chart': { //'caption': 'Inclinaison', - 'lowerLimit': '160', - 'upperLimit': '200', + 'lowerLimit': '-50', + 'upperLimit': '50', 'theme': 'fint', "gaugeFillMix": "{dark-40},{light-40},{dark-20}", 'bgColor': '#00b0c0', @@ -32,24 +33,24 @@ var BackUp = function() { 'colorRange': { 'color': [ { - 'minValue': '160', - 'maxValue': '171', + 'minValue': '-50', + 'maxValue': '-15', 'code': '#b41527', }, { - 'minValue': '171', - 'maxValue': '175', + 'minValue': '-15', + 'maxValue': '-5', 'code': '#e48739', }, { - 'minValue': '175', - 'maxValue': '185', + 'minValue': '-5', + 'maxValue': '5', 'code': '#399e38', }, { - 'minValue': '185', - 'maxValue': '189', + 'minValue': '5', + 'maxValue': '15', 'code': '#e48739', }, { - 'minValue': '189', - 'maxValue': '200', + 'minValue': '15', + 'maxValue': '50', 'code': '#b41527', }, ], @@ -57,7 +58,7 @@ var BackUp = function() { 'dials': { 'dial': [ { 'id': 'Dial1', - 'value': '180', + 'value': '0', 'borderalpha': '0', 'bgColor': '0,#aaaaaa,0', 'basewidth': '40', @@ -99,10 +100,11 @@ var BackUp = function() { $pressionTop.text(message['pressure_top']); $pressionBottom.text(message['pressure_bottom']); - $flexion.text(message['flexion']); +// $flexion.text(message['flexion']); if (message['angle_x']) { angle = parseInt(message['angle_x'], 10) + 90; + console.log('angle: ' + angle); ref = FusionCharts.getObjectReference('chart'); @@ -110,8 +112,19 @@ var BackUp = function() { $angleX.text(angle); } - $angleY.text(message['angle_y']); - $angleZ.text(message['angle_z']); + if (message['pressure_top']) { + pressure_top = parseInt(message['pressure_top'], 10); + } + if (message['pressure_bottom']) { + pressure_bottom = parseInt(message['pressure_bottom'], 10); + } + + console.log(pressure_top); + if (pressure_top < 900) { + $notification.show(); + } else { + $notification.hide(); + } }; }; }; |