]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
CTS-Bugfix: Unsorted drop down lists, Renamed bits of peripheral trigger inputs to...
authorManuel Penschuck <manuel.penschuck@stud.uni-frankfurt.de>
Mon, 19 May 2014 11:37:05 +0000 (13:37 +0200)
committerManuel Penschuck <manuel.penschuck@stud.uni-frankfurt.de>
Mon, 19 May 2014 11:40:13 +0000 (13:40 +0200)
web/htdocs/scripts/cts.js

index 4ad92bdea7fbaaddc37d3ab14905a0033d94faab..838ef588e95fb8d88a963b423a4d171a012285ea 100644 (file)
@@ -127,14 +127,9 @@ var CTS = new Class({
       (new Request.JSON({
          url: '/cts/cts.pl?write,' + arrValues.join(','),
          onSuccess: function(json, text) {
-            console.log(json)
-            console.log(text)
-            
             if (!json) {
                var m = text.match(/<pre>(.*)<\/pre>/i);
                
-               console.log(m)
-               
                if (m) alert("Server send error response:\n"+m[1]);
                else  alert("An unknown error occured while writing register");
             }
@@ -393,7 +388,7 @@ var CTS = new Class({
 
          e.set('title',
             s.exp + ': Address ' + formatAddress(reg._address) + bits
-            + (e.get('title') ? ' ' + e.get('title') : '')
+            + (e.get('title') ? ' \n' + e.get('title') : '')
          );
       }.bind(this));
    },
@@ -465,12 +460,16 @@ var CTS = new Class({
         
          if (i >= source_from) {
             var en = this.defs.registers[areg]._defs.input.enum;
+            keys = Object.keys(en);
+            keys.sort(function(a,b) {return parseInt(a)-parseInt(b)});
+            
             source.adopt(
                new Element('select', {'class': 'autocommit autoupdate', 'slice': areg + '.input'})
                .adopt(
-                  Object.values(en).map(function (r) {
-                  return new Element('option', {'value': r, 'text': this.translateName('addon-input-multiplexer', r, r)})
-               }, this))
+                  keys.map(function (k) {
+                     return new Element('option', {'value': en[k], 'text': this.translateName('addon-input-multiplexer', en[k], en[k])})
+                  }, this)
+               )
             );
          } else {
             source.set('text', 'hard wired');
@@ -489,11 +488,13 @@ var CTS = new Class({
          var reg = 'trg_addon_output_mux' + i;
          var en = this.defs.registers[reg]._defs.input.enum;
          var name = this.defs.properties['trg_addon_output_mux_names'][i];
-         
+         keys = Object.keys(en);
+         keys.sort(function(a,b) {return parseInt(a)-parseInt(b)});
+
          con.adopt(new Element('div', {'class': 'mux-container'}).adopt([
             new Element('label', {'for': 'out-mux-input' + i, 'text': this.translateName('addout-output-multiplexer', name, name)+": "}),
             new Element('select', {'id':  'out-mux-input' + i, 'slice': reg + '.input', 'class': 'autocommit autoupdate'}).adopt(
-               Object.values(en).map(function (r) {return new Element('option', {'value': r, 'text': r})})
+               keys.map(function (k) {return new Element('option', {'value': en[k], 'text': en[k]})})
             )
          ]));
       }
@@ -508,9 +509,15 @@ var CTS = new Class({
       var row, header;
       tab.adopt(header = new Element('tr', {'class': 'snd_header'}));
       header.adopt(new Element('td'));
-      for(var f=0; f < 4; f++)
-         for(var i=4; i>=0; i--)
-            header.adopt(new Element('td', {'text': 6+i, 'class': 'slice' + i}));
+      for(var f=0; f < 4; f++) {
+         for(var i=4; i>=0; i--) {
+            header.adopt(
+               new Element('td', {'class': 'slice' + i}).adopt(
+                  new Element('abbr', {'text': i-1, 'title': 'mapped to FPGA' + (f+1) + '_COMM(' + (i+6) + ')' + (i?'': ' - not accessible by most frontends')})
+               )
+            );
+         }
+      }
       
       for(var pt=0; pt < this.defs.properties['trg_periph_count']; pt++) {
          tab.adopt(row = new Element('tr', {'class': pt%2?'':'alt', 'flashgroup': 'itc-' + (pt + parseInt(this.defs.properties.trg_periph_itc_base))} ))
@@ -519,7 +526,9 @@ var CTS = new Class({
          for(var f=0; f<4; f++) {
             for(var i=4; i>=0; i--) {
                var bit = (5*f + i);
-                  row.adopt(new Element('td', {'class': 'slice' + i}).adopt(new Element('input', {'class': 'autoupdate autocommit', 'type': 'checkbox',
+                  row.adopt(new Element('td', {'class': 'slice' + i}).adopt(new Element('input', {
+                     'class': 'autoupdate autocommit', 'type': 'checkbox',
+                     'title': 'mapped to FPGA' + (f+1) + '_COMM(' + (i+6) + ')',
                      'slice': 'trg_periph_config' + pt + '.mask[' + bit + ']'})));
             }
          }
@@ -793,8 +802,6 @@ function timestamp2Date(ts) {
    
 
 function requestFailure(obj){
-   console.log(obj);
-   
    var text = (obj.responseText) ? obj.responseText : obj;
    var m = text.match(/<pre>([\s\S]*)<\/pre>/im);
    
@@ -919,7 +926,7 @@ var GuiExpander = new Class({
                             
       this.boxes.each(function(b) {
          var id = b.get('id');
-         if (!id) {console.debug("Expandable Box without ID!"); return;}
+         if (!id) {if (console) console.debug("Expandable Box without ID!"); return;}
          this[states[id] || b.hasClass('expanded') ? 'expand' : 'collapse'](b, true);