Changeset 17732
- Timestamp:
- 04/29/14 18:37:36 (11 years ago)
- Location:
- trunk/FACT++/www/viewer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/viewer/index.html
r17728 r17732 47 47 <body> 48 48 49 <div id='tooltip' style="position:absolute;display:none;border:1px solid #fdd;padding;2px;background-color:#fee;opacity:0.8"></div> 50 49 51 <div class="myaccordion" id="accordion5"> 50 52 <h3><a href="#">Editor 1 (proc)</a></h3> … … 129 131 130 132 <div class="ui-widget-content" style="background:#eee;margin-top:-10px"> 131 <input id="submit" type="button" onclick="onSubmit();" value="Submit"></input>133 <input id="submit" type="button" onclick="onSubmit();" value="Submit"></input> 132 134 <span style="float:right;white-space:nowrap;"> 133 135 Run file: … … 276 278 </div> 277 279 278 <div id='tooltip' style="position:absolute;display:none;border:1px solid #fdd;padding;2px;background-color:#fee;opacity:0.8"></div> 280 <div class="myaccordion" id="accordion6"> 281 <h3><a href="#">Additional controls</a></h3> 282 </div> 283 <div id="ctrlcontainer" class="ui-widget-content"> 284 <form id="controls" method="POST" style="margin-bottom:0"> 285 <input id="getcamera" type="button" onclick="onGetCameras();" value="Get camera data"></input> 286 <input id="getwaveform" type="button" onclick="onGetWaveforms();" value="Get waveforms"></input> 287 <input id="data" name="data" type="hidden"></input> 288 </form> 289 </div> 279 290 280 291 <div class="myaccordion" id="accordion4"> -
trunk/FACT++/www/viewer/index.js
r17728 r17732 171 171 { 172 172 $('#submit').prop('disabled', disabled); 173 $('#getcamera').prop('disabled', disabled); 174 $('#getwaveforms').prop('disabled', disabled); 173 175 $('#event').prop('disabled', disabled); 174 176 $('#pixel').prop('disabled', disabled); … … 181 183 } 182 184 185 function onGetCameras() 186 { 187 var arr = 188 [ 189 document.getElementById("camera1").dataAbs, 190 document.getElementById("camera2").dataAbs, 191 document.getElementById("camera3").dataAbs, 192 document.getElementById("camera4").dataAbs, 193 ]; 194 195 $('#controls > input[name=data]').val(JSON.stringify(arr)); 196 $('#controls').attr('action','index.php'); 197 $('#controls').submit(); 198 } 199 200 function onGetWaveforms() 201 { 202 var arr = document.getElementById("waveform").data; 203 204 $('#controls > input[name=data]').val(JSON.stringify(arr)); 205 $('#controls').attr('action','index.php'); 206 $('#controls').submit(); 207 } 208 183 209 function onReady() 184 210 { … … 224 250 setupAccordion('#accordion3', '#waveformcontainer'); 225 251 setupAccordion('#accordion4', '#helpcontainer', true); 252 setupAccordion('#accordion6', '#ctrlcontainer', true); 226 253 227 254 $("#selectfile1").on('change', onFile); … … 247 274 function onFilelistReceived(result) 248 275 { 249 var dbg = document.getElementById("debug");250 251 var pre = document.createElement("pre");252 pre.appendChild(document.createTextNode(rc));253 dbg.appendChild(pre);276 //var dbg = document.getElementById("debug"); 277 278 //var pre = document.createElement("pre"); 279 //pre.appendChild(document.createTextNode(rc)); 280 //dbg.appendChild(pre); 254 281 255 282 var rc; … … 329 356 var con = document.getElementById("console"); 330 357 331 var pre = document.createElement("pre");332 pre.appendChild(document.createTextNode(rc));333 dbg.appendChild(pre);358 //var pre = document.createElement("pre"); 359 //pre.appendChild(document.createTextNode(rc)); 360 //dbg.appendChild(pre); 334 361 335 362 try … … 392 419 con.appendChild(document.createTextNode(rc.debug)); 393 420 394 debug("return "+JSON.stringify(rc.ret));395 debug("");396 debug(" Execution times:");421 //debug("return "+JSON.stringify(rc.ret)); 422 //debug(""); 423 debug("PHP execution:"); 397 424 debug("Time Javascripts = "+(rc.timeJs[0]*1000).toFixed(2)+","+(rc.timeJs[1]*1000).toFixed(2)+","+(rc.timeJs[2]*1000).toFixed(2)+ " [ms]"); 398 425 } … … 430 457 { 431 458 var waveform = document.getElementById("waveform"); 459 waveform.data = [ ]; 432 460 433 461 var data = [[],[],[],[]]; … … 442 470 for (var i=0; i<evt.numRoi; i++) 443 471 data[0][i] = [ i, rc.waveform[i] ]; 472 473 waveform.data[0] = rc.waveform; 444 474 } 445 475 … … 456 486 data[j][i] = [ i, ref[i] ]; 457 487 488 waveform.data[j] = ref; 458 489 } 459 490 } -
trunk/FACT++/www/viewer/index.php
r17727 r17732 15 15 16 16 header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); 17 header( "Cache-Control: public"); // needed for i.e.18 header( "Content-Type: text/plain");19 header( "Content-Transfer-Encoding: Text");20 header( "Content-Disposition: attachment; filename=\"".$name."\"");17 header('Cache-Control: public'); // needed for i.e. 18 header('Content-Type: text/plain'); 19 header('Content-Transfer-Encoding: Text'); 20 header('Content-Disposition: attachment; filename="'.$name.'"'); 21 21 print($source); 22 return; 23 } 24 25 // This is a pretty weird hack because it does first convert 26 // all data to ascii (json) to print it... 27 if (isset($_POST['data'])) 28 { 29 header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); 30 header('Cache-Control: public'); // needed for i.e. 31 header('Content-Type: text/plain'); 32 header('Content-Transfer-Encoding: Text'); 33 header('Content-Disposition: attachment; filename="data.txt"'); 34 35 $json = json_decode($_POST['data']); 36 37 $n = count($json[0]); 38 $cnt = count($json); 39 40 for ($i=0; $i<$n; $i++) 41 { 42 print($i." ".$json[0][$i]); 43 44 if ($cnt>1) 45 print(" ".$json[1][$i]); 46 if ($cnt>2) 47 print(" ".$json[2][$i]); 48 if ($cnt>3) 49 print(" ".$json[3][$i]); 50 print("\n"); 51 } 22 52 return; 23 53 } … … 347 377 // Output result as JSON object 348 378 print(json_encode($rc)); 349 350 379 ?>
Note:
See TracChangeset
for help on using the changeset viewer.