From b3ba1e7c122939ea385dd0531321e824a5a7dfc9 Mon Sep 17 00:00:00 2001 From: Lucio Zambon <lucio.zambon@elettra.eu> Date: Fri, 6 Dec 2024 15:29:13 +0000 Subject: [PATCH] Add new file --- door.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 door.php diff --git a/door.php b/door.php new file mode 100644 index 0000000..5c9faf7 --- /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 + +*/ +?> -- GitLab