diff --git a/door.php b/door.php new file mode 100644 index 0000000000000000000000000000000000000000..5c9faf7ba3b049268001a452695da751f1ca5f86 --- /dev/null +++ b/door.php @@ -0,0 +1,41 @@ +<?php + $debug = false; + if (!isset($_REQUEST['debug'])) header('Content-type: application/json; charset=utf-8'); + $machine = empty($_REQUEST['machine'])? 'elettra': $_REQUEST['machine']; + if (isset($_REQUEST['src']) && strpos($machine, 'elettra')!==false) die('{"sr":["A2","A3","E4","E5","T1", "I2D", "DR_BRG"],'. + '"booster":["","","","A1","DR_A4.1","DR_A5.1","DR_A6.1","DR_A6.2","A0","DR_CS4.2","DR_CS4.1","DR_A10.1","DR_A8.1","DR_A12.1","DR_R3.1","DR_R3.2","DR_BSA3.1","DR_BSA4.1","DR_BSA1.1","DR_R"]}'); + $src = "srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/accessi/pss"; + $bsrc = "srv-tango-sre-01.ecs.elettra.trieste.it:20000/booster/accessi/plc_accessi"; + $d = file_get_contents("http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=$src/Doors_all"); + $old = file_get_contents("http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=$src/old_Doors_all"); + $bd = file_get_contents("http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=$bsrc/Doors_all"); + $bold = file_get_contents("http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=$bsrc/old_Doors_all"); + if ($debug) {$de = json_decode($d, true);$de[$debug] = 0;$d = json_encode($de);} + die('{"sr":{"door":'.$d.',"hold":'.$old.'},"booster":{"door":'.$bd.',"hold":'.$bold.'}}'); +/* +booster +08 - A0 +03 - A1 +19 - DR_R +yard +18 - DR_BSA1.1 +16 - DR_BSA3.1 +17 - DR_BSA4.1 +roof +15 - DR_R3.2 +left +09 - DR_CS4.2 +04 - DR_A4.1 +05 - DR_A5.1 +07 - DR_A6.2 +06 - DR_A6.1 +12 - DR_A8.1 +11 - DR_A10.1 +right +10 - DR_CS4.1 +13 - DR_A12.1 +15 - DR_R3.2 +14 - DR_R3.1 + +*/ +?>