SDS_status_main.php 53 KB

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