SDS_status_main.php 75 KB

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