SDS_status_main.php 69 KB

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