SDS_status_main.php 53 KB

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