Changeset 17774
- Timestamp:
- 05/04/14 15:28:46 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/viewer/index.php
r17745 r17774 3 3 if (!extension_loaded('v8js')) 4 4 die("V8Js missing"); 5 6 $path = array( 7 "cal" => "/daq/caltest/", 8 "raw" => "/daq/raw/" 9 ); 5 10 6 11 if (isset($_POST['editor1']) || isset($_POST['editor2'])) … … 90 95 */ 91 96 92 function getList($path, $sub )97 function getList($path, $sub, $check) 93 98 { 94 99 $hasdir = false; … … 103 108 104 109 if ($file->isDir()) 105 $list = array_merge($list, getList($path, $sub."/".$name ));110 $list = array_merge($list, getList($path, $sub."/".$name, $check)); 106 111 107 112 if ($file->isFile() && $file->isReadable()) … … 112 117 $rc = substr($name, 0, 4)."/".substr($name, 4, 2)."/".substr($name, 6, 2)."-".substr($name, 9, 3); 113 118 114 array_push($list, $rc);119 $list[$rc] = array_key_exists($rc, $check); 115 120 } 116 121 } … … 121 126 try 122 127 { 123 $list = getList("/daq/raw", ""); 124 sort($list); 128 $cal = getList($path['cal'], "", array()); 129 $raw = getList($path['raw'], "", $cal); 130 ksort($raw); 125 131 } 126 132 catch (Exception $e) … … 129 135 } 130 136 131 print(json_encode($ list));137 print(json_encode($raw)); 132 138 return; 133 139 } … … 172 178 $r = substr($file, 11, 3); 173 179 174 $filename = "/daq/raw/".$y."/".$m."/".$d."/".$y.$m.$d."_".$r.".fits.fz"; 180 $rootpath = isset($_POST['calibrated']) ? $path['cal'] : $path['raw']; 181 182 $filename = $rootpath.$y."/".$m."/".$d."/".$y.$m.$d."_".$r.".fits.fz"; 175 183 176 184 if (!file_exists($filename)) … … 189 197 $fil['drsFile'] = get($file, "s"); 190 198 $fil['numEvents'] = get($file, "L"); 199 $fil['scale'] = get($file, "s"); 191 200 $evt['numRoi'] = get($file, "L"); 192 201 $evt['numPix'] = get($file, "L"); 193 202 $evt['eventNumber'] = get($file, "L"); 194 $evt['triggerNumber'] = get($file, "L");203 //$evt['triggerNumber'] = get($file, "L"); 195 204 $evt['triggerType'] = get($file, "S"); 196 205 $evt['unixTime'] = get($file, "L", 2); … … 305 314 $v8->neighbors = $neighbors; 306 315 $v8->clone = function($data) { return $data; }; 316 $v8->scale = $fil['scale']==0 ? 2000./4096. : 1./$fil['scale']; 307 317 $v8->unpack = function($i) 308 318 { 309 global $binary, $roi ;319 global $binary, $roi, $v8; 310 320 $u = unpack("s".$roi, $binary[$i]); 311 321 $arr = array(); 312 322 for ($i=0; $i<$roi; $i++) 313 $arr[$i] = $u[$i+1]* 0.48828125;323 $arr[$i] = $u[$i+1]*$v8->scale; 314 324 return $arr; 315 325 };
Note:
See TracChangeset
for help on using the changeset viewer.