Changeset 17746


Ignore:
Timestamp:
04/30/14 20:22:00 (11 years ago)
Author:
tbretz
Message:
Fixed an issue when the slected pixel had no value attached; some performance improvements; reset event number when new file is selected; if the retrurned arrays are not complete, they will be an object not an array - that should work now (however, the returning of incomplete arrays from javascript in v8js is broken so in reality it doesn't work)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/viewer/index.js

    r17742 r17746  
    272272function onFileSelect(event, ui)
    273273{
     274    document.getElementById("event").value = 0;
    274275    onSubmit(ui.item.value);
    275276}
     
    331332    var canv = document.getElementById(id);
    332333
    333     canv.dataAbs = [ ];
     334    canv.dataAbs = new Array(1440);
    334335    for (var i=0; i<1440; i++)
    335336        if (data[i]!==undefined && data[i]!==null)
     
    339340    canv.max = Math.max.apply(Math, canv.dataAbs.filter(function(e){return !isNaN(e)}));
    340341
    341     canv.dataRel = [ ];
     342    canv.dataRel = new Array(1440);
    342343    for (var i=0; i<1440; i++)
    343344        if (data[i]!==undefined && data[i]!==null)
     
    365366    try
    366367    {
    367       rc = JSON.parse(rc);
     368        rc = JSON.parse(rc);
     369        if (!rc)
     370            return;
    368371    }
    369372    catch (e)
     
    430433    if (rc.ret!==undefined && Array.isArray(rc.ret))
    431434    {
    432         if (!Array.isArray(rc.ret[0]))
     435        if (rc.ret[0] instanceof Object)
     436            processCameraData("camera1", rc.ret[0]);
     437        else
    433438            processCameraData("camera1", rc.ret);
    434         else
    435             processCameraData("camera1", rc.ret[0]);
    436439
    437440        if (rc.ret.length>1)
     
    462465        waveform.data = [ ];
    463466
    464         var data = [[],[],[],[]];
     467        var data = [
     468                    new Array(evt.numRoi),
     469                    new Array(evt.numRoi),
     470                    new Array(evt.numRoi),
     471                    new Array(evt.numRoi)
     472                    ];
    465473
    466474        var min = [];
     
    11101118}
    11111119
    1112 var positions = [ ];
     1120var positions = new Array(1440);
    11131121
    11141122
     
    11681176    // ======================= Draw Legend ======================
    11691177
    1170     var pval = canv.dataAbs[pixel].toFixed(1);
     1178    var pval = parseFloat(canv.dataAbs[map[pixel]]).toFixed(1);
    11711179    var lmin = parseFloat(canv.min).toFixed(1);
    11721180    var lmax = parseFloat(canv.max).toFixed(1);
Note: See TracChangeset for help on using the changeset viewer.