SDS_status_main.php 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  1. <?php
  2. // display network localization
  3. if ($onsite) placeBox(25, 10, "Inside KIT CN network", 250, 2, "#DDDDDD");
  4. if (substr($ip, 0, 7) == "134.107") placeBox(25, 10, "MPP Munich network", 250, 2, "#FFFFFF");
  5. if (substr($ip, 0, 7) == "128.176") placeBox(25, 10, "WWU Muenster network", 250, 2, "#FFFFFF");
  6. $local = false;
  7. if (substr($ip, 0, 13) == "141.52.12.217") { placeBox(25, 10, "local dev computer", 250, 2, "#FFFFFF"); $local = true;}
  8. // echo '<br>Requested from inside KIT CN network.<br>';
  9. // global variable for PS operation mode
  10. $PSmode = $adeiValue[32][0];
  11. $MSmode = $adeiValue[33][0];
  12. $tol = 0.5;
  13. // ########## VALVES ##########
  14. // V4
  15. $value = $adeiValue[36][1];
  16. $clearance = $adeiValue[36][0];
  17. $pic = "valve";
  18. if (($value == 1) && ($clearance == 1)) $pic = $pic . "On";
  19. else if (($value == 0) && ($clearance == 0)) $pic = $pic . "Off";
  20. else if (($value == 0) && ($clearance == 1)) $pic = $pic . "FREE";
  21. else if (($value == 1) && ($clearance == 0)) $pic = $pic . "Error";
  22. placePicWithLink(303, 60, $pic . ".png", 30, "status CPS-PS gate vlave V4 &#10;purple: clearance to open, red: no clearance, grey: undefined", $adeiChannel[36][0].",".$adeiChannel[36][1]);
  23. // PS-MS flapper valve
  24. $value = 1; //getValveStatus($adeiValue[9][0]);
  25. $pic = "valve";
  26. if ($value == 1) $pic = $pic . "On";
  27. else if ($value == 0) $pic = $pic . "Off";
  28. placePic(303, 283, $pic . ".png", 30, "status PS beam-line gate valve&#10;green: open, red: closed, grey: undefined");
  29. // placePicWithLink(303, 283, $pic . ".png", 30, "status PS beam-line gate valve&#10;green: open, red: closed, grey: undefined", $adeiChannel[9][0]);
  30. // FPD gate valve
  31. $value = $adeiValue[36][2];
  32. $clearance = $adeiValue[31][0];
  33. $pic = "valve";
  34. if (($value == 1) && ($clearance == 1)) $pic = $pic . "On";
  35. else if (($value == 0) && ($clearance == 0)) $pic = $pic . "Off";
  36. else if (($value == 0) && ($clearance == 1)) $pic = $pic . "FREE";
  37. else if (($value == 1) && ($clearance == 0)) $pic = $pic . "Error";
  38. placePicWithLink(303, 1466, $pic . ".png", 30, "status FPD beam-line gate valve&#10;green: open, red: closed, grey: undefined", $adeiChannel[36][2].",".$adeiChannel[31][0]);
  39. // ########## MAGNETS ##########
  40. // CPS
  41. $NlCPS = 20550 / 0.9133;
  42. $BfieldCPS = 1.26e-6 * $adeiValue[24][0] * $NlCPS; // mu0 * I * N/l
  43. if ($BfieldCPS < 0.1) { $value = "OFF"; $color = "#FF0000"; }
  44. else { $value = sprintf('%.1F T', $BfieldCPS); $color = "#000000"; }
  45. placeTextWithLink(240, 2, $value, 60, 5, $color, "field of CPS behind separation wall derived from current", $adeiChannel[24][0]);
  46. placeText(265, 2, "CPS", 60, 2, "#000000");
  47. // PS1
  48. if ($adeiValue[3][3] == 0) { $value = "LEM"; $color = "#FF0000"; }
  49. else { $value = sprintf('%.1F T', $adeiValue[3][1] / 157.0 * 4.5); $color = "#000000"; }
  50. placeTextWithLink(240, 66, $value, 70, 5, $color, "stand-alone center field PS1 magnet", $adeiChannel[3][1]);
  51. placeText(265, 66, "PS1", 70, 2, "#000000");
  52. // PS2
  53. if ($adeiValue[3][2] == 0) { $value = "LEM"; $color = "#FF0000"; }
  54. else { $value = sprintf('%.1F T', $adeiValue[3][0] / 157.0 * 4.5); $color = "#000000"; }
  55. placeTextWithLink(240, 274, $value, 70, 5, $color, "stand-alone center field PS2 magnet", $adeiChannel[3][0]);
  56. placeText(265, 274, "PS2", 70, 2, "#000000");
  57. // Pinch
  58. placeTextWithLink(240, 1420, sprintf('%.1F', $adeiValue[4][0] / 86.98 * 6.0) . " T", 70, 5, "#000000", "stand-alone center field PCH magnet", $adeiChannel[4][0]);
  59. placeText(265, 1420, "PCH", 70, 2, "#000000");
  60. // Detector
  61. placeTextWithLink(240, 1495, sprintf('%.1F', $adeiValue[4][1] / 93.59 * 6.0) . " T", 70, 5, "#000000", "stand-alone center field DET magnet", $adeiChannel[4][1]);
  62. placeText(265, 1495, "DET", 70, 2, "#000000");
  63. // ########## PAE ##########
  64. placeTextWithLink(303, 1553, sprintf('%.1F', $adeiValue[6][2]) . " kV", 90, 5, "#000000", "PAE potential", $adeiChannel[6][2]);
  65. placeText(328, 1553, "PAE", 90, 2, "#000000");
  66. // ########## PUMP PORTS ##########
  67. placeText(416, 1623, "PP2", 50, 2, "#000000");
  68. placeText(466, 1623, "PP1", 50, 2, "#000000");
  69. placeText(516, 1623, "PP3", 50, 2, "#000000");
  70. // ########## BAFFLE ##########
  71. $max = array( 90, 94, 88 );
  72. $time_conversion_factor = 621355968000000000; // conversion for PCS7 .NET value;
  73. $timestamp = ($adeiValue[15][8] - $time_conversion_factor) / 10000000;
  74. echo '<br><font size="4" color="#000000">&nbsp;Baffle timestamp: ' . date("r", $timestamp ) . ' </font><br>';
  75. placeText(560, 1395, "LN<sub>2</sub> Tank", 130, 5, "#000000");
  76. $link = $adeiChannel[15][6] . "," . $adeiChannel[15][7];
  77. placePicWithLink(562,1360, "LN2tank.png", 60, "LN2 tank", $link);
  78. $value = $adeiValue[15][6]*0.77+0.83;
  79. $link = $adeiChannel[15][6];
  80. $text = sprintf('%.0F', $value) . " %";
  81. placeTextWithLink(590, 1395, $text, 70, 4, "#000000", "LN2 tank level", $link);
  82. $value = $adeiValue[15][7]-1.86;
  83. $link = $adeiChannel[15][7];
  84. $text = sprintf('%.1F', $value) . " bar";
  85. placeTextWithLink(590, 1450, $text, 70, 4, "#000000", "LN2 tank pressure", $link);
  86. for ($id = 0; $id < 3; $id++)
  87. {
  88. $value = $adeiValue[15][$id];
  89. $pic = "ice.png";
  90. $text = "---";
  91. if ($value < 800)
  92. {
  93. $text = sprintf('%.0F', $value) . " K";
  94. if ($value > $max[$id]) $pic = "iceOff.png";
  95. else
  96. {
  97. $value = $adeiValue[15][$id + 3];
  98. if ($value > 0.1 && $value < 7.0) $pic = "iceOn.png";
  99. else $pic = "iceBlink.gif";
  100. }
  101. }
  102. $pos = $id;
  103. if ($id == 0) $pos = 1;
  104. else if ($id == 1) $pos = 0;
  105. $link = $adeiChannel[15][$id] . "," . $adeiChannel[15][$id + 3];
  106. placePicWithLink(410 + $pos * 50, 1375, $pic, 30, "status baffle PP" . ($id + 1) . "&#10;blue: cooled, red: warmed, blinking: warming, grey: undefined", $link);
  107. placeTextWithLink(437 + $pos * 50, 1355, $text, 70, 4, "#000000", "temperature baffle PP" . ($id + 1), $link);
  108. }
  109. // ########## PRESSURES ##########
  110. // CC2320
  111. $value = $adeiValue[7][0];
  112. $pic = "cc";
  113. $text = "---";
  114. if ($value > 1E+2) { $pic = $pic; $text = "OFF"; }
  115. else if ($value > 2E-5) { $pic = $pic . "Off"; $text = "high"; }
  116. else if ($value <= 1E-4 && $value >= 1.3333E-11) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  117. else if ($value < 1.3333E-11) { $text = "LOW"; }
  118. placePicWithLink(410, 1435, $pic . ".png", 30, "status cold cathode gauge CC2320&#10;green: on, red: off, grey: undefined", $adeiChannel[7][0]);
  119. placeTextWithLink(439, 1415, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC2320", $adeiChannel[7][0]);
  120. $time_conversion_factor = 621355968000000000; // conversion for PCS7 .NET value;
  121. $timestamp = ($adeiValue[7][8] - $time_conversion_factor) / 10000000;
  122. echo '<font size="4" color="#000000">&nbsp;Vacuum timestamp: ' . date("r", $timestamp ) . ' </font><br>';
  123. // CC2345
  124. $value = $adeiValue[7][7];
  125. $pic = "cc";
  126. $text = "---";
  127. if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
  128. else if ($value <= 1E-4 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  129. placePicWithLink(427, 1482, $pic . ".png", 30, "status cold cathode gauge CC2345&#10;green: on, red: off, grey: undefined", $adeiChannel[7][7]);
  130. placeTextWithLink(406, 1462, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC2345", $adeiChannel[7][7]);
  131. // Ex3110
  132. $value = $adeiValue[8][0];
  133. $pic = "ex";
  134. $text = "---";
  135. if ($value > 2E-5) { $pic = $pic . "Off"; $text = "OFF"; }
  136. else if ($value <= 2E-5 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  137. placePicWithLink(510, 1435, $pic . ".png", 30, "status extractor ion gauge Ex3110&#10;green: on, red: off, grey: undefined", $adeiChannel[8][0]);
  138. placeTextWithLink(539, 1415, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex3110", $adeiChannel[8][0]);
  139. // Ex1110
  140. $value = $adeiValue[28][0];
  141. $link = $adeiChannel[28][0];
  142. $pic = "ex";
  143. $text = "---";
  144. if ($value > 2E-5) { $pic = $pic . "Off"; $text = "OFF"; }
  145. if ($value <= 2E-5 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value);}
  146. placePicWithLink(460, 1435, $pic.".png", 30, "status extractor ion gauge Ex1110&#10;green: off, blinking: on, grey: undefined", $link);
  147. placeTextWithLink(489, 1415, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex1110", $link);
  148. // Ex0096
  149. $value = $adeiValue[9][2];
  150. $link = $adeiChannel[9][2];
  151. $pic = "gauge";
  152. $text = "---";
  153. //$text = sprintf('%.1E', $value);
  154. if ($value > 1E+2) { $pic = $pic; $text = "OFF"; }
  155. else if ($value > 2E-5) { $pic = $pic . "Off"; $text = "OFF"; }
  156. else if ($value <= 1.1E-11) { $pic = $pic; $text = "LOW"; }
  157. else if ($value <= 2E-5 && $value > 1E-11) { $pic = "gaugeOn"; $text = sprintf('%.1E', $value);}
  158. placePicWithLink(230, 1220, $pic.".png", 30, "status stable ion gauge 0096&#10;green: off, blinking: on, grey: undefined", $link);
  159. placeTextWithLink(259, 1200, $text, 70, 4, "#000000", "pressure [mbar] stable ion gauge 0096", $link);
  160. // CC FPD
  161. $value = $adeiValue[6][1];
  162. $pic = "cc";
  163. $text = "---";
  164. if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
  165. if ($value < 1E-11) { $pic = $pic . "Off"; $text = "OFF"; }
  166. else if ($value <= 1E-4 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  167. placePicWithLink(188, 1475, $pic . ".png", 30, "status FPD cold cathode gauge&#10;green: on, red: off, grey: undefined", $adeiChannel[6][1]);
  168. placeTextWithLink(217, 1455, $text, 70, 4, "#000000", "pressure [mbar] FPD cold cathode gauge", $adeiChannel[6][1]);
  169. // Gauge Baffle
  170. $value = $adeiValue[5][0];
  171. $link = $adeiChannel[5][0];
  172. $color = "#000000";
  173. $pic = "gauge";
  174. $text = "---";
  175. if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
  176. // standard cold blue "#0026FF" , ice cold blue "#107BC7"
  177. if ($value < 2E-6 && $value > 1E-9) { $pic ="gaugeOn"; $color ="#107BC7"; $text = sprintf('%.1E', $value); }
  178. else if ($value >= 1E-6 && $value < 1e-1) { $pic = "gaugeOff"; $color = "FF0000"; $text = sprintf('%.1E', $value); }
  179. placePicWithLink(460, 1315, $pic . ".png", 30, "status baffle insulation vacuum gauge&#10;gray: off, green: on, red: too high&#10Should be < 5e-6 mbar for HV operation!!!", $link);
  180. placeTextWithLink(460+29, 1295, $text, 70, 4, $color, "pressure [mbar] baffle insulation vacuum gauge", $link);
  181. // PS CC1232
  182. $value = $adeiValue[27][0];
  183. $link = $adeiChannel[27][0];
  184. $pic = "cc";
  185. $text = "---";
  186. if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
  187. else if ($value <= 1E-4 && $value > 2E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  188. placePicWithLink(370, 240, $pic . ".png", 30, "status cold cathode gauge CC1232&#10;green: on, red: off, grey: undefined", $link);
  189. placeTextWithLink(399, 220, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC1232", $link);
  190. // PS Ex1221
  191. $value = $adeiValue[27][5];
  192. $link = $adeiChannel[27][5];
  193. $pic = "ex";
  194. $text = "---";
  195. if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
  196. else if ($value <= 1E-4 && $value > 2E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  197. placePicWithLink(188, 141, $pic . ".png", 30, "status extractor ion gauge Ex1221&#10;green: on, red: off, grey: undefined", $link);
  198. placeTextWithLink(217, 121, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex1221", $link);
  199. // ########## VACUUM PUMPS ##########
  200. // MS TMP Temperatures
  201. //T<sub>max</sub>
  202. $value = max($adeiValue[25][0], $adeiValue[25][1], $adeiValue[25][2]);
  203. $link = $adeiChannel[25][0] . "," . $adeiChannel[25][1] . "," . $adeiChannel[25][2];
  204. $color = "#000000";
  205. if ($value < 10) $color = "#0026FF";
  206. else if ($value > 50) $color = "#FF0000";
  207. placeTextWithLink(435, 1625, sprintf('%.1F &#176;C', $value), 70, 3, $color, "TMP max temperature PP2", $link);
  208. $value = max($adeiValue[26][0], $adeiValue[26][1], $adeiValue[26][2]);
  209. $link = $adeiChannel[26][0] . "," . $adeiChannel[26][1] . "," . $adeiChannel[26][2];
  210. $color = "#000000";
  211. if ($value < 10) $color = "#0026FF";
  212. else if ($value > 50) $color = "#FF0000";
  213. placeTextWithLink(535, 1625, sprintf('%.1F &#176;C', $value), 70, 3, $color, "TMP max temperature PP3", $link);
  214. // TMPs (PP2 + PP3)
  215. for ($pp = 0; $pp < 2; $pp++)
  216. {
  217. for ($id = 0; $id < 3; $id++)
  218. {
  219. $value = $adeiValue[$pp + 7][$id + 1];
  220. $pic = "tmp";
  221. $text = "---";
  222. if ($value < 50)
  223. {
  224. $pic = $pic . "Off";
  225. }
  226. else if ($value >= 50 && $value < 500)
  227. {
  228. $text = sprintf('%.0F', $value);
  229. if ($value > 450)
  230. {
  231. $value = $adeiValue[$pp + 7][$id + 4];
  232. //$pic = $pic . "On";
  233. if ($value == 1) $pic = $pic . "On";
  234. else if ($value == 0) $pic = $pic . "Closed";
  235. }
  236. else if ($value > 240)
  237. {
  238. $value = $adeiValue[$pp + 7][$id + 4];
  239. //$pic = $pic . "On";
  240. if ($value == 1) $pic = $pic . "Standby";
  241. else if ($value == 0) $pic = $pic . "Standby";
  242. }
  243. }
  244. placePicWithLink(410 + $pp * 100, 1528 + $id * 35, $pic . ".png", 30, "status turbo-molecular pump TMP" . ($pp + 2) . ($id + 4) . "20&#10;green: on, yellow: on but isolated, red: off, grey: undefined", $adeiChannel[$pp + 7][$id + 1]);
  245. placeTextWithLink(439 + $pp * 100, 1518 + $id * 35, $text, 50, 4, "#000000", "rotational speed [Hz] turbo-molecular pump TMP" . ($pp + 2) . ($id + 4) . "20", $adeiChannel[$pp + 7][$id + 1]);
  246. }
  247. }
  248. // PS TMPs
  249. for ($id = 0; $id < 2; $id++)
  250. {
  251. $value = $adeiValue[27][$id + 1];
  252. $link = $adeiChannel[27][$id + 1];
  253. $pic = "tmp";
  254. $text = "---";
  255. if ($value < 50)
  256. {
  257. $pic = $pic . "Off";
  258. }
  259. else if ($value >= 50 && $value < 700)
  260. {
  261. $text = sprintf('%.0F', $value);
  262. if ($value > 570)
  263. {
  264. $value = $adeiValue[27][$id + 3];
  265. //$pic = $pic . "On";
  266. if ($value == 1) $pic = $pic . "On";
  267. else if ($value == 0) $pic = $pic . "Standby";
  268. }
  269. }
  270. placePicWithLink(370, 157 + $id * 35, $pic . ".png", 30, "status turbo-molecular pump TMP" . (1123 - $id) . "&#10;green: on, yellow: on but isolated, red: off, grey: undefined", $link);
  271. placeTextWithLink(399, 148 + $id * 35, $text, 50, 4, "#000000", "rotational speed [Hz] turbo-molecular pump TMP" . (1123 - $id), $link);
  272. }
  273. // FPD CP
  274. $value = $adeiValue[6][3];
  275. $pic = "cp";
  276. $text = "---";
  277. if ($value > 20)
  278. {
  279. $pic = $pic . "Off";
  280. }
  281. else if ($value <= 20 && $value > 5)
  282. {
  283. $text = sprintf('%.0F K', $value);
  284. $value = $adeiValue[6][12];
  285. if ($value == 1) { $pic = $pic . "On"; }
  286. else if ($value == 0) { $pic = $pic . "Standby"; }
  287. }
  288. placePicWithLink(368-30, 1475, $pic . ".png", 30, "status FPD UHV cryo pump&#10;green: on, yellow: on but isolated, red: off, grey: undefined", $adeiChannel[6][3]);
  289. placeTextWithLink(368, 1455, $text, 70, 3, "#000000", "temperature FPD UHV cryo pump", $adeiChannel[6][3]);
  290. // ########## FPD SOURCES ##########
  291. $pic = "source";
  292. $text = "---";
  293. if ($adeiValue[6][9] == 1 && $adeiValue[6][10] == 1) { $pic = $pic . "On"; $text = "OUT"; }
  294. else if ($adeiValue[6][9] == 1 && $adeiValue[6][10] == 0) { $pic = $pic . "EIn"; $text = "IN"; }
  295. else if ($adeiValue[6][9] == 0 && $adeiValue[6][10] == 1) { $pic = $pic . "GIn"; $text = "IN"; }
  296. else if ($adeiValue[6][9] == 0 && $adeiValue[6][10] == 0) { $pic = $pic . "Off"; $text = "IN"; }
  297. $link = $adeiChannel[6][9] . "," . $adeiChannel[6][10];
  298. placePicWithLink(368-30, 1510, $pic . ".png", 30, "status FPD sources (electron and gamma source)&#10;green: retracted (out), red: inserted (in), grey: undefined", $link);
  299. placeTextWithLink(368, 1490, $text, 70, 3, "#000000", "status FPD sources (electron and gamma source)", $link);
  300. // ########## AIR COILS ##########
  301. // LFCS
  302. placeText(-15, 467, "LFCS", 70, 5, "#000000");
  303. $tol = 0.2;
  304. $text = "Unkn";
  305. $color = "#FFD800";
  306. $lfcs_array_offset = 2;
  307. $lfcs_config = -1; // store config for emcs later in loop
  308. for ($pp = 0; $pp < sizeof($aircoil_settings); $pp++)
  309. {
  310. for ($id = 0; $id < 16; $id++)
  311. {
  312. $tol = abs($tol);
  313. if ($id == 14) {$lfcs_array_offset = -13; }
  314. if ($id == 15) {$lfcs_array_offset = -15; }
  315. if (abs($adeiValue[0][$id + $lfcs_array_offset] - $aircoil_settings[$pp][$id + 1]) < $tol)
  316. {
  317. if ($id == 13) { $text = $aircoil_settings[$pp][0]; $lfcs_config = $pp; $color = "#FF9300"; }
  318. if ($id == 15) { $color = "#4CFF00"; } }
  319. else break;
  320. }
  321. if ($lfcs_config > -1) break;
  322. }
  323. if ($text == "All Off") { $text = "OFF"; $color = "#FF0000"; }
  324. placeBox(-12, 384, $text, 82, 3, $color);
  325. // EMCS
  326. placeText(-15, 200, "EMCS", 70, 5, "#000000");
  327. $tol = 0.2;
  328. $text = "???";
  329. $color = "#FFD800";
  330. $EMCShor = $aircoil_settings[$lfcs_config][15];
  331. $EMCSver = $aircoil_settings[$lfcs_config][16];
  332. if ($adeiValue[0][0] > $EMCSver - $tol && $adeiValue[0][0] < $EMCSver + $tol && $adeiValue[0][1] > $EMCShor - $tol && $adeiValue[0][1] < $EMCShor + $tol) { $text = "On OK"; $color = "#4CFF00"; }
  333. else if ($adeiValue[0][0] > $tol || $adeiValue[0][1] > $tol) { $text = "Unkn"; $color = "#FF9300"; }
  334. else { $text = "ERR ".$lfcs[$lfcs_config][16]; $color = "#FF0000"; }
  335. if ($adeiValue[0][0] < $tol && $adeiValue[0][1] < $tol && $adeiValue[0][0] > -$tol && $adeiValue[0][1] > -$tol) { $text = "OFF"; $color = "#FF0000"; }
  336. placeBox(-12, 128, $text, 67, 3, $color);
  337. // print current values
  338. $tol = 0.5;
  339. for ($coil = 0; $coil < 16; $coil++)
  340. {
  341. $value = $adeiValue[0][$coil];
  342. $color = "#000000";
  343. if (abs($value) < $adeiValue[21][$coil] - $tol || abs($value) > $adeiValue[21][$coil] + $tol) $color = "#FF0000";
  344. if ($value < -$tol && $adeiValue[22][$coil] != 1) $color = "#FF0000";
  345. if ($value > $tol && $adeiValue[22][$coil] != 0) $color = "#FF0000";
  346. if ($coil == 15) $value = -$value; // coil 14 is inverted
  347. $value = sprintf('%.1F', $value);
  348. if ($value <= -100 || $value >= 100) $value = sprintf('%.0F', $value);
  349. if ($value >= -0.1 && $value <= 0.1) $value = sprintf('%.1F', 0.0);
  350. // $status = $adeiValue[1][$coil];
  351. $status = 1;
  352. // $lem = $adeiValue[2][$coil];
  353. $lem = 1;
  354. if ($coil == 0) $pos = 270;
  355. else if ($coil == 1) $pos = 320;
  356. else if ($coil == 2) $pos = 521;
  357. else if ($coil == 15) $pos = 1167;
  358. else $pos = 609 + ($coil - 3) * 42.9;
  359. if ($status == 0 || $lem == 0) $color = "#FF0000";
  360. if ($status == 0) $value = "OVP";
  361. if ($lem == 0) $value = "LEM";
  362. $label = ($coil - 1);
  363. if ($coil == 0) $label = "VER";
  364. else if ($coil == 1) $label = "HOR";
  365. $color = "#006400";
  366. placeTextWithLink(-13, $pos, $value, 70, 4, $color, "air-coil current [A] for (".$lfcs[$lfcs_config][0].") setting.&#10;OVP: over-voltage protection triggered, LEM: DCCT offline", $adeiChannel[0][$coil]);
  367. placeText(5, $pos, $label, 70, 2, "#000000");
  368. $color = "#000000";
  369. $label = "";
  370. if ($adeiValue[22][$coil] == 1 && $adeiValue[23][16] == 0) { $color = "#FF0000"; $label = "FLIP"; }
  371. if ($adeiValue[22][$coil] == 0 && $adeiValue[23][16] == 1 && $adeiValue[23][$coil] == 1) { $color = "#FF0000"; $label = "PULS"; }
  372. if ($adeiValue[22][$coil] == 1 && $adeiValue[23][16] == 1 && $adeiValue[23][$coil] == 1) { $color = "#FF0000"; $label = "PULS"; } // F+P
  373. placeTextWithLink(22 + 12, $pos, $label, 70, 2, $color, "air-coil status&#10;FLIP: flipped, PULS: pulsed, F+P: both", $adeiChannel[23][$coil]);
  374. }
  375. // ########## HIGH VOLTAGE ##########
  376. if (($MSmode == 5) or ($MSmode == 4))
  377. { // only display in MS operation mode High-Voltage or baking
  378. // load patch-panel configuration
  379. $handle = fopen("patchpanel/ringstoadei.txt", "r");
  380. $ringsToAdei = array();
  381. if ($handle)
  382. {
  383. while (($buffer = fgets($handle, 4096)) !== false)
  384. {
  385. $buffer = trim($buffer);
  386. $ringsToAdei[count($ringsToAdei)] = $buffer;
  387. }
  388. fclose($handle);
  389. }
  390. // labels
  391. $posY = 12; // offset between labels and voltages (13)
  392. $posX = 6; // down/bottom (7)
  393. if ($MSmode == 5)
  394. { // only display in MS operation mode High-Voltage
  395. $time_conversion_factor = 2082844800;
  396. $timestamp = ($adeiValue[30][2] - $time_conversion_factor);
  397. echo '<font size="4" color="#000000">&nbsp;HV meas. timestamp: ' . date("r", $timestamp ) . ' </font><br>';
  398. // HV switch for K35
  399. $hv_switch1103_k35 = $adeiValue[35][2];
  400. if ($hv_switch1103_k35 == 1) $k35_text = "K35 @ MoS Voltage";
  401. else if ($hv_switch1103_k35 == 0) $k35_text = "K35 @ MS Voltage";
  402. $k35_text = "JRL50 @ PS Tank";
  403. // voltage monitoring readout K35
  404. $color = "#000000";
  405. $factor_m = 5000.1021;
  406. $offset = 4.529e-6;
  407. $gain = 0.999997525656185;
  408. $value = ($adeiValue[30][0] - $offset) * $gain * $factor_m;
  409. // $voltage_error = abs($value * 2e-3);
  410. $voltage_error = abs($value * 10e-6);
  411. if ($voltage_error*100 < 1) { $voltage_error = 0.2; }
  412. // voltage display K35
  413. $link = $adeiChannel[30][0];
  414. $text = "K35 divider readout 436-REU-0-0201-0001, precision voltage value, in 2019 used for JRL50 at PS";
  415. //placeText(385, 716, $k35_text, 130, 2, $color); // K35 voltage reading
  416. //placeTextWithLink(363, 696, sprintf('%.3F', $value ) . "(" . sprintf('%.0F', $voltage_error ) .") V" , 170, 4, $color, $text, $link);
  417. placeText(520, 136, $k35_text, 130, 2, $color); // K35 voltage reading
  418. // placeText(490, 136, "uncalibrated", 130, 2, "orange"); // K35 voltage reading
  419. placeTextWithLink(502, 116, sprintf('%.2F', $value ) . "(" . sprintf('%.0F', $voltage_error*100 ) .") V" , 170, 4, $color, $text, $link);
  420. // HV switch for K65
  421. $hv_switch1102_k65 = $adeiValue[35][1];
  422. $k65_text = "K35 @ MS Tank + IE";
  423. //$k65_text = "Fluke E @ Reference";
  424. //if ($hv_switch1102_k65 == 1) $k65_text = "K65 @ MoS Voltage";
  425. //if ($hv_switch1102_k65 == 0) $k65_text = "K65 @ MS Voltage";
  426. // voltage monitoring readout K65
  427. $color = "#000000";
  428. $factor_m = 1972.449;
  429. $factor_m_rel_error = 0.01/$factor_m;
  430. $offset = 3.831e-06;
  431. $gain = 1.00000037602556;
  432. $value = ($adeiValue[30][1] - $offset) * $gain * $factor_m;
  433. $voltage_error = abs($value * $factor_m_rel_error * 1e3); // in mV
  434. if ($voltage_error < 1) { $voltage_error = 1; }
  435. // voltage display K65
  436. $link = $adeiChannel[30][1];
  437. $text = "K65 divider readout 436-REU-0-0301-0001, precision voltage value, in 2019 used for K35";
  438. //placeText(385, 916,
  439. placeTextWithLink(363, 796, sprintf('%.3F', $value ) . "(" . sprintf('%.0F', $voltage_error ) .") V" , 170, 4, $color, $text, $link);
  440. // placeTextWithLink(363, 796, sprintf('%.6F', $value ) ." V" , 170, 4, $color, $text, $link);
  441. // placeTextWithLink(363, 896,
  442. //display stability indicators
  443. //if ($local) {
  444. if (sizeof($flukeE) > 2) {
  445. placeText(400, 811, $k65_text, 140, 2, $color); // K65 voltage reading
  446. if ($flukeE[0]['ppmdev'] <= 2e-6) $color1 = "lightgreen";
  447. if ($flukeE[1]['ppmdev'] <= 2e-6) $color2 = "lightgreen";
  448. if ($flukeE[2]['ppmdev'] <= 2e-6) $color3 = "lightgreen";
  449. if ($flukeE[3]['ppmdev'] <= 2e-6) $color4 = "lightgreen";
  450. if ($flukeE[0]['ppmdev'] > 2e-6) $color1 = "orange";
  451. if ($flukeE[1]['ppmdev'] > 2e-6) $color2 = "orange";
  452. if ($flukeE[2]['ppmdev'] > 2e-6) $color3 = "orange";
  453. if ($flukeE[3]['ppmdev'] > 2e-6) $color4 = "orange";
  454. if ($flukeE[0]['ppmdev'] > 5e-6) $color1 = "#FFA0A0";
  455. if ($flukeE[1]['ppmdev'] > 5e-6) $color2 = "#FFA0A0";
  456. if ($flukeE[2]['ppmdev'] > 5e-6) $color3 = "#FFA0A0";
  457. if ($flukeE[3]['ppmdev'] > 5e-6) $color4 = "#FFA0A0";
  458. placeBox(384, 915, "10s", 35, 1, $color1);
  459. placeBox(384, 880, "20s", 35, 1, $color2);
  460. placeBox(384, 845, "1m", 35, 1, $color3);
  461. placeBox(384, 810, "5m", 35, 1, $color4);
  462. echo '<font size="4" color="#000000">&nbsp;HV status timestamp: ' . $extraction_time_HV . ' </font><br>';
  463. }
  464. else placeText(385, 811, $k65_text, 140, 2, $color); // K65 voltage reading
  465. }
  466. //placeText(180, 845, "MS WEST IE", 70, 2,"#808080"); // west IE being displayed in loop below
  467. //placeText(450, 845, "MS EAST IE", 70, 2,"#808080"); // east IE
  468. placeText(265, 815, "MS IE COMMON", 130, 2, "#000000"); // mainspec IE Common
  469. // MS Tank from Precision HCP Supply or Standard HCN
  470. $text = "MS TANK";
  471. $ms_hcn_soll = $adeiValue[10][1];
  472. $ms_hcp_soll = $adeiValue[10][25];
  473. $HCP = false;
  474. if ($ms_hcn_soll == 0) {
  475. if ($ms_hcp_soll == 0) { $text = $text . " OFF";}
  476. else { $text = $text . " HCP"; $HCP = true; }
  477. } else { $text = $text . " HCN"; $HCP = false; }
  478. placeText(70, 830, $text, 100, 2, "#000000"); // mainspec tank
  479. // switch values here between HCN and HCP in Value and Channel Array !!!
  480. if ($HCP) { $adeiValue[10][0] = -$adeiValue[10][24]; $adeiValue[10][1] = $adeiValue[10][25];
  481. $adeiChannel[10][0] = $adeiChannel[10][24]; $adeiChannel[10][1] = $adeiChannel[10][25]; }
  482. placeText(110-$posY, 845, "W7-11", 70, 2, "#000000"); // w7-11
  483. placeText(503+$posY+$posX, 845, "E7-11", 70, 2, "#000000"); // e7-11
  484. placeText(126-$posY, 600, "W6", 70, 2, "#000000"); // w6
  485. placeText(487+$posY+$posX, 600, "E6", 70, 2, "#000000"); // e6
  486. placeText(126-$posY, 1090, "W12", 70, 2, "#000000"); // w12
  487. placeText(487+$posY+$posX, 1090, "E12", 70, 2, "#000000"); // e12
  488. placeText(161-$posY, 516, "W5", 70, 2, "#000000"); // w5
  489. placeText(452+$posY+$posX, 516, "E5", 70, 2, "#000000"); // e5
  490. placeText(161-$posY, 1174, "W13", 70, 2, "#000000"); // w13
  491. placeText(452+$posY+$posX, 1174, "E13", 70, 2, "#000000"); // e13
  492. placeText(194-$posY, 434, "W4", 70, 2, "#000000"); // w4
  493. placeText(419+$posY+$posX, 434, "E4", 70, 2, "#000000"); // e4
  494. placeText(194-$posY, 1256, "W14", 70, 2, "#000000"); // w14
  495. placeText(419+$posY+$posX, 1256, "E14", 70, 2, "#000000"); // e14
  496. placeText(225-$posY, 385, "W3", 70, 2, "#000000"); // w3
  497. placeText(388+$posY+$posX, 385, "E3", 70, 2, "#000000"); // e3
  498. placeText(225-$posY, 1305, "W15", 70, 2, "#000000"); // w15
  499. placeText(388+$posY+$posX, 1305, "E15", 70, 2, "#000000"); // e15
  500. placeText(273-$posY, 352, "W2", 70, 2, "#000000"); // w2
  501. placeText(340+$posY+$posX, 352, "E2", 70, 2, "#000000"); // e2
  502. placeText(273-$posY, 1338, "W16", 70, 2, "#000000"); // w16
  503. placeText(340+$posY+$posX, 1338, "E16", 70, 2, "#000000"); // e16
  504. if ($adeiValue[10][8] > 10.0) placeText(309, 359, "APE", 70, 2, "#000000"); // ape south
  505. if ($adeiValue[10][10] > 10.0) placeText(309, 1331, "APE", 70, 2, "#000000"); // ape north
  506. // offset voltages
  507. $posY = 16; // offset between outer and inner voltages
  508. $ringsPosY = array( 273, 273+$posY, 225, 225+$posY, 194, 194+$posY, 161, 161+$posY, 126, 126+$posY, 110, 110+$posY, 126, 126+$posY, 161, 161+$posY, 194, 194+$posY, 225, 225+$posY, 273, 273+$posY, 340, 340-$posY, 388, 388-$posY, 419, 419-$posY, 452, 452-$posY, 487, 487-$posY, 503, 503-$posY, 487, 487-$posY, 452, 452-$posY, 419, 419-$posY, 388, 388-$posY, 340, 340-$posY );
  509. $ringsPosX = array( 352, 352, 385, 385, 434, 434, 516, 516, 600, 600, 845, 845, 1090, 1090, 1174, 1174, 1256, 1256, 1305, 1305, 1338, 1338, 352, 352, 385, 385, 434, 434, 516, 516, 600, 600, 845, 845, 1090, 1090, 1174, 1174, 1256, 1256, 1305, 1305, 1338, 1338 );
  510. $tol = 0.2;
  511. for ($pp = 0; $pp < 2; $pp++) // west (0), east (1)
  512. {
  513. for ($id = 0; $id < 22; $id++) // rings: o, i, o, i, ...
  514. {
  515. // show voltage if not shorted to IE
  516. if ($ringsToAdei[$id + 22*$pp] != "IE" && $ringsToAdei[$id + 22*$pp] != "")
  517. {
  518. // color
  519. if ( ($adeiValue[11 + 2*$pp][$ringsToAdei[$id + 22*$pp]] > $adeiValue[12 + 2*$pp][$ringsToAdei[$id + 22*$pp]] - $tol) && ($adeiValue[11 + 2*$pp][$ringsToAdei[$id + 22*$pp]] < $adeiValue[12 + 2*$pp][$ringsToAdei[$id + 22*$pp]] + $tol) )
  520. $color = "#000000";
  521. else
  522. $color = "#FF0000";
  523. // show voltage
  524. if ( ($id % 2 == 0) || ($id % 2 == 1 && $ringsToAdei[$id + 22*$pp] != $ringsToAdei[$id + 22*$pp - 1]) )
  525. {
  526. placeTextWithLink($ringsPosY[$id + 22*$pp], $ringsPosX[$id + 22*$pp], "+" . sprintf('%.1F', $adeiValue[11 + 2*$pp][$ringsToAdei[$id + 22*$pp]]), 70, 4, $color, "relative voltage offset", $adeiChannel[11 + 2*$pp][$ringsToAdei[$id + 22*$pp]]);
  527. }
  528. }
  529. }
  530. }
  531. // tank, ie, dipole, ape
  532. $ringsPosY = array( 45, 240, 155, 425, 306, 306, 0, 240, 300, 285, 300, 315 );
  533. $ringsPosX = array( 805, 805, 805, 805, 319, 1371, 0, 150, 160, 190, 220, 190 );
  534. $tolA = array ( 15, 2, 1, 1, 1, 1, 0, 250, 2, 2, 2, 2);
  535. // MS voltages
  536. for ($pp = 0; $pp < 6; $pp++) // tank (0), ie (1), ie west (2), ie east (3), ape south (4), ape north (5)
  537. {
  538. // color
  539. if ( ($adeiValue[10][2*$pp] > $adeiValue[10][2*$pp + 1] - $tolA[$pp]) && ($adeiValue[10][2*$pp] < $adeiValue[10][2*$pp + 1] + $tolA[$pp]) )
  540. $color = "#000000";
  541. else
  542. $color = "#FF0000";
  543. // show voltage
  544. $value = $adeiValue[10][2*$pp];
  545. $link = $adeiChannel[10][2*$pp];
  546. $dipolestatus = $adeiValue[2][16];
  547. $dipolelink = $adeiChannel[2][16];
  548. if ($pp == 0) { $text = "absolute tank potential HCN:436-EHV-0-1001-0002 HCP:436-EHV-0-1002-0002"; }
  549. else if ($pp == 1) { $text = "IE common offset potential, 436-EHV-0-1003-0002"; }
  550. else if ($pp == 2) { $text = "relative voltage potential west IE"; }
  551. else if ($pp == 3) { $text = "relative voltage potential east IE"; }
  552. else if ($pp == 4) { $text = "relative voltage potential south APE"; }
  553. else if ($pp == 5) { $text = "relative voltage potential north APE"; }
  554. if ($pp == 2 || $pp == 3)
  555. {
  556. if ($dipolestatus == 1) // dipole enabled
  557. {
  558. $color = "#990000";
  559. $value = $adeiValue[10][2*$pp];
  560. if ($pp == 2)
  561. {
  562. placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000" );
  563. }
  564. else if ($pp == 3)
  565. {
  566. placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000");
  567. }
  568. }
  569. else
  570. {
  571. $value = $adeiValue[10][2*$pp]; // dipole disabled
  572. $color = "#909090";
  573. }
  574. if ($pp == 2) placeText(180, 825, "MS WEST IE", 110, 2, $color); // west IE
  575. else if ($pp == 3) placeText(450, 825, "MS EAST IE", 110, 2, $color); // east IE
  576. $link = $adeiChannel[10][2*$pp+1] . "," . $adeiChannel[10][2*$pp] . "," . $dipolelink;
  577. }
  578. // tank potential
  579. if ($pp == 0) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 150, 5, $color, $text, $link);
  580. // IE common
  581. else if ($pp == 1) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.2F V', -$value), 150, 5, $color, $text, $link);
  582. // IE dipoles
  583. else if ($pp == 2 || $pp == 3) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.2F V', $value), 150, 5, $color, $text, $link);
  584. // APE
  585. else if ($pp == 4 || $pp == 5)
  586. {
  587. if ($adeiValue[10][2*$pp] > 10.0) { placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp] , sprintf('%.1F', $value), 70, 4, $color, $text, $link); }
  588. }
  589. }
  590. }
  591. // PS voltages (add $pp < 10 for PS IE )
  592. if ($PSmode == 5)
  593. { // only display in PS operation mode High-Voltage
  594. placeText(265, 190, "PS TANK", 70, 2, "#000000"); // prespec tank
  595. placeText(330, 160, "PS IE", 120, 2, "#505050"); // prespec IE
  596. for ($pp = 7; $pp < 12; $pp++) // PS tank (channel 7 = array entry 14 + 15), IE west (8), IE east (9)
  597. {
  598. // color and text
  599. if ($pp == 7) { $text = "Primary PS tank potential of 416EHV1001"; $color = "#000000";}
  600. else if ($pp == 8) { $text = "relative voltage potential PS IE1 Ch1A of 416EHV1002"; $color = "#505050";}
  601. else if ($pp == 9) { $text = "relative voltage potential PS IE2 Ch1B of 416EHV1002"; $color = "#505050";}
  602. else if ($pp == 10) { $text = "relative voltage potential PS IE3 Ch2A of 416EHV1003"; $color = "#505050";}
  603. else if ($pp == 11) { $text = "relative voltage potential PS IE4 Ch2B of 416EHV1003"; $color = "#A0A0A0";}
  604. // setpoint mismatch color
  605. if ( ($adeiValue[10][2*$pp] > $adeiValue[10][2*$pp + 1] - $tolA[$pp]) && ($adeiValue[10][2*$pp] < $adeiValue[10][2*$pp + 1] + $tolA[$pp]) )
  606. $color = $color;
  607. else
  608. $color = "#FF0000";
  609. // show voltage
  610. $value = $adeiValue[10][2*$pp];
  611. $link = $adeiChannel[10][2*$pp];
  612. if ($pp == 7) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 150, 5, $color, $text, $link);
  613. else placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 60, 2, $color, $text, $link);
  614. }
  615. }
  616. // ########## Split Ring Electrodes ##########
  617. $srPosX = array( 59, 284, 1420 );
  618. $srPosY = array( 402, 402, 370 );
  619. $srKATRINNumber = array( "418-EEL-3-2150", "418-EEL-3-4150", "438-EEL-3-5150" );
  620. // CPS-PS electrode 418-EEL-2150
  621. // $sr: 0 = cps-ps ; 1 = PS-MS ; 2 = MS-FPD
  622. for ($sr = 0; $sr < 3; $sr++)
  623. {
  624. $splitringON = $adeiValue[36][4*$sr + 3];
  625. $pic = "splitring";
  626. if ($splitringON = 1)
  627. {
  628. $color = "#000000";
  629. $splitringVal = $adeiValue[36][4*$sr + 4];
  630. $splitringPOL = $adeiValue[36][4*$sr + 5];
  631. $splitringSet = $adeiValue[36][4*$sr + 6];
  632. $link = $adeiChannel[36][$sr*4 + 4];
  633. if ($splitringVal < 25) { $color="#FF0000"; $pic = $pic."Alarm";}
  634. else {
  635. if ($splitringPOL == 0) {$sign = "+"; $pic = $pic."On";}
  636. if ($splitringPOL == 1) {$sign = "-"; $pic = $pic."Warn";}
  637. }
  638. placePicWithLink($srPosY[$sr]-32,$srPosX[$sr]+16, $pic.".png", 30, "status of split ring electrode (green = polarity pos and OK, gray = off, red = low voltage alarm, orange = polarity neg warning", $link);
  639. placeTextWithLink($srPosY[$sr],$srPosX[$sr], $sign.sprintf('%.0F V', $splitringVal), 60, 2, $color, "Voltage on split ring electrode ".$srKATRINNumber[$sr], $link);
  640. }
  641. else placePicWithLink($srPosY[$sr]-32,$srPosX[$sr]+16, $pic."Off.png", 30, "status of split ring electrode", $link);
  642. }
  643. // ########## DETECTOR ##########
  644. // detector powered
  645. $lowVoltage = array( 12, 8, 6, 6, 120 );
  646. $link = "";
  647. $pic = "fpdOn";
  648. $text = "ON";
  649. for ($id = 0; $id < 5; $id++)
  650. {
  651. $value = $adeiValue[6][4 + $id];
  652. if (!($value < $lowVoltage[$id] + 0.2 && $value > $lowVoltage[$id] - 0.2))
  653. {
  654. $pic = "fpdOff";
  655. $text = "OFF";
  656. }
  657. $link = $link . $adeiChannel[6][4 + $id] . ",";
  658. }
  659. $link = substr($link, 0, strlen($link) - 1);
  660. placePicWithLink(200, 1600, $pic . ".png", 30, "status FPD power&#10;green: on, red: off, grey: undefined", $link);
  661. placeTextWithLink(227, 1580, $text, 70, 4, "#000000", "status FPD power", $link);
  662. // carousel
  663. $value = $adeiValue[6][11];
  664. $color = "#000000";
  665. if ($value < -95) $value = "---";
  666. else $value = sprintf('%.0F', $adeiValue[6][11]) . " &#176;C";
  667. placeTextWithLink(255, 1565, $value, 100, 4, $color, "temperature FPD carousel/electronics", $adeiChannel[6][11]);
  668. placeText(275, 1565, "carousel", 100, 2, "#000000");
  669. // ########## MAGNETOMETERS ##########
  670. $mag = array(4, 6, 4);
  671. for ($pp = 0; $pp < 3; $pp++)
  672. {
  673. $bx = 0;
  674. $by = 0;
  675. $bz = 0;
  676. $link = "";
  677. for ($id = 0; $id < $mag[$pp]; $id++)
  678. {
  679. $bx = $bx + $adeiValue[16 + $pp][3 * $id];
  680. $by = $by + $adeiValue[16 + $pp][3 * $id + 1];
  681. $bz = $bz + $adeiValue[16 + $pp][3 * $id + 2];
  682. $link = $link . $adeiChannel[16 + $pp][3 * $id + 2] . ",";
  683. //echo $bx . " " . $by . " " . $bz . "<br>";
  684. }
  685. $bx = $bx / $mag[$pp];
  686. $by = $by / $mag[$pp];
  687. $bz = $bz / $mag[$pp];
  688. $link = substr($link, 0, strlen($link) - 1);
  689. $value = sqrt($bx * $bx + $by * $by + $bz * $bz);
  690. $text = "averaged field precise magnetometers ";
  691. if ($pp == 0) $text = $text . "north ";
  692. else if ($pp == 1) $text = $text . "middle ";
  693. else if ($pp == 2) $text = $text . "south ";
  694. $text = $text . "ring";
  695. placeTextWithLink(553, 1015 - 170 * $pp, sprintf('%.1F G', $value), 70, 5, "#000000", $text, $link);
  696. }
  697. // dipole
  698. // $pic = "status";
  699. // if ($pulserId[0] == "dipole" && $daqElapsed[0] > 30)
  700. // {
  701. // if ($pulserCounts[0] > 0) $pic = $pic . "On";
  702. // else if ($pulserCounts[0] == 0) $pic = $pic . "Off";
  703. // }
  704. //placePic($posY + 34 + 25, $posX + 80, $pic . ".png", 17, "status dipole sync pulser&#10;green: on, red: off, grey: undefined");
  705. // egun
  706. // $pic = "status";
  707. // if ($pulserId[1] == "egun" && $daqElapsed[0] > 30)
  708. // {
  709. // if ($pulserCounts[1] > 0) $pic = $pic . "On";
  710. // else if ($pulserCounts[1] == 0) $pic = $pic . "Off";
  711. // }
  712. //placePic($posY + 34 + 50, $posX + 80, $pic . ".png", 17, "status egun sync pulser&#10;green: on, red: off, grey: undefined");
  713. // muon
  714. // $pic = "status";
  715. // if ($pulserId[3] == "muon" && $daqElapsed[0] > 30)
  716. // {
  717. // if ($pulserCounts[3] > 0) $pic = $pic . "On";
  718. // else if ($pulserCounts[3] == 0) $pic = $pic . "Off";
  719. // }
  720. // placePic($posY + 34 + 75, $posX + 80, $pic . ".png", 17, "status muon sync pulser&#10;green: on, red: off, grey: undefined");
  721. // ########## HALL ##########
  722. placePicWithLink(-30-3, 1585, "newTemperature.png", 23, "temperature in KATRIN hall", $adeiChannel[19][1]);
  723. placeTextWithLink(-30-3, 1605, sprintf('%.1F &#176;C', $adeiValue[19][1]), 80, 4, "#000000", "temperature in KATRIN hall", $adeiChannel[19][1]);
  724. placePicWithLink(-2-3, 1585, "newPressure.png", 23, "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  725. placeTextWithLink(-2-3, 1605, sprintf('%.0F hPa', $adeiValue[19][0] * 0.0689475729 * 1000.0), 80, 4, "#000000", "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  726. //placeTextWithLink(-2-3, 1820, sprintf('%.3F bar', $adeiValue[19][0] * 0.0689475729), 80, 4, "#000000", "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  727. placePicWithLink(26-3, 1585, "newHumidity.png", 23, "relative humidity in KATRIN hall", $adeiChannel[19][2]);
  728. placeTextWithLink(26-3, 1605, sprintf('%.1F &#037;', $adeiValue[19][2]), 80, 4, "#000000", "relative humidity in KATRIN hall", $adeiChannel[19][2]);
  729. // ########## HIGH PRESSURE MS ##########
  730. $value = $adeiValue[9][3];
  731. if ($value > 1.0)
  732. {
  733. if ($value < 20.0) $pic = "bottleBlinking.gif";
  734. else $pic = "bottleOn.png";
  735. $text = "ON";
  736. $color = "#000000";
  737. if ($adeiValue[9][4] != 64) $color = "#FF0000";
  738. placeTextWithLink(135, 1387, sprintf('%.1F &#037;', $adeiValue[9][3]), 70, 4, $color, "gas flow leak valve", $adeiChannel[9][5]);
  739. placeTextWithLink(160, 1387, sprintf('%.1E', $adeiValue[9][0]), 70, 4, $color, "pressure [mbar] MKS Baratron", $adeiChannel[9][3]);
  740. }
  741. else
  742. {
  743. $pic = "bottle.png";
  744. $text = "OFF";
  745. }
  746. $link = $adeiChannel[9][3] . "," . $adeiChannel[9][0];
  747. placePicWithLink(135, 1358, $pic, 48, "status gas injection system&#10;gray: off, blinking: low, green: on&#10Should be off for nominal pressure measurements!!!", $link);
  748. placeTextWithLink(180, 1347, $text, 70, 4, "#000000", "status gas injection system", $link);
  749. // ########## HIGH PRESSURE PS ##########
  750. $value = $adeiValue[27][7];
  751. $posOK = $adeiValue[27][6];
  752. $link = $adeiChannel[27][6].",".$adeiChannel[27][7];
  753. if ($value < 1)
  754. {
  755. $pic = "bottle.png";
  756. $text = "OFF";
  757. $color = "#909090";
  758. }
  759. else if (($value >= 1) && ($value < 15))
  760. {
  761. $pic = "bottleBlinking.gif";
  762. $text = "ON";
  763. $color = "#000000";
  764. }
  765. else if ($value >= 15)
  766. {
  767. $pic = "bottleOn.png";
  768. $text = sprintf('%.1F', $value)." %";
  769. $color = "#000000";
  770. if ($posOK == 1) placeBox(418, 107, "Pos OK", 40, 2, "#00FF00");
  771. else placeBox(418, 107, "PosErr", 40, 2, "#FF0000");
  772. }
  773. placePicWithLink(370, 113 , $pic, 30, "status PS gas injection system&#10;gray: off, blinking: low, green: on&#10Should be off for nominal pressure measurements!!!", $link);
  774. placeTextWithLink(402, 99, $text, 60, 2, $color, "status gas injection system", $link);
  775. // ########## PS PCS7 operation mode ##########
  776. $OpModeText = "PS mode: ";
  777. $color = "#FFFFFF";
  778. if ($PSmode == 0) { $OpModeText = $OpModeText." commissioning"; $color="#FFA0A0"; }
  779. else if ($PSmode == 1) $OpModeText = $OpModeText.$PSmode." pump down";
  780. else if ($PSmode == 2) $OpModeText = $OpModeText.$PSmode." venting";
  781. else if ($PSmode == 3) $OpModeText = $OpModeText.$PSmode." pumping";
  782. else if ($PSmode == 4) $OpModeText = $OpModeText.$PSmode." baking";
  783. else if ($PSmode == 5) { $OpModeText = $OpModeText.$PSmode." high voltage"; $color="#B0FFB0"; }
  784. placeBox(50, 10, $OpModeText, 250, 2, $color);
  785. // ########## PS PCS7 operation mode ##########
  786. $OpModeText = "MS mode: ";
  787. $color = "#FFFFFF";
  788. if ($MSmode == 0) { $OpModeText = $OpModeText." commissioning"; $color="#FFA0A0"; }
  789. else if ($MSmode == 1) $OpModeText = $OpModeText.$PSmode." pump down";
  790. else if ($MSmode == 2) $OpModeText = $OpModeText.$PSmode." venting";
  791. else if ($MSmode == 3) $OpModeText = $OpModeText.$PSmode." pumping";
  792. else if ($MSmode == 4) $OpModeText = $OpModeText.$PSmode." baking";
  793. else if ($MSmode == 5) { $OpModeText = $OpModeText.$PSmode." high voltage"; $color="#B0FFB0"; }
  794. placeBox(75, 10, $OpModeText, 250, 2, $color);
  795. // ########## TLK Wall and LAUDA TEMPERATURE ##########
  796. if ($PSmode == 5)
  797. { // only display if PS operation mode is HV
  798. // mean of 4023, 4033, 4043
  799. $link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
  800. $value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2])/3.0;
  801. $color = "#000000";
  802. if ($value < 4000) placeTextWithLink(440, 145, "T<sub>PS</sub> = " . sprintf('%.1F &#176;C', $value), 120, 4, $color, "PS mean temperature of 4023..33..43", $link);
  803. }
  804. if ($PSmode != 5)
  805. { // only display if PS operation mode is Baking
  806. $min = 18;
  807. $max = 30;
  808. // sensor 4100 ID [29][3]
  809. $link = $adeiChannel[29][3];
  810. $value = $adeiValue[29][3];
  811. $color = "#000000";
  812. if ($value < $min) $color = "#0026FF";
  813. else if ($value > $max) $color = "#FF0000";
  814. if ($value < 400) placeTextWithLink(120, 5, "T<sub>wall</sub> = " . sprintf('%.1F &#176;C', $value), 120, 4, $color, "TLK separation wall temperature of RTP4100", $link);
  815. $min = 15;
  816. // LAUDA System 5401 [34][0..1]
  817. $link = $adeiChannel[34][0].",".$adeiChannel[34][1];
  818. $value = $adeiValue[34][0];
  819. $max = $adeiValue[34][1]+1;
  820. $color = "#000000";
  821. if ($value < $min) $color = "#0026FF";
  822. else if ($value > $max) $color = "#FF0000";
  823. if ($value < 400) placeTextWithLink(460, 110, "T<sub>LAUDA</sub> = " . sprintf('%.1F &#176;C', $value), 180, 4, $color, "LAUDA System actual temperature value", $link);
  824. // ########## PS VESSEL TEMPERATURES ##########
  825. $min = 18;
  826. $max = 65;
  827. // mean of 4023, 4033, 4043
  828. $link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
  829. $value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2])/3.0;
  830. $color = "#000000";
  831. if ($value < $min) $color = "#0026FF";
  832. else if ($value > $max) $color = "#FF0000";
  833. if ($value < 4000) placeTextWithLink(305, 185, sprintf('%.1F &#176;C', $value), 90, 4, $color, "PS mean temperature of 4023..33..43", $link);
  834. // mean of 3901, 3902, 3903, 3904
  835. $link = $adeiChannel[29][4] . "," . $adeiChannel[29][5] . "," . $adeiChannel[29][6] . "," . $adeiChannel[29][7];
  836. $value = ($adeiValue[29][4] + $adeiValue[29][5] + $adeiValue[29][6] + $adeiValue[29][7])/4.0;
  837. $color = "#000000";
  838. if ($value < $min) $color = "#0026FF";
  839. else if ($value > $max) $color = "#FF0000";
  840. if ($value < 4000) placeTextWithLink(295, 110, sprintf('%.1F &#176;C', $value), 90, 4, $color, "PS mean temperature of 3902..03..04 upper NEG port", $link);
  841. // mean of 3912, 3913, (3914 failed)
  842. $link = $adeiChannel[29][8] . "," . $adeiChannel[29][9] . "," . $adeiChannel[29][10] . "," . $adeiChannel[29][11];
  843. // $value = ($adeiValue[29][8] + $adeiValue[29][9] + $adeiValue[29][10] + $adeiValue[29][11])/4.0;
  844. $value = ($adeiValue[29][8] + $adeiValue[29][9] + $adeiValue[29][10])/3.0;
  845. $color = "#000000";
  846. if ($value < $min) $color = "#0026FF";
  847. else if ($value > $max) $color = "#FF0000";
  848. if ($value < 4000) placeTextWithLink(315, 110, sprintf('%.1F &#176;C', $value), 90, 4, $color, "PS mean temperature of 3912..13..14 side NEG port", $link);
  849. }
  850. // ########## MS VESSEL TEMPERATURES ##########
  851. $min = 14;
  852. $max = 24;
  853. // 0066
  854. $value = $adeiValue[20][0];
  855. $color = "#000000";
  856. if ($value < $min) $color = "#0026FF";
  857. else if ($value > $max) $color = "#FF0000";
  858. if ($value < 400) placeTextWithLink(110, 933, "T<sub>IE0066</sub> = " . sprintf('%.1F &#176;C', $value), 170, 4, $color, "IE temperature 0066", $adeiChannel[20][0]);
  859. // 0076
  860. $value = $adeiValue[20][1];
  861. $color = "#000000";
  862. if ($value < $min) $color = "#0026FF";
  863. else if ($value > $max) $color = "#FF0000";
  864. if ($value < 400) placeTextWithLink(110+20, 933, "T<sub>IE0076</sub> = " . sprintf('%.1F &#176;C', $value), 170, 4, $color, "IE temperature 0076", $adeiChannel[20][1]);
  865. // 0270
  866. $value = $adeiValue[20][2];
  867. $color = "#000000";
  868. if ($value < $min) $color = "#0026FF";
  869. else if ($value > $max) $color = "#FF0000";
  870. if ($value < 400) placeTextWithLink(307, 805, "T<sub>0270</sub> = " . sprintf('%.1F &#176;C', $value), 160, 4, $color, "tank temperature 0270", $adeiChannel[20][2]);
  871. // 0283
  872. $value = $adeiValue[20][3];
  873. $color = "#000000";
  874. if ($value < $min) $color = "#0026FF";
  875. else if ($value > $max) $color = "#FF0000";
  876. if ($value < 400) placeTextWithLink(307, 963, "T<sub>0283</sub> = " . sprintf('%.1F &#176;C', $value), 160, 4, $color, "tank temperature 0283", $adeiChannel[20][3]);
  877. /*
  878. // 0066
  879. $value = $adeiValue[20][0] - $adeiValue[20][4];
  880. $color = "#000000";
  881. if ($value < 50) placeTextWithLink(110+16, 973-30, sprintf('(%.2F &#176;C/h)', $value), 130, 4, $color, "IE temperature 0066 (ramp speed)", $adeiChannel[20][0]);
  882. // 0076
  883. $value = $adeiValue[20][1] - $adeiValue[20][5];
  884. $color = "#000000";
  885. if ($value < 50) placeTextWithLink(126+24+16, 973-30, sprintf('(%.2F &#176;C/h)', $value), 130, 4, $color, "IE temperature 0076 (ramp speed)", $adeiChannel[20][1]);
  886. // 0270
  887. $value = $adeiValue[20][2] - $adeiValue[20][6];
  888. $color = "#000000";
  889. if ($value < 50) placeTextWithLink(307+16, 845-30, sprintf('(%.2F &#176;C/h)', $value), 130, 4, $color, "tank temperature 0270 (ramp speed)", $adeiChannel[20][2]);
  890. // 0283
  891. $value = $adeiValue[20][3] - $adeiValue[20][7];
  892. $color = "#000000";
  893. if ($value < 50) placeTextWithLink(307+16, 973-30, sprintf('(%.2F &#176;C/h)', $value), 130, 4, $color, "tank temperature 0283 (ramp speed)", $adeiChannel[20][3]);
  894. */
  895. $color = "#000000";
  896. // ########## STS ##########
  897. placeTextWithWebsiteLink(360, 5, "&larr;STS", 60, 5, $color, "Link to STS Status Overview", "https://neutrino.ikp.kit.edu/stsstatus/");
  898. // ########## WebTrium Link ##########
  899. placeTextWithWebsiteLink(-130, 1250, "&rarr; WebTrium", 155, 4, $color, "Link to WebTrium Overview", "https://webtrium.mpp.mpg.de");
  900. // ########## FPD Status ##########
  901. placeTextWithWebsiteLink(-100, 1250, "&rarr; FPD Status", 155, 4, $color, "Link to FPD Status Overview", "https://neutrino.ikp.kit.edu/fpdstatus");
  902. // ########## Sanshiro Katana Page ##########
  903. placeTextWithWebsiteLink(-70, 1250, "&rarr; Brew Kaffee Beans and Idle", 275, 4, $color, "Link to Brew Kaffee Beans and Idle page at UW/Seattle", "http://katana.npl.washington.edu/~sanshiro/");
  904. // ########## MoS und HV Status ##########
  905. placeTextWithWebsiteLink(-40, 1240, "&rarr; MoS and HV Status", 240, 4, $color, "Link to Monitor Spectrometer and High Voltage Status Overview", "https://bora-mos.kaas.kit.edu");
  906. // ########## Magnet Overview ##########
  907. placeTextWithWebsiteLink(-10, 1240, "&rarr; Magnet Control System", 270, 4, $color, "Link to Magnet Control System Status Page", "https://bora-mcs.kaas.kit.edu");
  908. // ########## PS ##########
  909. // placeText(100, 170, "PS", 60, 30, $color);
  910. // ########## HIGH VOLTAGE SWITCH ##########
  911. $value = $adeiValue[31][1];
  912. $pic = "switch";
  913. if ($value == 1) $pic = $pic . "Open";
  914. else if ($value == 0) $pic = $pic . "Closed";
  915. placePicWithLink(474, 440, $pic . ".png", 80, "status high-voltage ground switch", $adeiChannel[31][1]);
  916. ?>