SDS_status_main.php 50 KB

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