Changeset 17728


Ignore:
Timestamp:
04/29/14 16:16:51 (11 years ago)
Author:
tbretz
Message:
Added marker for selected pixel; added runinfo and trigger info; updated position of autocomplete dialog
Location:
trunk/FACT++/www/viewer
Files:
2 edited

Legend:

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

    r17723 r17728  
    119119      <pre style="color:green" id="console"></pre>
    120120   </div>
     121   <h3><a href="#">Run info</a></h3>
     122   <div>
     123      <pre id="runinfo"></pre>
     124   </div>
    121125   <h3><a href="#">Debug</a></h3>
    122126   <div id="debug">
     
    159163   <table width="100%">
    160164      <colgroup>
    161          <col style="width:50%;">
    162          <col style="width:50%;">
     165         <col style="width:40%;">
     166         <col style="width:20%;">
     167         <col style="width:40%;">
    163168      </colgroup>
    164169      <tr>
     
    175180               <input id="cameramaxon1" type="checkbox" onclick="onCameraMinMaxOn(1);" checked="true"></input>
    176181            </span>
     182         </td>
     183         <td style="text-align:center" id="eventinfo">
    177184         </td>
    178185         <td style="text-align:right">
     
    233240         </td>
    234241         <td style="text-align:center;">
    235             Pixel value:
    236             <input id="value" type="text" readonly="true"  value="0" style="text-align:right;width:100px"></input>
     242            <input id="marker" type="checkbox" checked="true" onclick="onMarker();">Show pixel marker</input>
     243            <!--Pixel value:
     244            <input id="value" type="text" readonly="true"  value="0" style="text-align:right;width:100px"></input>-->
    237245         </td>
    238246         <td style="text-align:right">
     
    323331The environment provides a global object (namesapce) called $ with the following members:
    324332<table>
     333<tr><td>$.file.numEvents</td><td>Number of events in the file</td></tr>
     334<tr><td>$.file.runStart</td><td>MJD of run start minus 40587 (unix time in days)</td></tr>
     335<tr><td>$.file.runEnd</td><td>MJD of run end minus 40587 (unix time in days)</td></tr>
     336<tr><td>$.file.drsFile</td><td>If this is a DRS calibration file, the step id, otherwise -1</td></tr>
    325337<tr><td>$.event</td><td>The event header information as obtained from the file</td></tr>
    326 <tr><td>$.event.numEvents</td><td>Number of events in the file</td></tr>
    327338<tr><td>$.event.numRoi</td><td>Number of samples per pixel</td></tr>
    328339<tr><td>$.event.numPix</td><td>Number of pixels</td></tr>
     
    330341<tr><td>$.event.triggerNumber</td><td>Trigger number</td></tr>
    331342<tr><td>$.event.triggerType</td><td>Trigger type</td></tr>
     343<tr><td>$.event.trigger</td><td>Decoded trigger information</td></tr>
    332344<tr><td>$.event.unixTime[2]</td><td>Timestamp when the event arrived at the event builder</td></tr>
    333 <tr><td>$.data[numPix][numRoi]</td><td>Theevent data</td></tr>
     345<tr><td>$.data[numPix][numRoi]</td><td>The event data</td></tr>
     346<tr><td>$.nroi</td><td>Shortcut to $.event.numRoi</td></tr>
     347<tr><td>$.npix</td><td>Shortcut to $.event.numPix</td></tr>
     348<tr><td>$.trigger</td><td>Shortcut to $.event.trigger</td></tr>
     349<tr><td>$.neighbors</td><td>Array of 1440 arrays each containing the corresponding neighbors</td></tr>
    334350</table>
    335351
  • trunk/FACT++/www/viewer/index.js

    r17721 r17728  
    264264    }
    265265
    266     $("#file").autocomplete({source: rc, select: onFileSelect} );
     266    var opts =
     267    {
     268        source: rc,
     269        select: onFileSelect,
     270        position: { my: "right top", at: "right bottom", collision: "flipfit" },
     271    };
     272
     273    $("#file").autocomplete(opts);
    267274    document.getElementById("file").value = "2014/04/17-181";
    268275
     
    313320    if (document.getElementById("cameramaxon"+n).checked)
    314321        document.getElementById("cameramax"+n).value = canv.max;
    315 
    316     onCameraMinMax(n);
    317322}
    318323
     
    338343    }
    339344
    340     document.getElementById("event").max = rc.event.numEvents;
     345    var evt = rc.event;
     346    var file = rc.file;
     347
     348    document.getElementById("event").max = file.numEvents;
    341349    var el = document.getElementById("numevents");
    342350    if (el.firstChild)
    343351        el.removeChild(el.firstChild);
    344     el.appendChild(document.createTextNode(rc.event.numEvents));
     352    el.appendChild(document.createTextNode(file.numEvents));
     353
     354    var infotxt = "<pre>";
     355    infotxt += "\nStart time: "+new Date(file.runStart*24*3600*1000).toUTCString();
     356    infotxt += "\nEnd   time: "+new Date(file.runEnd*24*3600*1000).toUTCString();
     357    infotxt += "\nRun   type: "+file.runType;
     358    if (file.drsFile>=0)
     359        infotxt += " [drs-step "+file.drsFile+"]";
     360
     361    $("#runinfo").html(infotxt);
     362    $("#eventinfo").html("Trigger: "+evt.trigger.join(' | ')+" [0x"+evt.triggerType.toString(16)+"]");
    345363
    346364    if (rc.ret)
     
    397415    }
    398416
    399     if (canv.dataAbs && rc.event)
    400         document.getElementById("value").value = canv.dataAbs[rc.event.pixel];
     417    // We have to redraw all of them to display the changed pixel value
     418    onCameraMinMax(1);
     419    onCameraMinMax(2);
     420    onCameraMinMax(3);
     421    onCameraMinMax(4);
     422
     423    //if (canv.dataAbs && evt)
     424    //    document.getElementById("value").value = canv.dataAbs[evt.pixel];
    401425
    402426    debug("Total time = "+(rc.timePhp*1000).toFixed(1)+" ms");
     
    411435        var min = [];
    412436        var max = [];
    413         if (Array.isArray(rc.waveform) && rc.waveform.length==rc.event.numRoi)
     437        if (Array.isArray(rc.waveform) && rc.waveform.length==evt.numRoi)
    414438        {
    415439            min.push(Math.min.apply(Math, rc.waveform));
    416440            max.push(Math.max.apply(Math, rc.waveform));
    417441
    418             for (var i=0; i<rc.event.numRoi; i++)
     442            for (var i=0; i<evt.numRoi; i++)
    419443                data[0][i] = [ i, rc.waveform[i] ];
    420444        }
     
    424448            var ref = rc.waveform[j];
    425449
    426             if (Array.isArray(ref) && ref.length==rc.event.numRoi)
     450            if (Array.isArray(ref) && ref.length==evt.numRoi)
    427451            {
    428452                min.push(Math.min.apply(Math, ref));
    429453                max.push(Math.max.apply(Math, ref));
    430454
    431                 for (var i=0; i<rc.event.numRoi; i++)
     455                for (var i=0; i<evt.numRoi; i++)
    432456                    data[j][i] = [ i, ref[i] ];
    433457
     
    438462        waveform.ymax = Math.max.apply(Math, max);
    439463        waveform.xmin = 0;
    440         waveform.xmax = rc.event.numRoi;
     464        waveform.xmax = evt.numRoi;
    441465
    442466        if (document.getElementById("waveformminon").checked)
     
    574598}
    575599
     600function onMarker()
     601{
     602    drawFullCam("camera1");
     603    drawFullCam("camera2");
     604    drawFullCam("camera3");
     605    drawFullCam("camera4");
     606}
     607
    576608function onEvent()
    577609{
     
    883915// ================================== Pixel mapping =================================================
    884916
    885 var codedMap = "966676:6:A;68656364626Y?\\?;A=A<AGADAN4K4i5g5h5o506W?Z?]?_?>A@A?AJAIAFACAM4J4H4f5d5e5l5m5n516X?[?^?N?P?AA1ABAVAUAKAHAEAO4L4I4G4E4c5a5b5M6j5k5V6Y6\\6_6G?J?O?Q?S?2A4A3AYAXAWAbA_AnAkAhA3404F4D4B4`5^5_5J6K6L6S6T6W6Z6]6E?H?K?M?R?T?V?5A7A6A\\A[AZAeAdAaA^AmAjAgA24o3m3C4A4?4]5[5\\5G6H6I6P6Q6R6U6X6[6^6F?I?L?<?>?U?;@=@8Ah@9AMALA]ABCACfAcA`AoAlAiA4414n3l3<4@4>425Z5X5Y5D6E6F698N6O608E8H8K8H>K>N>?>B>=???A?<@>@@@i@k@j@PAOANAECDCCC<C9CZCWCTC=3:3734313=4;4943515o4W5U5V5A6B6C6687888m7n7C8F8I8F>I>L>=>@>C>E>@?B?D??@A@C@l@n@m@SARAQAHCGCFC?C>C;C8CYCVCSC<393633303n2:4846405n4l4T5R5S5>6?6@6384858j7k7l7o7D8G8J8G>J>M>>>A>D>4>6>C?3?5?B@2@4@o@_@0ALBKBTA0CoBIC8D7D@C=C:C[CXCUC>3;3835323o2m2k27454j3m4k4i4Q5O5P5C7<6=6g71828o8h7i7S9<8?8B8Q>T>W>@=C=F=e<h<5>7>9>4?6?8?3@5@7@`@b@a@OBNBMB3C2C1C;D:D9D_D\\DQCNCKCF3C3@3>2;282Z1W1l2j2h2k3i3g3j4h4f4N5L5M5@7A7B7d7e7f7l8m8n8P9Q9:8=8@8O>R>U>>=A=D=c<f<i<k<8>:><>7?9?;?6@8@:@c@e@d@RBQBPB6C5C4C>D=D<DbDaD^D[DPCMCJCE3B3?3=2:272Y1V1T1i2g2e2h3f3d3g4e4c4K5I5J5=7>7?7a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E6E;F8F5F`E]EZEiEfEcEQ0N0K0H0E0B0m0k0j0Y0W0U0=1;191W2U2S2V3T3R3U4S4Q4B5@5A5k6l6m6O7P7Q7W8X8Y8;9<9=9_9`9a9j9k9\\:_:f:i:l:K:N:Q:T:W:Z:\\;_;b;S;V;Y;C<E<G<<<m;k;1<2<O<Q<S<i=[=P=h>X>Z>g?M@O@R@U@S@J@I@AB1B0BeBTB\\CmCAD@DQDiDhD5EdD<E4F2F0F=F:F7FbE_E\\EkEhEeES0P0M0J0G0D011o0h0g0e0V0T0`0:181Q2T2R2H2S3Q3P3R4P4K3?5=5>5c6i6j6h6M7N7L7U8V8T899:9W9]9^9\\9g9h9i9]:`:c:5;2;o:>;;;8;P;M;J;G;D;A;?<A<D<F<=<><n;o;3<5<R<T<Y=Z=Q=R=Y>[>\\>^>P@T@L@K@5B4B3B2BVBUB^C]CCDBDkDjDfDeD>E=E3F1FnElE@FCFFFIFLFOF;0>0A0205080513101i0f0d0c0b0_0I1H1D1P2O2G2F2D2O3N3M3J3H3a6b6e6f6g6I7J7K7R8S8397989V9Y9Z9[9f9^:a:d:4;1;n:=;:;7;O;L;I;F;C;@;@<B<0<4<U<V<X<`=]=\\=S=U=W=]>_>`>8B7B6BZBXBWB_CaC`CFDEDDDlDgDoEmE>FAFDFGFJFMF90<0?0003060714121a0^0]0G1C1B1N2L2E2C2B2@2L3I3`6d6E7F7G7H7O8Q8192969T9U9X96;3;0;?;<;9;Q;N;K;H;E;B;W<Y<^=_=a=T=V=X=\\B[BYBdCcCbCHDGD?FBFEFHFKFNF:0=0@0104070F1E1A1M2K2J2I2A2D7L8M8N8P809495961b:";
    886917var map = new Array(1440);
    887918
    888 // first: decode the pixel mapping!
    889 var sum = 1036080;
    890 for (var i=0; i<1440; i++)
    891 {
    892     var d0 = codedMap.charCodeAt(i*2)  -48;
    893     var d1 = codedMap.charCodeAt(i*2+1)-48;
    894 
    895     map[i] = d0 | (d1<<6);
    896     sum -= map[i];
    897 }
    898 if (sum!=0)
    899     alert("Pixel mapping table corrupted!");
     919function initPixelMap()
     920{
     921    var codedMap = "966676:6:A;68656364626Y?\\?;A=A<AGADAN4K4i5g5h5o506W?Z?]?_?>A@A?AJAIAFACAM4J4H4f5d5e5l5m5n516X?[?^?N?P?AA1ABAVAUAKAHAEAO4L4I4G4E4c5a5b5M6j5k5V6Y6\\6_6G?J?O?Q?S?2A4A3AYAXAWAbA_AnAkAhA3404F4D4B4`5^5_5J6K6L6S6T6W6Z6]6E?H?K?M?R?T?V?5A7A6A\\A[AZAeAdAaA^AmAjAgA24o3m3C4A4?4]5[5\\5G6H6I6P6Q6R6U6X6[6^6F?I?L?<?>?U?;@=@8Ah@9AMALA]ABCACfAcA`AoAlAiA4414n3l3<4@4>425Z5X5Y5D6E6F698N6O608E8H8K8H>K>N>?>B>=???A?<@>@@@i@k@j@PAOANAECDCCC<C9CZCWCTC=3:3734313=4;4943515o4W5U5V5A6B6C6687888m7n7C8F8I8F>I>L>=>@>C>E>@?B?D??@A@C@l@n@m@SARAQAHCGCFC?C>C;C8CYCVCSC<393633303n2:4846405n4l4T5R5S5>6?6@6384858j7k7l7o7D8G8J8G>J>M>>>A>D>4>6>C?3?5?B@2@4@o@_@0ALBKBTA0CoBIC8D7D@C=C:C[CXCUC>3;3835323o2m2k27454j3m4k4i4Q5O5P5C7<6=6g71828o8h7i7S9<8?8B8Q>T>W>@=C=F=e<h<5>7>9>4?6?8?3@5@7@`@b@a@OBNBMB3C2C1C;D:D9D_D\\DQCNCKCF3C3@3>2;282Z1W1l2j2h2k3i3g3j4h4f4N5L5M5@7A7B7d7e7f7l8m8n8P9Q9:8=8@8O>R>U>>=A=D=c<f<i<k<8>:><>7?9?;?6@8@:@c@e@d@RBQBPB6C5C4C>D=D<DbDaD^D[DPCMCJCE3B3?3=2:272Y1V1T1i2g2e2h3f3d3g4e4c4K5I5J5=7>7?7a7b7c7i8j8k8M9N9O9R9;8>8A8P>S>V>?=B=E=d<g<j<Z<\\<;>k=m=:?j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3T3R3U4S4Q4B5@5A5k6l6m6O7P7Q7W8X8Y8;9<9=9_9`9a9j9k9\\:_:f:i:l:K:N:Q:T:W:Z:\\;_;b;S;V;Y;C<E<G<<<m;k;1<2<O<Q<S<i=[=P=h>X>Z>g?M@O@R@U@S@J@I@AB1B0BeBTB\\CmCAD@DQDiDhD5EdD<E4F2F0F=F:F7FbE_E\\EkEhEeES0P0M0J0G0D011o0h0g0e0V0T0`0:181Q2T2R2H2S3Q3P3R4P4K3?5=5>5c6i6j6h6M7N7L7U8V8T899:9W9]9^9\\9g9h9i9]:`:c:5;2;o:>;;;8;P;M;J;G;D;A;?<A<D<F<=<><n;o;3<5<R<T<Y=Z=Q=R=Y>[>\\>^>P@T@L@K@5B4B3B2BVBUB^C]CCDBDkDjDfDeD>E=E3F1FnElE@FCFFFIFLFOF;0>0A0205080513101i0f0d0c0b0_0I1H1D1P2O2G2F2D2O3N3M3J3H3a6b6e6f6g6I7J7K7R8S8397989V9Y9Z9[9f9^:a:d:4;1;n:=;:;7;O;L;I;F;C;@;@<B<0<4<U<V<X<`=]=\\=S=U=W=]>_>`>8B7B6BZBXBWB_CaC`CFDEDDDlDgDoEmE>FAFDFGFJFMF90<0?0003060714121a0^0]0G1C1B1N2L2E2C2B2@2L3I3`6d6E7F7G7H7O8Q8192969T9U9X96;3;0;?;<;9;Q;N;K;H;E;B;W<Y<^=_=a=T=V=X=\\B[BYBdCcCbCHDGD?FBFEFHFKFNF:0=0@0104070F1E1A1M2K2J2I2A2D7L8M8N8P809495961b:";
     922    // first: decode the pixel mapping!
     923    var sum = 1036080;
     924    for (var i=0; i<1440; i++)
     925    {
     926        var d0 = codedMap.charCodeAt(i*2)  -48;
     927        var d1 = codedMap.charCodeAt(i*2+1)-48;
     928
     929        map[i] = d0 | (d1<<6);
     930        sum -= map[i];
     931    }
     932    if (sum!=0)
     933        alert("Pixel mapping table corrupted!");
     934}
     935
     936initPixelMap();
    900937
    901938// ================================== Camera Display ================================================
     939
     940var coord = new Array(1440);
     941function initCameraCoordinates()
     942{
     943    coord[0] = [0, 0];
     944    var cnt = 1;
     945    for (var ring=1; ring<24; ring++)
     946    {
     947        for (var s=0; s<6; s++)
     948        {
     949            for (var i=1; i<=ring; i++)
     950            {
     951                var pos = new Position(s, ring, i);
     952                if (pos.d() - pos.x > 395.75)
     953                    continue;
     954
     955                coord[cnt++] = [ pos.x, pos.y];
     956            }
     957        }
     958    }
     959
     960    coord[1438] = [7, -22];
     961    coord[1439] = [7,  22];
     962}
     963
     964initCameraCoordinates();
    902965
    903966function hueToRGB(hue)
     
    9391002}
    9401003
    941 function drawHex(ctx, x, y, col, min, max)
    942 {
    943     if (col===undefined || col===null)
    944         return;
    945 
    946     var lvl = (col-min)/(max-min);
    947 
    948     ctx.fillStyle = "#"+HLStoRGB(lvl);
    949 
    950     ctx.save();
    951 
    952     ctx.translate(x, y);
     1004function outlineHex(ctx)
     1005{
    9531006    ctx.scale(1/2, 1/3);
    9541007
     
    9601013    ctx.lineTo( 0, -2);
    9611014    ctx.lineTo( 1, -1);
     1015    ctx.lineTo( 1,  1);
     1016}
     1017
     1018function drawHex(ctx, x, y, col, min, max)
     1019{
     1020    if (col===undefined || col===null)
     1021        return;
     1022
     1023    var lvl = (col-min)/(max-min);
     1024
     1025    ctx.fillStyle = "#"+HLStoRGB(lvl);
     1026
     1027    ctx.save();
     1028    ctx.translate(x, y);
     1029    outlineHex(ctx);
    9621030    ctx.fill();
    963 
    9641031    ctx.restore();
    9651032}
     
    9791046}
    9801047
     1048var positions = [ ];
     1049
     1050
    9811051function drawFullCam(id)
    9821052{
     
    9941064    if (!data)
    9951065        return;
     1066
     1067    var pixel = document.getElementById('pixel').value;
    9961068
    9971069    var min = (canv.zmin-canv.min)/canv.max;
     
    10101082    ctx.translate(-0.5, 0);
    10111083
    1012     drawHex(ctx, 0, 0, data[map[0]], min, max);
    1013 
    1014     var cnt = 1;
    1015     for (var ring=1; ring<24; ring++)
    1016     {
    1017         for (var s=0; s<6; s++)
    1018         {
    1019             for (var i=1; i<=ring; i++)
    1020             {
    1021                 var pos = new Position(s, ring, i);
    1022                 if (pos.d() - pos.x > 395.75)
    1023                     continue;
    1024 
    1025                 drawHex(ctx, pos.x, pos.y, data[map[cnt]], min, max);
    1026                 cnt++;
    1027             }
    1028         }
    1029     }
    1030 
    1031     drawHex(ctx, 7, -22, data[map[1438]], min, max);
    1032     drawHex(ctx, 7,  22, data[map[1439]], min, max);
     1084    for (var i=0; i<1440; i++)
     1085        drawHex(ctx, coord[i][0], coord[i][1], data[map[i]], min, max);
     1086
     1087    if (document.getElementById('marker').checked)
     1088    {
     1089        // Draw marker
     1090        ctx.save();
     1091
     1092        ctx.lineWidth = 0.25;
     1093        ctx.fillStyle = "#000";
     1094
     1095        ctx.translate(coord[pixel][0], coord[pixel][1]);
     1096        outlineHex(ctx);
     1097        ctx.stroke();
     1098
     1099        ctx.restore();
     1100    }
    10331101
    10341102    ctx.restore();
     
    10361104    // ======================= Draw Legend ======================
    10371105
     1106    var pval = canv.dataAbs[pixel].toFixed(1);
    10381107    var lmin = parseFloat(canv.min).toFixed(1);
    10391108    var lmax = parseFloat(canv.max).toFixed(1);
     
    10581127
    10591128    var mw = Math.max(ctx.measureText(lmin).width,
     1129                      ctx.measureText(pval).width,
    10601130                      ctx.measureText(lmax).width);
    10611131
     
    10631133    ctx.strokeStyle  = "#000";
    10641134
    1065     //ctx.strokeText(min, 5+mw, 5+24);
    1066     ctx.strokeText(lmin, 5+mw, 5+12);
    1067     ctx.strokeText(lmax, 5+mw, 5);
    1068 }
    1069 
     1135    ctx.strokeText(lmax, 5+mw, 5+24);
     1136    ctx.strokeText(pval, 5+mw, 5+12);
     1137    ctx.strokeText(lmin, 5+mw, 5);
     1138}
     1139
Note: See TracChangeset for help on using the changeset viewer.