Skip to content
Snippets Groups Projects
Commit 1fc43aa0 authored by Lucio Zambon's avatar Lucio Zambon
Browse files

Update updater.php

parent b551796f
No related branches found
No related tags found
No related merge requests found
......@@ -67,13 +67,15 @@ if (isset($_REQUEST['read']) && !empty($_REQUEST['filename'])) {
die("[[".$d[34].'],['.$d[35]."]]");
}
if ($_REQUEST['filename']=='sr.100.bpm.src') {
$f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s-%3EGetGofBpmNames');
// $f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s-%3EGetGofBpmNames');
$f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/DIAGNOSTICS/bpm_s(BpmLabel)');
if (isset($_REQUEST['debug'])) print_r($f);
$d = json_decode(strtr($f, [',""'=>'', '"LGBPM_S2.1","LGBPM_S2.2",'=>'', '"LGBPM_S7.1","LGBPM_S7.2",'=>'']));
// $d = json_decode(strtr($f, [',""'=>'', '"LGBPM_S2.1","LGBPM_S2.2",'=>'', '"LGBPM_S7.1","LGBPM_S7.2",'=>'']));
$d = json_decode($f, true);
$h = $v = [];
foreach ($d as $name) {
$h[] = "srv-tango-sre-01:20000/sr/feedback/$name/HorPos";
$v[] = "srv-tango-sre-01:20000/sr/feedback/$name/VerPos";
$h[] = "\"srv-tango-sre-01:20000/sr/feedback/$name/HorPos\"";
$v[] = "\"srv-tango-sre-01:20000/sr/feedback/$name/VerPos\"";
}
die('[['.implode(',', $h).'],['.implode(',', $v).']]');
}
......@@ -81,19 +83,25 @@ if (isset($_REQUEST['read']) && !empty($_REQUEST['filename'])) {
header('Content-Type: application/json');
list($trash, $f) = explode(':', strtr(file_get_contents('/run/panther/elettra.100.bpm'), array('e '=>'e')));
$d = explode(';', $f);
die("{\"preinjector\":{\"x\":[".implode(',', array_slice($d, 0, 7)).'],"y":['.implode(',', array_slice($d, 7, 7))."]},\"bts\":{\"x\":[".implode(',', array_slice($d, 14, 10)).'],"y":['.implode(',', array_slice($d, 24, 10))."]},\"sr\":{\"x\":[".$d[34].'],"y":['.$d[35]."]}}");
die("{\"preinjector\":{\"Hor\":[".implode(',', array_slice($d, 0, 7)).'],"Ver":['.implode(',', array_slice($d, 7, 7))."]},\"bts\":{\"Hor\":[".implode(',', array_slice($d, 14, 10)).'],"Ver":['.implode(',', array_slice($d, 24, 10))."]},\"sr\":{\"Hor\":[".$d[34].'],"Ver":['.$d[35]."]}}");
}
if ($_REQUEST['filename']=='elettra.100.bpm.src') {
$f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s-%3EGetGofBpmNames');
$d = json_decode(strtr($f, [',""'=>'', '"LGBPM_S2.1","LGBPM_S2.2",'=>'', '"LGBPM_S7.1","LGBPM_S7.2",'=>'']));
header('Content-Type: application/json');
// $f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/feedback/profile_s-%3EGetGofBpmNames');
$f = file_get_contents('http://puma-01.elettra.eu/rchan.php?json&valueOnly&src=srv-tango-sre-01.ecs.elettra.trieste.it:20000/sr/DIAGNOSTICS/bpm_s(BpmLabel)');
if (isset($_REQUEST['debug'])) print_r($f);
// $d = json_decode(strtr($f, [',""'=>'', '"LGBPM_S2.1","LGBPM_S2.2",'=>'', '"LGBPM_S7.1","LGBPM_S7.2",'=>'']));
$d = json_decode($f, true);
$h = $v = [];
foreach ($d as $name) {
$h[] = "srv-tango-sre-01:20000/sr/feedback/$name/HorPos";
$v[] = "srv-tango-sre-01:20000/sr/feedback/$name/VerPos";
$h[] = "\"srv-tango-sre-01:20000/sr/feedback/$name/HorPos\"";
$v[] = "\"srv-tango-sre-01:20000/sr/feedback/$name/VerPos\"";
}
list($trash, $f) = explode(':', file_get_contents('/run/panther/elettra.100.bpm.src'), 2);
$d = explode(',', $f);
die("[[".implode(',', array_slice($d, 0, 7)).','.implode(',', array_slice($d, 14, 10)).','.implode(',', $h).'],['.implode(',', array_slice($d, 7, 7)).','.implode(',', array_slice($d, 24, 10)).','.implode(',', $v)."]]");
die("{\"preinjector\":{\"Factor\":1000,\"Hor\":\n[\"".implode("\",\n\"", array_slice($d, 0, 7))."\"], \"Ver\":\n[\"".implode("\",\n\"", array_slice($d, 7, 7)).
"\"]},\n\"bts\":{\"Factor\":0.001,\"Hor\":\n[\"".implode("\",\n\"", array_slice($d, 14, 10))."\"],\"Ver\":\n[\"".implode("\",\n\"", array_slice($d, 24, 10)).
"\"]},\n\"sr\":{\"Factor\":1000,\"Hor\":[\n".implode(",\n", $h).'],"Ver":['.implode(',', $v)."\n]\n}\n}");
}
if ($_REQUEST['filename']=='fermi.1000.vlv') {
list($trash, $f) = explode(':', file_get_contents('/run/panther/padres.1000.vlv'));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment