123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?php
- // ########## SLOW CONTROL CHANNELS ##########
- $adeiChannel = array(
- // DPS Magnets
- array(//0
- /*"cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__15", //"311-RBY-1-1051",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__18", //"311-RBY-1-1052",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__21", //"311-RBY-1-2051",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__24", //"311-RBY-1-2052",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__27", //"311-RBY-1-3051",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__30", //"311-RBY-1-3052",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__33", //"311-RBY-1-4051",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__36", //"311-RBY-1-4052",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__39", //"311-RBY-1-5051",
- "cscryo__ControlSystem_DPS__310_MAG_Magnetbetrieb__42" //"311-RBY-1-5052" // hall probes */
- "cstmagnet__ControlSystem_Magnet__800_MAG_MAG_Control__69", //"311-E23-1-1100",
- "cstmagnet__ControlSystem_Magnet__800_MAG_MAG_Control__84", //"311-E23-1-2100",
- "cstmagnet__ControlSystem_Magnet__800_MAG_MAG_Control__99", //"311-E23-1-3100",
- "cstmagnet__ControlSystem_Magnet__800_MAG_MAG_Control__114", //"311-E23-1-4100",
- "cstmagnet__ControlSystem_Magnet__800_MAG_MAG_Control__129" //"311-E23-1-5100" // current
- ),
- // CPS Magnets
- array(//1
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__0",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__3",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__6",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__9",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__12",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__15",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__18",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__21",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__24",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__27",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__30",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__33",
- "cscps__ControlSystem_CPS__320_MAG_Magnetfeld__36"
- ),
- // CPS Current
- array(//2
- "cscps__ControlSystem_CPS__320_MAG_Stromzufuhr__0"
- ),
- // WGTS currents
- array(//3
- "cswgts__ControlSystem_WGTS_Magnet__200_MAG_Stromzufuhr_M1_M4_M5__0"
- ),
- array(//4
- "cswgts__ControlSystem_WGTS_Magnet__200_MAG_Stromzufuhr_M2_M3__0"
- ),
- array(//5
- "cswgts__ControlSystem_WGTS_Magnet__200_MAG_Stromzufuhr_M6_M7__0"
- ),
- // throughput
- array(//6
- "cstloops__ControlSystem_Loop_ISS__610InnerLoop_CircIn__12" // 610-RFY-8-0206
- )
- );
- $username = 'katrin';
- $password = 'neutrino';
- $context = stream_context_create(array(
- 'http' => 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("http://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 . "<br>";
- 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] . "<br>";
- }
- }
-
- // 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
- )
- );
- ?>
|