testit_read.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <?php
  2. function show_status($done, $total, $size=30) {
  3. static $start_time;
  4. // if we go over our bound, just ignore it
  5. if($done > $total) return;
  6. if(empty($start_time)) $start_time=time();
  7. $now = time();
  8. $perc=(double)($done/$total);
  9. $bar=floor($perc*$size);
  10. $status_bar="\r[";
  11. $status_bar.=str_repeat("=", $bar);
  12. if($bar<$size){
  13. $status_bar.=">";
  14. $status_bar.=str_repeat(" ", $size-$bar);
  15. } else {
  16. $status_bar.="=";
  17. }
  18. $disp=number_format($perc*100, 0);
  19. $status_bar.="] $disp% $done/$total";
  20. $rate = ($now-$start_time)/$done;
  21. $left = $total - $done;
  22. $eta = round($rate * $left, 2);
  23. $elapsed = $now - $start_time;
  24. $status_bar.= " remaining: ".number_format($eta)." sec. elapsed: ".number_format($elapsed)." sec.";
  25. echo "$status_bar ";
  26. flush();
  27. // when done, send a newline
  28. if($done == $total) {
  29. echo "\n";
  30. }
  31. }
  32. // ########## SLOW CONTROL CHANNELS ##########
  33. $adeiChannel = array(
  34. array(
  35. "aircoils__aircoils_rep__0__2", //EMCS currents
  36. "aircoils__aircoils_rep__0__3",
  37. "aircoils__aircoils_rep__0__4",
  38. "aircoils__aircoils_rep__0__5",
  39. "aircoils__aircoils_rep__0__6",
  40. "aircoils__aircoils_rep__0__7",
  41. "aircoils__aircoils_rep__0__8",
  42. "aircoils__aircoils_rep__0__9",
  43. "aircoils__aircoils_rep__0__10",
  44. "aircoils__aircoils_rep__0__11",
  45. "aircoils__aircoils_rep__0__12",
  46. "aircoils__aircoils_rep__0__13",
  47. "aircoils__aircoils_rep__0__14",
  48. "aircoils__aircoils_rep__0__15",
  49. "aircoils__aircoils_rep__0__16",
  50. "aircoils__aircoils_rep__0__17"
  51. ),
  52. array(
  53. "aircoils__aircoils_rep__0__34", //EMCS Status
  54. "aircoils__aircoils_rep__0__35",
  55. "aircoils__aircoils_rep__0__36",
  56. "aircoils__aircoils_rep__0__37",
  57. "aircoils__aircoils_rep__0__38",
  58. "aircoils__aircoils_rep__0__39",
  59. "aircoils__aircoils_rep__0__40",
  60. "aircoils__aircoils_rep__0__41",
  61. "aircoils__aircoils_rep__0__42",
  62. "aircoils__aircoils_rep__0__43",
  63. "aircoils__aircoils_rep__0__44",
  64. "aircoils__aircoils_rep__0__45",
  65. "aircoils__aircoils_rep__0__46",
  66. "aircoils__aircoils_rep__0__47",
  67. "aircoils__aircoils_rep__0__48",
  68. "aircoils__aircoils_rep__0__49"
  69. ),
  70. array(
  71. "aircoils__aircoils_rep__0__86", // LEM Status
  72. "aircoils__aircoils_rep__0__87",
  73. "aircoils__aircoils_rep__0__88",
  74. "aircoils__aircoils_rep__0__89",
  75. "aircoils__aircoils_rep__0__90",
  76. "aircoils__aircoils_rep__0__91",
  77. "aircoils__aircoils_rep__0__92",
  78. "aircoils__aircoils_rep__0__93",
  79. "aircoils__aircoils_rep__0__94",
  80. "aircoils__aircoils_rep__0__95",
  81. "aircoils__aircoils_rep__0__96",
  82. "aircoils__aircoils_rep__0__97",
  83. "aircoils__aircoils_rep__0__98",
  84. "aircoils__aircoils_rep__0__99",
  85. "aircoils__aircoils_rep__0__100",
  86. "aircoils__aircoils_rep__0__101",
  87. "aircoils__aircoils_rep__0__102" // HV dipole trigger status
  88. ),
  89. array(
  90. "aircoils__aircoils_rep__0__82", //PS1 + PS2 current
  91. "aircoils__aircoils_rep__0__83",
  92. "aircoils__aircoils_rep__0__84", //PS1 + PS2 Status
  93. "aircoils__aircoils_rep__0__85"
  94. ),
  95. array(
  96. "fpd__katrin_rep__0__153",
  97. "fpd__katrin_rep__0__158"
  98. ),
  99. // Baffle vacuum (index 5, former egun part)
  100. array(
  101. "csms__ControlSystem_MS__432VAK_Kryoleitung__9"
  102. ),
  103. array(
  104. "fpd__katrin_rep__0__43",
  105. "fpd__katrin_rep__0__66",
  106. "fpd__katrin_rep__0__80",
  107. "fpd__katrin_rep__0__99",
  108. "fpd__katrin_rep__0__112",
  109. "fpd__katrin_rep__0__113",
  110. "fpd__katrin_rep__0__116",
  111. "fpd__katrin_rep__0__117",
  112. "fpd__katrin_rep__0__118",
  113. "fpd__katrin_rep__0__60",
  114. "fpd__katrin_rep__0__62",
  115. "fpd__katrin_rep__0__114",
  116. "fpd__katrin_rep__0__45"
  117. ),
  118. array(
  119. "csms__ControlSystem_MS__432VAK_PumpPort2__33",
  120. "csms__ControlSystem_MS__432VAK_PumpPort2__6",
  121. "csms__ControlSystem_MS__432VAK_PumpPort2__12",
  122. "csms__ControlSystem_MS__432VAK_PumpPort2__18",
  123. "csms__ControlSystem_MS__432VAK_PumpPort2__57",
  124. "csms__ControlSystem_MS__432VAK_PumpPort2__60",
  125. "csms__ControlSystem_MS__432VAK_PumpPort2__63",
  126. "csms__ControlSystem_MS__432VAK_PumpPort2__36"
  127. ),
  128. array(
  129. "csms__ControlSystem_MS__432VAK_PumpPort3__24",
  130. "csms__ControlSystem_MS__432VAK_PumpPort3__6",
  131. "csms__ControlSystem_MS__432VAK_PumpPort3__12",
  132. "csms__ControlSystem_MS__432VAK_PumpPort3__18",
  133. "csms__ControlSystem_MS__432VAK_PumpPort3__42",
  134. "csms__ControlSystem_MS__432VAK_PumpPort3__45",
  135. "csms__ControlSystem_MS__432VAK_PumpPort3__48"
  136. ),
  137. array(
  138. "csms__ControlSystem_MS__432VAK_Tank__6", // RPM 106
  139. "csms__ControlSystem_MS__432VAK_Tank__9", // VAI 105
  140. "csms__ControlSystem_MS__432VAK_Tank__0", // RPI 0096
  141. "csms__ControlSystem_MS__432VAK_Tank__15",
  142. "csms__ControlSystem_MS__432VAK_Tank__27",
  143. "csms__ControlSystem_MS__432VAK_Tank__30",
  144. "csms__ControlSystem_MS__432VAK_Tank__33",
  145. "csms__ControlSystem_MS__432VAK_Tank__30",
  146. "csms__ControlSystem_MS__432VAK_Tank__30",
  147. "csms__ControlSystem_MS__432VAK_Tank__30",
  148. "csms__ControlSystem_MS__432VAK_Tank__30"
  149. // "csms__ControlSystem_MS__432VAK_Tank__15",
  150. // "csms__ControlSystem_MS__432VAK_Tank__27",
  151. // "csms__ControlSystem_MS__432VAK_Tank__30",
  152. // "csms__ControlSystem_MS__432VAK_Tank__33",
  153. // "csms__ControlSystem_MS__432VAK_Tank__39",
  154. // "csms__ControlSystem_MS__432VAK_Tank__45",
  155. // "csms__ControlSystem_MS__432VAK_Tank__48",
  156. // "csms__ControlSystem_MS__432VAK_Tank__36"
  157. ),
  158. array( //HV subsystem
  159. "hv__katrin-hv_rep__0__39", // MS vessel IST
  160. "hv__katrin-hv_rep__0__38", // MS vessel SOLL
  161. "hv__katrin-hv_rep__0__87", // MS IE Common electrode IST
  162. "hv__katrin-hv_rep__0__86", // MS IE Common electrode SOLL
  163. "hv__katrin-hv_rep__0__71", // MS IE dipole west IST
  164. "hv__katrin-hv_rep__0__70", // MS IE dipole west SOLL
  165. "hv__katrin-hv_rep__0__79", // MS IE dipole east IST
  166. "hv__katrin-hv_rep__0__78", // MS IE dipole east SOLL
  167. "hv__katrin-hv_rep__0__63",
  168. "hv__katrin-hv_rep__0__62",
  169. "hv__katrin-hv_rep__0__55",
  170. "hv__katrin-hv_rep__0__54",
  171. "hv__katrin-hv_rep__0__132", // dipole relay status
  172. "hv__katrin-hv_rep__0__131", // dipole relay status
  173. "hv__katrin-hv_rep__0__95", // PS vessel IST
  174. "hv__katrin-hv_rep__0__94", // PS vessel SOLL
  175. "hv__katrin-hv_rep__0__103", // PS dipole west IST
  176. "hv__katrin-hv_rep__0__102", // PS dipole west SOLL
  177. "hv__katrin-hv_rep__0__111", // PS dipole east IST
  178. "hv__katrin-hv_rep__0__110", // PS dipole east SOLL
  179. "hv__katrin-hv_rep__0__47", // MS IE Precision Supply IST
  180. "hv__katrin-hv_rep__0__46", // MS IE Precision Supply SOLL
  181. ),
  182. array(
  183. "hv__katrin-hv_rep__1__3",
  184. "hv__katrin-hv_rep__1__10",
  185. "hv__katrin-hv_rep__1__17",
  186. "hv__katrin-hv_rep__1__24",
  187. "hv__katrin-hv_rep__1__31",
  188. "hv__katrin-hv_rep__1__38",
  189. "hv__katrin-hv_rep__1__45",
  190. "hv__katrin-hv_rep__1__52",
  191. "hv__katrin-hv_rep__1__59",
  192. "hv__katrin-hv_rep__1__66",
  193. "hv__katrin-hv_rep__1__73",
  194. "hv__katrin-hv_rep__1__80",
  195. "hv__katrin-hv_rep__1__87",
  196. "hv__katrin-hv_rep__1__94",
  197. "hv__katrin-hv_rep__1__101",
  198. "hv__katrin-hv_rep__1__108",
  199. "hv__katrin-hv_rep__1__115",
  200. "hv__katrin-hv_rep__1__122",
  201. "hv__katrin-hv_rep__1__129",
  202. "hv__katrin-hv_rep__1__136",
  203. "hv__katrin-hv_rep__1__143",
  204. "hv__katrin-hv_rep__1__150",
  205. "hv__katrin-hv_rep__1__157",
  206. "hv__katrin-hv_rep__1__164"
  207. ),
  208. array(
  209. "hv__katrin-hv_rep__1__2",
  210. "hv__katrin-hv_rep__1__9",
  211. "hv__katrin-hv_rep__1__16",
  212. "hv__katrin-hv_rep__1__23",
  213. "hv__katrin-hv_rep__1__30",
  214. "hv__katrin-hv_rep__1__37",
  215. "hv__katrin-hv_rep__1__44",
  216. "hv__katrin-hv_rep__1__51",
  217. "hv__katrin-hv_rep__1__58",
  218. "hv__katrin-hv_rep__1__65",
  219. "hv__katrin-hv_rep__1__72",
  220. "hv__katrin-hv_rep__1__79",
  221. "hv__katrin-hv_rep__1__86",
  222. "hv__katrin-hv_rep__1__93",
  223. "hv__katrin-hv_rep__1__100",
  224. "hv__katrin-hv_rep__1__107",
  225. "hv__katrin-hv_rep__1__114",
  226. "hv__katrin-hv_rep__1__121",
  227. "hv__katrin-hv_rep__1__128",
  228. "hv__katrin-hv_rep__1__135",
  229. "hv__katrin-hv_rep__1__142",
  230. "hv__katrin-hv_rep__1__149",
  231. "hv__katrin-hv_rep__1__156",
  232. "hv__katrin-hv_rep__1__163"
  233. ),
  234. array(
  235. "hv__katrin-hv_rep__2__3",
  236. "hv__katrin-hv_rep__2__10",
  237. "hv__katrin-hv_rep__2__17",
  238. "hv__katrin-hv_rep__2__24",
  239. "hv__katrin-hv_rep__2__31",
  240. "hv__katrin-hv_rep__2__38",
  241. "hv__katrin-hv_rep__2__45",
  242. "hv__katrin-hv_rep__2__52",
  243. "hv__katrin-hv_rep__2__59",
  244. "hv__katrin-hv_rep__2__66",
  245. "hv__katrin-hv_rep__2__73",
  246. "hv__katrin-hv_rep__2__80",
  247. "hv__katrin-hv_rep__2__87",
  248. "hv__katrin-hv_rep__2__94",
  249. "hv__katrin-hv_rep__2__101",
  250. "hv__katrin-hv_rep__2__108",
  251. "hv__katrin-hv_rep__2__115",
  252. "hv__katrin-hv_rep__2__122",
  253. "hv__katrin-hv_rep__2__129",
  254. "hv__katrin-hv_rep__2__136",
  255. "hv__katrin-hv_rep__2__143",
  256. "hv__katrin-hv_rep__2__150",
  257. "hv__katrin-hv_rep__2__157",
  258. "hv__katrin-hv_rep__2__164"
  259. ),
  260. array(
  261. "hv__katrin-hv_rep__2__2",
  262. "hv__katrin-hv_rep__2__9",
  263. "hv__katrin-hv_rep__2__16",
  264. "hv__katrin-hv_rep__2__23",
  265. "hv__katrin-hv_rep__2__30",
  266. "hv__katrin-hv_rep__2__37",
  267. "hv__katrin-hv_rep__2__44",
  268. "hv__katrin-hv_rep__2__51",
  269. "hv__katrin-hv_rep__2__58",
  270. "hv__katrin-hv_rep__2__65",
  271. "hv__katrin-hv_rep__2__72",
  272. "hv__katrin-hv_rep__2__79",
  273. "hv__katrin-hv_rep__2__86",
  274. "hv__katrin-hv_rep__2__93",
  275. "hv__katrin-hv_rep__2__100",
  276. "hv__katrin-hv_rep__2__107",
  277. "hv__katrin-hv_rep__2__114",
  278. "hv__katrin-hv_rep__2__121",
  279. "hv__katrin-hv_rep__2__128",
  280. "hv__katrin-hv_rep__2__135",
  281. "hv__katrin-hv_rep__2__142",
  282. "hv__katrin-hv_rep__2__149",
  283. "hv__katrin-hv_rep__2__156",
  284. "hv__katrin-hv_rep__2__163"
  285. ),
  286. array(
  287. "csms__ControlSystem_MS__430KRYO_Baffel__147",
  288. "csms__ControlSystem_MS__430KRYO_Baffel__159",
  289. "csms__ControlSystem_MS__430KRYO_Baffel__171",
  290. "csms__ControlSystem_MS__430KRYO_Baffel__183",
  291. "csms__ControlSystem_MS__430KRYO_Baffel__189",
  292. "csms__ControlSystem_MS__430KRYO_Baffel__195",
  293. "csms__ControlSystem_MS__430KRYO_Baffel__120",
  294. "csms__ControlSystem_MS__430KRYO_Baffel__123"
  295. ),
  296. array(
  297. "precmm0__PrecMagnet__NorthRing__0",
  298. "precmm0__PrecMagnet__NorthRing__1",
  299. "precmm0__PrecMagnet__NorthRing__2",
  300. "precmm0__PrecMagnet__NorthRing__7",
  301. "precmm0__PrecMagnet__NorthRing__8",
  302. "precmm0__PrecMagnet__NorthRing__9",
  303. "precmm0__PrecMagnet__NorthRing__14",
  304. "precmm0__PrecMagnet__NorthRing__15",
  305. "precmm0__PrecMagnet__NorthRing__16",
  306. "precmm0__PrecMagnet__NorthRing__21",
  307. "precmm0__PrecMagnet__NorthRing__22",
  308. "precmm0__PrecMagnet__NorthRing__23"
  309. ),
  310. array(
  311. "precmm0__PrecMagnet__MidRing__0",
  312. "precmm0__PrecMagnet__MidRing__1",
  313. "precmm0__PrecMagnet__MidRing__2",
  314. "precmm0__PrecMagnet__MidRing__7",
  315. "precmm0__PrecMagnet__MidRing__8",
  316. "precmm0__PrecMagnet__MidRing__9",
  317. "precmm0__PrecMagnet__MidRing__14",
  318. "precmm0__PrecMagnet__MidRing__15",
  319. "precmm0__PrecMagnet__MidRing__16",
  320. "precmm0__PrecMagnet__MidRing__21",
  321. "precmm0__PrecMagnet__MidRing__22",
  322. "precmm0__PrecMagnet__MidRing__23",
  323. "precmm0__PrecMagnet__MidRing__28",
  324. "precmm0__PrecMagnet__MidRing__29",
  325. "precmm0__PrecMagnet__MidRing__30",
  326. "precmm0__PrecMagnet__MidRing__35",
  327. "precmm0__PrecMagnet__MidRing__36",
  328. "precmm0__PrecMagnet__MidRing__37"
  329. ),
  330. array(
  331. "precmm0__PrecMagnet__SouthRing__0",
  332. "precmm0__PrecMagnet__SouthRing__1",
  333. "precmm0__PrecMagnet__SouthRing__2",
  334. "precmm0__PrecMagnet__SouthRing__7",
  335. "precmm0__PrecMagnet__SouthRing__8",
  336. "precmm0__PrecMagnet__SouthRing__9",
  337. "precmm0__PrecMagnet__SouthRing__14",
  338. "precmm0__PrecMagnet__SouthRing__15",
  339. "precmm0__PrecMagnet__SouthRing__16",
  340. "precmm0__PrecMagnet__SouthRing__21",
  341. "precmm0__PrecMagnet__SouthRing__22",
  342. "precmm0__PrecMagnet__SouthRing__23"
  343. ),
  344. array(
  345. "fpd__katrin_rep__0__198",
  346. "fpd__katrin_rep__0__199",
  347. "fpd__katrin_rep__0__200"
  348. ),
  349. array(
  350. "csms__ControlSystem_MS__435HZ_Temperatur__27",
  351. "csms__ControlSystem_MS__435HZ_Temperatur__33",
  352. "csms__ControlSystem_MS__435HZ_Temperatur__42",
  353. "csms__ControlSystem_MS__435HZ_Temperatur__45"
  354. ),
  355. array(
  356. "aircoils__aircoils_rep__1__2",
  357. "aircoils__aircoils_rep__1__3",
  358. "aircoils__aircoils_rep__1__4",
  359. "aircoils__aircoils_rep__1__5",
  360. "aircoils__aircoils_rep__1__6",
  361. "aircoils__aircoils_rep__1__7",
  362. "aircoils__aircoils_rep__1__8",
  363. "aircoils__aircoils_rep__1__9",
  364. "aircoils__aircoils_rep__1__10",
  365. "aircoils__aircoils_rep__1__11",
  366. "aircoils__aircoils_rep__1__12",
  367. "aircoils__aircoils_rep__1__13",
  368. "aircoils__aircoils_rep__1__14",
  369. "aircoils__aircoils_rep__1__15",
  370. "aircoils__aircoils_rep__1__16",
  371. "aircoils__aircoils_rep__1__17"
  372. ),
  373. array(
  374. "aircoils__aircoils_rep__1__18",
  375. "aircoils__aircoils_rep__1__19",
  376. "aircoils__aircoils_rep__1__20",
  377. "aircoils__aircoils_rep__1__21",
  378. "aircoils__aircoils_rep__1__22",
  379. "aircoils__aircoils_rep__1__23",
  380. "aircoils__aircoils_rep__1__24",
  381. "aircoils__aircoils_rep__1__25",
  382. "aircoils__aircoils_rep__1__26",
  383. "aircoils__aircoils_rep__1__27",
  384. "aircoils__aircoils_rep__1__28",
  385. "aircoils__aircoils_rep__1__29",
  386. "aircoils__aircoils_rep__1__30",
  387. "aircoils__aircoils_rep__1__31",
  388. "aircoils__aircoils_rep__1__32",
  389. "aircoils__aircoils_rep__1__33"
  390. ),
  391. array(
  392. "aircoils__aircoils_rep__1__57",
  393. "aircoils__aircoils_rep__1__58",
  394. "aircoils__aircoils_rep__1__43",
  395. "aircoils__aircoils_rep__1__44",
  396. "aircoils__aircoils_rep__1__45",
  397. "aircoils__aircoils_rep__1__46",
  398. "aircoils__aircoils_rep__1__47",
  399. "aircoils__aircoils_rep__1__48",
  400. "aircoils__aircoils_rep__1__49",
  401. "aircoils__aircoils_rep__1__50",
  402. "aircoils__aircoils_rep__1__51",
  403. "aircoils__aircoils_rep__1__52",
  404. "aircoils__aircoils_rep__1__53",
  405. "aircoils__aircoils_rep__1__54",
  406. "aircoils__aircoils_rep__1__55",
  407. "aircoils__aircoils_rep__1__56",
  408. "aircoils__aircoils_rep__1__38"
  409. ),
  410. // CPS current (index 24)
  411. array(
  412. "cscps__ControlSystem_CPS__320_MAG_Stromzufuhr__0"
  413. ) ,
  414. // PP2 TMP temps (index 25)
  415. array(
  416. "csms__ControlSystem_MS__435HZ_PumpPort2__78",
  417. "csms__ControlSystem_MS__435HZ_PumpPort2__81",
  418. "csms__ControlSystem_MS__435HZ_PumpPort2__84"
  419. ),
  420. // PP3 TMP temps (index 26)
  421. array(
  422. "csms__ControlSystem_MS__435HZ_PumpPort3__60",
  423. "csms__ControlSystem_MS__435HZ_PumpPort3__63",
  424. "csms__ControlSystem_MS__435HZ_PumpPort3__66"
  425. ),
  426. // PS vacuum system (index 27)
  427. array(
  428. "csps__ControlSystem_PS__412VAK_PumpPort__27", // CC1232
  429. "csps__ControlSystem_PS__412VAK_PumpPort__6", // TMP 1122 speed
  430. "csps__ControlSystem_PS__412VAK_PumpPort__12", // TMP 1123 speed
  431. "csps__ControlSystem_PS__412VAK_PumpPort__42", // VAO 1313 ZUST
  432. "csps__ControlSystem_PS__412VAK_PumpPort__45", // VAO 1314 ZUST
  433. "csps__ControlSystem_PS__412VAK_PumpPort__21" // Ex1221
  434. ),
  435. // MS PP1 vacuum (index 28)
  436. array(
  437. "csms__ControlSystem_MS__432VAK_PumpPort1__0"
  438. ),
  439. // PS Temperatures (index 29)
  440. array(
  441. "csps__ControlSystem_PS__415HZ_Tank__78",
  442. "csps__ControlSystem_PS__415HZ_Tank__84",
  443. "csps__ControlSystem_PS__415HZ_Tank__90"
  444. ) ,
  445. // Voltage monitoring K35 etc. (index 30)
  446. array(
  447. "hv__katrin-hv_rep__7__2", //K35 divided voltage
  448. "hv__katrin-hv_rep__7__5" //K65 divided voltage
  449. ),
  450. // Interlock V4 and Detector Valve (index 31)
  451. array(
  452. "csms__ControlSystem_MS__436HV_Interlook__6" //CRT 5221 Freigabe
  453. )
  454. );
  455. $username = 'katrin';
  456. $password = 'neutrino';
  457. $context = stream_context_create(array(
  458. 'http' => array(
  459. 'header' => "Authorization: Basic " . base64_encode("$username:$password"), "Connection: close\r\n"
  460. )
  461. ));
  462. echo "Include ADEI array from file.";
  463. include 'ADEIvalues.php';
  464. echo "Done.".PHP_EOL;
  465. // Now read and test. $lines_read will contain an array like the original.
  466. // $adeiValue = [];
  467. // We use file function to read the file as an array of lines.
  468. //$file_r = file('ADEIvalues.dat');
  469. // Unpack all lines
  470. //foreach ($file_r as $line) {
  471. // Format is i* because we may have more than 1 int in the line
  472. // If you changed format while packing, you will have to unpack with the
  473. // corresponding same format
  474. // $adeiValue[] = unpack('f*', $line);
  475. //var_dump($adeiValue);
  476. //usleep(1000000);
  477. //}
  478. foreach ($adeiValue as $inner_array_value) {
  479. foreach ($inner_array_value as $num) {
  480. // Use of i format (integer). If you want to change format
  481. // according to the value of $num, you will have to save the
  482. // format too.
  483. echo $num . " ";
  484. usleep(10000);
  485. }
  486. echo PHP_EOL;
  487. }
  488. echo "Done.".PHP_EOL;
  489. ?>