getADEIData.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <html>
  2. <head>
  3. <title>getFluxTube</title>
  4. </head>
  5. <body>
  6. <?php
  7. $adeiChannel = array(
  8. array(
  9. "aircoils__aircoils_rep__0__2",
  10. "aircoils__aircoils_rep__0__3",
  11. "aircoils__aircoils_rep__0__4",
  12. "aircoils__aircoils_rep__0__5",
  13. "aircoils__aircoils_rep__0__6",
  14. "aircoils__aircoils_rep__0__7",
  15. "aircoils__aircoils_rep__0__8",
  16. "aircoils__aircoils_rep__0__9",
  17. "aircoils__aircoils_rep__0__10",
  18. "aircoils__aircoils_rep__0__11",
  19. "aircoils__aircoils_rep__0__12",
  20. "aircoils__aircoils_rep__0__13",
  21. "aircoils__aircoils_rep__0__14",
  22. "aircoils__aircoils_rep__0__15",
  23. "aircoils__aircoils_rep__0__16",
  24. "aircoils__aircoils_rep__0__17"
  25. ),
  26. array(
  27. "aircoils__aircoils_rep__0__34",
  28. "aircoils__aircoils_rep__0__35",
  29. "aircoils__aircoils_rep__0__36",
  30. "aircoils__aircoils_rep__0__37",
  31. "aircoils__aircoils_rep__0__38",
  32. "aircoils__aircoils_rep__0__39",
  33. "aircoils__aircoils_rep__0__40",
  34. "aircoils__aircoils_rep__0__41",
  35. "aircoils__aircoils_rep__0__42",
  36. "aircoils__aircoils_rep__0__43",
  37. "aircoils__aircoils_rep__0__44",
  38. "aircoils__aircoils_rep__0__45",
  39. "aircoils__aircoils_rep__0__46",
  40. "aircoils__aircoils_rep__0__47",
  41. "aircoils__aircoils_rep__0__48",
  42. "aircoils__aircoils_rep__0__49"
  43. ),
  44. array(
  45. "aircoils__aircoils_rep__0__86",
  46. "aircoils__aircoils_rep__0__87",
  47. "aircoils__aircoils_rep__0__88",
  48. "aircoils__aircoils_rep__0__89",
  49. "aircoils__aircoils_rep__0__90",
  50. "aircoils__aircoils_rep__0__91",
  51. "aircoils__aircoils_rep__0__92",
  52. "aircoils__aircoils_rep__0__93",
  53. "aircoils__aircoils_rep__0__94",
  54. "aircoils__aircoils_rep__0__95",
  55. "aircoils__aircoils_rep__0__96",
  56. "aircoils__aircoils_rep__0__97",
  57. "aircoils__aircoils_rep__0__98",
  58. "aircoils__aircoils_rep__0__99",
  59. "aircoils__aircoils_rep__0__100",
  60. "aircoils__aircoils_rep__0__101"
  61. ),
  62. array(
  63. "aircoils__aircoils_rep__0__100",
  64. "aircoils__aircoils_rep__0__101",
  65. "aircoils__aircoils_rep__0__102",
  66. "aircoils__aircoils_rep__0__103"
  67. ),
  68. array(
  69. "fpd__katrin_rep__0__153",
  70. "fpd__katrin_rep__0__158"
  71. ),
  72. array(
  73. "aircoils__aircoils_rep__1__3",
  74. "aircoils__aircoils_rep__1__4",
  75. "aircoils__aircoils_rep__1__9",
  76. "aircoils__aircoils_rep__1__10",
  77. "aircoils__aircoils_rep__1__18",
  78. "aircoils__aircoils_rep__1__14",
  79. "aircoils__aircoils_rep__1__16",
  80. "aircoils__aircoils_rep__1__19"
  81. ),
  82. array(
  83. "fpd__katrin_rep__0__43",
  84. "fpd__katrin_rep__0__66",
  85. "fpd__katrin_rep__0__80",
  86. "fpd__katrin_rep__0__99",
  87. "fpd__katrin_rep__0__112",
  88. "fpd__katrin_rep__0__113",
  89. "fpd__katrin_rep__0__116",
  90. "fpd__katrin_rep__0__117",
  91. "fpd__katrin_rep__0__118",
  92. "fpd__katrin_rep__0__60",
  93. "fpd__katrin_rep__0__62",
  94. "fpd__katrin_rep__0__114",
  95. "fpd__katrin_rep__0__45"
  96. ),
  97. array(
  98. "csms__ControlSystem_MS__432VAK_PumpPort2__54",
  99. "csms__ControlSystem_MS__432VAK_PumpPort2__9",
  100. "csms__ControlSystem_MS__432VAK_PumpPort2__18",
  101. "csms__ControlSystem_MS__432VAK_PumpPort2__27",
  102. "csms__ControlSystem_MS__432VAK_PumpPort2__99",
  103. "csms__ControlSystem_MS__432VAK_PumpPort2__102",
  104. "csms__ControlSystem_MS__432VAK_PumpPort2__105"
  105. ),
  106. array(
  107. "csms__ControlSystem_MS__432VAK_PumpPort3__36",
  108. "csms__ControlSystem_MS__432VAK_PumpPort3__9",
  109. "csms__ControlSystem_MS__432VAK_PumpPort3__18",
  110. "csms__ControlSystem_MS__432VAK_PumpPort3__27",
  111. "csms__ControlSystem_MS__432VAK_PumpPort3__63",
  112. "csms__ControlSystem_MS__432VAK_PumpPort3__66",
  113. "csms__ControlSystem_MS__432VAK_PumpPort3__69"
  114. ),
  115. array(
  116. "csms__ControlSystem_MS__432VAK_Tank__6",
  117. "csms__ControlSystem_MS__432VAK_Tank__9",
  118. "csms__ControlSystem_MS__432VAK_Tank__0",
  119. "csms__ControlSystem_MS__432VAK_Tank__15",
  120. "csms__ControlSystem_MS__432VAK_Tank__27",
  121. "csms__ControlSystem_MS__432VAK_Tank__30",
  122. "csms__ControlSystem_MS__432VAK_Tank__33",
  123. "csms__ControlSystem_MS__432VAK_Tank__39",
  124. "csms__ControlSystem_MS__432VAK_Tank__45",
  125. "csms__ControlSystem_MS__432VAK_Tank__48",
  126. "csms__ControlSystem_MS__432VAK_Tank__36"
  127. ),
  128. array(
  129. "hv__katrin-hv_rep__0__87",
  130. "hv__katrin-hv_rep__0__86",
  131. "hv__katrin-hv_rep__0__95",
  132. "hv__katrin-hv_rep__0__94",
  133. "hv__katrin-hv_rep__0__71",
  134. "hv__katrin-hv_rep__0__70",
  135. "hv__katrin-hv_rep__0__79",
  136. "hv__katrin-hv_rep__0__78",
  137. "hv__katrin-hv_rep__0__63",
  138. "hv__katrin-hv_rep__0__62",
  139. "hv__katrin-hv_rep__0__55",
  140. "hv__katrin-hv_rep__0__54",
  141. "hv__katrin-hv_rep__0__132",
  142. "hv__katrin-hv_rep__0__131"
  143. ),
  144. array(
  145. "hv__katrin-hv_rep__2__3",
  146. "hv__katrin-hv_rep__2__10",
  147. "hv__katrin-hv_rep__2__17",
  148. "hv__katrin-hv_rep__2__24",
  149. "hv__katrin-hv_rep__2__31",
  150. "hv__katrin-hv_rep__2__38",
  151. "hv__katrin-hv_rep__2__45",
  152. "hv__katrin-hv_rep__2__52",
  153. "hv__katrin-hv_rep__2__59",
  154. "hv__katrin-hv_rep__2__66",
  155. "hv__katrin-hv_rep__2__73",
  156. "hv__katrin-hv_rep__2__80",
  157. "hv__katrin-hv_rep__2__87",
  158. "hv__katrin-hv_rep__2__94",
  159. "hv__katrin-hv_rep__2__101",
  160. "hv__katrin-hv_rep__2__108",
  161. "hv__katrin-hv_rep__2__115",
  162. "hv__katrin-hv_rep__2__122",
  163. "hv__katrin-hv_rep__2__129",
  164. "hv__katrin-hv_rep__2__136",
  165. "hv__katrin-hv_rep__2__143",
  166. "hv__katrin-hv_rep__2__150",
  167. "hv__katrin-hv_rep__2__157",
  168. "hv__katrin-hv_rep__2__164"
  169. ),
  170. array(
  171. "hv__katrin-hv_rep__2__2",
  172. "hv__katrin-hv_rep__2__9",
  173. "hv__katrin-hv_rep__2__16",
  174. "hv__katrin-hv_rep__2__23",
  175. "hv__katrin-hv_rep__2__30",
  176. "hv__katrin-hv_rep__2__37",
  177. "hv__katrin-hv_rep__2__44",
  178. "hv__katrin-hv_rep__2__51",
  179. "hv__katrin-hv_rep__2__58",
  180. "hv__katrin-hv_rep__2__65",
  181. "hv__katrin-hv_rep__2__72",
  182. "hv__katrin-hv_rep__2__79",
  183. "hv__katrin-hv_rep__2__86",
  184. "hv__katrin-hv_rep__2__93",
  185. "hv__katrin-hv_rep__2__100",
  186. "hv__katrin-hv_rep__2__107",
  187. "hv__katrin-hv_rep__2__114",
  188. "hv__katrin-hv_rep__2__121",
  189. "hv__katrin-hv_rep__2__128",
  190. "hv__katrin-hv_rep__2__135",
  191. "hv__katrin-hv_rep__2__142",
  192. "hv__katrin-hv_rep__2__149",
  193. "hv__katrin-hv_rep__2__156",
  194. "hv__katrin-hv_rep__2__163"
  195. ),
  196. array(
  197. "hv__katrin-hv_rep__3__3",
  198. "hv__katrin-hv_rep__3__10",
  199. "hv__katrin-hv_rep__3__17",
  200. "hv__katrin-hv_rep__3__24",
  201. "hv__katrin-hv_rep__3__31",
  202. "hv__katrin-hv_rep__3__38",
  203. "hv__katrin-hv_rep__3__45",
  204. "hv__katrin-hv_rep__3__52",
  205. "hv__katrin-hv_rep__3__59",
  206. "hv__katrin-hv_rep__3__66",
  207. "hv__katrin-hv_rep__3__73",
  208. "hv__katrin-hv_rep__3__80",
  209. "hv__katrin-hv_rep__3__87",
  210. "hv__katrin-hv_rep__3__94",
  211. "hv__katrin-hv_rep__3__101",
  212. "hv__katrin-hv_rep__3__108",
  213. "hv__katrin-hv_rep__3__115",
  214. "hv__katrin-hv_rep__3__122",
  215. "hv__katrin-hv_rep__3__129",
  216. "hv__katrin-hv_rep__3__136",
  217. "hv__katrin-hv_rep__3__143",
  218. "hv__katrin-hv_rep__3__150",
  219. "hv__katrin-hv_rep__3__157",
  220. "hv__katrin-hv_rep__3__164"
  221. ),
  222. array(
  223. "hv__katrin-hv_rep__3__2",
  224. "hv__katrin-hv_rep__3__9",
  225. "hv__katrin-hv_rep__3__16",
  226. "hv__katrin-hv_rep__3__23",
  227. "hv__katrin-hv_rep__3__30",
  228. "hv__katrin-hv_rep__3__37",
  229. "hv__katrin-hv_rep__3__44",
  230. "hv__katrin-hv_rep__3__51",
  231. "hv__katrin-hv_rep__3__58",
  232. "hv__katrin-hv_rep__3__65",
  233. "hv__katrin-hv_rep__3__72",
  234. "hv__katrin-hv_rep__3__79",
  235. "hv__katrin-hv_rep__3__86",
  236. "hv__katrin-hv_rep__3__93",
  237. "hv__katrin-hv_rep__3__100",
  238. "hv__katrin-hv_rep__3__107",
  239. "hv__katrin-hv_rep__3__114",
  240. "hv__katrin-hv_rep__3__121",
  241. "hv__katrin-hv_rep__3__128",
  242. "hv__katrin-hv_rep__3__135",
  243. "hv__katrin-hv_rep__3__142",
  244. "hv__katrin-hv_rep__3__149",
  245. "hv__katrin-hv_rep__3__156",
  246. "hv__katrin-hv_rep__3__163"
  247. ),
  248. array(
  249. "csms__ControlSystem_MS__430KRYO_Baffel__21",
  250. "csms__ControlSystem_MS__430KRYO_Baffel__33",
  251. "csms__ControlSystem_MS__430KRYO_Baffel__51",
  252. "csms__ControlSystem_MS__430KRYO_Baffel__60",
  253. "csms__ControlSystem_MS__430KRYO_Baffel__66",
  254. "csms__ControlSystem_MS__430KRYO_Baffel__72"
  255. ),
  256. array(
  257. "precmm0__PrecMagnet__NorthRing__0",
  258. "precmm0__PrecMagnet__NorthRing__1",
  259. "precmm0__PrecMagnet__NorthRing__2",
  260. "precmm0__PrecMagnet__NorthRing__7",
  261. "precmm0__PrecMagnet__NorthRing__8",
  262. "precmm0__PrecMagnet__NorthRing__9",
  263. "precmm0__PrecMagnet__NorthRing__14",
  264. "precmm0__PrecMagnet__NorthRing__15",
  265. "precmm0__PrecMagnet__NorthRing__16",
  266. "precmm0__PrecMagnet__NorthRing__21",
  267. "precmm0__PrecMagnet__NorthRing__22",
  268. "precmm0__PrecMagnet__NorthRing__23"
  269. ),
  270. array(
  271. "precmm0__PrecMagnet__MidRing__0",
  272. "precmm0__PrecMagnet__MidRing__1",
  273. "precmm0__PrecMagnet__MidRing__2",
  274. "precmm0__PrecMagnet__MidRing__7",
  275. "precmm0__PrecMagnet__MidRing__8",
  276. "precmm0__PrecMagnet__MidRing__9",
  277. "precmm0__PrecMagnet__MidRing__14",
  278. "precmm0__PrecMagnet__MidRing__15",
  279. "precmm0__PrecMagnet__MidRing__16",
  280. "precmm0__PrecMagnet__MidRing__21",
  281. "precmm0__PrecMagnet__MidRing__22",
  282. "precmm0__PrecMagnet__MidRing__23",
  283. "precmm0__PrecMagnet__MidRing__28",
  284. "precmm0__PrecMagnet__MidRing__29",
  285. "precmm0__PrecMagnet__MidRing__30",
  286. "precmm0__PrecMagnet__MidRing__35",
  287. "precmm0__PrecMagnet__MidRing__36",
  288. "precmm0__PrecMagnet__MidRing__37"
  289. ),
  290. array(
  291. "precmm0__PrecMagnet__SouthRing__0",
  292. "precmm0__PrecMagnet__SouthRing__1",
  293. "precmm0__PrecMagnet__SouthRing__2",
  294. "precmm0__PrecMagnet__SouthRing__7",
  295. "precmm0__PrecMagnet__SouthRing__8",
  296. "precmm0__PrecMagnet__SouthRing__9",
  297. "precmm0__PrecMagnet__SouthRing__14",
  298. "precmm0__PrecMagnet__SouthRing__15",
  299. "precmm0__PrecMagnet__SouthRing__16",
  300. "precmm0__PrecMagnet__SouthRing__21",
  301. "precmm0__PrecMagnet__SouthRing__22",
  302. "precmm0__PrecMagnet__SouthRing__23"
  303. ),
  304. array(
  305. "fpd__katrin_rep__0__198",
  306. "fpd__katrin_rep__0__199",
  307. "fpd__katrin_rep__0__200"
  308. ),
  309. array(
  310. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__15",
  311. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__18",
  312. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__21",
  313. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__24",
  314. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__27",
  315. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__30",
  316. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__33",
  317. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__36",
  318. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__39",
  319. "cscryo__ControlSystem_Cryo__310DPS_Magnetsteuerung__42"
  320. ),
  321. array(
  322. "csms__ControlSystem_MS__435HZ_Temperatur__24",
  323. "csms__ControlSystem_MS__435HZ_Temperatur__30",
  324. "csms__ControlSystem_MS__435HZ_Temperatur__39",
  325. "csms__ControlSystem_MS__435HZ_Temperatur__42"
  326. ),
  327. array(
  328. "aircoils__aircoils_rep__2__2",
  329. "aircoils__aircoils_rep__2__3",
  330. "aircoils__aircoils_rep__2__4",
  331. "aircoils__aircoils_rep__2__5",
  332. "aircoils__aircoils_rep__2__6",
  333. "aircoils__aircoils_rep__2__7",
  334. "aircoils__aircoils_rep__2__8",
  335. "aircoils__aircoils_rep__2__9",
  336. "aircoils__aircoils_rep__2__10",
  337. "aircoils__aircoils_rep__2__11",
  338. "aircoils__aircoils_rep__2__12",
  339. "aircoils__aircoils_rep__2__13",
  340. "aircoils__aircoils_rep__2__14",
  341. "aircoils__aircoils_rep__2__15",
  342. "aircoils__aircoils_rep__2__16",
  343. "aircoils__aircoils_rep__2__17"
  344. ),
  345. array(
  346. "aircoils__aircoils_rep__2__18",
  347. "aircoils__aircoils_rep__2__19",
  348. "aircoils__aircoils_rep__2__20",
  349. "aircoils__aircoils_rep__2__21",
  350. "aircoils__aircoils_rep__2__22",
  351. "aircoils__aircoils_rep__2__23",
  352. "aircoils__aircoils_rep__2__24",
  353. "aircoils__aircoils_rep__2__25",
  354. "aircoils__aircoils_rep__2__26",
  355. "aircoils__aircoils_rep__2__27",
  356. "aircoils__aircoils_rep__2__28",
  357. "aircoils__aircoils_rep__2__29",
  358. "aircoils__aircoils_rep__2__30",
  359. "aircoils__aircoils_rep__2__31",
  360. "aircoils__aircoils_rep__2__32",
  361. "aircoils__aircoils_rep__2__33"
  362. ),
  363. array(
  364. "aircoils__aircoils_rep__2__57",
  365. "aircoils__aircoils_rep__2__58",
  366. "aircoils__aircoils_rep__2__43",
  367. "aircoils__aircoils_rep__2__44",
  368. "aircoils__aircoils_rep__2__45",
  369. "aircoils__aircoils_rep__2__46",
  370. "aircoils__aircoils_rep__2__47",
  371. "aircoils__aircoils_rep__2__48",
  372. "aircoils__aircoils_rep__2__49",
  373. "aircoils__aircoils_rep__2__50",
  374. "aircoils__aircoils_rep__2__51",
  375. "aircoils__aircoils_rep__2__52",
  376. "aircoils__aircoils_rep__2__53",
  377. "aircoils__aircoils_rep__2__54",
  378. "aircoils__aircoils_rep__2__55",
  379. "aircoils__aircoils_rep__2__56",
  380. "aircoils__aircoils_rep__2__38"
  381. )
  382. );
  383. $username = 'katrin';
  384. $password = 'neutrino';
  385. $context = stream_context_create(array(
  386. 'http' => array(
  387. 'header' => "Authorization: Basic " . base64_encode("$username:$password"), "Connection: close\r\n"
  388. )
  389. ));
  390. $handle = fopen("adei", "w");
  391. $content = "";
  392. for ($id = 0; $id < sizeof($adeiChannel); $id++)
  393. {
  394. $adeiChannels = "";
  395. for ($id2 = 0; $id2 < sizeof($adeiChannel[$id]); $id2++)
  396. {
  397. $adeiChannels = $adeiChannels . $adeiChannel[$id][$id2] . ",";
  398. }
  399. $adeiChannels = substr($adeiChannels, 0, strlen($adeiChannels) - 1);
  400. $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 . "&window=60&format=csv", false, $context);
  401. //$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);
  402. //echo $fileip . "<br>";
  403. for ($id2 = sizeof($adeiChannel[$id]) - 1 ; $id2 > -1; $id2--)
  404. {
  405. $pos = strrpos($fileip, ",");
  406. $adeiValue[$id][$id2] = floatval(substr($fileip, $pos + 2));
  407. $fileip = substr($fileip, 0, $pos);
  408. //echo $id . "," . $id2 . "," . $adeiValue[$id][$id2] . "<br>";
  409. $content = $content . $adeiValue[$id][$id2] . " ";
  410. }
  411. $content = $content . "|";
  412. }
  413. fwrite($handle, $content);
  414. fclose($handle);
  415. ?>
  416. </body>
  417. </html>