From f3766b48fff4569331bfaa444789105b0133c294 Mon Sep 17 00:00:00 2001 From: kanoi Date: Wed, 18 Mar 2015 04:10:45 +1100 Subject: [PATCH] php - optionally draw time key below shift key --- html/can.js | 5 +++-- pool/page_usperf.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/html/can.js b/html/can.js index 1c69bf14..a7504f93 100644 --- a/html/can.js +++ b/html/can.js @@ -36,7 +36,8 @@ var f=1; for(var i=0;i=x0;i-=(6*3600)){var n=dfmt(i);var xo=(i-x0)/(x1-x0);if(c['tkey']){gbe(c,xo,0);gln(c,xo,-0.02);gst(c);gfz(c,xo,0,0,-hi*1.5,n,'brown','center')}if(c['tlines']){gbe(c,xo,0);gln(c,xo,1);gst(c)}} +var tpos=2.7;if(c['over']){tpos=1.5} +for(var i=xhr;i>=x0;i-=(6*3600)){var n=dfmt(i);var xo=(i-x0)/(x1-x0);if(c['tkey']){gbe(c,xo,0);gln(c,xo,-0.02);gst(c);gfz(c,xo,0,0,-hi*tpos,n,'brown','center')}if(c['tlines']){gbe(c,xo,0);gln(c,xo,1);gst(c)}} glw(c,0.1); gss(c,'black'); if(c['smooth']){var xa=0,ya=0,xb=0,yb=0; @@ -49,7 +50,7 @@ gbe(c,0,y);gln(c,1,y);gst(c); var t=''+av.toFixed(2);gfz(c,1,y,1,0,t,'red','left') } function sn(i,shi){if(shi.indexOf(' Shift ')<0){return ''+(i%10)}else{return shi.replace(/.* ([a-z])[a-z]*$/,'$1')}} -function gc(c){var div=document.getElementById('can0');while(div.firstChild){div.removeChild(div.firstChild)}c['can']=document.createElement('canvas');c['can'].id='can';c['wx']=window.innerWidth;c['wy']=window.innerHeight;c['xm']=Math.round(c['wx']*0.9+0.5);c['ym']=Math.round(c['wy']*0.8+0.5);if(c['ym']>c['xm']){c['ym']=c['xm']}c['xo']=0.0;c['yo']=0.0;c['ctx']=c['can'].getContext('2d');c['ctx'].canvas.width=c['xm']+1;c['ctx'].canvas.height=c['ym']+1;div.appendChild(c['can']);div=document.getElementById('smooth');c['smooth']=(div&&div.checked);div=document.getElementById('skey');c['skey']=(div&&div.checked);div=document.getElementById('slines');c['slines']=(div&&div.checked);div=document.getElementById('tkey');c['tkey']=(div&&div.checked);div=document.getElementById('tlines');c['tlines']=(div&&div.checked);div=document.getElementById('zerob');c['zerob']=(div&&div.checked)} +function gc(c){var div=document.getElementById('can0');while(div.firstChild){div.removeChild(div.firstChild)}c['can']=document.createElement('canvas');c['can'].id='can';c['wx']=window.innerWidth;c['wy']=window.innerHeight;c['xm']=Math.round(c['wx']*0.9+0.5);c['ym']=Math.round(c['wy']*0.8+0.5);if(c['ym']>c['xm']){c['ym']=c['xm']}c['xo']=0.0;c['yo']=0.0;c['ctx']=c['can'].getContext('2d');c['ctx'].canvas.width=c['xm']+1;c['ctx'].canvas.height=c['ym']+1;div.appendChild(c['can']);div=document.getElementById('smooth');c['smooth']=(div&&div.checked);div=document.getElementById('over');c['over']=(div&&div.checked);div=document.getElementById('skey');c['skey']=(div&&div.checked);div=document.getElementById('slines');c['slines']=(div&&div.checked);div=document.getElementById('tkey');c['tkey']=(div&&div.checked);div=document.getElementById('tlines');c['tlines']=(div&&div.checked);div=document.getElementById('zerob');c['zerob']=(div&&div.checked)} function gdrw(d){var c={};gc(c); gfs(c,'white');gss(c,'#0000c0');glw(c,0.5);gbd(c); var rows=d['rows'],ymin=-1,ymax=0,xmin=-1,xmax=0; diff --git a/pool/page_usperf.php b/pool/page_usperf.php index 4c8aeed3..650df30f 100644 --- a/pool/page_usperf.php +++ b/pool/page_usperf.php @@ -20,6 +20,7 @@ function dousperf($data, $user) $pg .= ">shift lines "; $pg .= " time key "; $pg .= " time lines "; + $pg .= " key overlap "; $pg .= " smooth "; $pg .= " zero based"; $pg .= "
";