SDS_status_main.php 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755
  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(-135, 1190, "MPP Munich network", 250, 2, "#FFFFFF");
  5. if (substr($ip, 0, 7) == "128.176") placeBox(-135, 1190, "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.158") | (substr($ip, 0, 13) == "141.52.12.63"))
  12. {
  13. placeBox(-75, 1190, "local dev computer", 250, 2, "#FFFFFF");
  14. $local = true;
  15. $MSmode = 5;
  16. $PSmode = 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(-115, 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.$MSmode." pump down";
  33. else if ($MSmode == 2) $OpModeText = $OpModeText.$MSmode." venting";
  34. else if ($MSmode == 3) $OpModeText = $OpModeText.$MSmode." pumping";
  35. else if ($MSmode == 4) $OpModeText = $OpModeText.$MSmode." baking";
  36. else if ($MSmode == 5) { $OpModeText = $OpModeText.$MSmode." high voltage"; $color="#B0FFB0"; }
  37. placeBox(-95, 1190, $OpModeText, 250, 2, $color);
  38. // ########## VALVES ##########
  39. // V4
  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 '<h4 style="font-family: inherit; font-weight: plain; font-style: normal;">Baffle timestamp: ' . date("r", $timestamp ) . '</h4>';
  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 < 100.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 >= 1E-11) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  143. else if ($value < 1E-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:&#010P = ".sprintf('%.3E mbar;', $value), $adeiChannel[7][0]);
  146. $time_conversion_factor = 621355968000000000; // conversion for PCS7 .NET value;
  147. $timestamp = ($adeiValue[7][8] - $time_conversion_factor) / 10000000;
  148. echo '<h4 style="font-family: inherit; font-weight: plain; font-style: normal;">Vacuum timestamp: ' . date("r", $timestamp ) . '</h4>';
  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 >= 1E-11) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
  155. else if ($value < 1E-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:&#010P = ".sprintf('%.3E mbar;', $value), $adeiChannel[7][7]);
  158. // Ex3110
  159. $value = $adeiValue[8][0];
  160. $pic = "ex";
  161. $text = "---";
  162. if ($value > 2E-5) {$text = "OFF"; {if ($MSmode < 5) $pic = $pic . "Off"; else $pic = $pic;}}
  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) {$text = "OFF"; {if ($MSmode < 5) $pic = $pic . "Off"; else $pic = $pic;}}
  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) {$text = "OFF"; {if ($MSmode < 5) $pic = $pic . "Off"; else $pic = $pic;}}
  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) {$text = "OFF"; {if ($PSmode < 5) $pic = $pic . "Off"; else $pic = $pic;}}
  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. If ($MSmode < 5) $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. If ($PSmode < 5) $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.3;
  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. $current = $adeiValue[0][$coil];
  369. $voltage = $adeiValue[1][$coil];
  370. $voltage = sprintf('%.1F', $voltage);
  371. $color = "#000000";
  372. if (abs($current) < $adeiValue[21][$coil] - $tol || abs($current) > $adeiValue[21][$coil] + $tol) $color = "#FF0000";
  373. if ($current < -$tol && $adeiValue[22][$coil] != 1) $color = "#FF0000";
  374. if ($current > $tol && $adeiValue[22][$coil] != 0) $color = "#FF0000";
  375. $current = sprintf('%.1F', $current);
  376. if ($current <= -100 || $current >= 100) $current = sprintf('%.0F', $current);
  377. if ($current >= -0.1 && $current <= 0.1) $current = sprintf('%.1F', 0.0);
  378. $vpos = -26;
  379. $pos = 609 + ($coil - 4) * 42.9;
  380. if ($coil == 0) {$pos = 320; $vpos = 56;} // pos for EMCS VER
  381. else if ($coil == 1) {$pos = 378; $vpos = 56;} // pos for EMCS HOR
  382. else if ($coil == 21) {$pos = $pos + 4;} // for coil 21
  383. $lem = $adeiValue[2][$coil];
  384. $color = "#006400";
  385. if ($lem == 1) $current = "LEM";
  386. $label = ($coil - 1);
  387. if ($coil == 0) $label = "VER";
  388. else if ($coil == 1) $label = "HOR";
  389. // add value label
  390. //if ($coil == 2) {
  391. // placeText($vpos+2, $pos-30, "I [A] =", 50, 2, "#888888");
  392. // placeText($vpos+17, $pos-30, "U [V] =", 47, 1, "#888888");
  393. //}
  394. // add air coil numbers here
  395. placeText($vpos+32, $pos, $label, 70, 2, "#000000");
  396. // print voltage value of air coil
  397. placeTextWithLink($vpos+18, $pos, $voltage, 70, 1, $color, "air-coil voltage [V]", $adeiChannel[1][$coil]);
  398. // print current value of air coil
  399. placeTextWithLink($vpos, $pos, $current, 70, 4, $color, "air-coil current [A]&#10;LEM: DCCT offline", $adeiChannel[0][$coil]);
  400. }
  401. // ######### HV Divider Temp Monitoring
  402. if ($MSmode == 5)
  403. { // only display in MS operation mode High-Voltage
  404. $K35_temp = $adeiValue[10][26];
  405. $K35_link = $adeiChannel[10][26];
  406. $K65_temp = $adeiValue[10][27];
  407. $K65_link = $adeiChannel[10][27];
  408. $divider_temp_spec = 25.0;
  409. $tol_div = 0.2;
  410. $color = "#FFFFFF";
  411. if (abs($K35_temp - $divider_temp_spec) > $tol_div) $color = "#FF0000";
  412. if (abs($K35_temp) < 1) $color = "#ABABAB";
  413. placeBox(586, 322,sprintf('%.1F &#176;C', $K35_temp), 50, 2, $color);
  414. placePicWithLink(536,324, "K35_drawing.png", 50, "K35 temperature status", $K35_link);
  415. $color = "#FFFFFF";
  416. if (abs($K65_temp - $divider_temp_spec) > $tol_div) $color = "#FF0000";
  417. if (abs($K65_temp) < 1) $color = "#ABABAB";
  418. placeBox(586, 378,sprintf('%.1F &#176;C', $K65_temp), 50, 2, $color);
  419. placePicWithLink(536,379, "K65_drawing.png", 50, "K65 temperature status", $K65_link);
  420. }
  421. // ########## HIGH VOLTAGE ##########
  422. if (($MSmode == 5) or ($MSmode == 4))
  423. { // only display in MS operation mode High-Voltage or baking
  424. // ##### path to patch panel configuration file
  425. if (file_exists("patchpanel/data/activeIEconfig.txt"))
  426. {$path_to_patchpanel = "patchpanel/data/activeIEconfig.txt"; }// only for KAAS server
  427. else {$path_to_patchpanel = "patchpanel/ringstoadei.txt"; } // for IKP dev server
  428. // load patch-panel configuration
  429. $handle = fopen($path_to_patchpanel, "r");
  430. $ringsToAdei = array();
  431. if ($handle)
  432. {
  433. while (($buffer = fgets($handle, 4096)) !== false)
  434. {
  435. $buffer = trim($buffer);
  436. $ringsToAdei[count($ringsToAdei)] = $buffer;
  437. }
  438. fclose($handle);
  439. }
  440. // labels
  441. $posY = 8; // offset between labels and voltages (13)
  442. $posX = 10; // down/bottom (7)
  443. if ($MSmode == 5)
  444. { // only display in MS operation mode High-Voltage
  445. $K35_value = $adeiValue[30][0];
  446. $K35_link = $adeiChannel[30][0];
  447. $K35_TS = $adeiValue[30][1];
  448. $K35_RunFlag = $adeiValue[30][2];
  449. $K35_text = "not connected";
  450. $K65_value = $adeiValue[30][3];
  451. $K65_link = $adeiChannel[30][3];
  452. $K65_TS = $adeiValue[30][4];
  453. $K65_RunFlag = $adeiValue[30][5];
  454. // Kal1 = JRL at PS vessel voltage
  455. // Kal1 = DVM at IE Common voltage for SuperKrypton 2021
  456. $Kal1_value = $adeiValue[30][6];
  457. $Kal1_link = $adeiChannel[30][6];
  458. $Kal1_TS = $adeiValue[30][7];
  459. $Kal1_RunFlag = $adeiValue[30][8];
  460. $Kal1_text = "DVM @ IE Common";
  461. $time_conversion_factor = 2082844800;
  462. $most_recent_TS = max($K35_TS,$K65_TS,$Kal1_TS);
  463. if (max($K35_RunFlag,$K65_RunFlag,$Kal1_RunFlag) > 0)
  464. {
  465. $timestamp = ($most_recent_TS - $time_conversion_factor);
  466. echo '<h4 style="font-family: inherit; font-weight: plain; font-style: normal;">HV meas. timestamp: ' . date("r", $timestamp ) . '</h4>';
  467. }
  468. else echo '<font size="4" color="#000000">&nbsp;HV meas. OFFLINE </font><br>';
  469. // HV switch for K35
  470. $hv_switch1103_k35 = $adeiValue[35][2];
  471. if ($hv_switch1103_k35 == 1) $K35_text = "K35 @ MoS Voltage";
  472. else if ($hv_switch1103_k35 == 0) $K35_text = "K35 @ MS Voltage";
  473. $K35_text = "K65 @ MS Tank + IE";
  474. // voltage monitoring readout K35
  475. $color = "#000000";
  476. //$factor_m = 1818.108;
  477. $factor_m = 3636.27;
  478. $factor_m_rel_error = 2.0e-6;
  479. $offset = 3.67e-6;
  480. $offset_error = 1.6e-7;
  481. $gain = 0.99999956;
  482. $gain_error = 6.5e-8;
  483. $value = ($K35_value - $offset) * $gain * $factor_m;
  484. $voltage_error = abs($value * $factor_m_rel_error * 1e3); // in mV
  485. if ($voltage_error*100 < 1) { $voltage_error = 0.2; }
  486. // voltage display K35
  487. $link = $K35_link;
  488. //$text = "K35 divider readout 436-REU-0-0201-0001, but connected to K65 in KNM6 at 436-REU-0-0101-0001, precision voltage value";
  489. $text = "K65 divider readout 436-REU-0-0101-0001, precision voltage value, 40 KV operation + regulation";
  490. // if (($K35_RunFlag > 0) && $local)
  491. if (($K35_RunFlag > 0) & ($value < -1))
  492. {
  493. placeText(342, 811, $K35_text, 140, 2, $color); // K35 voltage reading
  494. placeTextWithLink(320, 746, "U<sub>0</sub> = ".sprintf('%.3F', $value ) . "(" . sprintf('%.0F', $voltage_error ) .") V" , 270, 5, $color, $text, $link);
  495. if (($value < -19724.6) & ($value > -19724.7)) placeText(280, 796, "calibration in progress", 170, 2, "green"); // calibration ongoing
  496. }
  497. // HV switch for K65
  498. $hv_switch1102_k65 = $adeiValue[35][1];
  499. //$K65_text = "K65 @ MS Tank + IE";
  500. $K65_text = "K35 @ MS Tank + IE";
  501. //if ($hv_switch1102_k65 == 1) $K65_text = "K65 @ MoS Voltage";
  502. //if ($hv_switch1102_k65 == 0) $K65_text = "K65 @ MS Voltage";
  503. // voltage monitoring readout K65
  504. $color = "#000000";
  505. //$factor_m = 1818.108;
  506. //$factor_m_rel_error = 0.02/$factor_m;
  507. //$offset = -4.1e-6;
  508. //$gain = 1.00000136;
  509. $factor_m = 1972.462;
  510. $factor_m_rel_error = 1.0e-6; // including calibration, gain and offset error
  511. $offset = 3.67e-6;
  512. $offset_error = 3.5e-7;
  513. $gain = 0.999999277;
  514. $gain_error = 9.9e-8;
  515. $value = ($K65_value - $offset) * $gain * $factor_m;
  516. $voltage_error = abs($value * $factor_m_rel_error * 1e3); // in mV
  517. if ($voltage_error < 1) { $voltage_error = 1; }
  518. // voltage display K65
  519. $link = $K65_link;
  520. $text = "K65 divider channel 436-REU-0-0301-0001, precision voltage value, KNM5 calibration, in 2022 connected to K35";
  521. //$text = "K65 divider channel 436-REU-0-0301-0001, precision voltage value, KNM5 calibration, in 2021 used for 436-REU-0-0201-0001 as long as K35 is down.";
  522. //if (($K65_RunFlag > 0) && $local)
  523. if (($K65_RunFlag > 0) & ($value < -1))
  524. {
  525. if (($value < -19724.6) & ($value > -19724.7)) placeText(340, 796, "calibration in progress", 170, 2, "green"); // calibration ongoing
  526. placeTextWithLink(358, 746, "U<sub>0</sub> = ".sprintf('%.3F', $value ) . "(" . sprintf('%.0F', $voltage_error ) .") V" , 270, 5, $color, $text, $link);
  527. //display stability indicators
  528. //if ($local)
  529. {
  530. if ((sizeof($flukeE) > 2) & ($value < -1000))
  531. {
  532. placeText(381, 811, $K65_text, 140, 2, $color); // K65 voltage reading
  533. if ($flukeE[0]['ppmdev'] <= 2e-6) $color1 = "lightgreen";
  534. if ($flukeE[1]['ppmdev'] <= 2e-6) $color2 = "lightgreen";
  535. if ($flukeE[2]['ppmdev'] <= 2e-6) $color3 = "lightgreen";
  536. if ($flukeE[3]['ppmdev'] <= 2e-6) $color4 = "lightgreen";
  537. if ($flukeE[0]['ppmdev'] > 2e-6) $color1 = "orange";
  538. if ($flukeE[1]['ppmdev'] > 2e-6) $color2 = "orange";
  539. if ($flukeE[2]['ppmdev'] > 2e-6) $color3 = "orange";
  540. if ($flukeE[3]['ppmdev'] > 2e-6) $color4 = "orange";
  541. if ($flukeE[0]['ppmdev'] > 5e-6) $color1 = "#FFA0A0";
  542. if ($flukeE[1]['ppmdev'] > 5e-6) $color2 = "#FFA0A0";
  543. if ($flukeE[2]['ppmdev'] > 5e-6) $color3 = "#FFA0A0";
  544. if ($flukeE[3]['ppmdev'] > 5e-6) $color4 = "#FFA0A0";
  545. placeBox(396, 915, "10s", 35, 1, $color1);
  546. placeBox(396, 880, "20s", 35, 1, $color2);
  547. placeBox(396, 845, "1m", 35, 1, $color3);
  548. placeBox(396, 810, "5m", 35, 1, $color4);
  549. echo '<h4 style="font-family: inherit; font-weight: plain; font-style: normal;">HV status timestamp: ' . $extraction_time_HV . '</h4>';
  550. }
  551. else placeText(381, 811, $K65_text, 140, 2, $color); // K65 voltage reading
  552. }
  553. }
  554. // voltage monitoring readout Kal1 e.g. JRL at PS
  555. // in 2021 used for IE Common monitoring
  556. $color = "#000000";
  557. //$factor_m = 5000.1021;
  558. //$offset = 4.529e-6;
  559. //$gain = 0.999997525656185;
  560. $factor_m = 1.0;
  561. $offset = 0.0;
  562. $gain = 1.0;
  563. $value = ($Kal1_value - $offset) * $gain * $factor_m;
  564. // $voltage_error = abs($value * 2e-3);
  565. $voltage_error = abs($value * 20 * 10e-6);
  566. //if ($voltage_error*100 < 1) { $voltage_error = 0.2; }
  567. if ($voltage_error*100 < 0.002) { $voltage_error = 0.002; }
  568. // voltage display K35
  569. $link = $Kal1_link;
  570. // $text = "JRL divider at Kal1 monitoring input 436-REU-0-0501-0001, precision voltage value";
  571. $text = "DVM at IE Common, 436-REU-0-0301-001, precision voltage value";
  572. if ($Kal1_RunFlag > 0)
  573. {
  574. placeText(304, 815, $Kal1_text, 130, 2, $color); // Kal1 voltage reading
  575. if (abs($value) > 36000) placeText(490, 116, "calibration in progress", 170, 2, "green"); // calibration ongoing
  576. placeTextWithLink(284, 765, "U<sub>IE</sub> = ".sprintf('%.3F', $value ) . "(" . sprintf('%.0F', $voltage_error*100 ) .") V" , 230, 4, $color, $text, $link);
  577. }
  578. // Post Regulation Current Monitor
  579. $U_ist = abs($adeiValue[10][0]);
  580. $I_ist = abs($adeiValue[10][28]);
  581. $PID_setpoint = abs($adeiValue[10][30]);
  582. $PR_hw_current = abs($adeiValue[10][31]);
  583. $hv_switch1102_k65 = $adeiValue[35][1];
  584. $hv_switch1103_k35 = $adeiValue[35][2];
  585. $R_K65 = 54.5e6;
  586. $R_K35 = 58.65e6;
  587. if ($hv_switch1103_k35+$hv_switch1102_k65 == 2) $R_ges = 33.057e6; // manual entry of R_ges with K65 and K35 connected
  588. else $R_ges = (1-$hv_switch1103_k35)*$R_K35+(1-$hv_switch1102_k65)*$R_K65; // choose just one divider
  589. $I_noPR = $U_ist / $R_ges * 1000.0;
  590. $I_PR = $I_ist - $I_noPR;
  591. $APR_on = abs($adeiValue[10][29]);
  592. $verbose = false; // switch for status outputs, dev mode
  593. // 28W limit, 33 kV mit 0,7 mA ist Maximum für stabilen Betrieb
  594. $P_PR = 0.0;
  595. If ($I_PR > 0.01) { $P_PR = $U_ist * $I_PR/1000; }
  596. else $I_PR = 0.0;
  597. $pic = "postreg";
  598. if ($verbose) echo '<br><br><br>';
  599. if ($I_PR < 0.1) { if ($verbose) echo 'PR off<br>'; $pic = $pic."Off";}
  600. else { if ($I_PR < 0.46) { if ($verbose) echo 'PR_current low'; $pic = $pic."Warn";}
  601. else if (($I_PR >= 0.46) && ($I_PR <= 0.8)) { if ($verbose) echo 'PR_current OK'; $pic = $pic."On";}
  602. else if ($I_PR > 0.8) { if ($verbose) echo 'PR_current overload'; $pic = $pic."Alarm";}
  603. if ($verbose) {
  604. echo '<br>';
  605. if ($P_PR < 23) echo " PR_wattage in range";
  606. else if ($P_PR < 28) echo " PR_wattage high";
  607. else if ($P_PR > 28) echo " PR_wattage CRITICAL";
  608. echo '<br>';
  609. }
  610. }
  611. if ($verbose) {
  612. echo '<br>';
  613. echo 'R_fixed = '.$R_ges.' MOhm, ';
  614. echo 'R_Divider = '.$U_ist/($I_ist*1000).' MOhm, ';
  615. echo 'I_ist = '.$I_ist.' mA, ';
  616. echo 'I_noPR = '.$I_noPR.' mA, ';
  617. echo 'I_PR = '.$I_PR.' mA, ';
  618. echo 'P_PR = '.$P_PR.' W<br>';
  619. }
  620. $pos_y = 501;
  621. $pos_x = 455;
  622. $color = "#000000";
  623. placePic($pos_y,$pos_x, $pic.".png", 30, "Estimated status of HV post regulation &#010green = normal operation &#010gray = off &#010red = current too high &#010orange = current too low");
  624. if ($I_PR < 0.1)
  625. {
  626. placeText($pos_y+31,$pos_x-15, "OFF", 60, 2, $color, "HV post regulation offline.");
  627. }
  628. else
  629. {
  630. placeTextWithLink($pos_y+31,$pos_x-15, sprintf('%.2F mA', $I_PR), 60, 2, $color, "Estimated current through post regulation triode shunt. 0.46-0.8 mA for optimal performance.", $adeiChannel[10][28]);
  631. placeTextWithLink($pos_y+45,$pos_x-14, sprintf('%2.0F W', $P_PR), 60, 2, $color, "Estimated power consumption of post regulation triode shunt. Must be < 28 W.", $adeiChannel[10][28]);
  632. if ($APR_on) placeTextWithLink($pos_y+57,$pos_x-4, "APR ON", 40, 0, "#40AA40", "Advanced Post Regulation (APR) status.", $adeiChannel[10][29]);
  633. if ($PID_setpoint > 9.0) placeTextWithLink($pos_y+66,$pos_x-54, "APR setpoint limit", 140, 0, "#FF0000", "APR setpoint at 90% of limit.", $adeiChannel[10][30]);
  634. if (abs($I_PR - $PR_hw_current) > 0.1) placeTextWithLink($pos_y+75,$pos_x-54, "PR current mismatch", 140, 0, "#FF0000", "Estimated and actual current of post regulation don't match.", $adeiChannel[10][31]);
  635. }
  636. } // end of PCS7 mode switch
  637. //placeText(180, 845, "MS WEST IE", 70, 2,"#808080"); // west IE being displayed in loop below
  638. //placeText(450, 845, "MS EAST IE", 70, 2,"#808080"); // east IE
  639. placeText(265, 815, "MS IE COMMON", 130, 2, "#000000"); // mainspec IE Common
  640. // MS Tank from Precision HCP Supply or Standard HCN
  641. $text = "MS TANK";
  642. $ms_hcp_soll = $adeiValue[10][1]; //flipped 2021-02-16 for new HCP device
  643. $ms_hcn_soll = $adeiValue[10][25];
  644. if ($ms_hcn_soll > 1) {
  645. // next two lines are only for the HNC 40 kV power supply operation
  646. $adeiValue[10][0] = $adeiValue[10][24];
  647. $adeiValue[10][1] = $adeiValue[10][25];
  648. }
  649. $HCP = true;
  650. if ($ms_hcn_soll == 0) {
  651. if ($ms_hcp_soll == 0) { $text = $text . " OFF";}
  652. else { $text = $text . " HCP"; $HCP = true; }
  653. } else { $text = $text . " HCN"; $HCP = false; }
  654. placeText(70, 830, $text, 100, 2, "#000000"); // mainspec tank
  655. // switch values here between HCN and HCP in Value and Channel Array !!!
  656. //if ($HCP) { $adeiValue[10][0] = -$adeiValue[10][24]; $adeiValue[10][1] = $adeiValue[10][25]; $adeiChannel[10][0] = $adeiChannel[10][24]; $adeiChannel[10][1] = $adeiChannel[10][25]; }
  657. if ($HCP) { $adeiValue[10][0] = -$adeiValue[10][0];}
  658. placeText(110-$posY, 845, "W7-11", 70, 2, "#000000"); // w7-11
  659. placeText(503+$posY+$posX, 845, "E7-11", 70, 2, "#000000"); // e7-11
  660. placeText(126-$posY, 600, "W6", 70, 2, "#000000"); // w6
  661. placeText(487+$posY+$posX, 600, "E6", 70, 2, "#000000"); // e6
  662. placeText(126-$posY, 1090, "W12", 70, 2, "#000000"); // w12
  663. placeText(487+$posY+$posX, 1090, "E12", 70, 2, "#000000"); // e12
  664. placeText(161-$posY, 516, "W5", 70, 2, "#000000"); // w5
  665. placeText(452+$posY+$posX, 516, "E5", 70, 2, "#000000"); // e5
  666. placeText(161-$posY, 1174, "W13", 70, 2, "#000000"); // w13
  667. placeText(452+$posY+$posX, 1174, "E13", 70, 2, "#000000"); // e13
  668. placeText(194-$posY, 434, "W4", 70, 2, "#000000"); // w4
  669. placeText(419+$posY+$posX, 434, "E4", 70, 2, "#000000"); // e4
  670. placeText(194-$posY, 1256, "W14", 70, 2, "#000000"); // w14
  671. placeText(419+$posY+$posX, 1256, "E14", 70, 2, "#000000"); // e14
  672. placeText(225-$posY, 385, "W3", 70, 2, "#000000"); // w3
  673. placeText(388+$posY+$posX, 385, "E3", 70, 2, "#000000"); // e3
  674. placeText(225-$posY, 1305, "W15", 70, 2, "#000000"); // w15
  675. placeText(388+$posY+$posX, 1305, "E15", 70, 2, "#000000"); // e15
  676. placeText(273-$posY, 352, "W2", 70, 2, "#000000"); // w2
  677. placeText(340+$posY+$posX, 352, "E2", 70, 2, "#000000"); // e2
  678. placeText(273-$posY, 1338, "W16", 70, 2, "#000000"); // w16
  679. placeText(340+$posY+$posX, 1338, "E16", 70, 2, "#000000"); // e16
  680. if ($adeiValue[10][8] > 10.0) placeText(309, 359, "APE", 70, 2, "#000000"); // ape south
  681. if ($adeiValue[10][10] > 10.0) placeText(309, 1331, "APE", 70, 2, "#000000"); // ape north
  682. // offset voltages
  683. $posY = 16; // offset between outer and inner voltages
  684. $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 );
  685. $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 );
  686. $tol = 0.2;
  687. $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");
  688. for ($pp = 0; $pp < 2; $pp++) // west (0), east (1)
  689. {
  690. for ($id = 0; $id < 22; $id++) // rings: o, i, o, i, ...
  691. {
  692. // show voltage if not shorted to IE
  693. if ($ringsToAdei[$id + 22*$pp] != "IE" && $ringsToAdei[$id + 22*$pp] != "")
  694. {
  695. // color
  696. 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) )
  697. $color = "#000000";
  698. else
  699. $color = "#FF0000";
  700. // show voltage
  701. if ( ($id % 2 == 0) || ($id % 2 == 1 && $ringsToAdei[$id + 22*$pp] != $ringsToAdei[$id + 22*$pp - 1]) )
  702. {
  703. $value = $adeiValue[11 + 2*$pp][$ringsToAdei[$id + 22*$pp]];
  704. $mace_setting[$ringNames[$id + 22*$pp]]=$value;
  705. 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]]);
  706. }
  707. }
  708. }
  709. }
  710. // tank, ie, dipole, ape
  711. $ringsPosY = array( 52, 247, 155, 425, 306, 306, 0, 240, 300, 285, 300, 315 );
  712. $ringsPosX = array( 805, 805, 805, 805, 319, 1371, 0, 150, 160, 190, 220, 190 );
  713. $tolA = array ( 15, 2, 1, 1, 1, 1, 0, 250, 2, 2, 2, 2);
  714. // MS voltages
  715. for ($pp = 0; $pp < 6; $pp++) // tank (0), ie (1), ie west (2), ie east (3), ape south (4), ape north (5)
  716. {
  717. // color
  718. if ( ($adeiValue[10][2*$pp] > $adeiValue[10][2*$pp + 1] - $tolA[$pp]) && ($adeiValue[10][2*$pp] < $adeiValue[10][2*$pp + 1] + $tolA[$pp]) )
  719. $color = "#000000";
  720. else
  721. $color = "#FF0000";
  722. // show voltage
  723. $value = $adeiValue[10][2*$pp];
  724. $link = $adeiChannel[10][2*$pp];
  725. $dipolestatus = $adeiValue[2][16];
  726. $dipolelink = $adeiChannel[2][16];
  727. if ($pp == 0) { $text = "absolute tank potential HCN:436-EHV-0-1001-0002 HCP:436-EHV-0-1002-0002"; }
  728. else if ($pp == 1) { $text = "IE common offset potential, 436-EHV-0-1003-0002"; }
  729. else if ($pp == 2) { $text = "relative voltage potential west IE"; }
  730. else if ($pp == 3) { $text = "relative voltage potential east IE"; }
  731. else if ($pp == 4) { $text = "relative voltage potential south APE"; }
  732. else if ($pp == 5) { $text = "relative voltage potential north APE"; }
  733. if ($pp == 2 || $pp == 3)
  734. {
  735. if ($dipolestatus == 1) // dipole enabled
  736. {
  737. $color = "#990000";
  738. $value = $adeiValue[10][2*$pp];
  739. if ($pp == 2)
  740. {
  741. placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000" );
  742. }
  743. else if ($pp == 3)
  744. {
  745. placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000");
  746. }
  747. }
  748. else
  749. {
  750. $value = $adeiValue[10][2*$pp]; // dipole disabled
  751. $color = "#909090";
  752. }
  753. if ($pp == 2) placeText(180, 825, "MS WEST IE", 110, 2, $color); // west IE
  754. else if ($pp == 3) placeText(450, 825, "MS EAST IE", 110, 2, $color); // east IE
  755. $link = $adeiChannel[10][2*$pp+1] . "," . $adeiChannel[10][2*$pp] . "," . $dipolelink;
  756. }
  757. // tank potential
  758. if ($pp == 0) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 150, 4, $color, $text, $link);
  759. // IE common
  760. else if ($pp == 1)
  761. {
  762. if ($Kal1_RunFlag == 0) $digits = '%.2F V'; else $digits = '%.1F V';
  763. placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf($digits, -$value), 150, 4, $color, $text, $link);
  764. $mace_setting["IECommon"]=-$value;
  765. $digits = '';
  766. }
  767. // IE dipoles
  768. else if ($pp == 2 || $pp == 3) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.2F V', $value), 150, 5, $color, $text, $link);
  769. // APE
  770. else if ($pp == 4 || $pp == 5)
  771. {
  772. if ($adeiValue[10][2*$pp] > 10.0) { placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp] , sprintf('%.1F', $value), 70, 4, $color, $text, $link); }
  773. }
  774. }
  775. }
  776. // PS voltages (add $pp < 10 for PS IE )
  777. if ($PSmode == 5)
  778. { // only display in PS operation mode High-Voltage
  779. // only indices 7++ are needed for PS (copy from MS definition)
  780. $ringsPosY = array( 52, 247, 155, 425, 306, 306, 0, 240, 300, 285, 300, 315 );
  781. $ringsPosX = array( 805, 805, 805, 805, 319, 1371, 0, 150, 160, 190, 220, 190 );
  782. $tolA = array ( 15, 2, 1, 1, 1, 1, 0, 250, 2, 2, 2, 2);
  783. placeText(265, 190, "PS TANK", 70, 2, "#000000"); // prespec tank
  784. placeText(330, 160, "PS IE", 120, 2, "#505050"); // prespec IE
  785. for ($pp = 7; $pp < 12; $pp++) // PS tank (channel 7 = array entry 14 + 15), IE west (8), IE east (9)
  786. {
  787. // color and text
  788. if ($pp == 7) { $text = "Primary PS tank potential of 416EHV1001"; $color = "#000000";}
  789. else if ($pp == 8) { $text = "relative voltage potential PS IE1 Ch1A of 416EHV1002"; $color = "#505050";}
  790. else if ($pp == 9) { $text = "relative voltage potential PS IE2 Ch1B of 416EHV1002"; $color = "#505050";}
  791. else if ($pp == 10) { $text = "relative voltage potential PS IE3 Ch2A of 416EHV1003"; $color = "#505050";}
  792. else if ($pp == 11) { $text = "relative voltage potential PS IE4 Ch2B of 416EHV1003"; $color = "#A0A0A0";}
  793. // setpoint mismatch color
  794. if ( ($adeiValue[10][2*$pp] > $adeiValue[10][2*$pp + 1] - $tolA[$pp]) && ($adeiValue[10][2*$pp] < $adeiValue[10][2*$pp + 1] + $tolA[$pp]) )
  795. $color = $color;
  796. else
  797. $color = "#FF0000";
  798. // show voltage
  799. $value = $adeiValue[10][2*$pp];
  800. $link = $adeiChannel[10][2*$pp];
  801. if ($pp == 7) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 150, 5, $color, $text, $link);
  802. else placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 60, 2, $color, $text, $link);
  803. }
  804. }
  805. // ########## Split Ring Electrodes ##########
  806. $srPosX = array( 59, 284, 1420 );
  807. $srPosY = array( 402, 402, 370 );
  808. $srKATRINNumber = array( "418-EEL-3-2150", "418-EEL-3-4150", "438-EEL-3-5150" );
  809. // CPS-PS electrode 418-EEL-2150
  810. // $sr: 0 = cps-ps ; 1 = PS-MS ; 2 = MS-FPD
  811. for ($sr = 0; $sr < 3; $sr++)
  812. {
  813. $splitringON = $adeiValue[36][4*$sr + 3];
  814. $pic = "splitring";
  815. if ($splitringON = 1)
  816. {
  817. $color = "#000000";
  818. $splitringVal = $adeiValue[36][4*$sr + 4];
  819. $splitringPOL = $adeiValue[36][4*$sr + 5];
  820. $splitringSet = $adeiValue[36][4*$sr + 6];
  821. $link = $adeiChannel[36][$sr*4 + 4];
  822. if (abs($splitringVal) < 25) { $color="#FF0000"; $pic = $pic."Alarm"; $sign = "";}
  823. else {
  824. if ($splitringPOL == 0) {$sign = "+"; $pic = $pic."On";}
  825. if ($splitringPOL == 1) {$sign = ""; $pic = $pic."Warn";}
  826. }
  827. 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);
  828. placeTextWithLink($srPosY[$sr],$srPosX[$sr], $sign.sprintf('%.0F V', $splitringVal), 60, 2, $color, "Voltage on split ring electrode ".$srKATRINNumber[$sr], $link);
  829. }
  830. else placePicWithLink($srPosY[$sr]-32,$srPosX[$sr]+16, $pic."Off.png", 30, "status of split ring electrode", $link);
  831. }
  832. // ########## DETECTOR ##########
  833. // detector powered
  834. $lowVoltage = array( 12, 8, 6, 6, 120 );
  835. $link = "";
  836. $pic = "fpdOn";
  837. $text = "ON";
  838. for ($id = 0; $id < 5; $id++)
  839. {
  840. $value = $adeiValue[6][4 + $id];
  841. if (!($value < $lowVoltage[$id] + 0.2 && $value > $lowVoltage[$id] - 0.2))
  842. {
  843. $pic = "fpdOff";
  844. $text = "OFF";
  845. }
  846. $link = $link . $adeiChannel[6][4 + $id] . ",";
  847. }
  848. $link = substr($link, 0, strlen($link) - 1);
  849. placePicWithLink(200, 1600, $pic . ".png", 30, "status FPD power&#10;green: on, red: off, grey: undefined", $link);
  850. placeTextWithLink(227, 1580, $text, 70, 4, "#000000", "status FPD power", $link);
  851. // carousel
  852. $value = $adeiValue[6][11];
  853. $color = "#000000";
  854. if ($value < -95) $value = "---";
  855. else $value = sprintf('%.0F', $adeiValue[6][11]) . " &#176;C";
  856. placeTextWithLink(255, 1565, $value, 100, 4, $color, "temperature FPD carousel/electronics", $adeiChannel[6][11]);
  857. placeText(275, 1565, "carousel", 100, 2, "#000000");
  858. // ########## MAGNETOMETERS ##########
  859. $mag = array(4, 6, 3); // removed 4th entry of south ring, due to disconnection
  860. for ($pp = 0; $pp < 3; $pp++)
  861. {
  862. $bx = 0;
  863. $by = 0;
  864. $bz = 0;
  865. $link = "";
  866. for ($id = 0; $id < $mag[$pp]; $id++)
  867. {
  868. $bx = $bx + $adeiValue[16 + $pp][3 * $id];
  869. $by = $by + $adeiValue[16 + $pp][3 * $id + 1];
  870. $bz = $bz + $adeiValue[16 + $pp][3 * $id + 2];
  871. $link = $link . $adeiChannel[16 + $pp][3 * $id + 2] . ",";
  872. //echo $bx . " " . $by . " " . $bz . "<br>";
  873. }
  874. $bx = $bx / $mag[$pp];
  875. $by = $by / $mag[$pp];
  876. $bz = $bz / $mag[$pp];
  877. $link = substr($link, 0, strlen($link) - 1);
  878. $value = sqrt($bx * $bx + $by * $by + $bz * $bz);
  879. $text = "averaged field precise magnetometers ";
  880. if ($pp == 0) $text = $text . "north ";
  881. else if ($pp == 1) $text = $text . "middle ";
  882. else if ($pp == 2) $text = $text . "south ";
  883. $text = $text . "ring";
  884. placeTextWithLink(553, 1015 - 170 * $pp, sprintf('%.1F G', $value), 80, 5, "#000000", $text, $link);
  885. }
  886. // ########## SAP MAGNETOMETERS ##########
  887. $mag = array(5, 4,); // 5 SAP North Ring, 4 SAP South Ring magnetometers
  888. for ($pp = 0; $pp < 2; $pp++)
  889. {
  890. $bx = 0;
  891. $by = 0;
  892. $bz = 0;
  893. $link = "";
  894. for ($id = 0; $id < $mag[$pp]; $id++)
  895. {
  896. $bx = $bx + $adeiValue[37 + $pp][3 * $id];
  897. $by = $by + $adeiValue[37 + $pp][3 * $id + 1];
  898. $bz = $bz + $adeiValue[37 + $pp][3 * $id + 2];
  899. $link = $link . $adeiChannel[37 + $pp][37 * $id + 2] . ",";
  900. //echo $bx . " " . $by . " " . $bz . "<br>";
  901. }
  902. $bx = $bx / $mag[$pp];
  903. $by = $by / $mag[$pp];
  904. $bz = $bz / $mag[$pp];
  905. $link = substr($link, 0, strlen($link) - 1);
  906. // radings in muT, therfore factor 100 for Gauss display
  907. $value = 0.01*sqrt($bx * $bx + $by * $by + $bz * $bz);
  908. $text = "averaged field precise magnetometers SAP ";
  909. if ($pp == 0) $text = $text . "north ";
  910. else if ($pp == 1) $text = $text . "south ";
  911. $text = $text . "ring";
  912. placeTextWithLink(553, 1240 - 110 * $pp, sprintf('%.1F G', $value), 80, 5, "#000000", $text, $link);
  913. }
  914. // dipole
  915. // $pic = "status";
  916. // if ($pulserId[0] == "dipole" && $daqElapsed[0] > 30)
  917. // {
  918. // if ($pulserCounts[0] > 0) $pic = $pic . "On";
  919. // else if ($pulserCounts[0] == 0) $pic = $pic . "Off";
  920. // }
  921. //placePic($posY + 34 + 25, $posX + 80, $pic . ".png", 17, "status dipole sync pulser&#10;green: on, red: off, grey: undefined");
  922. // egun
  923. // $pic = "status";
  924. // if ($pulserId[1] == "egun" && $daqElapsed[0] > 30)
  925. // {
  926. // if ($pulserCounts[1] > 0) $pic = $pic . "On";
  927. // else if ($pulserCounts[1] == 0) $pic = $pic . "Off";
  928. // }
  929. //placePic($posY + 34 + 50, $posX + 80, $pic . ".png", 17, "status egun sync pulser&#10;green: on, red: off, grey: undefined");
  930. // muon
  931. // $pic = "status";
  932. // if ($pulserId[3] == "muon" && $daqElapsed[0] > 30)
  933. // {
  934. // if ($pulserCounts[3] > 0) $pic = $pic . "On";
  935. // else if ($pulserCounts[3] == 0) $pic = $pic . "Off";
  936. // }
  937. // placePic($posY + 34 + 75, $posX + 80, $pic . ".png", 17, "status muon sync pulser&#10;green: on, red: off, grey: undefined");
  938. // ########## HIGH PRESSURE MS ##########
  939. $value = $adeiValue[9][3];
  940. if ($value > 1.0)
  941. {
  942. if ($value < 20.0) $pic = "bottleBlinking.gif";
  943. else $pic = "bottleOn.png";
  944. $text = "ON";
  945. $color = "#000000";
  946. if ($adeiValue[9][4] != 64) $color = "#FF0000";
  947. placeTextWithLink(135, 1387, sprintf('%.1F &#037;', $adeiValue[9][3]), 70, 4, $color, "gas flow leak valve", $adeiChannel[9][5]);
  948. placeTextWithLink(160, 1387, sprintf('%.1E', $adeiValue[9][0]), 70, 4, $color, "pressure [mbar] MKS Baratron", $adeiChannel[9][3]);
  949. }
  950. else
  951. {
  952. $pic = "bottle.png";
  953. $text = "OFF";
  954. }
  955. $link = $adeiChannel[9][3] . "," . $adeiChannel[9][0];
  956. placePicWithLink(135, 1358, $pic, 48, "status gas injection system&#10;gray: off, blinking: low, green: on&#10Should be off for nominal pressure measurements!!!", $link);
  957. placeTextWithLink(180, 1347, $text, 70, 4, "#000000", "status gas injection system", $link);
  958. // ########## HIGH PRESSURE PS ##########
  959. $value = $adeiValue[27][7];
  960. $posOK = $adeiValue[27][6];
  961. $link = $adeiChannel[27][6].",".$adeiChannel[27][7];
  962. if ($value < 1)
  963. {
  964. $pic = "bottle.png";
  965. $text = "OFF";
  966. $color = "#909090";
  967. }
  968. else if (($value >= 1) && ($value < 15))
  969. {
  970. $pic = "bottleBlinking.gif";
  971. $text = "ON";
  972. $color = "#000000";
  973. }
  974. else if ($value >= 15)
  975. {
  976. $pic = "bottleOn.png";
  977. $text = sprintf('%.1F', $value)." %";
  978. $color = "#000000";
  979. if ($posOK == 1) placeBox(418, 107, "Pos OK", 40, 2, "#00FF00");
  980. else placeBox(418, 107, "PosErr", 40, 2, "#FF0000");
  981. }
  982. 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);
  983. placeTextWithLink(402, 99, $text, 60, 2, $color, "status gas injection system", $link);
  984. // ########## TLK Wall and LAUDA TEMPERATURE ##########
  985. if ($PSmode == 5)
  986. { // only display if PS operation mode is HV
  987. // mean of 4023, 4033, 4043
  988. $link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
  989. $value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2])/3.0;
  990. $color = "#000000";
  991. 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);
  992. }
  993. if ($PSmode != 5)
  994. { // only display if PS operation mode is Baking
  995. $min = 18;
  996. $max = 30;
  997. // sensor 4100 ID [29][3]
  998. $link = $adeiChannel[29][3];
  999. $value = $adeiValue[29][3];
  1000. $color = "#000000";
  1001. if ($value < $min) $color = "#0026FF";
  1002. else if ($value > $max) $color = "#FF0000";
  1003. 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);
  1004. $min = 15;
  1005. // LAUDA System 5401 [34][0..1]
  1006. $link = $adeiChannel[34][0].",".$adeiChannel[34][1];
  1007. $value = $adeiValue[34][0];
  1008. $max = $adeiValue[34][1]+1;
  1009. $color = "#000000";
  1010. if ($value < $min) $color = "#0026FF";
  1011. else if ($value > $max) $color = "#FF0000";
  1012. if ($value < 400) placeTextLeftWithLink(475, 5, "T<sub>LAUDA</sub> = " . sprintf('%.1F &#176;C', $value), 180, 4, $color, "LAUDA System actual temperature value", $link);
  1013. // ########## PS VESSEL TEMPERATURES ##########
  1014. $min = 18;
  1015. $max = 65;
  1016. // mean of 4023, 4033, 4043
  1017. $link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
  1018. $value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2])/3.0;
  1019. $color = "#000000";
  1020. if ($value < $min) $color = "#0026FF";
  1021. else if ($value > $max) $color = "#FF0000";
  1022. if ($value < 4000) placeTextWithLink(305, 185, sprintf('%.1F &#176;C', $value), 90, 4, $color, "PS mean temperature of 4023..33..43", $link);
  1023. // mean of 3901, 3902, 3903, 3904
  1024. $link = $adeiChannel[29][4] . "," . $adeiChannel[29][5] . "," . $adeiChannel[29][6] . "," . $adeiChannel[29][7];
  1025. $value = ($adeiValue[29][4] + $adeiValue[29][5] + $adeiValue[29][6] + $adeiValue[29][7])/4.0;
  1026. $color = "#000000";
  1027. if ($value < $min) $color = "#0026FF";
  1028. else if ($value > $max) $color = "#FF0000";
  1029. 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);
  1030. // mean of 3912, 3913, (3914 failed)
  1031. $link = $adeiChannel[29][8] . "," . $adeiChannel[29][9] . "," . $adeiChannel[29][10] . "," . $adeiChannel[29][11];
  1032. // $value = ($adeiValue[29][8] + $adeiValue[29][9] + $adeiValue[29][10] + $adeiValue[29][11])/4.0;
  1033. $value = ($adeiValue[29][8] + $adeiValue[29][9] + $adeiValue[29][10])/3.0;
  1034. $color = "#000000";
  1035. if ($value < $min) $color = "#0026FF";
  1036. else if ($value > $max) $color = "#FF0000";
  1037. 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);
  1038. }
  1039. // ########## MS VESSEL TEMPERATURES ##########
  1040. $min = 14;
  1041. $max = 24;
  1042. // 0066
  1043. $value = $adeiValue[20][0];
  1044. $color = "#000000";
  1045. if ($value < $min) $color = "#0026FF";
  1046. else if ($value > $max) $color = "#FF0000";
  1047. 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]);
  1048. // 0076
  1049. $value = $adeiValue[20][1];
  1050. $color = "#000000";
  1051. if ($value < $min) $color = "#0026FF";
  1052. else if ($value > $max) $color = "#FF0000";
  1053. 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]);
  1054. // 0270
  1055. $value = $adeiValue[20][2];
  1056. $color = "#000000";
  1057. if ($value < $min) $color = "#0026FF";
  1058. else if ($value > $max) $color = "#FF0000";
  1059. 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]);
  1060. 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]);
  1061. // define global tank temperature
  1062. $global_MS_temperature = $adeiValue[20][2];
  1063. // 0283
  1064. $value = $adeiValue[20][3];
  1065. $color = "#000000";
  1066. if ($value < $min) $color = "#0026FF";
  1067. else if ($value > $max) $color = "#FF0000";
  1068. 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]);
  1069. 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]);
  1070. // port 0100 saphire window
  1071. $value = $adeiValue[19][3];
  1072. $color = "#000000";
  1073. 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]);
  1074. $color = "#000000";
  1075. // ########## STS ##########
  1076. placeTextLeftWithWebsiteLink(370, 1, "&larr;STS", 60, 5, $color, "Link to STS Status Overview", "https://katrin.kit.edu/status-sts/");
  1077. // ########## WebTrium Link ##########
  1078. placeTextLeftWithWebsiteLink(20, 1450, "&rarr; WebTrium", 155, 4, $color, "Link to WebTrium Overview", "https://webtrium.mpp.mpg.de");
  1079. // ########## FPD Status ##########
  1080. placeTextLeftWithWebsiteLink(50, 1450, "&rarr; FPD Status", 155, 4, $color, "Link to FPD Status Overview", "https://ikp-katrin-fpd.ikp.kit.edu/fpdstatus/");
  1081. // ########## Sanshiro Katana Page ##########
  1082. 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/");
  1083. // ########## MoS und HV Status ##########
  1084. placeTextLeftWithWebsiteLink(110, 1450, "&rarr; MoS and HV Status", 240, 4, $color, "Link to Monitor Spectrometer and High Voltage Status Overview", "https://katrin.kit.edu/bora-mos");
  1085. // ########## Magnet Overview ##########
  1086. placeTextLeftWithWebsiteLink(140, 1450, "&rarr; Magnet Control System", 270, 4, $color, "Link to Magnet Control System Status Page", "https://katrin.kit.edu/bora-mcs");
  1087. // ########## PS ##########
  1088. // placeText(100, 170, "PS", 60, 30, $color);
  1089. // ########## MAC-E filter configuration display ##########
  1090. $tol = 0.2;
  1091. $tol = abs($tol);
  1092. $color = "#FFD800"; //base color: US school bus yellow
  1093. for ($pp = 0; $pp < sizeof($mace_configurations); $pp++) // loop over all predefined configurations
  1094. {
  1095. for ($id = 1; $id < sizeof($mace_configurations[$pp]); $id++) // loop thru all parameters, but not name in $id=0
  1096. {
  1097. if (($id < 3) & (array_values($mace_configurations[$pp])[$id] != array_values($mace_setting)[$id])) break;
  1098. if (abs(array_values($mace_configurations[$pp])[$id] - array_values($mace_setting)[$id]) < $tol)
  1099. {
  1100. if ($id == 25) {
  1101. $mace_setting["Config"] = $mace_configurations[$pp]["Config"];
  1102. $color = "#4CFF00"; // success color: harlequin green
  1103. }
  1104. else
  1105. {
  1106. $color = "#FF9300"; // failure color: dark orange
  1107. }
  1108. }
  1109. else break;
  1110. }
  1111. if ($color == "#4CFF00") break;
  1112. }
  1113. if (($mace_setting["Config"] == "unkn") or ($mace_setting["Config"] == "other"))
  1114. {
  1115. $color = "#FFD800"; //unknown config color: US school bus yellow
  1116. }
  1117. placeText(115, 232, "MAC-E", 85, 5, "#000000");
  1118. placeBox(140, 230, $mace_setting["Config"] , 85, 3, $color);
  1119. if ($V4_open) {
  1120. // ########## PS Ion Monitor status display ##########
  1121. if ($adeiValue[39][1] < 0.5)
  1122. {
  1123. $ion_mon_stat = "active";
  1124. $color = "#4CFF00";
  1125. }
  1126. else
  1127. {
  1128. $ion_mon_stat = "bypassed";
  1129. $color = "#FF0000";
  1130. placePicWithLink(130, 33, "alarm_flash.gif", 50, "Ion alarm not armed!", $adeiChannel[39][1]);
  1131. }
  1132. placeText(115+65, 4, "Ion Mon", 105, 5, "#000000");
  1133. placeBox(140+65, 2, $ion_mon_stat , 105, 3, $color);
  1134. }
  1135. // ########## HIGH VOLTAGE SWITCH ##########
  1136. $value = $adeiValue[31][1];
  1137. $pic = "switch";
  1138. if ($value == 1) $pic = $pic . "Open";
  1139. else if ($value == 0) $pic = $pic . "Closed";
  1140. placePicWithLink(498, 501, $pic . ".png", 80, "status high-voltage grounding switch", $adeiChannel[31][1]);
  1141. // ########## EGUN COUPLING SWITCH ##########
  1142. if ($MSmode == 5) // only display in MS operation mode High-Voltage
  1143. {
  1144. $switch_status = $adeiValue[46][0];
  1145. $laser_status = $adeiValue[47][0];
  1146. $switch_name = "egunSwitch";
  1147. $egun_name = "egun";
  1148. if ($switch_status == 1) $switch_name = $switch_name . "HV";
  1149. else $switch_name = $switch_name . "GND";
  1150. placePicWithLink(415, 325, $switch_name . ".png", 90, "status egun coupling switch", $adeiChannel[46][0]);
  1151. if ($laser_status > 2 ) $egun_name = $egun_name . "On";
  1152. else $egun_name = $egun_name . "Off";
  1153. placePicWithLink(431, 300, $egun_name . ".png", 30, "status egun operation", $adeiChannel[47][0]);
  1154. }
  1155. // ########## MONITOR SPECTROMETR COUPLING STATUS ##########
  1156. $hv_switch1101_mos = $adeiValue[35][0];
  1157. $mos = "beamline_mos.png";
  1158. placePicXY(525, 120, $mos, 190, 60, "status monitor spectrometer connection");
  1159. if ($hv_switch1101_mos == 1)
  1160. {
  1161. $color = "#4CFF00"; // green
  1162. placeBox(586, 120, "MoS coupled", 190, 2, $color);
  1163. }
  1164. else
  1165. {
  1166. $color = "#CFCFCF"; // light gray
  1167. placeBox(586, 120, "MoS separated", 190, 2, $color);
  1168. }
  1169. // ########## define global dewpoint max value ###########
  1170. $global_max_dewpoint = -273.0;
  1171. // ########## PS Opus weather station ##########
  1172. $data_index = 40;
  1173. $Opus_tempC = $adeiValue[$data_index][0];
  1174. $Opus_tempF = $adeiValue[$data_index][1];
  1175. $Opus_dewpointC = $adeiValue[$data_index][2];
  1176. $Opus_dewpointF = $adeiValue[$data_index][3];
  1177. $Opus_relH_percent = $adeiValue[$data_index][4];
  1178. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1179. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1180. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1181. $Opus_voltage = $adeiValue[$data_index][8];
  1182. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1183. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1184. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1185. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1186. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1187. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1188. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1189. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1190. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1191. // update dewpoint max value
  1192. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1193. $location_text = "pre spectrometer";
  1194. $draw_x = 0;
  1195. $draw_y = -15;
  1196. placePicWithLink($draw_y, $draw_x+5, "newTemperature.png", 23, "temperature at ".$location_text, $Opus_tempC_channel);
  1197. placeTextWithLink($draw_y, $draw_x+30, sprintf('%.1F &#176;C', $Opus_tempC), 90, 4, "#000000", "temperature at ".$location_text, $Opus_tempC_channel);
  1198. placePicWithLink($draw_y+25, $draw_x+5, "newPressure.png", 23, "atmospheric pressure at ".$location_text, $Opus_absPressure_hPa_channel);
  1199. placeTextWithLink($draw_y+25, $draw_x+30, sprintf('%.0F hPa', $Opus_absPressure_hPa), 90, 4, "#000000", "atmospheric pressure at ".$location_text, $Opus_absPressure_hPa_channel);
  1200. placePicWithLink($draw_y+50, $draw_x+5, "newHumidity.png", 23, "relative humidity at ".$location_text, $Opus_relH_percent_channel);
  1201. placeTextWithLink($draw_y+50, $draw_x+30, sprintf('%.1F &#037;', $Opus_relH_percent), 90, 4, "#000000", "relative humidity at ".$location_text , $Opus_relH_percent_channel);
  1202. placePicWithLink($draw_y+75, $draw_x+5, "newDewpoint.png", 23, "dewpoint at ".$location_text, $Opus_dewpointC_channel);
  1203. placeTextWithLink($draw_y+75, $draw_x+30, sprintf('%.1F &#176;C', $Opus_dewpointC), 90, 4, "#000000", "dewpoint at ".$location_text , $Opus_dewpointC_channel);
  1204. // ########## DET Opus weather station ##########
  1205. $data_index = 41;
  1206. $Opus_tempC = $adeiValue[$data_index][0];
  1207. $Opus_tempF = $adeiValue[$data_index][1];
  1208. $Opus_dewpointC = $adeiValue[$data_index][2];
  1209. $Opus_dewpointF = $adeiValue[$data_index][3];
  1210. $Opus_relH_percent = $adeiValue[$data_index][4];
  1211. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1212. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1213. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1214. $Opus_voltage = $adeiValue[$data_index][8];
  1215. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1216. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1217. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1218. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1219. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1220. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1221. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1222. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1223. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1224. // update dewpoint max value
  1225. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1226. $location_text = "detector platform";
  1227. $draw_x = 1600;
  1228. $draw_y = -15;
  1229. placePicWithLink($draw_y, $draw_x+5, "newTemperature.png", 23, "temperature at ".$location_text, $Opus_tempC_channel);
  1230. placeTextWithLink($draw_y, $draw_x+30, sprintf('%.1F &#176;C', $Opus_tempC), 90, 4, "#000000", "temperature at ".$location_text, $Opus_tempC_channel);
  1231. placePicWithLink($draw_y+25, $draw_x+5, "newPressure.png", 23, "atmospheric pressure at ".$location_text, $Opus_absPressure_hPa_channel);
  1232. placeTextWithLink($draw_y+25, $draw_x+30, sprintf('%.0F hPa', $Opus_absPressure_hPa), 90, 4, "#000000", "atmospheric pressure at ".$location_text, $Opus_absPressure_hPa_channel);
  1233. placePicWithLink($draw_y+50, $draw_x+5, "newHumidity.png", 23, "relative humidity at ".$location_text, $Opus_relH_percent_channel);
  1234. placeTextWithLink($draw_y+50, $draw_x+30, sprintf('%.1F &#037;', $Opus_relH_percent), 90, 4, "#000000", "relative humidity at ".$location_text , $Opus_relH_percent_channel);
  1235. // ########## Detector Platform OLD ##########
  1236. //placePicWithLink(-135, 1605, "newTemperature.png", 23, "temperature in KATRIN hall", $adeiChannel[19][1]);
  1237. //placeTextWithLink(-135, 1630, sprintf('%.1F &#176;C', $adeiValue[19][1]), 90, 4, "#000000", "temperature in KATRIN hall", $adeiChannel[19][1]);
  1238. //placePicWithLink(-110, 1605, "newPressure.png", 23, "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  1239. //placeTextWithLink(-110, 1630, sprintf('%.0F hPa', $adeiValue[19][0] * 0.0689475729 * 1000.0), 90, 4, "#000000", "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  1240. //placePicWithLink(-85, 1605, "newHumidity.png", 23, "relative humidity in KATRIN hall", $adeiChannel[19][2]);
  1241. //placeTextWithLink(-85, 1630, sprintf('%.1F &#037;', $adeiValue[19][2]), 90, 4, "#000000", "relative humidity in KATRIN hall", $adeiChannel[19][2]);
  1242. // ########## HV Opus weather station ##########
  1243. $data_index = 42;
  1244. $Opus_tempC = $adeiValue[$data_index][0];
  1245. $Opus_tempF = $adeiValue[$data_index][1];
  1246. $Opus_dewpointC = $adeiValue[$data_index][2];
  1247. $Opus_dewpointF = $adeiValue[$data_index][3];
  1248. $Opus_relH_percent = $adeiValue[$data_index][4];
  1249. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1250. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1251. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1252. $Opus_voltage = $adeiValue[$data_index][8];
  1253. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1254. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1255. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1256. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1257. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1258. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1259. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1260. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1261. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1262. // update dewpoint max value
  1263. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1264. $location_text = "high-voltage cage";
  1265. $draw_x = 434;
  1266. $draw_y = 586;
  1267. if (($Opus_tempC > 0) && (($Opus_tempC < 99)) && ($Opus_absPressure_hPa > 0))
  1268. {
  1269. placeBoxRight($draw_y, $draw_x,sprintf('%.1F &#176;C', $Opus_tempC), 65, 2, $color);
  1270. placePicWithLink($draw_y+2, $draw_x+5, "newTemperature.png", 15, "temperature at ".$location_text.", and &#010rel. humidity is H = ".sprintf('%.1F &#037;', $Opus_relH_percent).",&#010dewpoint Td = ".sprintf('%.1F &#176;C', $Opus_dewpointC).",&#010atm. pressure is p = ".sprintf('%.0F hPa', $Opus_absPressure_hPa).".", $Opus_tempC_channel);
  1271. }
  1272. // ########## MS bottom Opus weather station ##########
  1273. $data_index = 43;
  1274. $Opus_tempC = $adeiValue[$data_index][0];
  1275. $Opus_tempF = $adeiValue[$data_index][1];
  1276. $Opus_dewpointC = $adeiValue[$data_index][2];
  1277. $Opus_dewpointF = $adeiValue[$data_index][3];
  1278. $Opus_relH_percent = $adeiValue[$data_index][4];
  1279. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1280. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1281. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1282. $Opus_voltage = $adeiValue[$data_index][8];
  1283. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1284. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1285. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1286. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1287. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1288. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1289. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1290. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1291. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1292. // update dewpoint max value
  1293. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1294. $location_text = "main spectrometer basement";
  1295. $draw_x = 845;
  1296. $draw_y = 586;
  1297. $color = "#CCCCCC";
  1298. if (($Opus_tempC > 0) && (($Opus_tempC < 99)) && ($Opus_absPressure_hPa > 0))
  1299. {
  1300. placeBoxRight($draw_y, $draw_x,sprintf('%.1F &#176;C', $Opus_tempC), 65, 2, $color);
  1301. placePicWithLink($draw_y+2, $draw_x+5, "newTemperature.png", 15, "temperature at ".$location_text.", and &#010rel. humidity is H = ".sprintf('%.1F &#037;', $Opus_relH_percent).",&#010dewpoint Td = ".sprintf('%.1F &#176;C', $Opus_dewpointC).",&#010atm. pressure is p = ".sprintf('%.0F hPa', $Opus_absPressure_hPa).".", $Opus_tempC_channel);
  1302. }
  1303. // ########## MS top Opus weather station ##########
  1304. $data_index = 44;
  1305. $Opus_tempC = $adeiValue[$data_index][0];
  1306. $Opus_tempF = $adeiValue[$data_index][1];
  1307. $Opus_dewpointC = $adeiValue[$data_index][2];
  1308. $Opus_dewpointF = $adeiValue[$data_index][3];
  1309. $Opus_relH_percent = $adeiValue[$data_index][4];
  1310. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1311. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1312. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1313. $Opus_voltage = $adeiValue[$data_index][8];
  1314. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1315. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1316. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1317. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1318. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1319. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1320. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1321. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1322. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1323. // update dewpoint max value
  1324. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1325. $location_text = "main spectrometer under the roof";
  1326. $draw_x = 845;
  1327. $draw_y = 31;
  1328. if (($Opus_tempC > 0) && (($Opus_tempC < 99)) && ($Opus_absPressure_hPa > 0))
  1329. {
  1330. placeBoxRight($draw_y, $draw_x,sprintf('%.1F &#176;C', $Opus_tempC), 65, 2, $color);
  1331. placePicWithLink($draw_y+2, $draw_x+5, "newTemperature.png", 15, "temperature at ".$location_text.", and &#010rel. humidity is H = ".sprintf('%.1F &#037;', $Opus_relH_percent).",&#010dewpoint Td = ".sprintf('%.1F &#176;C', $Opus_dewpointC).",&#010atm. pressure is p = ".sprintf('%.0F hPa', $Opus_absPressure_hPa).".", $Opus_tempC_channel);
  1332. }
  1333. // ########## MoS general Opus weather station ##########
  1334. $data_index = 45;
  1335. $Opus_tempC = $adeiValue[$data_index][0];
  1336. $Opus_tempF = $adeiValue[$data_index][1];
  1337. $Opus_dewpointC = $adeiValue[$data_index][2];
  1338. $Opus_dewpointF = $adeiValue[$data_index][3];
  1339. $Opus_relH_percent = $adeiValue[$data_index][4];
  1340. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1341. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1342. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1343. $Opus_voltage = $adeiValue[$data_index][8];
  1344. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1345. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1346. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1347. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1348. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1349. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1350. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1351. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1352. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1353. $location_text = "monitor spectrometer building";
  1354. $draw_x = 0;
  1355. $draw_y = 536;
  1356. placePicWithLink($draw_y, $draw_x+5, "newTemperature.png", 23, "temperature at ".$location_text, $Opus_tempC_channel);
  1357. placeTextWithLink($draw_y, $draw_x+30, sprintf('%.1F &#176;C', $Opus_tempC), 90, 4, "#000000", "temperature at ".$location_text, $Opus_tempC_channel);
  1358. placePicWithLink($draw_y+25, $draw_x+5, "newPressure.png", 23, "atmospheric pressure at ".$location_text, $Opus_absPressure_hPa_channel);
  1359. placeTextWithLink($draw_y+25, $draw_x+30, sprintf('%.0F hPa', $Opus_absPressure_hPa), 90, 4, "#000000", "atmospheric pressure at ".$location_text, $Opus_absPressure_hPa_channel);
  1360. placePicWithLink($draw_y+50, $draw_x+5, "newHumidity.png", 23, "relative humidity at ".$location_text, $Opus_relH_percent_channel);
  1361. placeTextWithLink($draw_y+50, $draw_x+30, sprintf('%.1F &#037;', $Opus_relH_percent), 90, 4, "#000000", "relative humidity at ".$location_text , $Opus_relH_percent_channel);
  1362. // ########## MS condensation alert during HV operation ##########
  1363. if ($MSmode == 5) {
  1364. if ($global_max_dewpoint - $global_MS_temperature > -1) // check dewpoint 1 °C below tank temperature
  1365. {
  1366. placePic(-130+12, 857, "alarm_flash.gif", 50, "Condensation alert, don't operate high voltage!");
  1367. $color = "#FFD800"; // yellow
  1368. placeBox(-130+60, 805, "CONDENSATION ALERT" , 150, 3, $color);
  1369. }
  1370. }
  1371. ?>