array(
'header' => "Authorization: Basic " . base64_encode("$username:$password"), "Connection: close\r\n"
)
));
for ($id = 0; $id < sizeof($adeiChannel); $id++)
{
$adeiChannels = "";
for ($id2 = 0; $id2 < sizeof($adeiChannel[$id]); $id2++)
{
$adeiChannels = $adeiChannels . $adeiChannel[$id][$id2] . ",";
}
$adeiChannels = substr($adeiChannels, 0, strlen($adeiChannels) - 1);
// adei address changed
$fileip = file_get_contents("https://adei-katrin.kaas.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&rt=full&window=60,-1&format=csv", false, $context);
// old adei
//$fileip = file_get_contents("http://katrin.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&window=60&format=csv", false, $context);
// backup server
//$fileip = file_get_contents("http://ipekatrinbackupserv1.ipe.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&window=60&format=csv", false, $context);
//echo $fileip . "
";
for ($id2 = sizeof($adeiChannel[$id]) - 1 ; $id2 > -1; $id2--)
{
$pos = strrpos($fileip, ",");
$adeiValue[$id][$id2] = floatval(substr($fileip, $pos + 2));
$fileip = substr($fileip, 0, $pos);
//echo $id . "," . $id2 . "," . $adeiValue[$id][$id2] . "
";
}
}
// corresponding KATRIN numbers of sensors
$KatrinNumber = array(
// DPS Magnets
array(//0
/*"311-RBY-1-1051",
"311-RBY-1-1052",
"311-RBY-1-2051",
"311-RBY-1-2052",
"311-RBY-1-3051",
"311-RBY-1-3052",
"311-RBY-1-4051",
"311-RBY-1-4052",
"311-RBY-1-5051",
"311-RBY-1-5052" */ //those were the hall probe numbers
"311-E23-1-1100",
"311-E23-1-2100",
"311-E23-1-3100",
"311-E23-1-4100",
"311-E23-1-5100" // current
),
// CPS Magnets
array(//1
"320-RBI-1-1101",
"320-RBI-1-1102",
"320-RBI-1-2101",
"320-RBI-1-2102",
"320-RBI-1-3101",
"320-RBI-1-3102",
"320-RBI-1-4101",
"320-RBI-1-4102",
"320-RBI-1-5101",
//"320-RBI-1-5102", // corrupted, not in ADEI anymore
"320-RBI-1-6101",
"320-RBI-1-6102",
"320-RBI-1-7101",
"320-RBI-1-7102"
),
// CPS Current
array(//2
"320-REI-1-5103"
),
// WGTS currents
array(//3
"200-REI-5-3111" // M5_M4_M1
),
array(//4
"200-REI-5-3211" // M2_M3
),
array(//5
"200-REI-5-3311" // M7_M6
),
// throughput
array(//6
"610-RFY-8-0206" // 610-RFY-8-0206
)
);
?>