Browse Source

fixed attribute checking error.

Signed-off-by: nicolaisi <nicholas.jerome@kit.edu>
nicolaisi 7 years ago
parent
commit
ebb60460bc
3 changed files with 4 additions and 533 deletions
  1. 1 0
      .gitignore
  2. 3 7
      status.html
  3. 0 526
      style.yaml

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 config.yaml
 cache.yaml
+style.yaml
 .tmp.yaml
 *.yaml
 backup

+ 3 - 7
status.html

@@ -135,13 +135,11 @@ function myTimer() {
       			}
 		    } else if (data_type == "integer-to-string") {
                         var dict_attr = JSON.parse($("#" + key).attr('data-dict'));
-                        //var dict_cond = {}; 
                         var dict_cond;
-                        var attr = $("#" + key).attr('data-cond');
-                        if (typeof attr !== typeof undefined && attr !== false) {
-                            dict_cond = {};
-                        } else {
+                        if ($("#"+key).attr("data-cond")) {
                             dict_cond = JSON.parse($("#" + key).attr('data-cond'));
+                        } else {
+                            dict_cond = {};
                         }
                         var dict_color = "";
                         if (key in response) {
@@ -150,8 +148,6 @@ function myTimer() {
                                 dict_color = dict_cond[token];
                             }
                         }
-                        //console.log("CHECK");
-                        //console.log(response[key]);
                         $(".varval", "#" + key).css("color", dict_color);
                         $(".varval", "#" + key).text(dict_attr[response[key]]);
 		    }

+ 0 - 526
style.yaml

@@ -1,526 +0,0 @@
-311-RBY-1-5051:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: 'DPS magnet            '
-    weight: '400'
-  height: 171.11112
-  larger: ''
-  left: 23px
-  lesser: ''
-  top: 521px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '           T'
-    weight: '400'
-  width: 120.11112
-320-MOD-0-0001:
-  cond: '{"1":"","2":"","3":"","4":"","5":"","6":"", "7": "","8": ""}'
-  dict: '{"1":"Bake-Out","2":"Cool-Down","3":"Argon-Preparation","4":"Standby","5":"Standard
-    Operation","6":" Regeneration", "7": "Warm-Up","8": "CKrS Calibration"}'
-  header:
-    size: 27.3667px
-    title: 'Operation Mode           '
-    weight: bold
-  height: 133.11112
-  left: 192px
-  top: 132px
-  type: integer-to-string
-  unit:
-    size: 27.3667px
-    title: ''
-    weight: '400'
-  width: 343.11112
-320-REI-1-5103:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: 'Current:                     '
-    weight: '400'
-  height: 95.11112
-  larger: '200'
-  left: 209px
-  lesser: ''
-  top: 450px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                    A'
-    weight: '400'
-  width: 275.11112
-320-REU-8-1102:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '|                        '
-    weight: '400'
-  height: 95.11112
-  larger: '0.1'
-  left: 513px
-  lesser: ''
-  top: 389px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                       V'
-    weight: '400'
-  width: 134.11112
-320-REU-8-2102:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '|                      '
-    weight: '400'
-  height: 95.11112
-  larger: '0.1'
-  left: 501px
-  lesser: ''
-  top: 330px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                     V'
-    weight: '400'
-  width: 131.11112
-320-RLI-2-8116:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '          '
-    weight: '400'
-  height: 53.11112
-  larger: '90'
-  left: 781px
-  lesser: '10'
-  top: 141px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '         %'
-    weight: '400'
-  width: 190.11112
-320-RLI-2-9111:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '          '
-    weight: '400'
-  height: 63.11112
-  larger: '90'
-  left: 1158px
-  lesser: '10'
-  top: 347px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '         %'
-    weight: '400'
-  width: 195.11112
-320-RLI-5-0103:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '          '
-    weight: '400'
-  height: 68.11112
-  larger: '90'
-  left: 1158px
-  lesser: '10'
-  top: 171px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '         %'
-    weight: '400'
-  width: 178.11112
-320-RPI-2-8125:
-  condition: ''
-  header:
-    size: 28px
-    title: '     '
-    weight: '400'
-  height: 95.11112
-  larger: '2.5'
-  left: 779px
-  lesser: ''
-  top: 186px
-  type: data
-  unit:
-    size: 28px
-    title: '    bar'
-    weight: '400'
-  width: 142.11112
-320-RPI-9-0121:
-  condition: ''
-  header:
-    size: 28px
-    title: '     '
-    weight: '400'
-  height: 94.11112
-  larger: '2.5'
-  left: 1157px
-  lesser: ''
-  top: 401px
-  type: data
-  unit:
-    size: 28px
-    title: '    bar'
-    weight: '400'
-  width: 148.11112
-320-RTP-3-1101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                                   '
-    weight: '400'
-  height: 95.11112
-  larger: '77'
-  left: 180px
-  lesser: ''
-  top: 820px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                                  K'
-    weight: '400'
-  width: 124.11112
-320-RTP-3-6101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                                '
-    weight: '400'
-  height: 134.11112
-  larger: '77'
-  left: 1325px
-  lesser: ''
-  top: 820px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                               K'
-    weight: '400'
-  width: 121.11112
-320-RTP-3-7101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                               '
-    weight: '400'
-  height: 95.11112
-  larger: '77'
-  left: 1625px
-  lesser: ''
-  top: 818px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                              K'
-    weight: '400'
-  width: 123.11112
-320-RTP-5-0102:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '             '
-    weight: '400'
-  height: 94.11112
-  larger: '79'
-  left: 1158px
-  lesser: ''
-  top: 121px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '            K'
-    weight: '400'
-  width: 131.11112
-320-RTP-5-9107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: 'Rad. shield                    '
-    weight: '400'
-  height: 95.11112
-  larger: '100'
-  left: 488px
-  lesser: ''
-  top: -21px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                   K'
-    weight: '400'
-  width: 282.11112
-320-RTP-5-9111:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: 'Rad. shield                   '
-    weight: '400'
-  height: 172.11112
-  larger: '100'
-  left: 1799px
-  lesser: ''
-  top: 237px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                  K'
-    weight: '400'
-  width: 121.11112
-320-RTP-8-1103:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: 'Negative pole:                         '
-    weight: '400'
-  height: 95.11112
-  larger: '350'
-  left: 207px
-  lesser: ''
-  top: 389px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                        K'
-    weight: '400'
-  width: 339.11112
-320-RTP-8-2103:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: 'Positive pole:                       '
-    weight: '400'
-  height: 94.11112
-  larger: '350'
-  left: 208px
-  lesser: ''
-  top: 331px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                      K'
-    weight: '400'
-  width: 311.11112
-320-RTT-1-1107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                              '
-    weight: '400'
-  height: 94.11112
-  larger: '6'
-  left: 183px
-  lesser: ''
-  top: 642px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                             K'
-    weight: '400'
-  width: 127.11112
-320-RTT-1-2107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                             '
-    weight: '400'
-  height: 94.11112
-  larger: '6'
-  left: 454px
-  lesser: ''
-  top: 643px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                            K'
-    weight: '400'
-  width: 133.11112
-320-RTT-1-3107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                            '
-    weight: '400'
-  height: 94.11112
-  larger: '6'
-  left: 656px
-  lesser: ''
-  top: 643px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                           K'
-    weight: '400'
-  width: 121.11112
-320-RTT-1-4107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                           '
-    weight: '400'
-  height: 94.11112
-  larger: '6'
-  left: 843px
-  lesser: ''
-  top: 642px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                          K'
-    weight: '400'
-  width: 120.11112
-320-RTT-1-5107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                           '
-    weight: '400'
-  height: 94.11112
-  larger: '6'
-  left: 1044px
-  lesser: ''
-  top: 641px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                          K'
-    weight: '400'
-  width: 140.11112
-320-RTT-1-6108:
-  condition: ''
-  header:
-    size: 28px
-    title: '   '
-    weight: '400'
-  height: 61.11112
-  larger: '6'
-  left: 1336px
-  lesser: ''
-  top: 644px
-  type: data
-  unit:
-    size: 28px
-    title: '  K'
-    weight: '400'
-  width: 120.11112
-320-RTT-1-7107:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                          '
-    weight: '400'
-  height: 94.11112
-  larger: '6'
-  left: 1632px
-  lesser: ''
-  top: 643px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                         K'
-    weight: '400'
-  width: 122.11112
-320-RTT-2-8115:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                  '
-    weight: '400'
-  height: 63.11112
-  larger: '6.5'
-  left: 782px
-  lesser: ''
-  top: 95px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                 K'
-    weight: '400'
-  width: 143.11112
-320-RTY-3-2101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                                   '
-    weight: '400'
-  height: 94.11112
-  larger: '4.5'
-  left: 455px
-  lesser: ''
-  top: 823px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                                  K'
-    weight: '400'
-  width: 118.11112
-320-RTY-3-3101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                                   '
-    weight: '400'
-  height: 94.11112
-  larger: '4.5'
-  left: 658px
-  lesser: ''
-  top: 823px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                                  K'
-    weight: '400'
-  width: 121.11112
-320-RTY-3-4101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                                  '
-    weight: '400'
-  height: 134.11112
-  larger: '4.5'
-  left: 854px
-  lesser: ''
-  top: 821px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                                 K'
-    weight: '400'
-  width: 113.11112
-320-RTY-3-5101:
-  condition: ''
-  header:
-    size: 27.3667px
-    title: '                                 '
-    weight: '400'
-  height: 94.11112
-  larger: '4.5'
-  left: 1045px
-  lesser: ''
-  top: 821px
-  type: data
-  unit:
-    size: 27.3667px
-    title: '                                K'
-    weight: '400'
-  width: 101.11112
-411-REI-1-1110-0030:
-  cond: ''
-  dict: '{"0":"off","1":"on"}'
-  header:
-    size: 27.3667px
-    title: 'PS magnet            '
-    weight: '400'
-  height: 133.11112
-  left: 1800px
-  top: 513px
-  type: integer-to-string
-  unit:
-    size: 27.3667px
-    title: ''
-    weight: '400'
-  width: 154.11112