00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 function out1x1gif() {
00053 header("Content-Type: image/gif");
00054 header("Content-Length: 35\n");
00055 echo "GIF87a\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00".
00056 "\xff\xff\xff\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x4c".
00057 "\x01\x00\x3b";
00058 }
00059
00060
00061
00062
00063
00064
00065
00066 $init_pars=array(
00067 "FLIP"=>3,
00068 "COLOR"=>1,
00069 "DCM_HOR" => 1,
00070 "DCM_VERT" => 1,
00071 "BIN_HOR" => 1,
00072 "BIN_VERT" => 1,
00073 "QUALITY" => 90,
00074 "COLOR_SATURATION_BLUE" => 200 ,
00075 "COLOR_SATURATION_RED" => 200 ,
00076 "BITS" => 8,
00077 "GAMMA" => 57,
00078 "PIXEL_LOW" => 10,
00079 "PIXEL_HIGH" => 254,
00080 "EXPOS" => 100,
00081 "WOI_LEFT" => 0,
00082 "WOI_TOP" => 0,
00083 "WOI_WIDTH" => 10000,
00084 "WOI_HEIGHT" => 10000,
00085 "RSCALE" => 256,
00086 "BSCALE" => 256,
00087 "GAINR" => 512,
00088 "GAING" => 512,
00089 "GAINB" => 512,
00090 "GAINGB" => 512,
00091 "BAYER" => 4
00092 );
00093 $aexp_arr=array(
00094 "AUTOEXP_ON"=>0,
00095 "HISTWND_RWIDTH"=>0,
00096 "HISTWND_RHEIGHT"=>0,
00097 "HISTWND_RLEFT"=>0,
00098 "HISTWND_RTOP"=>0,
00099 "AUTOEXP_EXP_MAX"=>0,
00100 "AUTOEXP_OVEREXP_MAX"=>0,
00101 "AUTOEXP_S_PERCENT"=>0,
00102 "AUTOEXP_S_INDEX"=>0,
00103 "AUTOEXP_EXP"=>0,
00104 "AUTOEXP_SKIP_PMIN"=>0,
00105 "AUTOEXP_SKIP_PMAX"=>0,
00106 "AUTOEXP_SKIP_T"=>0,
00107 "HISTWND_WIDTH"=>0,
00108 "HISTWND_HEIGHT"=>0,
00109 "HISTWND_TOP"=>0,
00110 "HISTWND_LEFT"=>0
00111 );
00112
00113 $keep_pars=array(
00114 "COLOR"=>0,
00115 "TRIG"=>0
00116 );
00117
00118 $wb_thrsh=0.98;
00119 $wb_minfrac=0.01;
00120 $wb_rscale=1.0;
00121 $wb_bscale=1.0;
00122 $white_balance=false;
00123 $wbrslt=-1;
00124 $autoexp_set=false;
00125 $sleep= ($_GET["sleep"]); if ($sleep>0) sleep($sleep);
00126 $usleep= ($_GET["usleep"]); if ($usleep>0) usleep($usleep);
00127 $autoexp=elphel_get_P_value (ELPHEL_AUTOEXP_ON);
00128 $pars=array();
00129 $mode=$_GET["mode"];
00130 $keep_pars=elphel_get_P_arr($keep_pars);
00131 $timeout=500;
00132 $hist_in_thresh=0.0;
00133 $hist_out_thresh=0.0;
00134 $autoexp_get=false;
00135 $streamer_get=false;
00136 $show_written=false;
00137 $exif_get=false;
00138 $circbuf_get=false;
00139 $debug_arr=array();
00140 if ($mode=="reset") {
00141 $pars=$init_pars;
00142 $mode="set";
00143 if (elphel_get_state()>7) {
00144 if ($keep_pars["TRIG"]& 4) {
00145 elphel_set_P_value(ELPHEL_TRIG,$keep_pars["TRIG"] & ~4);
00146 elphel_program_sensor (0);
00147 }
00148 }
00149 elphel_reset_sensor();
00150 }
00151 $toRead=array();
00152
00153 foreach($_GET as $key=>$value) {
00154 switch($key) {
00156 case "_time":
00157 if (elphel_get_fpga_time() > 100000000) break;
00158 case "_stime":
00159 $a=((float) $value)/1000;
00160 elphel_set_fpga_time ($a);
00161 exec("date -s ".date("mdHiY.s",(int)$a),$out,$ret);
00162 break;
00163 case "timeout":
00164 $timeout=(int) ($value+0);
00165 case "mode":
00166 case "acquire":
00167 case "out":
00168 case "compressor":
00169 case "imgsrv":
00170
00171 break;
00172 case "color":
00173 switch ($value) {
00174 case "jp4": $value=2; break;
00175 case "color":$value=1; break;
00176 case "mono": $value=0; break;
00177 }
00178 $keep_pars["COLOR"]=$pars["COLOR"]=((integer) $value) | ($keep_pars["COLOR"] & ~7);
00179 break;
00180 case "test":
00181 switch ($value) {
00182 case "fpga": $value=2; break;
00183 case "sensor":$value=1; break;
00184 }
00185 $keep_pars["COLOR"]=$pars["COLOR"]=(((integer) $value) << 8) | ($keep_pars["COLOR"] & ~0x700);
00186 break;
00187 case "flip": $pars["FLIP"]= ((strpos($value,"x")===false)?0:1)+((strpos($value,"y")===false)?0:2); break;
00188 case "trig":
00189 switch ($value) {
00190 case "sync": $value=0; break;
00191 case "async": $value=4; break;
00192 }
00193 $keep_pars["TRIG"]=$pars["TRIG"]=($value? 4: 0) | ($keep_pars["TRIG"] & ~0x4);
00194 break;
00195
00196 case "gam":
00197 case "gamma":
00198 $pars["GAMMA"]=(integer) $value;
00199 break;
00200 case "pxl":
00201 case "pixel_low":
00202 $pars["PIXEL_LOW"]=(integer) $value;
00203 break;
00204 case "pxh":
00205 case "pixel_high":
00206 $pars["PIXEL_HIGH"]=(integer) $value;
00207 break;
00208 case "iq":
00209 case "quality":
00210 $pars["QUALITY"]=(integer) $value;
00211 break;
00212 case "iq":
00213 case "quality":
00214 $pars["QUALITY"]=(integer) $value;
00215 break;
00216 case "byr":
00217 case "bayer":
00218 if ($value="auto") $value=4;
00219 $pars["BAYER"]=(integer) $value;
00220 break;
00221 case "fpns":
00222 case "fpn_sub":
00223 $pars["FPNS"]=(integer) $value;
00224 break;
00225 case "fpnm":
00226 case "fpn_mpy":
00227 $pars["FPNM"]=(integer) $value;
00228 break;
00229 case "expos":
00230 case "exposure":
00231 if (is_numeric($value)) $value=$value*10000;
00232 case "e":
00233 switch ($value) {
00234 case "auto":
00235 if ($autoexp==0) {
00236 $pars["AUTOEXP_ON"]=1;
00237 $autoexp_set=true;
00238 }
00239 break;
00240 case "manual":
00241 if ($autoexp!=0) {
00242 $pars["AUTOEXP_ON"]=0;
00243 $autoexp_set=true;
00244 }
00245 break;
00246 default:
00247 $value=(integer) $value;
00248 if ($value>0) {
00249 $pars["EXPOS"]=$value;
00250 if ($autoexp!=0) {
00251 $pars["AUTOEXP_ON"]=0;
00252 $autoexp_set=true;
00253 }
00254 }
00255 }
00256 break;
00257 case "ve":
00258 $pars["VEXPOS"]=(integer) $value;
00259 break;
00260 case "vw":
00261 $pars["VIRT_WIDTH"]=(integer) $value;
00262 break;
00263 case "vh":
00264 $pars["VIRT_HEIGHT"]=(integer) $value;
00265 break;
00266 case "wl":
00267 case "left":
00268 $pars["WOI_LEFT"]=(integer) $value;
00269 break;
00270 case "wt":
00271 case "top":
00272 $pars["WOI_TOP"]=(integer) $value;
00273 break;
00274 case "ww":
00275 case "width":
00276 $pars["WOI_WIDTH"]=(integer) $value;
00277 break;
00278 case "wh":
00279 case "height":
00280 $pars["WOI_HEIGHT"]=(integer) $value;
00281 break;
00282 case "pfh":
00283 $pars["PF_HEIGHT"]=(integer) $value;
00284 break;
00285 case "fsd":
00286 case "fsync_dly":
00287 $pars["FRAMESYNC_DLY"]=(integer) $value;
00288 break;
00289 case "dh":
00290 $pars["DCM_HOR"]=(integer) $value;
00291 break;
00292 case "dv":
00293 $pars["DCM_VERT"]=(integer) $value;
00294 break;
00295 case "bh":
00296 $pars["BIN_HOR"]=(integer) $value;
00297 break;
00298 case "bv":
00299 $pars["BIN_VERT"]=(integer) $value;
00300 break;
00301 case "clk":
00302 case "shl":
00303 break;
00304 case "bit":
00305 case "bits":
00306 $pars["BITS"]=(integer) $value;
00307 break;
00308 case "gr":
00309 case "red":
00310 $pars["GAINR"]=(integer) ($value*256);
00311 break;
00312 case "gg":
00313 case "green":
00314 $pars["GAING"]=(integer) ($value*256);
00315 break;
00316 case "gb":
00317 case "blue":
00318 $pars["GAINB"]=(integer) ($value*256);
00319 break;
00320 case "ggb":
00321 case "gg2":
00322 case "green2":
00323 $pars["GAINGB"]=(integer) ($value*256);
00324 break;
00325 case "sens":
00326 case "gain":
00327 $value= (integer) ($value*256);
00328 $pars["GAINR"] = $value;
00329 $pars["GAING"] = $value;
00330 $pars["GAINB"] = $value;
00331 $pars["GAINGB"]= $value;
00332 break;
00333 case "rscale":
00334 $pars["RSCALE"]=(integer) ($value*256);
00335 break;
00336 case "bscale":
00337 $pars["BSCALE"]=(integer) ($value*256);
00338 break;
00339 case "csb":
00340 $pars["COLOR_SATURATION_BLUE"]=(integer) $value;
00341 break;
00342 case "saturation_blue":
00343 $pars["COLOR_SATURATION_BLUE"]=(integer)(100*$value);
00344 break;
00345 case "csr":
00346 $pars["COLOR_SATURATION_RED"]=(integer) $value;
00347 break;
00348 case "saturation_red":
00349 $pars["COLOR_SATURATION_RED"]=(integer)(100*$value);
00350 break;
00351 case "eol":
00352 $pars["OVERLAP"]=(integer)(100*$value);
00353 break;
00354 case "vtrig":
00355 $pars["VIRTTRIG"]=(integer)(100*$value);
00356 break;
00357 case "fclk":
00358 $pars["CLK_FPGA"]=(integer)(1000000*$value);
00359 break;
00360 case "sclk":
00361 $pars["CLK_SENSOR"]=(integer)(1000000*$value);
00362 break;
00363 case "xtra":
00364 $pars["FPGA_XTRA"]=(integer) $value;
00365 break;
00366
00367
00368
00369 case "fps":
00370 $value=(integer) (1000 *$value);
00371 $pars["FP1000SLIM"]=$value;
00372 if ($_GET["fpslm"]!==NULL) $pars["FPSFLAGS"]=(integer) $_GET["fpslm"];
00373 else $pars["FPSFLAGS"]= 1;
00374 break;
00375 case "fpslm":
00376 if ($_GET["fps"]===NULL) $pars["FPSFLAGS"]=(integer) $_GET["fpslm"];
00377 break;
00379 case "wb_thrsh":
00380 if (is_numeric ($value) && ($value > 0) && ($value <= 1)) $wb_thrsh=$value;
00381 $white_balance=true;
00382 break;
00383 case "wb_minfrac":
00384 if (is_numeric ($value) && ($value > 0) && ($value < 1)) $wb_minfrac=$value;
00385 $white_balance=true;
00386 break;
00387 case "wb_rscale":
00388 if (is_numeric ($value) && ($value >= 0.1) && ($value <= 10.1)) $wb_rscale=$value;
00389 $white_balance=true;
00390 break;
00391 case "wb_bscale":
00392 if (is_numeric ($value) && ($value >= 0.1) && ($value <= 10.1)) $wb_rscale=$value;
00393 $white_balance=true;
00394 break;
00395 case "wbalance":
00396 case "balance":
00397 $white_balance=true;
00398 break;
00399 case "aexp_get":
00400 $autoexp_get=true;
00401 break;
00403 case "aexp_on":
00404 $pars["AUTOEXP_ON"]=($value)?1:0;
00405 $autoexp_set=true;
00406 break;
00407 case "aexp_width":
00408 if ($value < 1) $value=100*$value;
00409 $pars["HISTWND_RWIDTH"]=(integer) $value;
00410 $autoexp_set=true;
00411 break;
00412 case "aexp_height":
00413 if ($value < 1) $value=100*$value;
00414 $pars["HISTWND_RHEIGHT"]=(integer) $value;
00415 $autoexp_set=true;
00416 break;
00417 case "aexp_left":
00418 if ($value < 1) $value=100*$value;
00419 $pars["HISTWND_RLEFT"]=(integer) $value;
00420 $autoexp_set=true;
00421 break;
00422 case "aexp_top":
00423 if ($value < 1) $value=100*$value;
00424 $pars["HISTWND_RTOP"]=(integer) $value;
00425 $autoexp_set=true;
00426 break;
00427 case "aexp_exp_max":
00428 if ($value < 20) $value=1000*$value;
00429 $pars["AUTOEXP_EXP_MAX"]=(integer) $value;
00430 $autoexp_set=true;
00431 break;
00432 case "aexp_overexp":
00433 if ($value < 1) $value=10000*$value;
00434 $pars["AUTOEXP_OVEREXP_MAX"]=(integer) $value;
00435 $autoexp_set=true;
00436 break;
00437 case "aexp_below":
00438 if ($value < 1) $value=10000*$value;
00439 $pars["AUTOEXP_OVEREXP_MAX"]=(integer) $value;
00440 $autoexp_set=true;
00441 break;
00442 case "aexp_threshold":
00443 case "aexp_thresh":
00444 case "aexp_index":
00445 if ($value < 1) $value=255.5*$value;
00446 $pars["AUTOEXP_S_INDEX"]=(integer) $value;
00447 $autoexp_set=true;
00448 break;
00449 case "aexp_frac":
00450 case "aexp_fraction":
00451 if ($value < 1) $value=10000*$value;
00452 $pars["AUTOEXP_S_PERCENT"]=(integer) $value;
00453 $autoexp_set=true;
00454 break;
00455
00456 case "aexp_chng_min":
00457 if ($value < 1) $value=10000*$value;
00458 $pars["AUTOEXP_SKIP_PMIN"]=(integer) $value;
00459 $autoexp_set=true;
00460 break;
00461 case "aexp_chng_minabs":
00462 $pars["AUTOEXP_SKIP_T"]=(integer) $value;
00463 $autoexp_set=true;
00464 break;
00465 case "aexp_chng_max":
00466 if ($value < 1) $value=10000*$value;
00467 $pars["AUTOEXP_SKIP_PMAX"]=(integer) $value;
00468 $autoexp_set=true;
00469 break;
00470
00471
00472
00473
00474
00475
00476
00477
00478 case "written":
00479 case "show_written":
00480 $show_written=true;
00481 break;
00482 case "streamer_get":
00483 $streamer_get=true;
00484 break;
00485 case "exif":
00486 $exif_get=$value+0;
00487 break;
00488 case "description":
00489 if ( $value!==null) elphel_set_exif_field(0x10e, $value.chr(0));
00490 break;
00491 case "circbuf":
00492 $circbuf_get=true;
00493 break;
00494 default:
00495 $toRead[$key]="";
00496 if ($value!=="") $pars[$key]=(integer) $value+0;
00497 }
00498 }
00499 $npars=elphel_set_P_arr($pars);
00500 if ($white_balance) {
00501 $wbrslt=elphel_white_balance ($wb_thrsh, $wb_minfrac, $wb_rscale, $wb_bscale);
00502 }
00503 if ($autoexp_set) {
00504 elphel_autoexposure_set();
00505 }
00507
00508 $was_running=(elphel_get_state()>7);
00509 if (($mode=="safe") && !$was_running) $mode=$set;
00510 if (($npars>0) || ($wbrslt>=0) || ($mode=="skipbad") || ($mode=="set") || ($mode=="force")){
00511 if (($mode=="skipbad") || ($mode=="set") || ($mode=="force")) {
00512 if ($was_running && !($mode=="force")) elphel_compressor_stop();
00513 if (!($mode=="force")) {
00514 for ($i=0; $i<=($timeout/50);$i++)
00515 if (!elphel_is_compressor_idle()) usleep (50000) ;
00516 else break;
00517 $debug_arr["stopping_force"]=$i;
00518 }
00519 if ($mode=="skipbad") elphel_program_sensor (1);
00520 else elphel_program_sensor (0);
00521 } else {
00522 $debug_arr["program_sensor"]=1;
00523 elphel_program_sensor (1);
00524 }
00525 }
00526
00527
00528 if (($pars["QUALITY"] !==null) &&
00529 ($pars["QUALITY"] != elphel_get_P_value (ELPHEL_QUALITY))) {
00530 if (elphel_get_state()>7) elphel_compressor_stop();
00531 for ($i=0; $i<=($timeout/50);$i++)
00532 if (!elphel_is_compressor_idle()) usleep (50000) ;
00533 else break;
00534 $debug_arr["stopping_quality"]=$i;
00535 }
00536
00537 switch ($_GET["compressor"]) {
00538 case "stop":
00539 elphel_compressor_stop();
00540 break;
00541 case "wait":
00542 while (elphel_get_state()>7) usleep (100000) ;
00543 break;
00544 case "restore":
00545 $debug_arr["was_running"]=$was_running;
00546 $debug_arr["before_restore_state"]=elphel_get_state();
00547 if ($was_running && (elphel_get_state() <=7)) elphel_compressor_run();
00548 else elphel_fpga_write (4,5);
00549 break;
00550 case "run":
00551 elphel_compressor_run();
00552 break;
00553 case "single":
00554 elphel_compressor_frame();
00555 break;
00556 case "reset":
00557
00558
00559
00560 if (elphel_get_state()>7) {
00561 if (elphel_get_P_value (ELPHEL_TRIG) & 4) {
00562 elphel_set_P_value(ELPHEL_TRIG,$keep_pars["TRIG"] & ~4);
00563 elphel_program_sensor (0);
00564 }
00565 elphel_compressor_stop();
00566 while (elphel_get_state()>7) usleep (100000) ;
00567 elphel_compressor_reset();
00568 elphel_compressor_reset();
00569
00570
00571 if ($keep_pars["TRIG"]& 4) {
00572 elphel_set_P_value(ELPHEL_TRIG,$keep_pars["TRIG"]);
00573 elphel_program_sensor (0);
00574 }
00575 }
00576 break;
00577 }
00578 if ($_GET["out"]=="gif") {
00579 out1x1gif();
00580 exit (0);
00581 }
00582 $xml = new SimpleXMLElement("<?xml version='1.0'?><pars/>");
00583 if (count($toRead)>0) $toRead=elphel_get_P_arr($toRead);
00584 if ($_GET["STATE"]!==NULL) $toRead["STATE"]=elphel_get_state();
00585 if ($_GET["imgsrv"]!==NULL) $toRead["imgsrv"]='http:
00586 foreach ($debug_arr as $key=>$value) {
00587 $xml->addChild ($key,$value);
00588 }
00589 foreach ($toRead as $key=>$value) {
00590 $xml->addChild ($key,$value);
00591 }
00592 if ($exif_get!==false) {
00593 $exif_got=elphel_get_exif_elphel($exif_get);
00594 if ($exif_got) {
00595 $xml->addChild ('Exif');
00596 $xml->Exif->addChild ("Exif_page",$exif_get);
00597 foreach ($exif_got as $key=>$value) {
00598 $xml->Exif->addChild ($key,$value);
00599 }
00600 }
00601 }
00602
00605 if ($hist_in_thresh) {
00606 $xml->addChild ('hist_in');
00607 $xml->hist_in->addChild ('hist_in_thresh',$hist_in_thresh);
00608 $xml->hist_in->addChild ('hist_in_r', elphel_histogram(0,elphel_gamma(0,$hist_in_thresh)));
00609 $xml->hist_in->addChild ('hist_in_g', elphel_histogram(1,elphel_gamma(1,$hist_in_thresh)));
00610 $xml->hist_in->addChild ('hist_in_g2',elphel_histogram(2,elphel_gamma(2,$hist_in_thresh)));
00611 $xml->hist_in->addChild ('hist_in_b', elphel_histogram(3,elphel_gamma(3,$hist_in_thresh)));
00612 }
00614 if ($hist_out_thresh) {
00615 $xml->addChild ('hist_out');
00616 $xml->hist_out->addChild ('hist_out_thresh',$hist_out_thresh);
00617 $xml->hist_out->addChild ('hist_out_r', elphel_histogram(0,$hist_out_thresh));
00618 $xml->hist_out->addChild ('hist_out_g', elphel_histogram(1,$hist_out_thresh));
00619 $xml->hist_out->addChild ('hist_out_g2',elphel_histogram(2,$hist_out_thresh));
00620 $xml->hist_out->addChild ('hist_out_b', elphel_histogram(3,$hist_out_thresh));
00621 }
00622
00624 if ($autoexp_get) {
00625 $xml->addChild ('autoexposure');
00626 elphel_autoexposure_get();
00627 $aexp_arr=elphel_get_P_arr ($aexp_arr);
00628 foreach ($aexp_arr as $key=>$value) {
00629 $xml->autoexposure->addChild ($key,$value);
00630 }
00631 }
00632
00633 if ($white_balance) {
00634 $xml->addChild ('white_balance');
00635 $xml->white_balance->addChild ('wb_thrsh', $wb_thrsh);
00636 $xml->white_balance->addChild ('wb_minfrac',$wb_minfrac);
00637 $xml->white_balance->addChild ('wb_rscale', $wb_rscale);
00638 $xml->white_balance->addChild ('wb_bscale', $wb_bscale);
00639 $xml->white_balance->addChild ('result',($rslt>=0)?"OK":"failure");
00640 if ($wbrslt>=0) {
00641 $xml->white_balance->addChild ('after');
00642 $balance_pars=elphel_get_P_arr(array("RSCALE"=>0,"BSCALE"=>0,"GSCALE"=>0));
00643 foreach ($balance_pars as $key=>$value) {
00644 $xml->white_balance->after->addChild ($key,$value);
00645 }
00646 }
00647 }
00648
00649 if ($streamer_get) {
00650 $xml->addChild ('streamer');
00651 $streamer_run=false;
00654
00655 $streamer_conf=file($streamer_run?'/var/state/streamer.conf':'/etc/streamer.conf');
00656 foreach ($streamer_conf as $line) {
00657 $conf_cmd=split('=',$line);
00658 if (trim($conf_cmd[0])=='pid') {
00659 exec ('kill -0 '.$conf_cmd[1], $outv,$retv);
00660 $streamer_run=($retv==0);
00661 } else {
00662 $xml->streamer->addChild ('S_'.trim($conf_cmd[0]),trim($conf_cmd[1]));
00663 }
00664 }
00665 $xml->streamer->addChild ('S_STREAM',$streamer_run?1:0);
00666 }
00668 if ($circbuf_get) {
00669 $xml->addChild ('circbuf');
00670 $circbuf=elphel_get_circbuf_pointers();
00671 if (is_array ($circbuf)) {
00672 $circbuf_count=count($circbuf);
00673 $xml->circbuf->addChild ('circbuf_count',$circbuf_count);
00674 for ($i=0;$i<$circbuf_count;$i++) {
00675 $xml->circbuf->addChild ('frame'.$i);
00676 $xml->circbuf->{'frame'.$i}->addChild ('circbuf_pointer',$circbuf[$i]['circbuf_pointer']);
00677 $xml->circbuf->{'frame'.$i}->addChild ('exif_pointer' ,$circbuf[$i]['exif_pointer']);
00678 }
00679 }
00680 }
00681 switch ($_GET["out"]) {
00682 case "all":
00683 $xml->addChild ('state',elphel_get_state());
00684 $xml->addChild ('FRAME',elphel_get_P_value (ELPHEL_FRAME));
00685 $xml->addChild ('TRIG',elphel_get_P_value (ELPHEL_TRIG));
00686 break;
00687 }
00688 if (count($pars)) {
00689 $xml->addChild ('pars_written');
00690 $xml->pars_written->addChild ('number_written',$npars);
00691 if ($show_written) {
00692 foreach ($pars as $key=>$value) {
00693 $xml->pars_written->addChild ($key,$value);
00694 }
00695 }
00696 }
00697
00698 $rslt=$xml->asXML();
00699 header("Content-Type: text/xml");
00700 header("Content-Length: ".strlen($rslt)."\n");
00701 header("Pragma: no-cache\n");
00702 printf($rslt);
00703
00704 ?>