SDS_status_main.php 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114
  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)
  21. {
  22. $OpModeText = $OpModeText . " commissioning";
  23. $color = "#FFA0A0";
  24. }
  25. else if ($PSmode == 1) $OpModeText = $OpModeText . $PSmode . " pump down";
  26. else if ($PSmode == 2) $OpModeText = $OpModeText . $PSmode . " venting";
  27. else if ($PSmode == 3) $OpModeText = $OpModeText . $PSmode . " pumping";
  28. else if ($PSmode == 4) $OpModeText = $OpModeText . $PSmode . " baking";
  29. else if ($PSmode == 5)
  30. {
  31. $OpModeText = $OpModeText . $PSmode . " high voltage";
  32. $color = "#B0FFB0";
  33. }
  34. placeBox(-110, 1190, $OpModeText, 250, 2, $color);
  35. // ########## PS PCS7 operation mode ##########
  36. $OpModeText = "MS mode: ";
  37. $color = "#FFFFFF";
  38. if ($MSmode == 0)
  39. {
  40. $OpModeText = $OpModeText . " commissioning";
  41. $color = "#FFA0A0";
  42. }
  43. else if ($MSmode == 1) $OpModeText = $OpModeText . $PSmode . " pump down";
  44. else if ($MSmode == 2) $OpModeText = $OpModeText . $PSmode . " venting";
  45. else if ($MSmode == 3) $OpModeText = $OpModeText . $PSmode . " pumping";
  46. else if ($MSmode == 4) $OpModeText = $OpModeText . $PSmode . " baking";
  47. else if ($MSmode == 5)
  48. {
  49. $OpModeText = $OpModeText . $PSmode . " high voltage";
  50. $color = "#B0FFB0";
  51. }
  52. placeBox(-85, 1190, $OpModeText, 250, 2, $color);
  53. // ########## VALVES ##########
  54. // V4
  55. $value = $adeiValue[36][1];
  56. $clearance = $adeiValue[36][0];
  57. $pic = "valve";
  58. $V4_open = false;
  59. if (($value == 1) && ($clearance == 1))
  60. {
  61. $pic = $pic . "On";
  62. $V4_open = true;
  63. }
  64. else if (($value == 0) && ($clearance == 0)) $pic = $pic . "Off";
  65. else if (($value == 0) && ($clearance == 1)) $pic = $pic . "FREE";
  66. else if (($value == 1) && ($clearance == 0)) $pic = $pic . "Error";
  67. 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]);
  68. // PS-MS flapper valve VMO 4110
  69. $value_open = $adeiValue[9][8];
  70. $value_closed = $adeiValue[9][9];
  71. $pic = "valve";
  72. if (($value_open == 1) && ($value_closed == 0)) $pic = $pic . "On";
  73. else if (($value_open == 0) && ($value_closed == 1)) $pic = $pic . "Off";
  74. 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]);
  75. // FPD gate valve
  76. $value = $adeiValue[36][2];
  77. $clearance = $adeiValue[31][0];
  78. $pic = "valve";
  79. if (($value == 1) && ($clearance == 1)) $pic = $pic . "On";
  80. else if (($value == 0) && ($clearance == 0)) $pic = $pic . "Off";
  81. else if (($value == 0) && ($clearance == 1)) $pic = $pic . "FREE";
  82. else if (($value == 1) && ($clearance == 0)) $pic = $pic . "Error";
  83. 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]);
  84. // ########## MAGNETS ##########
  85. // CPS
  86. $NlCPS = 20550 / 0.9133;
  87. $BfieldCPS = 1.26e-6 * $adeiValue[24][0] * $NlCPS; // mu0 * I * N/l
  88. if ($BfieldCPS < 0.1)
  89. {
  90. $value = "OFF";
  91. $color = "#FF0000";
  92. }
  93. else
  94. {
  95. $value = sprintf('%.1F T', $BfieldCPS);
  96. $color = "#000000";
  97. }
  98. placeTextWithLink(240, 2, $value, 60, 5, $color, "field of CPS behind separation wall derived from current", $adeiChannel[24][0]);
  99. placeText(265, 2, "CPS", 60, 2, "#000000");
  100. // PS1
  101. if ($adeiValue[3][3] == 0)
  102. {
  103. $value = "LEM";
  104. $color = "#FF0000";
  105. }
  106. else
  107. {
  108. $value = sprintf('%.1F T', $adeiValue[3][1] / 157.0 * 4.5);
  109. $color = "#000000";
  110. }
  111. placeTextWithLink(240, 66, $value, 70, 5, $color, "stand-alone center field PS1 magnet", $adeiChannel[3][1]);
  112. placeText(265, 66, "PS1", 70, 2, "#000000");
  113. // PS2
  114. if ($adeiValue[3][2] == 0)
  115. {
  116. $value = "LEM";
  117. $color = "#FF0000";
  118. }
  119. else
  120. {
  121. $value = sprintf('%.1F T', $adeiValue[3][0] / 157.0 * 4.5);
  122. $color = "#000000";
  123. }
  124. placeTextWithLink(240, 274, $value, 70, 5, $color, "stand-alone center field PS2 magnet", $adeiChannel[3][0]);
  125. placeText(265, 274, "PS2", 70, 2, "#000000");
  126. // Pinch
  127. 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]);
  128. placeText(265, 1420, "PCH", 70, 2, "#000000");
  129. // Detector
  130. 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]);
  131. placeText(265, 1495, "DET", 70, 2, "#000000");
  132. // ########## PAE ##########
  133. placeTextWithLink(303, 1553, sprintf('%.1F', $adeiValue[6][2]) . " kV", 90, 5, "#000000", "PAE potential", $adeiChannel[6][2]);
  134. placeText(328, 1553, "PAE", 90, 2, "#000000");
  135. // ########## PUMP PORTS ##########
  136. placeText(416, 1623, "PP2", 50, 2, "#000000");
  137. placeText(466, 1623, "PP1", 50, 2, "#000000");
  138. placeText(516, 1623, "PP3", 50, 2, "#000000");
  139. // ########## BAFFLE ##########
  140. $max = array(
  141. 90,
  142. 94,
  143. 88
  144. );
  145. $time_conversion_factor = 621355968000000000; // conversion for PCS7 .NET value;
  146. $timestamp = ($adeiValue[15][8] - $time_conversion_factor) / 10000000;
  147. echo '<br><font size="4" color="#000000">&nbsp;Baffle timestamp: ' . date("r", $timestamp) . ' </font><br>';
  148. //placeText(560, 1395, "LN<sub>2</sub> Tank", 130, 5, "#000000");
  149. $link = $adeiChannel[15][6] . "," . $adeiChannel[15][7];
  150. //placePicWithLink(563,1367, "LN2tank.png", 45, "LN2 tank", $link);
  151. $value = $adeiValue[15][6] * 0.77 + 0.83;
  152. $link = $adeiChannel[15][6];
  153. $text = sprintf('%.0F', $value) . " %";
  154. //placeTextWithLink(590, 1395, $text, 70, 4, "#000000", "LN2 tank level", $link);
  155. $value = $adeiValue[15][7] - 1.86;
  156. $link = $adeiChannel[15][7];
  157. $text = sprintf('%.1F', $value) . " bar";
  158. //placeTextWithLink(590, 1450, $text, 70, 4, "#000000", "LN2 tank pressure", $link);
  159. for ($id = 0;$id < 3;$id++)
  160. {
  161. $value = $adeiValue[15][$id];
  162. $pic = "ice.png";
  163. $text = "---";
  164. if ($value < 800)
  165. {
  166. $text = sprintf('%.0F', $value) . " K";
  167. if ($value > $max[$id]) $pic = "iceOff.png";
  168. else
  169. {
  170. $value = $adeiValue[15][$id + 3];
  171. if ($value > 0.1 && $value < 100.0) $pic = "iceOn.png";
  172. else $pic = "iceBlink.gif";
  173. }
  174. }
  175. $pos = $id;
  176. if ($id == 0) $pos = 1;
  177. else if ($id == 1) $pos = 0;
  178. $link = $adeiChannel[15][$id] . "," . $adeiChannel[15][$id + 3];
  179. placePicWithLink(410 + $pos * 50, 1375, $pic, 30, "status baffle PP" . ($id + 1) . "&#10;blue: cooled, red: warmed, blinking: warming, grey: undefined", $link);
  180. placeTextWithLink(437 + $pos * 50, 1355, $text, 70, 4, "#000000", "temperature baffle PP" . ($id + 1) , $link);
  181. }
  182. // ########## PRESSURES ##########
  183. // CC2320
  184. $value = $adeiValue[7][0];
  185. $pic = "cc";
  186. $text = "---";
  187. if ($value > 1E+2)
  188. {
  189. $pic = $pic;
  190. $text = "OFF";
  191. }
  192. else if ($value > 2E-5)
  193. {
  194. $pic = $pic . "Off";
  195. $text = "high";
  196. }
  197. else if ($value <= 1E-4 && $value >= 1.334E-11)
  198. {
  199. $pic = $pic . "On";
  200. $text = sprintf('%.1E', $value);
  201. }
  202. else if ($value < 1.334E-11)
  203. {
  204. $text = "LOW";
  205. }
  206. placePicWithLink(410, 1435, $pic . ".png", 30, "status cold cathode gauge CC2320&#10;green: on, red: off, grey: undefined", $adeiChannel[7][0]);
  207. placeTextWithLink(439, 1415, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC2320", $adeiChannel[7][0]);
  208. $time_conversion_factor = 621355968000000000; // conversion for PCS7 .NET value;
  209. $timestamp = ($adeiValue[7][8] - $time_conversion_factor) / 10000000;
  210. echo '<font size="4" color="#000000">&nbsp;Vacuum timestamp: ' . date("r", $timestamp) . ' </font><br>';
  211. // CC2345
  212. $value = $adeiValue[7][7];
  213. $pic = "cc";
  214. $text = "---";
  215. if ($value > 1E-4)
  216. {
  217. $pic = $pic . "Off";
  218. $text = "OFF";
  219. }
  220. else if ($value <= 1E-4 && $value >= 1.334E-11)
  221. {
  222. $pic = $pic . "On";
  223. $text = sprintf('%.1E', $value);
  224. }
  225. else if ($value < 1.334E-11)
  226. {
  227. $text = "LOW";
  228. }
  229. placePicWithLink(427, 1482, $pic . ".png", 30, "status cold cathode gauge CC2345&#10;green: on, red: off, grey: undefined", $adeiChannel[7][7]);
  230. placeTextWithLink(406, 1462, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC2345", $adeiChannel[7][7]);
  231. // Ex3110
  232. $value = $adeiValue[8][0];
  233. $pic = "ex";
  234. $text = "---";
  235. if ($value > 2E-5)
  236. {
  237. $text = "OFF";
  238. {
  239. if ($MSmode < 5) $pic = $pic . "Off";
  240. else $pic = $pic;
  241. }
  242. }
  243. else if ($value <= 2E-5 && $value > 1E-12)
  244. {
  245. $pic = $pic . "On";
  246. $text = sprintf('%.1E', $value);
  247. }
  248. placePicWithLink(510, 1435, $pic . ".png", 30, "status extractor ion gauge Ex3110&#10;green: on, red: off, grey: undefined", $adeiChannel[8][0]);
  249. placeTextWithLink(539, 1415, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex3110", $adeiChannel[8][0]);
  250. // Ex1110
  251. $value = $adeiValue[28][0];
  252. $link = $adeiChannel[28][0];
  253. $pic = "ex";
  254. $text = "---";
  255. if ($value > 2E-5)
  256. {
  257. $text = "OFF";
  258. {
  259. if ($MSmode < 5) $pic = $pic . "Off";
  260. else $pic = $pic;
  261. }
  262. }
  263. else if ($value <= 2E-5 && $value > 1E-12)
  264. {
  265. $pic = $pic . "On";
  266. $text = sprintf('%.1E', $value);
  267. }
  268. placePicWithLink(460, 1435, $pic . ".png", 30, "status extractor ion gauge Ex1110&#10;green: off, blinking: on, grey: undefined", $link);
  269. placeTextWithLink(489, 1415, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex1110", $link);
  270. // Ex0096
  271. $value = $adeiValue[9][2];
  272. $link = $adeiChannel[9][2];
  273. $pic = "ex";
  274. $text = "---";
  275. if ($value > 1E+2)
  276. {
  277. $text = "OFF";
  278. {
  279. if ($MSmode < 5) $pic = $pic . "Off";
  280. else $pic = $pic;
  281. }
  282. }
  283. else if ($value > 2E-5)
  284. {
  285. $pic = $pic . "Off";
  286. $text = "OFF";
  287. }
  288. else if ($value <= 2E-5 && $value > 1E-12)
  289. {
  290. $pic = $pic . "On";
  291. $text = sprintf('%.1E', $value);
  292. }
  293. placePicWithLink(230, 1220, $pic . ".png", 30, "status extractor ion gauge 0096&#10;green: off, blinking: on, grey: undefined", $link);
  294. placeTextWithLink(259, 1200, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge 0096", $link);
  295. // CC FPD
  296. $value = $adeiValue[6][1];
  297. $pic = "cc";
  298. $text = "---";
  299. if ($value > 1E-4)
  300. {
  301. $pic = $pic . "Off";
  302. $text = "OFF";
  303. }
  304. if ($value < 1E-11)
  305. {
  306. $pic = $pic . "Off";
  307. $text = "OFF";
  308. }
  309. else if ($value <= 1E-4 && $value > 1E-12)
  310. {
  311. $pic = $pic . "On";
  312. $text = sprintf('%.1E', $value);
  313. }
  314. placePicWithLink(188, 1475, $pic . ".png", 30, "status FPD cold cathode gauge&#10;green: on, red: off, grey: undefined", $adeiChannel[6][1]);
  315. placeTextWithLink(217, 1455, $text, 70, 4, "#000000", "pressure [mbar] FPD cold cathode gauge", $adeiChannel[6][1]);
  316. // Gauge Baffle
  317. $value = $adeiValue[5][0];
  318. $link = $adeiChannel[5][0];
  319. $color = "#000000";
  320. $pic = "gauge";
  321. $text = "---";
  322. if ($value > 1E-4)
  323. {
  324. $pic = $pic . "Off";
  325. $text = "OFF";
  326. }
  327. // standard cold blue "#0026FF" , ice cold blue "#107BC7"
  328. if ($value < 2E-6 && $value > 1E-9)
  329. {
  330. $pic = "gaugeOn";
  331. $color = "#107BC7";
  332. $text = sprintf('%.1E', $value);
  333. }
  334. else if ($value >= 1E-6 && $value < 1e-1)
  335. {
  336. $pic = "gaugeOff";
  337. $color = "FF0000";
  338. $text = sprintf('%.1E', $value);
  339. }
  340. 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);
  341. placeTextWithLink(460 + 29, 1295, $text, 70, 4, $color, "pressure [mbar] baffle insulation vacuum gauge", $link);
  342. // PS CC1232
  343. $value = $adeiValue[27][0];
  344. $link = $adeiChannel[27][0];
  345. $pic = "cc";
  346. $text = "---";
  347. if ($value >= 9.9E-5)
  348. {
  349. $pic = $pic . "Off";
  350. $text = "OFF";
  351. }
  352. else if ($value < 1E-4 && $value > 1.2E-11)
  353. {
  354. $pic = $pic . "On";
  355. $text = sprintf('%.1E', $value);
  356. }
  357. placePicWithLink(370, 240, $pic . ".png", 30, "status cold cathode gauge CC1232&#10;green: on, red: off, grey: undefined", $link);
  358. placeTextWithLink(399, 220, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC1232", $link);
  359. // PS Ex1221
  360. $value = $adeiValue[27][5];
  361. $link = $adeiChannel[27][5];
  362. $pic = "ex";
  363. $text = "---";
  364. if ($value >= 9.9E-5)
  365. {
  366. $text = "OFF";
  367. {
  368. if ($PSmode < 5) $pic = $pic . "Off";
  369. else $pic = $pic;
  370. }
  371. }
  372. else if ($value < 1E-4 && $value > 7E-13)
  373. {
  374. $pic = $pic . "On";
  375. $text = sprintf('%.1E', $value);
  376. }
  377. placePicWithLink(188, 141, $pic . ".png", 30, "status extractor ion gauge Ex1221&#10;green: on, red: off, grey: undefined", $link);
  378. placeTextWithLink(217, 121, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex1221", $link);
  379. // ########## VACUUM PUMPS ##########
  380. // MS TMP Temperatures
  381. //T<sub>max</sub>
  382. $value = max($adeiValue[25][0], $adeiValue[25][1], $adeiValue[25][2]);
  383. $link = $adeiChannel[25][0] . "," . $adeiChannel[25][1] . "," . $adeiChannel[25][2];
  384. $color = "#000000";
  385. if ($value < 10) $color = "#0026FF";
  386. else if ($value > 50) $color = "#FF0000";
  387. placeTextWithLink(435, 1625, sprintf('%.1F &#176;C', $value) , 70, 3, $color, "TMP max temperature PP2", $link);
  388. $value = max($adeiValue[26][0], $adeiValue[26][1], $adeiValue[26][2]);
  389. $link = $adeiChannel[26][0] . "," . $adeiChannel[26][1] . "," . $adeiChannel[26][2];
  390. $color = "#000000";
  391. if ($value < 10) $color = "#0026FF";
  392. else if ($value > 50) $color = "#FF0000";
  393. placeTextWithLink(535, 1625, sprintf('%.1F &#176;C', $value) , 70, 3, $color, "TMP max temperature PP3", $link);
  394. // TMPs (PP2 + PP3)
  395. for ($pp = 0;$pp < 2;$pp++)
  396. {
  397. for ($id = 0;$id < 3;$id++)
  398. {
  399. $value = $adeiValue[$pp + 7][$id + 1];
  400. $pic = "tmp";
  401. $text = "---";
  402. if ($value < 50)
  403. {
  404. if ($MSmode < 5) $pic = $pic . "Off";
  405. }
  406. else if ($value >= 50 && $value < 500)
  407. {
  408. $text = sprintf('%.0F', $value);
  409. if ($value > 450)
  410. {
  411. $value = $adeiValue[$pp + 7][$id + 4];
  412. //$pic = $pic . "On";
  413. if ($value == 1) $pic = $pic . "On";
  414. else if ($value == 0) $pic = $pic . "Closed";
  415. }
  416. else if ($value > 240)
  417. {
  418. $value = $adeiValue[$pp + 7][$id + 4];
  419. //$pic = $pic . "On";
  420. if ($value == 1) $pic = $pic . "Standby";
  421. else if ($value == 0) $pic = $pic . "Standby";
  422. }
  423. }
  424. 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]);
  425. 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]);
  426. }
  427. }
  428. // PS TMPs
  429. for ($id = 0;$id < 2;$id++)
  430. {
  431. $value = $adeiValue[27][$id + 1];
  432. $link = $adeiChannel[27][$id + 1];
  433. $pic = "tmp";
  434. $text = "---";
  435. if ($value < 50)
  436. {
  437. if ($PSmode < 5) $pic = $pic . "Off";
  438. }
  439. else if ($value >= 50 && $value < 700)
  440. {
  441. $text = sprintf('%.0F', $value);
  442. if ($value > 570)
  443. {
  444. $value = $adeiValue[27][$id + 3];
  445. //$pic = $pic . "On";
  446. if ($value == 1) $pic = $pic . "On";
  447. else if ($value == 0) $pic = $pic . "Standby";
  448. }
  449. }
  450. 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);
  451. placeTextWithLink(399, 148 + $id * 35, $text, 50, 4, "#000000", "rotational speed [Hz] turbo-molecular pump TMP" . (1123 - $id) , $link);
  452. }
  453. // FPD CP
  454. $value = $adeiValue[6][3];
  455. $pic = "cp";
  456. $text = "---";
  457. if ($value > 20)
  458. {
  459. $pic = $pic . "Off";
  460. }
  461. else if ($value <= 20 && $value > 5)
  462. {
  463. $text = sprintf('%.0F K', $value);
  464. $value = $adeiValue[6][12];
  465. if ($value == 1)
  466. {
  467. $pic = $pic . "On";
  468. }
  469. else if ($value == 0)
  470. {
  471. $pic = $pic . "Standby";
  472. }
  473. }
  474. 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]);
  475. placeTextWithLink(368, 1455, $text, 70, 3, "#000000", "temperature FPD UHV cryo pump", $adeiChannel[6][3]);
  476. // ########## FPD SOURCES ##########
  477. $pic = "source";
  478. $text = "---";
  479. if ($adeiValue[6][9] == 1 && $adeiValue[6][10] == 1)
  480. {
  481. $pic = $pic . "On";
  482. $text = "OUT";
  483. }
  484. else if ($adeiValue[6][9] == 1 && $adeiValue[6][10] == 0)
  485. {
  486. $pic = $pic . "EIn";
  487. $text = "IN";
  488. }
  489. else if ($adeiValue[6][9] == 0 && $adeiValue[6][10] == 1)
  490. {
  491. $pic = $pic . "GIn";
  492. $text = "IN";
  493. }
  494. else if ($adeiValue[6][9] == 0 && $adeiValue[6][10] == 0)
  495. {
  496. $pic = $pic . "Off";
  497. $text = "IN";
  498. }
  499. $link = $adeiChannel[6][9] . "," . $adeiChannel[6][10];
  500. placePicWithLink(368 - 30, 1510, $pic . ".png", 30, "status FPD sources (electron and gamma source)&#10;green: retracted (out), red: inserted (in), grey: undefined", $link);
  501. placeTextWithLink(368, 1490, $text, 70, 3, "#000000", "status FPD sources (electron and gamma source)", $link);
  502. // ########## AIR COILS ##########
  503. // LFCS
  504. $tol = 0.3;
  505. $text = "Unkn";
  506. $color = "#FFD800";
  507. $lfcs_array_offset = 2;
  508. $lfcs_config = - 1; // store config for emcs later in loop
  509. for ($pp = 0;$pp < sizeof($aircoil_settings);$pp++)
  510. {
  511. for ($id = 0;$id < 22;$id++) // still old air coil number
  512. {
  513. $tol = abs($tol);
  514. if ($id == 20)
  515. {
  516. $lfcs_array_offset = - 19;
  517. }
  518. if ($id == 21)
  519. {
  520. $lfcs_array_offset = - 21;
  521. }
  522. if (abs($adeiValue[0][$id + $lfcs_array_offset] - $aircoil_settings[$pp][$id + 1]) < $tol)
  523. {
  524. if ($id == 19)
  525. {
  526. $text = $aircoil_settings[$pp][0];
  527. $lfcs_config = $pp;
  528. $color = "#FF9300";
  529. }
  530. if ($id == 21)
  531. {
  532. $color = "#4CFF00";
  533. }
  534. }
  535. else break;
  536. }
  537. if ($lfcs_config > - 1) break;
  538. }
  539. if ($text == "All Off")
  540. {
  541. $text = "OFF";
  542. $color = "#FF0000";
  543. }
  544. $mace_setting["LFCS"] = $text;
  545. placeText(-15, 232, "LFCS", 85, 5, "#000000");
  546. placeBox(10, 230, $text, 85, 3, $color);
  547. // EMCS
  548. $tol = 0.2;
  549. $text = "???";
  550. $color = "#FFD800";
  551. $EMCShor = $aircoil_settings[$lfcs_config][21];
  552. $EMCSver = $aircoil_settings[$lfcs_config][22];
  553. if ($adeiValue[0][0] > $EMCSver - $tol && $adeiValue[0][0] < $EMCSver + $tol && $adeiValue[0][1] > $EMCShor - $tol && $adeiValue[0][1] < $EMCShor + $tol)
  554. {
  555. $text = "On OK";
  556. $color = "#4CFF00";
  557. }
  558. else if ($adeiValue[0][0] > $tol || $adeiValue[0][1] > $tol)
  559. {
  560. $text = "Unkn";
  561. $color = "#FFD800";
  562. }
  563. else
  564. {
  565. $text = "ERR " . $lfcs[$lfcs_config][16];
  566. $color = "#FF0000";
  567. }
  568. if ($adeiValue[0][0] < $tol && $adeiValue[0][1] < $tol && $adeiValue[0][0] > - $tol && $adeiValue[0][1] > - $tol)
  569. {
  570. $text = "OFF";
  571. $color = "#FF0000";
  572. }
  573. $mace_setting["EMCS"] = $text;
  574. placeText(50, 232, "EMCS", 85, 5, "#000000");
  575. placeBox(75, 230, $text, 85, 3, $color);
  576. // print current values
  577. $tol = 0.5;
  578. for ($coil = 0;$coil < 22;$coil++)
  579. {
  580. $current = $adeiValue[0][$coil];
  581. $voltage = $adeiValue[1][$coil];
  582. $voltage = sprintf('%.1F', $voltage);
  583. $color = "#000000";
  584. if (abs($current) < $adeiValue[21][$coil] - $tol || abs($current) > $adeiValue[21][$coil] + $tol) $color = "#FF0000";
  585. if ($current < - $tol && $adeiValue[22][$coil] != 1) $color = "#FF0000";
  586. if ($current > $tol && $adeiValue[22][$coil] != 0) $color = "#FF0000";
  587. $current = sprintf('%.1F', $current);
  588. if ($current <= - 100 || $current >= 100) $current = sprintf('%.0F', $current);
  589. if ($current >= - 0.1 && $current <= 0.1) $current = sprintf('%.1F', 0.0);
  590. $vpos = - 26;
  591. $pos = 609 + ($coil - 4) * 42.9;
  592. if ($coil == 0)
  593. {
  594. $pos = 320;
  595. $vpos = 56;
  596. } // pos for EMCS VER
  597. else if ($coil == 1)
  598. {
  599. $pos = 378;
  600. $vpos = 56;
  601. } // pos for EMCS HOR
  602. else if ($coil == 21)
  603. {
  604. $pos = $pos + 4;
  605. } // for coil 21
  606. $lem = $adeiValue[2][$coil];
  607. $color = "#006400";
  608. if ($lem == 1) $current = "LEM";
  609. $label = ($coil - 1);
  610. if ($coil == 0) $label = "VER";
  611. else if ($coil == 1) $label = "HOR";
  612. // add value label
  613. //if ($coil == 2) {
  614. // placeText($vpos+2, $pos-30, "I [A] =", 50, 2, "#888888");
  615. // placeText($vpos+17, $pos-30, "U [V] =", 47, 1, "#888888");
  616. //}
  617. // add air coil numbers here
  618. placeText($vpos + 32, $pos, $label, 70, 2, "#000000");
  619. // print voltage value of air coil
  620. placeTextWithLink($vpos + 18, $pos, $voltage, 70, 1, $color, "air-coil voltage [V]", $adeiChannel[1][$coil]);
  621. // print current value of air coil
  622. placeTextWithLink($vpos, $pos, $current, 70, 4, $color, "air-coil current [A]&#10;LEM: DCCT offline", $adeiChannel[0][$coil]);
  623. }
  624. // ######### HV Divider Temp Monitoring
  625. if ($MSmode == 5)
  626. { // only display in MS operation mode High-Voltage
  627. $K35_temp = $adeiValue[10][26];
  628. $K35_link = $adeiChannel[10][26];
  629. $K65_temp = $adeiValue[10][27];
  630. $K65_link = $adeiChannel[10][27];
  631. $divider_temp_spec = 25.0;
  632. $tol_div = 0.2;
  633. $color = "#FFFFFF";
  634. if (abs($K35_temp - $divider_temp_spec) > $tol_div) $color = "#FF0000";
  635. placeBox(586, 322, sprintf('%.1F &#176;C', $K35_temp) , 50, 2, $color);
  636. placePicWithLink(536, 324, "K35_drawing.png", 50, "K35 temperature status", $K35_link);
  637. $color = "#FFFFFF";
  638. if (abs($K65_temp - $divider_temp_spec) > $tol_div) $color = "#FF0000";
  639. placeBox(586, 378, sprintf('%.1F &#176;C', $K65_temp) , 50, 2, $color);
  640. placePicWithLink(536, 379, "K65_drawing.png", 50, "K65 temperature status", $K65_link);
  641. }
  642. // ########## HIGH VOLTAGE ##########
  643. if (($MSmode == 5) or ($MSmode == 4))
  644. { // only display in MS operation mode High-Voltage or baking
  645. // ##### path to patch panel configuration file
  646. if (file_exists("patchpanel/data/activeIEconfig.txt"))
  647. {
  648. $path_to_patchpanel = "patchpanel/data/activeIEconfig.txt";
  649. } // only for KAAS server
  650. else
  651. {
  652. $path_to_patchpanel = "patchpanel/ringstoadei.txt";
  653. } // for IKP dev server
  654. // load patch-panel configuration
  655. $handle = fopen($path_to_patchpanel, "r");
  656. $ringsToAdei = array();
  657. if ($handle)
  658. {
  659. while (($buffer = fgets($handle, 4096)) !== false)
  660. {
  661. $buffer = trim($buffer);
  662. $ringsToAdei[count($ringsToAdei) ] = $buffer;
  663. }
  664. fclose($handle);
  665. }
  666. // labels
  667. $posY = 8; // offset between labels and voltages (13)
  668. $posX = 10; // down/bottom (7)
  669. if ($MSmode == 5)
  670. { // only display in MS operation mode High-Voltage
  671. $K35_value = $adeiValue[30][0];
  672. $K35_link = $adeiChannel[30][0];
  673. $K35_TS = $adeiValue[30][1];
  674. $K35_RunFlag = $adeiValue[30][2];
  675. $K35_text = "not connected";
  676. $K65_value = $adeiValue[30][3];
  677. $K65_link = $adeiChannel[30][3];
  678. $K65_TS = $adeiValue[30][4];
  679. $K65_RunFlag = $adeiValue[30][5];
  680. // Kal1 = JRL at PS vessel voltage
  681. // Kal1 = DVM at IE Common voltage for SuperKrypton 2021
  682. $Kal1_value = $adeiValue[30][6];
  683. $Kal1_link = $adeiChannel[30][6];
  684. $Kal1_TS = $adeiValue[30][7];
  685. $Kal1_RunFlag = $adeiValue[30][8];
  686. $Kal1_text = "DVM @ IE Common";
  687. $time_conversion_factor = 2082844800;
  688. $most_recent_TS = max($K35_TS, $K65_TS, $Kal1_TS);
  689. if (max($K35_RunFlag, $K65_RunFlag, $Kal1_RunFlag) > 0)
  690. {
  691. $timestamp = ($most_recent_TS - $time_conversion_factor);
  692. echo '<font size="4" color="#000000">&nbsp;HV meas. timestamp: ' . date("r", $timestamp) . ' </font><br>';
  693. }
  694. else echo '<font size="4" color="#000000">&nbsp;HV meas. OFFLINE </font><br>';
  695. // HV switch for K35
  696. $hv_switch1103_k35 = $adeiValue[35][2];
  697. if ($hv_switch1103_k35 == 1) $K35_text = "K35 @ MoS Voltage";
  698. else if ($hv_switch1103_k35 == 0) $K35_text = "K35 @ MS Voltage";
  699. $K35_text = "K65 @ MS Tank + IE";
  700. // voltage monitoring readout K35
  701. $color = "#000000";
  702. $factor_m = 1818.108;
  703. $factor_m_rel_error = 1.0e-6;
  704. $offset = 3.67e-6;
  705. $offset_error = 1.6e-7;
  706. $gain = 0.99999956;
  707. $gain_error = 6.5e-8;
  708. $value = ($K35_value - $offset) * $gain * $factor_m;
  709. $voltage_error = abs($value * $factor_m_rel_error * 1e3); // in mV
  710. if ($voltage_error * 100 < 1)
  711. {
  712. $voltage_error = 0.2;
  713. }
  714. // voltage display K35
  715. $link = $K35_link;
  716. $text = "K35 divider readout 436-REU-0-0201-0001, but connected to K65 in KNM6 at 436-REU-0-0101-0001, precision voltage value";
  717. if ($K35_RunFlag > 0)
  718. {
  719. placeText(342, 811, $K35_text, 140, 2, $color); // K35 voltage reading
  720. placeTextWithLink(320, 746, "U<sub>0</sub> = " . sprintf('%.3F', $value) . "(" . sprintf('%.0F', $voltage_error) . ") V", 270, 5, $color, $text, $link);
  721. if (($value < - 19724.6) & ($value > - 19724.7)) placeText(280, 796, "calibration in progress", 170, 2, "green"); // calibration ongoing
  722. }
  723. // HV switch for K65
  724. $hv_switch1102_k65 = $adeiValue[35][1];
  725. //$K65_text = "K65 @ MS Tank + IE";
  726. $K65_text = "K35 @ MS Tank + IE";
  727. //if ($hv_switch1102_k65 == 1) $K65_text = "K65 @ MoS Voltage";
  728. //if ($hv_switch1102_k65 == 0) $K65_text = "K65 @ MS Voltage";
  729. // voltage monitoring readout K65
  730. $color = "#000000";
  731. //$factor_m = 1818.108;
  732. //$factor_m_rel_error = 0.02/$factor_m;
  733. //$offset = -4.1e-6;
  734. //$gain = 1.00000136;
  735. $factor_m = 1972.462;
  736. $factor_m_rel_error = 1.0e-6; // including calibration, gain and offset error
  737. $offset = 3.67e-6;
  738. $offset_error = 3.5e-7;
  739. $gain = 0.999999277;
  740. $gain_error = 9.9e-8;
  741. $value = ($K65_value - $offset) * $gain * $factor_m;
  742. $voltage_error = abs($value * $factor_m_rel_error * 1e3); // in mV
  743. if ($voltage_error < 1)
  744. {
  745. $voltage_error = 1;
  746. }
  747. // voltage display K65
  748. $link = $K65_link;
  749. $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";
  750. //$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.";
  751. if ($K65_RunFlag > 0)
  752. {
  753. if (($value < - 19724.6) & ($value > - 19724.7)) placeText(340, 796, "calibration in progress", 170, 2, "green"); // calibration ongoing
  754. placeTextWithLink(358, 746, "U<sub>0</sub> = " . sprintf('%.3F', $value) . "(" . sprintf('%.0F', $voltage_error) . ") V", 270, 5, $color, $text, $link);
  755. //display stability indicators
  756. //if ($local)
  757. {
  758. if (sizeof($flukeE) > 2)
  759. {
  760. placeText(381, 811, $K65_text, 140, 2, $color); // K65 voltage reading
  761. if ($flukeE[0]['ppmdev'] <= 2e-6) $color1 = "lightgreen";
  762. if ($flukeE[1]['ppmdev'] <= 2e-6) $color2 = "lightgreen";
  763. if ($flukeE[2]['ppmdev'] <= 2e-6) $color3 = "lightgreen";
  764. if ($flukeE[3]['ppmdev'] <= 2e-6) $color4 = "lightgreen";
  765. if ($flukeE[0]['ppmdev'] > 2e-6) $color1 = "orange";
  766. if ($flukeE[1]['ppmdev'] > 2e-6) $color2 = "orange";
  767. if ($flukeE[2]['ppmdev'] > 2e-6) $color3 = "orange";
  768. if ($flukeE[3]['ppmdev'] > 2e-6) $color4 = "orange";
  769. if ($flukeE[0]['ppmdev'] > 5e-6) $color1 = "#FFA0A0";
  770. if ($flukeE[1]['ppmdev'] > 5e-6) $color2 = "#FFA0A0";
  771. if ($flukeE[2]['ppmdev'] > 5e-6) $color3 = "#FFA0A0";
  772. if ($flukeE[3]['ppmdev'] > 5e-6) $color4 = "#FFA0A0";
  773. placeBox(396, 915, "10s", 35, 1, $color1);
  774. placeBox(396, 880, "20s", 35, 1, $color2);
  775. placeBox(396, 845, "1m", 35, 1, $color3);
  776. placeBox(396, 810, "5m", 35, 1, $color4);
  777. echo '<font size="4" color="#000000">&nbsp;HV status timestamp: ' . $extraction_time_HV . ' </font><br>';
  778. }
  779. else placeText(381, 811, $K65_text, 140, 2, $color); // K65 voltage reading
  780. }
  781. }
  782. // voltage monitoring readout Kal1 e.g. JRL at PS
  783. // in 2021 used for IE Common monitoring
  784. $color = "#000000";
  785. //$factor_m = 5000.1021;
  786. //$offset = 4.529e-6;
  787. //$gain = 0.999997525656185;
  788. $factor_m = 1.0;
  789. $offset = 0.0;
  790. $gain = 1.0;
  791. $value = ($Kal1_value - $offset) * $gain * $factor_m;
  792. // $voltage_error = abs($value * 2e-3);
  793. $voltage_error = abs($value * 20 * 10e-6);
  794. //if ($voltage_error*100 < 1) { $voltage_error = 0.2; }
  795. if ($voltage_error * 100 < 0.002)
  796. {
  797. $voltage_error = 0.002;
  798. }
  799. // voltage display K35
  800. $link = $Kal1_link;
  801. // $text = "JRL divider at Kal1 monitoring input 436-REU-0-0501-0001, precision voltage value";
  802. $text = "DVM at IE Common, 436-REU-0-0301-001, precision voltage value";
  803. if ($Kal1_RunFlag > 0)
  804. {
  805. placeText(304, 815, $Kal1_text, 130, 2, $color); // Kal1 voltage reading
  806. if (abs($value) > 36000) placeText(490, 116, "calibration in progress", 170, 2, "green"); // calibration ongoing
  807. placeTextWithLink(284, 765, "U<sub>IE</sub> = " . sprintf('%.3F', $value) . "(" . sprintf('%.0F', $voltage_error * 100) . ") V", 230, 4, $color, $text, $link);
  808. }
  809. // Post Regulation Current Monitor
  810. $U_ist = abs($adeiValue[10][0]);
  811. $I_ist = abs($adeiValue[10][28]);
  812. $PID_setpoint = abs($adeiValue[10][30]);
  813. $PR_hw_current = abs($adeiValue[10][31]);
  814. $hv_switch1102_k65 = $adeiValue[35][1];
  815. $hv_switch1103_k35 = $adeiValue[35][2];
  816. $R_K65 = 54.5e6;
  817. $R_K35 = 58.65e6;
  818. if ($hv_switch1103_k35 + $hv_switch1102_k65 = 2) $R_ges = 33.057e6; // manual entry of R_ges with K65 and K35 connected
  819. else $R_ges = (1 - $hv_switch1103_k35) * $R_K35 + (1 - $hv_switch1102_k65) * $R_K65; // choose just one divider
  820. $I_noPR = $U_ist / $R_ges * 1000.0;
  821. $I_PR = $I_ist - $I_noPR;
  822. $APR_on = abs($adeiValue[10][29]);
  823. $verbose = false; // switch for status outputs, dev mode
  824. // 28W limit, 33 kV mit 0,7 mA ist Maximum für stabilen Betrieb
  825. $P_PR = 0.0;
  826. if ($I_PR > 0.01)
  827. {
  828. $P_PR = $U_ist * $I_PR / 1000;
  829. }
  830. else $I_PR = 0.0;
  831. $pic = "postreg";
  832. if ($verbose) echo '<br><br><br>';
  833. if ($I_PR < 0.1)
  834. {
  835. if ($verbose) echo 'PR off<br>';
  836. $pic = $pic . "Off";
  837. }
  838. else
  839. {
  840. if ($I_PR < 0.46)
  841. {
  842. if ($verbose) echo 'PR_current low';
  843. $pic = $pic . "Warn";
  844. }
  845. else if (($I_PR >= 0.46) && ($I_PR <= 0.8))
  846. {
  847. if ($verbose) echo 'PR_current OK';
  848. $pic = $pic . "On";
  849. }
  850. else if ($I_PR > 0.8)
  851. {
  852. if ($verbose) echo 'PR_current overload';
  853. $pic = $pic . "Alarm";
  854. }
  855. if ($verbose)
  856. {
  857. echo '<br>';
  858. if ($P_PR < 23) echo " PR_wattage in range";
  859. else if ($P_PR < 28) echo " PR_wattage high";
  860. else if ($P_PR > 28) echo " PR_wattage CRITICAL";
  861. echo '<br>';
  862. }
  863. }
  864. if ($verbose)
  865. {
  866. echo '<br>';
  867. echo 'R_Divider = ' . $U_ist / ($I_ist * 1000) . ' MOhm, ';
  868. echo 'I_ist = ' . $I_ist . ' mA, ';
  869. echo 'I_noPR = ' . $I_noPR . ' mA, ';
  870. echo 'I_PR = ' . $I_PR . ' mA, ';
  871. echo 'P_PR = ' . $P_PR . ' W<br>';
  872. }
  873. $color = "#000000";
  874. 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");
  875. if ($I_PR < 0.1)
  876. {
  877. placeText(466, 324, "OFF", 60, 2, $color, "HV post regulation offline.");
  878. }
  879. else
  880. {
  881. 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]);
  882. 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]);
  883. if ($APR_on) placeTextWithLink(492, 335, "APR ON", 40, 0, "#40AA40", "Advanced Post Regulation (APR) status.", $adeiChannel[10][29]);
  884. if ($PID_setpoint > 9.0) placeTextWithLink(501, 285, "APR setpoint limit", 140, 0, "#FF0000", "APR setpoint at 90% of limit.", $adeiChannel[10][30]);
  885. 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]);
  886. }
  887. } // end of PCS7 mode switch
  888. //placeText(180, 845, "MS WEST IE", 70, 2,"#808080"); // west IE being displayed in loop below
  889. //placeText(450, 845, "MS EAST IE", 70, 2,"#808080"); // east IE
  890. placeText(265, 815, "MS IE COMMON", 130, 2, "#000000"); // mainspec IE Common
  891. // MS Tank from Precision HCP Supply or Standard HCN
  892. $text = "MS TANK";
  893. $ms_hcp_soll = $adeiValue[10][1]; //flipped 2021-02-16 for new HCP device
  894. $ms_hcn_soll = $adeiValue[10][25];
  895. $HCP = true;
  896. if ($ms_hcn_soll == 0)
  897. {
  898. if ($ms_hcp_soll == 0)
  899. {
  900. $text = $text . " OFF";
  901. }
  902. else
  903. {
  904. $text = $text . " HCP";
  905. $HCP = true;
  906. }
  907. }
  908. else
  909. {
  910. $text = $text . " HCN";
  911. $HCP = false;
  912. }
  913. placeText(70, 830, $text, 100, 2, "#000000"); // mainspec tank
  914. // switch values here between HCN and HCP in Value and Channel Array !!!
  915. //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]; }
  916. if ($HCP)
  917. {
  918. $adeiValue[10][0] = - $adeiValue[10][0];
  919. }
  920. placeText(110 - $posY, 845, "W7-11", 70, 2, "#000000"); // w7-11
  921. placeText(503 + $posY + $posX, 845, "E7-11", 70, 2, "#000000"); // e7-11
  922. placeText(126 - $posY, 600, "W6", 70, 2, "#000000"); // w6
  923. placeText(487 + $posY + $posX, 600, "E6", 70, 2, "#000000"); // e6
  924. placeText(126 - $posY, 1090, "W12", 70, 2, "#000000"); // w12
  925. placeText(487 + $posY + $posX, 1090, "E12", 70, 2, "#000000"); // e12
  926. placeText(161 - $posY, 516, "W5", 70, 2, "#000000"); // w5
  927. placeText(452 + $posY + $posX, 516, "E5", 70, 2, "#000000"); // e5
  928. placeText(161 - $posY, 1174, "W13", 70, 2, "#000000"); // w13
  929. placeText(452 + $posY + $posX, 1174, "E13", 70, 2, "#000000"); // e13
  930. placeText(194 - $posY, 434, "W4", 70, 2, "#000000"); // w4
  931. placeText(419 + $posY + $posX, 434, "E4", 70, 2, "#000000"); // e4
  932. placeText(194 - $posY, 1256, "W14", 70, 2, "#000000"); // w14
  933. placeText(419 + $posY + $posX, 1256, "E14", 70, 2, "#000000"); // e14
  934. placeText(225 - $posY, 385, "W3", 70, 2, "#000000"); // w3
  935. placeText(388 + $posY + $posX, 385, "E3", 70, 2, "#000000"); // e3
  936. placeText(225 - $posY, 1305, "W15", 70, 2, "#000000"); // w15
  937. placeText(388 + $posY + $posX, 1305, "E15", 70, 2, "#000000"); // e15
  938. placeText(273 - $posY, 352, "W2", 70, 2, "#000000"); // w2
  939. placeText(340 + $posY + $posX, 352, "E2", 70, 2, "#000000"); // e2
  940. placeText(273 - $posY, 1338, "W16", 70, 2, "#000000"); // w16
  941. placeText(340 + $posY + $posX, 1338, "E16", 70, 2, "#000000"); // e16
  942. if ($adeiValue[10][8] > 10.0) placeText(309, 359, "APE", 70, 2, "#000000"); // ape south
  943. if ($adeiValue[10][10] > 10.0) placeText(309, 1331, "APE", 70, 2, "#000000"); // ape north
  944. // offset voltages
  945. $posY = 16; // offset between outer and inner voltages
  946. $ringsPosY = array(
  947. 275,
  948. 275 + $posY,
  949. 227,
  950. 227 + $posY,
  951. 196,
  952. 196 + $posY,
  953. 163,
  954. 163 + $posY,
  955. 128,
  956. 128 + $posY,
  957. 112,
  958. 112 + $posY,
  959. 128,
  960. 128 + $posY,
  961. 163,
  962. 163 + $posY,
  963. 196,
  964. 196 + $posY,
  965. 227,
  966. 227 + $posY,
  967. 275,
  968. 275 + $posY,
  969. 342,
  970. 342 - $posY,
  971. 390,
  972. 390 - $posY,
  973. 421,
  974. 421 - $posY,
  975. 454,
  976. 454 - $posY,
  977. 489,
  978. 489 - $posY,
  979. 505,
  980. 505 - $posY,
  981. 489,
  982. 489 - $posY,
  983. 454,
  984. 454 - $posY,
  985. 421,
  986. 421 - $posY,
  987. 390,
  988. 390 - $posY,
  989. 342,
  990. 342 - $posY
  991. );
  992. $ringsPosX = array(
  993. 352,
  994. 352,
  995. 385,
  996. 385,
  997. 434,
  998. 434,
  999. 516,
  1000. 516,
  1001. 600,
  1002. 600,
  1003. 845,
  1004. 845,
  1005. 1090,
  1006. 1090,
  1007. 1174,
  1008. 1174,
  1009. 1256,
  1010. 1256,
  1011. 1305,
  1012. 1305,
  1013. 1338,
  1014. 1338,
  1015. 352,
  1016. 352,
  1017. 385,
  1018. 385,
  1019. 434,
  1020. 434,
  1021. 516,
  1022. 516,
  1023. 600,
  1024. 600,
  1025. 845,
  1026. 845,
  1027. 1090,
  1028. 1090,
  1029. 1174,
  1030. 1174,
  1031. 1256,
  1032. 1256,
  1033. 1305,
  1034. 1305,
  1035. 1338,
  1036. 1338
  1037. );
  1038. $tol = 0.2;
  1039. $ringNames = array(
  1040. "W2",
  1041. "W2i",
  1042. "W3",
  1043. "W3i",
  1044. "W4",
  1045. "W4i",
  1046. "W5",
  1047. "W5i",
  1048. "W6",
  1049. "W6i",
  1050. "W7-11",
  1051. "W7-11i",
  1052. "W12",
  1053. "W12i",
  1054. "W13",
  1055. "W13i",
  1056. "W14",
  1057. "W14i",
  1058. "W15",
  1059. "W15i",
  1060. "W16",
  1061. "W16i",
  1062. "E2",
  1063. "E2i",
  1064. "E3",
  1065. "E3i",
  1066. "E4",
  1067. "E4i",
  1068. "E5",
  1069. "E5i",
  1070. "E6",
  1071. "E6i",
  1072. "E7-11",
  1073. "E7-11i",
  1074. "E12",
  1075. "E12i",
  1076. "E13",
  1077. "E13i",
  1078. "E14",
  1079. "E14i",
  1080. "E15",
  1081. "E15i",
  1082. "E16",
  1083. "E16i"
  1084. );
  1085. for ($pp = 0;$pp < 2;$pp++) // west (0), east (1)
  1086. {
  1087. for ($id = 0;$id < 22;$id++) // rings: o, i, o, i, ...
  1088. {
  1089. // show voltage if not shorted to IE
  1090. if ($ringsToAdei[$id + 22 * $pp] != "IE" && $ringsToAdei[$id + 22 * $pp] != "")
  1091. {
  1092. // color
  1093. 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)) $color = "#000000";
  1094. else $color = "#FF0000";
  1095. // show voltage
  1096. if (($id % 2 == 0) || ($id % 2 == 1 && $ringsToAdei[$id + 22 * $pp] != $ringsToAdei[$id + 22 * $pp - 1]))
  1097. {
  1098. $value = $adeiValue[11 + 2 * $pp][$ringsToAdei[$id + 22 * $pp]];
  1099. $mace_setting[$ringNames[$id + 22 * $pp]] = $value;
  1100. 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]]);
  1101. }
  1102. }
  1103. }
  1104. }
  1105. // tank, ie, dipole, ape
  1106. $ringsPosY = array(
  1107. 52,
  1108. 247,
  1109. 155,
  1110. 425,
  1111. 306,
  1112. 306,
  1113. 0,
  1114. 240,
  1115. 300,
  1116. 285,
  1117. 300,
  1118. 315
  1119. );
  1120. $ringsPosX = array(
  1121. 805,
  1122. 805,
  1123. 805,
  1124. 805,
  1125. 319,
  1126. 1371,
  1127. 0,
  1128. 150,
  1129. 160,
  1130. 190,
  1131. 220,
  1132. 190
  1133. );
  1134. $tolA = array(
  1135. 15,
  1136. 2,
  1137. 1,
  1138. 1,
  1139. 1,
  1140. 1,
  1141. 0,
  1142. 250,
  1143. 2,
  1144. 2,
  1145. 2,
  1146. 2
  1147. );
  1148. // MS voltages
  1149. for ($pp = 0;$pp < 6;$pp++) // tank (0), ie (1), ie west (2), ie east (3), ape south (4), ape north (5)
  1150. {
  1151. // color
  1152. if (($adeiValue[10][2 * $pp] > $adeiValue[10][2 * $pp + 1] - $tolA[$pp]) && ($adeiValue[10][2 * $pp] < $adeiValue[10][2 * $pp + 1] + $tolA[$pp])) $color = "#000000";
  1153. else $color = "#FF0000";
  1154. // show voltage
  1155. $value = $adeiValue[10][2 * $pp];
  1156. $link = $adeiChannel[10][2 * $pp];
  1157. $dipolestatus = $adeiValue[2][16];
  1158. $dipolelink = $adeiChannel[2][16];
  1159. if ($pp == 0)
  1160. {
  1161. $text = "absolute tank potential HCN:436-EHV-0-1001-0002 HCP:436-EHV-0-1002-0002";
  1162. }
  1163. else if ($pp == 1)
  1164. {
  1165. $text = "IE common offset potential, 436-EHV-0-1003-0002";
  1166. }
  1167. else if ($pp == 2)
  1168. {
  1169. $text = "relative voltage potential west IE";
  1170. }
  1171. else if ($pp == 3)
  1172. {
  1173. $text = "relative voltage potential east IE";
  1174. }
  1175. else if ($pp == 4)
  1176. {
  1177. $text = "relative voltage potential south APE";
  1178. }
  1179. else if ($pp == 5)
  1180. {
  1181. $text = "relative voltage potential north APE";
  1182. }
  1183. if ($pp == 2 || $pp == 3)
  1184. {
  1185. if ($dipolestatus == 1) // dipole enabled
  1186. {
  1187. $color = "#990000";
  1188. $value = $adeiValue[10][2 * $pp];
  1189. if ($pp == 2)
  1190. {
  1191. placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000");
  1192. }
  1193. else if ($pp == 3)
  1194. {
  1195. placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000");
  1196. }
  1197. }
  1198. else
  1199. {
  1200. $value = $adeiValue[10][2 * $pp]; // dipole disabled
  1201. $color = "#909090";
  1202. }
  1203. if ($pp == 2) placeText(180, 825, "MS WEST IE", 110, 2, $color); // west IE
  1204. else if ($pp == 3) placeText(450, 825, "MS EAST IE", 110, 2, $color); // east IE
  1205. $link = $adeiChannel[10][2 * $pp + 1] . "," . $adeiChannel[10][2 * $pp] . "," . $dipolelink;
  1206. }
  1207. // tank potential
  1208. if ($pp == 0) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value) , 150, 4, $color, $text, $link);
  1209. // IE common
  1210. else if ($pp == 1)
  1211. {
  1212. if ($Kal1_RunFlag == 0) $digits = '%.2F V';
  1213. else $digits = '%.1F V';
  1214. placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf($digits, -$value) , 150, 4, $color, $text, $link);
  1215. $mace_setting["IECommon"] = - $value;
  1216. $digits = '';
  1217. }
  1218. // IE dipoles
  1219. else if ($pp == 2 || $pp == 3) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.2F V', $value) , 150, 5, $color, $text, $link);
  1220. // APE
  1221. else if ($pp == 4 || $pp == 5)
  1222. {
  1223. if ($adeiValue[10][2 * $pp] > 10.0)
  1224. {
  1225. placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F', $value) , 70, 4, $color, $text, $link);
  1226. }
  1227. }
  1228. }
  1229. }
  1230. // PS voltages (add $pp < 10 for PS IE )
  1231. if ($PSmode == 5)
  1232. { // only display in PS operation mode High-Voltage
  1233. placeText(265, 190, "PS TANK", 70, 2, "#000000"); // prespec tank
  1234. placeText(330, 160, "PS IE", 120, 2, "#505050"); // prespec IE
  1235. for ($pp = 7;$pp < 12;$pp++) // PS tank (channel 7 = array entry 14 + 15), IE west (8), IE east (9)
  1236. {
  1237. // color and text
  1238. if ($pp == 7)
  1239. {
  1240. $text = "Primary PS tank potential of 416EHV1001";
  1241. $color = "#000000";
  1242. }
  1243. else if ($pp == 8)
  1244. {
  1245. $text = "relative voltage potential PS IE1 Ch1A of 416EHV1002";
  1246. $color = "#505050";
  1247. }
  1248. else if ($pp == 9)
  1249. {
  1250. $text = "relative voltage potential PS IE2 Ch1B of 416EHV1002";
  1251. $color = "#505050";
  1252. }
  1253. else if ($pp == 10)
  1254. {
  1255. $text = "relative voltage potential PS IE3 Ch2A of 416EHV1003";
  1256. $color = "#505050";
  1257. }
  1258. else if ($pp == 11)
  1259. {
  1260. $text = "relative voltage potential PS IE4 Ch2B of 416EHV1003";
  1261. $color = "#A0A0A0";
  1262. }
  1263. // setpoint mismatch color
  1264. if (($adeiValue[10][2 * $pp] > $adeiValue[10][2 * $pp + 1] - $tolA[$pp]) && ($adeiValue[10][2 * $pp] < $adeiValue[10][2 * $pp + 1] + $tolA[$pp])) $color = $color;
  1265. else $color = "#FF0000";
  1266. // show voltage
  1267. $value = $adeiValue[10][2 * $pp];
  1268. $link = $adeiChannel[10][2 * $pp];
  1269. if ($pp == 7) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value) , 150, 5, $color, $text, $link);
  1270. else placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value) , 60, 2, $color, $text, $link);
  1271. }
  1272. }
  1273. // ########## Split Ring Electrodes ##########
  1274. $srPosX = array(
  1275. 59,
  1276. 284,
  1277. 1420
  1278. );
  1279. $srPosY = array(
  1280. 402,
  1281. 402,
  1282. 370
  1283. );
  1284. $srKATRINNumber = array(
  1285. "418-EEL-3-2150",
  1286. "418-EEL-3-4150",
  1287. "438-EEL-3-5150"
  1288. );
  1289. // CPS-PS electrode 418-EEL-2150
  1290. // $sr: 0 = cps-ps ; 1 = PS-MS ; 2 = MS-FPD
  1291. for ($sr = 0;$sr < 3;$sr++)
  1292. {
  1293. $splitringON = $adeiValue[36][4 * $sr + 3];
  1294. $pic = "splitring";
  1295. if ($splitringON = 1)
  1296. {
  1297. $color = "#000000";
  1298. $splitringVal = $adeiValue[36][4 * $sr + 4];
  1299. $splitringPOL = $adeiValue[36][4 * $sr + 5];
  1300. $splitringSet = $adeiValue[36][4 * $sr + 6];
  1301. $link = $adeiChannel[36][$sr * 4 + 4];
  1302. if (abs($splitringVal) < 25)
  1303. {
  1304. $color = "#FF0000";
  1305. $pic = $pic . "Alarm";
  1306. $sign = "";
  1307. }
  1308. else
  1309. {
  1310. if ($splitringPOL == 0)
  1311. {
  1312. $sign = "+";
  1313. $pic = $pic . "On";
  1314. }
  1315. if ($splitringPOL == 1)
  1316. {
  1317. $sign = "";
  1318. $pic = $pic . "Warn";
  1319. }
  1320. }
  1321. 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);
  1322. placeTextWithLink($srPosY[$sr], $srPosX[$sr], $sign . sprintf('%.0F V', $splitringVal) , 60, 2, $color, "Voltage on split ring electrode " . $srKATRINNumber[$sr], $link);
  1323. }
  1324. else placePicWithLink($srPosY[$sr] - 32, $srPosX[$sr] + 16, $pic . "Off.png", 30, "status of split ring electrode", $link);
  1325. }
  1326. // ########## DETECTOR ##########
  1327. // detector powered
  1328. $lowVoltage = array(
  1329. 12,
  1330. 8,
  1331. 6,
  1332. 6,
  1333. 120
  1334. );
  1335. $link = "";
  1336. $pic = "fpdOn";
  1337. $text = "ON";
  1338. for ($id = 0;$id < 5;$id++)
  1339. {
  1340. $value = $adeiValue[6][4 + $id];
  1341. if (!($value < $lowVoltage[$id] + 0.2 && $value > $lowVoltage[$id] - 0.2))
  1342. {
  1343. $pic = "fpdOff";
  1344. $text = "OFF";
  1345. }
  1346. $link = $link . $adeiChannel[6][4 + $id] . ",";
  1347. }
  1348. $link = substr($link, 0, strlen($link) - 1);
  1349. placePicWithLink(200, 1600, $pic . ".png", 30, "status FPD power&#10;green: on, red: off, grey: undefined", $link);
  1350. placeTextWithLink(227, 1580, $text, 70, 4, "#000000", "status FPD power", $link);
  1351. // carousel
  1352. $value = $adeiValue[6][11];
  1353. $color = "#000000";
  1354. if ($value < - 95) $value = "---";
  1355. else $value = sprintf('%.0F', $adeiValue[6][11]) . " &#176;C";
  1356. placeTextWithLink(255, 1565, $value, 100, 4, $color, "temperature FPD carousel/electronics", $adeiChannel[6][11]);
  1357. placeText(275, 1565, "carousel", 100, 2, "#000000");
  1358. // ########## MAGNETOMETERS ##########
  1359. $mag = array(
  1360. 4,
  1361. 6,
  1362. 3
  1363. ); // removed 4th entry of south ring, due to disconnection
  1364. for ($pp = 0;$pp < 3;$pp++)
  1365. {
  1366. $bx = 0;
  1367. $by = 0;
  1368. $bz = 0;
  1369. $link = "";
  1370. for ($id = 0;$id < $mag[$pp];$id++)
  1371. {
  1372. $bx = $bx + $adeiValue[16 + $pp][3 * $id];
  1373. $by = $by + $adeiValue[16 + $pp][3 * $id + 1];
  1374. $bz = $bz + $adeiValue[16 + $pp][3 * $id + 2];
  1375. $link = $link . $adeiChannel[16 + $pp][3 * $id + 2] . ",";
  1376. //echo $bx . " " . $by . " " . $bz . "<br>";
  1377. }
  1378. $bx = $bx / $mag[$pp];
  1379. $by = $by / $mag[$pp];
  1380. $bz = $bz / $mag[$pp];
  1381. $link = substr($link, 0, strlen($link) - 1);
  1382. $value = sqrt($bx * $bx + $by * $by + $bz * $bz);
  1383. $text = "averaged field precise magnetometers ";
  1384. if ($pp == 0) $text = $text . "north ";
  1385. else if ($pp == 1) $text = $text . "middle ";
  1386. else if ($pp == 2) $text = $text . "south ";
  1387. $text = $text . "ring";
  1388. placeTextWithLink(553, 1015 - 170 * $pp, sprintf('%.1F G', $value) , 80, 5, "#000000", $text, $link);
  1389. }
  1390. // ########## SAP MAGNETOMETERS ##########
  1391. $mag = array(
  1392. 5,
  1393. 4,
  1394. ); // 5 SAP North Ring, 4 SAP South Ring magnetometers
  1395. for ($pp = 0;$pp < 2;$pp++)
  1396. {
  1397. $bx = 0;
  1398. $by = 0;
  1399. $bz = 0;
  1400. $link = "";
  1401. for ($id = 0;$id < $mag[$pp];$id++)
  1402. {
  1403. $bx = $bx + $adeiValue[37 + $pp][3 * $id];
  1404. $by = $by + $adeiValue[37 + $pp][3 * $id + 1];
  1405. $bz = $bz + $adeiValue[37 + $pp][3 * $id + 2];
  1406. $link = $link . $adeiChannel[37 + $pp][37 * $id + 2] . ",";
  1407. //echo $bx . " " . $by . " " . $bz . "<br>";
  1408. }
  1409. $bx = $bx / $mag[$pp];
  1410. $by = $by / $mag[$pp];
  1411. $bz = $bz / $mag[$pp];
  1412. $link = substr($link, 0, strlen($link) - 1);
  1413. // radings in muT, therfore factor 100 for Gauss display
  1414. $value = 0.01 * sqrt($bx * $bx + $by * $by + $bz * $bz);
  1415. $text = "averaged field precise magnetometers SAP ";
  1416. if ($pp == 0) $text = $text . "north ";
  1417. else if ($pp == 1) $text = $text . "south ";
  1418. $text = $text . "ring";
  1419. placeTextWithLink(553, 1240 - 110 * $pp, sprintf('%.1F G', $value) , 80, 5, "#000000", $text, $link);
  1420. }
  1421. // dipole
  1422. // $pic = "status";
  1423. // if ($pulserId[0] == "dipole" && $daqElapsed[0] > 30)
  1424. // {
  1425. // if ($pulserCounts[0] > 0) $pic = $pic . "On";
  1426. // else if ($pulserCounts[0] == 0) $pic = $pic . "Off";
  1427. // }
  1428. //placePic($posY + 34 + 25, $posX + 80, $pic . ".png", 17, "status dipole sync pulser&#10;green: on, red: off, grey: undefined");
  1429. // egun
  1430. // $pic = "status";
  1431. // if ($pulserId[1] == "egun" && $daqElapsed[0] > 30)
  1432. // {
  1433. // if ($pulserCounts[1] > 0) $pic = $pic . "On";
  1434. // else if ($pulserCounts[1] == 0) $pic = $pic . "Off";
  1435. // }
  1436. //placePic($posY + 34 + 50, $posX + 80, $pic . ".png", 17, "status egun sync pulser&#10;green: on, red: off, grey: undefined");
  1437. // muon
  1438. // $pic = "status";
  1439. // if ($pulserId[3] == "muon" && $daqElapsed[0] > 30)
  1440. // {
  1441. // if ($pulserCounts[3] > 0) $pic = $pic . "On";
  1442. // else if ($pulserCounts[3] == 0) $pic = $pic . "Off";
  1443. // }
  1444. // placePic($posY + 34 + 75, $posX + 80, $pic . ".png", 17, "status muon sync pulser&#10;green: on, red: off, grey: undefined");
  1445. // ########## HIGH PRESSURE MS ##########
  1446. $value = $adeiValue[9][3];
  1447. if ($value > 1.0)
  1448. {
  1449. if ($value < 20.0) $pic = "bottleBlinking.gif";
  1450. else $pic = "bottleOn.png";
  1451. $text = "ON";
  1452. $color = "#000000";
  1453. if ($adeiValue[9][4] != 64) $color = "#FF0000";
  1454. placeTextWithLink(135, 1387, sprintf('%.1F &#037;', $adeiValue[9][3]) , 70, 4, $color, "gas flow leak valve", $adeiChannel[9][5]);
  1455. placeTextWithLink(160, 1387, sprintf('%.1E', $adeiValue[9][0]) , 70, 4, $color, "pressure [mbar] MKS Baratron", $adeiChannel[9][3]);
  1456. }
  1457. else
  1458. {
  1459. $pic = "bottle.png";
  1460. $text = "OFF";
  1461. }
  1462. $link = $adeiChannel[9][3] . "," . $adeiChannel[9][0];
  1463. placePicWithLink(135, 1358, $pic, 48, "status gas injection system&#10;gray: off, blinking: low, green: on&#10Should be off for nominal pressure measurements!!!", $link);
  1464. placeTextWithLink(180, 1347, $text, 70, 4, "#000000", "status gas injection system", $link);
  1465. // ########## HIGH PRESSURE PS ##########
  1466. $value = $adeiValue[27][7];
  1467. $posOK = $adeiValue[27][6];
  1468. $link = $adeiChannel[27][6] . "," . $adeiChannel[27][7];
  1469. if ($value < 1)
  1470. {
  1471. $pic = "bottle.png";
  1472. $text = "OFF";
  1473. $color = "#909090";
  1474. }
  1475. else if (($value >= 1) && ($value < 15))
  1476. {
  1477. $pic = "bottleBlinking.gif";
  1478. $text = "ON";
  1479. $color = "#000000";
  1480. }
  1481. else if ($value >= 15)
  1482. {
  1483. $pic = "bottleOn.png";
  1484. $text = sprintf('%.1F', $value) . " %";
  1485. $color = "#000000";
  1486. if ($posOK == 1) placeBox(418, 107, "Pos OK", 40, 2, "#00FF00");
  1487. else placeBox(418, 107, "PosErr", 40, 2, "#FF0000");
  1488. }
  1489. 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);
  1490. placeTextWithLink(402, 99, $text, 60, 2, $color, "status gas injection system", $link);
  1491. // ########## TLK Wall and LAUDA TEMPERATURE ##########
  1492. if ($PSmode == 5)
  1493. { // only display if PS operation mode is HV
  1494. // mean of 4023, 4033, 4043
  1495. $link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
  1496. $value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2]) / 3.0;
  1497. $color = "#000000";
  1498. 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);
  1499. }
  1500. if ($PSmode != 5)
  1501. { // only display if PS operation mode is Baking
  1502. $min = 18;
  1503. $max = 30;
  1504. // sensor 4100 ID [29][3]
  1505. $link = $adeiChannel[29][3];
  1506. $value = $adeiValue[29][3];
  1507. $color = "#000000";
  1508. if ($value < $min) $color = "#0026FF";
  1509. else if ($value > $max) $color = "#FF0000";
  1510. 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);
  1511. $min = 15;
  1512. // LAUDA System 5401 [34][0..1]
  1513. $link = $adeiChannel[34][0] . "," . $adeiChannel[34][1];
  1514. $value = $adeiValue[34][0];
  1515. $max = $adeiValue[34][1] + 1;
  1516. $color = "#000000";
  1517. if ($value < $min) $color = "#0026FF";
  1518. else if ($value > $max) $color = "#FF0000";
  1519. if ($value < 400) placeTextLeftWithLink(475, 5, "T<sub>LAUDA</sub> = " . sprintf('%.1F &#176;C', $value) , 180, 4, $color, "LAUDA System actual temperature value", $link);
  1520. // ########## PS VESSEL TEMPERATURES ##########
  1521. $min = 18;
  1522. $max = 65;
  1523. // mean of 4023, 4033, 4043
  1524. $link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
  1525. $value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2]) / 3.0;
  1526. $color = "#000000";
  1527. if ($value < $min) $color = "#0026FF";
  1528. else if ($value > $max) $color = "#FF0000";
  1529. if ($value < 4000) placeTextWithLink(305, 185, sprintf('%.1F &#176;C', $value) , 90, 4, $color, "PS mean temperature of 4023..33..43", $link);
  1530. // mean of 3901, 3902, 3903, 3904
  1531. $link = $adeiChannel[29][4] . "," . $adeiChannel[29][5] . "," . $adeiChannel[29][6] . "," . $adeiChannel[29][7];
  1532. $value = ($adeiValue[29][4] + $adeiValue[29][5] + $adeiValue[29][6] + $adeiValue[29][7]) / 4.0;
  1533. $color = "#000000";
  1534. if ($value < $min) $color = "#0026FF";
  1535. else if ($value > $max) $color = "#FF0000";
  1536. 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);
  1537. // mean of 3912, 3913, (3914 failed)
  1538. $link = $adeiChannel[29][8] . "," . $adeiChannel[29][9] . "," . $adeiChannel[29][10] . "," . $adeiChannel[29][11];
  1539. // $value = ($adeiValue[29][8] + $adeiValue[29][9] + $adeiValue[29][10] + $adeiValue[29][11])/4.0;
  1540. $value = ($adeiValue[29][8] + $adeiValue[29][9] + $adeiValue[29][10]) / 3.0;
  1541. $color = "#000000";
  1542. if ($value < $min) $color = "#0026FF";
  1543. else if ($value > $max) $color = "#FF0000";
  1544. 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);
  1545. }
  1546. // ########## MS VESSEL TEMPERATURES ##########
  1547. $min = 14;
  1548. $max = 24;
  1549. // 0066
  1550. $value = $adeiValue[20][0];
  1551. $color = "#000000";
  1552. if ($value < $min) $color = "#0026FF";
  1553. else if ($value > $max) $color = "#FF0000";
  1554. 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]);
  1555. // 0076
  1556. $value = $adeiValue[20][1];
  1557. $color = "#000000";
  1558. if ($value < $min) $color = "#0026FF";
  1559. else if ($value > $max) $color = "#FF0000";
  1560. 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]);
  1561. // 0270
  1562. $value = $adeiValue[20][2];
  1563. $color = "#000000";
  1564. if ($value < $min) $color = "#0026FF";
  1565. else if ($value > $max) $color = "#FF0000";
  1566. 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]);
  1567. 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]);
  1568. // define global tank temperature
  1569. $global_MS_temperature = $adeiValue[20][2];
  1570. // 0283
  1571. $value = $adeiValue[20][3];
  1572. $color = "#000000";
  1573. if ($value < $min) $color = "#0026FF";
  1574. else if ($value > $max) $color = "#FF0000";
  1575. 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]);
  1576. 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]);
  1577. // port 0100 saphire window
  1578. $value = $adeiValue[19][3];
  1579. $color = "#000000";
  1580. 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]);
  1581. $color = "#000000";
  1582. // ########## STS ##########
  1583. placeTextLeftWithWebsiteLink(370, 1, "&larr;STS", 60, 5, $color, "Link to STS Status Overview", "https://katrin.kit.edu/status-sts/");
  1584. // ########## WebTrium Link ##########
  1585. placeTextLeftWithWebsiteLink(20, 1450, "&rarr; WebTrium", 155, 4, $color, "Link to WebTrium Overview", "https://webtrium.mpp.mpg.de");
  1586. // ########## FPD Status ##########
  1587. placeTextLeftWithWebsiteLink(50, 1450, "&rarr; FPD Status", 155, 4, $color, "Link to FPD Status Overview", "https://ikp-katrin-fpd.ikp.kit.edu/fpdstatus/");
  1588. // ########## Sanshiro Katana Page ##########
  1589. 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/");
  1590. // ########## MoS und HV Status ##########
  1591. 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");
  1592. // ########## Magnet Overview ##########
  1593. placeTextLeftWithWebsiteLink(140, 1450, "&rarr; Magnet Control System", 270, 4, $color, "Link to Magnet Control System Status Page", "https://katrin.kit.edu/bora-mcs");
  1594. // ########## PS ##########
  1595. // placeText(100, 170, "PS", 60, 30, $color);
  1596. // ########## MAC-E filter configuration display ##########
  1597. $tol = 0.2;
  1598. $tol = abs($tol);
  1599. $color = "#FFD800"; //base color: US school bus yellow
  1600. for ($pp = 0;$pp < sizeof($mace_configurations);$pp++) // loop over all predefined configurations
  1601. {
  1602. for ($id = 1;$id < sizeof($mace_configurations[$pp]);$id++) // loop thru all parameters, but not name in $id=0
  1603. {
  1604. if (($id < 3) & (array_values($mace_configurations[$pp]) [$id] != array_values($mace_setting) [$id])) break;
  1605. if (abs(array_values($mace_configurations[$pp]) [$id] - array_values($mace_setting) [$id]) < $tol)
  1606. {
  1607. if ($id == 25)
  1608. {
  1609. $mace_setting["Config"] = $mace_configurations[$pp]["Config"];
  1610. $color = "#4CFF00"; // success color: harlequin green
  1611. }
  1612. else
  1613. {
  1614. $color = "#FF9300"; // failure color: dark orange
  1615. }
  1616. }
  1617. else break;
  1618. }
  1619. if ($color == "#4CFF00") break;
  1620. }
  1621. if (($mace_setting["Config"] == "unkn") or ($mace_setting["Config"] == "other"))
  1622. {
  1623. $color = "#FFD800"; //unknown config color: US school bus yellow
  1624. }
  1625. placeText(115, 232, "MAC-E", 85, 5, "#000000");
  1626. placeBox(140, 230, $mace_setting["Config"], 85, 3, $color);
  1627. if ($V4_open)
  1628. {
  1629. // ########## PS Ion Monitor status display ##########
  1630. if ($adeiValue[39][1] < 0.5)
  1631. {
  1632. $ion_mon_stat = "active";
  1633. $color = "#4CFF00";
  1634. }
  1635. else
  1636. {
  1637. $ion_mon_stat = "bypassed";
  1638. $color = "#FF0000";
  1639. placePicWithLink(130, 33, "alarm_flash.gif", 50, "Ion alarm not armed!", $adeiChannel[39][1]);
  1640. }
  1641. placeText(115 + 65, 4, "Ion Mon", 105, 5, "#000000");
  1642. placeBox(140 + 65, 2, $ion_mon_stat, 105, 3, $color);
  1643. }
  1644. // ########## HIGH VOLTAGE SWITCH ##########
  1645. $value = $adeiValue[31][1];
  1646. $pic = "switch";
  1647. if ($value == 1) $pic = $pic . "Open";
  1648. else if ($value == 0) $pic = $pic . "Closed";
  1649. placePicWithLink(474, 440, $pic . ".png", 80, "status high-voltage grounding switch", $adeiChannel[31][1]);
  1650. // ########## MONITOR SPECTROMETR COUPLING STATUS ##########
  1651. $hv_switch1101_mos = $adeiValue[35][0];
  1652. $mos = "beamline_mos.png";
  1653. placePicXY(525, 120, $mos, 190, 60, "status monitor spectrometer connection");
  1654. if ($hv_switch1101_mos == 1)
  1655. {
  1656. $color = "#4CFF00"; // green
  1657. placeBox(586, 120, "MoS coupled", 190, 2, $color);
  1658. }
  1659. else
  1660. {
  1661. $color = "#CFCFCF"; // light gray
  1662. placeBox(586, 120, "MoS separated", 190, 2, $color);
  1663. }
  1664. // ########## define global dewpoint max value ###########
  1665. $global_max_dewpoint = - 273.0;
  1666. // ########## PS Opus weather station ##########
  1667. $data_index = 40;
  1668. $Opus_tempC = $adeiValue[$data_index][0];
  1669. $Opus_tempF = $adeiValue[$data_index][1];
  1670. $Opus_dewpointC = $adeiValue[$data_index][2];
  1671. $Opus_dewpointF = $adeiValue[$data_index][3];
  1672. $Opus_relH_percent = $adeiValue[$data_index][4];
  1673. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1674. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1675. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1676. $Opus_voltage = $adeiValue[$data_index][8];
  1677. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1678. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1679. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1680. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1681. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1682. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1683. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1684. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1685. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1686. // update dewpoint max value
  1687. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1688. $location_text = "pre spectrometer";
  1689. $draw_x = 0;
  1690. $draw_y = - 15;
  1691. placePicWithLink($draw_y, $draw_x + 5, "newTemperature.png", 23, "temperature at " . $location_text, $Opus_tempC_channel);
  1692. placeTextWithLink($draw_y, $draw_x + 30, sprintf('%.1F &#176;C', $Opus_tempC) , 90, 4, "#000000", "temperature at " . $location_text, $Opus_tempC_channel);
  1693. placePicWithLink($draw_y + 25, $draw_x + 5, "newPressure.png", 23, "atmospheric pressure at " . $location_text, $Opus_absPressure_hPa_channel);
  1694. 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);
  1695. placePicWithLink($draw_y + 50, $draw_x + 5, "newHumidity.png", 23, "relative humidity at " . $location_text, $Opus_relH_percent_channel);
  1696. 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);
  1697. placePicWithLink($draw_y + 75, $draw_x + 5, "newDewpoint.png", 23, "dewpoint at " . $location_text, $Opus_dewpointC_channel);
  1698. placeTextWithLink($draw_y + 75, $draw_x + 30, sprintf('%.1F &#176;C', $Opus_dewpointC) , 90, 4, "#000000", "dewpoint at " . $location_text, $Opus_dewpointC_channel);
  1699. // ########## DET Opus weather station ##########
  1700. $data_index = 41;
  1701. $Opus_tempC = $adeiValue[$data_index][0];
  1702. $Opus_tempF = $adeiValue[$data_index][1];
  1703. $Opus_dewpointC = $adeiValue[$data_index][2];
  1704. $Opus_dewpointF = $adeiValue[$data_index][3];
  1705. $Opus_relH_percent = $adeiValue[$data_index][4];
  1706. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1707. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1708. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1709. $Opus_voltage = $adeiValue[$data_index][8];
  1710. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1711. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1712. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1713. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1714. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1715. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1716. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1717. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1718. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1719. // update dewpoint max value
  1720. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1721. $location_text = "detector platform";
  1722. $draw_x = 1600;
  1723. $draw_y = - 15;
  1724. placePicWithLink($draw_y, $draw_x + 5, "newTemperature.png", 23, "temperature at " . $location_text, $Opus_tempC_channel);
  1725. placeTextWithLink($draw_y, $draw_x + 30, sprintf('%.1F &#176;C', $Opus_tempC) , 90, 4, "#000000", "temperature at " . $location_text, $Opus_tempC_channel);
  1726. placePicWithLink($draw_y + 25, $draw_x + 5, "newPressure.png", 23, "atmospheric pressure at " . $location_text, $Opus_absPressure_hPa_channel);
  1727. 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);
  1728. placePicWithLink($draw_y + 50, $draw_x + 5, "newHumidity.png", 23, "relative humidity at " . $location_text, $Opus_relH_percent_channel);
  1729. 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);
  1730. // ########## Detector Platform OLD ##########
  1731. //placePicWithLink(-135, 1605, "newTemperature.png", 23, "temperature in KATRIN hall", $adeiChannel[19][1]);
  1732. //placeTextWithLink(-135, 1630, sprintf('%.1F &#176;C', $adeiValue[19][1]), 90, 4, "#000000", "temperature in KATRIN hall", $adeiChannel[19][1]);
  1733. //placePicWithLink(-110, 1605, "newPressure.png", 23, "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  1734. //placeTextWithLink(-110, 1630, sprintf('%.0F hPa', $adeiValue[19][0] * 0.0689475729 * 1000.0), 90, 4, "#000000", "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
  1735. //placePicWithLink(-85, 1605, "newHumidity.png", 23, "relative humidity in KATRIN hall", $adeiChannel[19][2]);
  1736. //placeTextWithLink(-85, 1630, sprintf('%.1F &#037;', $adeiValue[19][2]), 90, 4, "#000000", "relative humidity in KATRIN hall", $adeiChannel[19][2]);
  1737. // ########## HV Opus weather station ##########
  1738. $data_index = 42;
  1739. $Opus_tempC = $adeiValue[$data_index][0];
  1740. $Opus_tempF = $adeiValue[$data_index][1];
  1741. $Opus_dewpointC = $adeiValue[$data_index][2];
  1742. $Opus_dewpointF = $adeiValue[$data_index][3];
  1743. $Opus_relH_percent = $adeiValue[$data_index][4];
  1744. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1745. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1746. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1747. $Opus_voltage = $adeiValue[$data_index][8];
  1748. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1749. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1750. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1751. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1752. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1753. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1754. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1755. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1756. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1757. // update dewpoint max value
  1758. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1759. $location_text = "high-voltage cage";
  1760. $draw_x = 434;
  1761. $draw_y = 586;
  1762. if (($Opus_tempC > 0) && (($Opus_tempC < 99)) && ($Opus_absPressure_hPa > 0))
  1763. {
  1764. placeBoxRight($draw_y, $draw_x, sprintf('%.1F &#176;C', $Opus_tempC) , 65, 2, $color);
  1765. 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);
  1766. }
  1767. // ########## MS bottom Opus weather station ##########
  1768. $data_index = 43;
  1769. $Opus_tempC = $adeiValue[$data_index][0];
  1770. $Opus_tempF = $adeiValue[$data_index][1];
  1771. $Opus_dewpointC = $adeiValue[$data_index][2];
  1772. $Opus_dewpointF = $adeiValue[$data_index][3];
  1773. $Opus_relH_percent = $adeiValue[$data_index][4];
  1774. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1775. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1776. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1777. $Opus_voltage = $adeiValue[$data_index][8];
  1778. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1779. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1780. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1781. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1782. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1783. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1784. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1785. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1786. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1787. // update dewpoint max value
  1788. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1789. $location_text = "main spectrometer basement";
  1790. $draw_x = 845;
  1791. $draw_y = 586;
  1792. $color = "#CCCCCC";
  1793. if (($Opus_tempC > 0) && (($Opus_tempC < 99)) && ($Opus_absPressure_hPa > 0))
  1794. {
  1795. placeBoxRight($draw_y, $draw_x, sprintf('%.1F &#176;C', $Opus_tempC) , 65, 2, $color);
  1796. 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);
  1797. }
  1798. // ########## MS top Opus weather station ##########
  1799. $data_index = 44;
  1800. $Opus_tempC = $adeiValue[$data_index][0];
  1801. $Opus_tempF = $adeiValue[$data_index][1];
  1802. $Opus_dewpointC = $adeiValue[$data_index][2];
  1803. $Opus_dewpointF = $adeiValue[$data_index][3];
  1804. $Opus_relH_percent = $adeiValue[$data_index][4];
  1805. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1806. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1807. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1808. $Opus_voltage = $adeiValue[$data_index][8];
  1809. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1810. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1811. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1812. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1813. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1814. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1815. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1816. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1817. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1818. // update dewpoint max value
  1819. if ($Opus_dewpointC > $global_max_dewpoint) $global_max_dewpoint = $Opus_dewpointC;
  1820. $location_text = "main spectrometer under the roof";
  1821. $draw_x = 845;
  1822. $draw_y = 31;
  1823. if (($Opus_tempC > 0) && (($Opus_tempC < 99)) && ($Opus_absPressure_hPa > 0))
  1824. {
  1825. placeBoxRight($draw_y, $draw_x, sprintf('%.1F &#176;C', $Opus_tempC) , 65, 2, $color);
  1826. 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);
  1827. }
  1828. // ########## MoS general Opus weather station ##########
  1829. $data_index = 45;
  1830. $Opus_tempC = $adeiValue[$data_index][0];
  1831. $Opus_tempF = $adeiValue[$data_index][1];
  1832. $Opus_dewpointC = $adeiValue[$data_index][2];
  1833. $Opus_dewpointF = $adeiValue[$data_index][3];
  1834. $Opus_relH_percent = $adeiValue[$data_index][4];
  1835. $Opus_relH_gramm = $adeiValue[$data_index][5];
  1836. $Opus_absPressure_hPa = $adeiValue[$data_index][6];
  1837. $Opus_relPressure_hPa = $adeiValue[$data_index][7];
  1838. $Opus_voltage = $adeiValue[$data_index][8];
  1839. $Opus_tempC_channel = $adeiChannel[$data_index][0];
  1840. $Opus_tempF_channel = $adeiChannel[$data_index][1];
  1841. $Opus_dewpointC_channel = $adeiChannel[$data_index][2];
  1842. $Opus_dewpointF_channel = $adeiChannel[$data_index][3];
  1843. $Opus_relH_percent_channel = $adeiChannel[$data_index][4];
  1844. $Opus_relH_gramm_channel = $adeiChannel[$data_index][5];
  1845. $Opus_absPressure_hPa_channel = $adeiChannel[$data_index][6];
  1846. $Opus_relPressure_hPa_channel = $adeiChannel[$data_index][7];
  1847. $Opus_voltage_channel = $adeiChannel[$data_index][8];
  1848. $location_text = "monitor spectrometer building";
  1849. $draw_x = 0;
  1850. $draw_y = 536;
  1851. placePicWithLink($draw_y, $draw_x + 5, "newTemperature.png", 23, "temperature at " . $location_text, $Opus_tempC_channel);
  1852. placeTextWithLink($draw_y, $draw_x + 30, sprintf('%.1F &#176;C', $Opus_tempC) , 90, 4, "#000000", "temperature at " . $location_text, $Opus_tempC_channel);
  1853. placePicWithLink($draw_y + 25, $draw_x + 5, "newPressure.png", 23, "atmospheric pressure at " . $location_text, $Opus_absPressure_hPa_channel);
  1854. 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);
  1855. placePicWithLink($draw_y + 50, $draw_x + 5, "newHumidity.png", 23, "relative humidity at " . $location_text, $Opus_relH_percent_channel);
  1856. 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);
  1857. // ########## MS condensation alert during HV operation ##########
  1858. if ($MSmode == 5)
  1859. {
  1860. if ($global_max_dewpoint - $global_MS_temperature > - 1) // check dewpoint 1 °C below tank temperature
  1861. {
  1862. placePic(-130 + 12, 857, "alarm_flash.gif", 50, "Condensation alert, don't operate high voltage!");
  1863. $color = "#FFD800"; // yellow
  1864. placeBox(-130 + 60, 805, "CONDENSATION ALERT", 150, 3, $color);
  1865. }
  1866. }
  1867. ?>