Requested from inside KIT network.
';
$tol = 0.5;
// ########## VALVES ##########
// V4
$value = $adeiValue[31][0];
$pic = "valve";
if ($value == 1) $pic = $pic . "FREE";
else if ($value == 0) $pic = $pic . "Off";
placePicWithLink(303, 60, $pic . ".png", 30, "status CPS-PS gate vlave V4
purple: clearance to open, red: no clearance, grey: undefined", $adeiChannel[6][0]);
// PS
$value = 1; //getValveStatus($adeiValue[9][0]);
$pic = "valve";
if ($value == 1) $pic = $pic . "On";
else if ($value == 0) $pic = $pic . "Off";
placePicWithLink(303, 283, $pic . ".png", 30, "status PS beam-line gate valve
green: open, red: closed, grey: undefined", $adeiChannel[9][0]);
// FPD
$value = $adeiValue[6][0];
$pic = "valve";
if ($value == 1) $pic = $pic . "On";
else if ($value == 0) $pic = $pic . "Off";
placePicWithLink(303, 1466, $pic . ".png", 30, "status FPD beam-line gate valve
green: open, red: closed, grey: undefined", $adeiChannel[6][0]);
// ########## MAGNETS ##########
// CPS
$NlCPS = 20550 / 0.9133;
$BfieldCPS = 1.26e-6 * $adeiValue[24][0] * $NlCPS; // mu0 * I * N/l
if ($BfieldCPS < 0.1) { $value = "OFF"; $color = "#FF0000"; }
else { $value = sprintf('%.1F T', $BfieldCPS); $color = "#000000"; }
placeTextWithLink(240, 2, $value, 60, 5, $color, "field of CPS behind separation wall derived from current", $adeiChannel[24][0]);
placeText(265, 2, "CPS", 60, 2, "#000000");
// PS1
if ($adeiValue[3][3] == 0) { $value = "LEM"; $color = "#FF0000"; }
else { $value = sprintf('%.1F T', $adeiValue[3][1] / 157.0 * 4.5); $color = "#000000"; }
placeTextWithLink(240, 66, $value, 70, 5, $color, "stand-alone center field PS1 magnet", $adeiChannel[3][1]);
placeText(265, 66, "PS1", 70, 2, "#000000");
// PS2
if ($adeiValue[3][2] == 0) { $value = "LEM"; $color = "#FF0000"; }
else { $value = sprintf('%.1F T', $adeiValue[3][0] / 157.0 * 4.5); $color = "#000000"; }
placeTextWithLink(240, 274, $value, 70, 5, $color, "stand-alone center field PS2 magnet", $adeiChannel[3][0]);
placeText(265, 274, "PS2", 70, 2, "#000000");
// Pinch
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]);
placeText(265, 1420, "PCH", 70, 2, "#000000");
// Detector
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]);
placeText(265, 1495, "DET", 70, 2, "#000000");
// ########## PAE ##########
placeTextWithLink(303, 1553, sprintf('%.1F', $adeiValue[6][2]) . " kV", 90, 5, "#000000", "PAE potential", $adeiChannel[6][2]);
placeText(328, 1553, "PAE", 90, 2, "#000000");
// ########## PUMP PORTS ##########
placeText(416, 1623, "PP2", 50, 2, "#000000");
placeText(466, 1623, "PP1", 50, 2, "#000000");
placeText(516, 1623, "PP3", 50, 2, "#000000");
// ########## BAFFLE ##########
$max = array( 90, 94, 88 );
placeText(560, 1395, "LN
2 Tank", 130, 5, "#000000");
$link = $adeiChannel[15][6] . "," . $adeiChannel[15][7];
placePicWithLink(562,1360, "LN2tank.png", 60, "LN2 tank", $link);
$value = $adeiValue[15][6];
$link = $adeiChannel[15][6];
$text = sprintf('%.0F', $value) . " %";
placeTextWithLink(590, 1395, $text, 70, 4, "#000000", "LN2 tank level", $link);
$value = $adeiValue[15][7];
$link = $adeiChannel[15][7];
$text = sprintf('%.1F', $value) . " bar";
placeTextWithLink(590, 1450, $text, 70, 4, "#000000", "LN2 tank pressure", $link);
for ($id = 0; $id < 3; $id++)
{
$value = $adeiValue[15][$id];
$pic = "ice.png";
$text = "---";
if ($value < 800)
{
$text = sprintf('%.0F', $value) . " K";
if ($value > $max[$id]) $pic = "iceOff.png";
else
{
$value = $adeiValue[15][$id + 3];
if ($value > 0.1 && $value < 7.0) $pic = "iceOn.png";
else $pic = "iceBlink.gif";
}
}
$pos = $id;
if ($id == 0) $pos = 1;
else if ($id == 1) $pos = 0;
$link = $adeiChannel[15][$id] . "," . $adeiChannel[15][$id + 3];
placePicWithLink(410 + $pos * 50, 1375, $pic, 30, "status baffle PP" . ($id + 1) . "
blue: cooled, red: warmed, blinking: warming, grey: undefined", $link);
placeTextWithLink(437 + $pos * 50, 1355, $text, 70, 4, "#000000", "temperature baffle PP" . ($id + 1), $link);
}
// ########## PRESSURES ##########
// CC2320
$value = $adeiValue[7][0];
$pic = "cc";
$text = "---";
if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
else if ($value <= 1E-4 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
placePicWithLink(410, 1435, $pic . ".png", 30, "status cold cathode gauge CC2320
green: on, red: off, grey: undefined", $adeiChannel[7][0]);
placeTextWithLink(439, 1415, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC2320", $adeiChannel[7][0]);
// CC2345
$value = $adeiValue[7][7];
$pic = "cc";
$text = "---";
if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
else if ($value <= 1E-4 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
placePicWithLink(427, 1482, $pic . ".png", 30, "status cold cathode gauge CC2345
green: on, red: off, grey: undefined", $adeiChannel[7][7]);
placeTextWithLink(406, 1462, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC2345", $adeiChannel[7][7]);
// Ex3110
$value = $adeiValue[8][0];
$pic = "ex";
$text = "---";
if ($value > 2E-5) { $pic = $pic . "Off"; $text = "OFF"; }
else if ($value <= 2E-5 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
placePicWithLink(510, 1435, $pic . ".png", 30, "status extractor ion gauge Ex3110
green: on, red: off, grey: undefined", $adeiChannel[8][0]);
placeTextWithLink(539, 1415, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex3110", $adeiChannel[8][0]);
// Ex1110
$value = $adeiValue[28][0];
$link = $adeiChannel[28][0];
$pic = "ex";
$text = "---";
if ($value > 2E-5) { $pic = $pic . "Off"; $text = "OFF"; }
if ($value <= 2E-5 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value);}
placePicWithLink(460, 1435, $pic, 30, "status extractor ion gauge Ex1110
green: off, blinking: on, grey: undefined", $link);
placeTextWithLink(489, 1415, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex1110", $link);
// Ex0096
$value = $adeiValue[9][2];
$link = $adeiChannel[9][2];
$pic = "gauge";
$text = "---";
//$text = sprintf('%.1E', $value);
if ($value > 2E-5) { $pic = $pic . "Off"; $text = "OFF"; }
if ($value <= 1E-11) { $pic = $pic; $text = "LOW"; }
if ($value <= 2E-5 && $value > 1E-11) { $pic = "gaugeOn.png"; $text = sprintf('%.1E', $value);}
placePicWithLink(230, 1220, $pic, 30, "status stable ion gauge 0096
green: off, blinking: on, grey: undefined", $link);
placeTextWithLink(259, 1200, $text, 70, 4, "#000000", "pressure [mbar] stable ion gauge 0096", $link);
// CC FPD
$value = $adeiValue[6][1];
$pic = "cc";
$text = "---";
if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
if ($value < 1E-11) { $pic = $pic . "Off"; $text = "OFF"; }
else if ($value <= 1E-4 && $value > 1E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
placePicWithLink(188, 1475, $pic . ".png", 30, "status FPD cold cathode gauge
green: on, red: off, grey: undefined", $adeiChannel[6][1]);
placeTextWithLink(217, 1455, $text, 70, 4, "#000000", "pressure [mbar] FPD cold cathode gauge", $adeiChannel[6][1]);
// Gauge Baffle
$value = $adeiValue[5][0];
$link = $adeiChannel[5][0];
$color = "#000000";
$pic = "gauge";
$text = "---";
if ($value > 1E-4) { $pic = $pic . "Off"; $text = "OFF"; }
// standard cold blue "#0026FF" , ice cold blue "#107BC7"
if ($value < 2E-6 && $value > 1E-9) { $pic ="gaugeOn.png"; $color ="#107BC7"; $text = sprintf('%.1E', $value); }
else if ($value >= 1E-6 && $value < 1e-1) { $pic = "gaugeOff.png"; $color = "FF0000"; $text = sprintf('%.1E', $value); }
placePicWithLink(460, 1315, $pic, 30, "status baffle insulation vacuum gauge
gray: off, green: on, red: too high
Should be < 5e-6 mbar for HV operation!!!", $link);
placeTextWithLink(460+29, 1295, $text, 70, 4, $color, "pressure [mbar] baffle insulation vacuum gauge", $link);
// PS CC1232
$value = $adeiValue[27][0];
$link = $adeiChannel[27][0];
$pic = "cc";
$text = "---";
if ($value > 1E-5) { $pic = $pic . "Off"; $text = "OFF"; }
else if ($value <= 1E-5 && $value > 2E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
placePicWithLink(370, 210, $pic . ".png", 30, "status cold cathode gauge CC1232
green: on, red: off, grey: undefined", $link);
placeTextWithLink(399, 190, $text, 70, 4, "#000000", "pressure [mbar] cold cathode gauge CC1232", $link);
// PS Ex1221
$value = $adeiValue[27][5];
$link = $adeiChannel[27][5];
$pic = "ex";
$text = "---";
if ($value > 1E-5) { $pic = $pic . "Off"; $text = "OFF"; }
else if ($value <= 1E-5 && $value > 2E-12) { $pic = $pic . "On"; $text = sprintf('%.1E', $value); }
placePicWithLink(188, 141, $pic . ".png", 30, "status extractor ion gauge Ex1221
green: on, red: off, grey: undefined", $link);
placeTextWithLink(217, 121, $text, 70, 4, "#000000", "pressure [mbar] extractor ion gauge Ex1221", $link);
// ########## VACUUM PUMPS ##########
// MS TMP Temperatures
//T
max
$value = max($adeiValue[25][0], $adeiValue[25][1], $adeiValue[25][2]);
$link = $adeiChannel[25][0] . "," . $adeiChannel[25][1] . "," . $adeiChannel[25][2];
$color = "#000000";
if ($value < 10) $color = "#0026FF";
else if ($value > 50) $color = "#FF0000";
placeTextWithLink(435, 1625, sprintf('%.1F °C', $value), 70, 3, $color, "TMP max temperature PP2", $link);
$value = max($adeiValue[26][0], $adeiValue[26][1], $adeiValue[26][2]);
$link = $adeiChannel[26][0] . "," . $adeiChannel[26][1] . "," . $adeiChannel[26][2];
$color = "#000000";
if ($value < 10) $color = "#0026FF";
else if ($value > 50) $color = "#FF0000";
placeTextWithLink(535, 1625, sprintf('%.1F °C', $value), 70, 3, $color, "TMP max temperature PP3", $link);
// TMPs (PP2 + PP3)
for ($pp = 0; $pp < 2; $pp++)
{
for ($id = 0; $id < 3; $id++)
{
$value = $adeiValue[$pp + 7][$id + 1];
$pic = "tmp";
$text = "---";
if ($value < 50)
{
$pic = $pic . "Off";
}
else if ($value >= 50 && $value < 500)
{
$text = sprintf('%.0F', $value);
if ($value > 450)
{
$value = $adeiValue[$pp + 7][$id + 4];
//$pic = $pic . "On";
if ($value == 1) $pic = $pic . "On";
else if ($value == 0) $pic = $pic . "Standby";
}
}
placePicWithLink(410 + $pp * 100, 1528 + $id * 35, $pic . ".png", 30, "status turbo-molecular pump TMP" . ($pp + 2) . ($id + 4) . "20
green: on, yellow: on but isolated, red: off, grey: undefined", $adeiChannel[$pp + 7][$id + 1]);
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]);
}
}
// PS TMPs
for ($id = 0; $id < 2; $id++)
{
$value = $adeiValue[27][$id + 1];
$link = $adeiChannel[27][$id + 1];
$pic = "tmp";
$text = "---";
if ($value < 50)
{
$pic = $pic . "Off";
}
else if ($value >= 50 && $value < 700)
{
$text = sprintf('%.0F', $value);
if ($value > 570)
{
$value = $adeiValue[27][$id + 3];
//$pic = $pic . "On";
if ($value == 1) $pic = $pic . "On";
else if ($value == 0) $pic = $pic . "Standby";
}
}
placePicWithLink(370, 123 + $id * 35, $pic . ".png", 30, "status turbo-molecular pump TMP" . (1123 - $id) . "
green: on, yellow: on but isolated, red: off, grey: undefined", $link);
placeTextWithLink(399, 114 + $id * 35, $text, 50, 4, "#000000", "rotational speed [Hz] turbo-molecular pump TMP" . (1123 - $id), $link);
}
// FPD CP
$value = $adeiValue[6][3];
$pic = "cp";
$text = "---";
if ($value > 20)
{
$pic = $pic . "Off";
}
else if ($value <= 20 && $value > 5)
{
$text = sprintf('%.0F K', $value);
$value = $adeiValue[6][12];
if ($value == 1) { $pic = $pic . "On"; }
else if ($value == 0) { $pic = $pic . "Standby"; }
}
placePicWithLink(340, 1470, $pic . ".png", 30, "status FPD UHV cryo pump
green: on, yellow: on but isolated, red: off, grey: undefined", $adeiChannel[6][3]);
placeTextWithLink(367, 1450, $text, 70, 4, "#000000", "temperature FPD UHV cryo pump", $adeiChannel[6][3]);
// ########## FPD SOURCES ##########
$pic = "source";
$text = "---";
if ($adeiValue[6][9] == 1 && $adeiValue[6][10] == 1) { $pic = $pic . "On"; $text = "OUT"; }
else if ($adeiValue[6][9] == 1 && $adeiValue[6][10] == 0) { $pic = $pic . "EIn"; $text = "IN"; }
else if ($adeiValue[6][9] == 0 && $adeiValue[6][10] == 1) { $pic = $pic . "GIn"; $text = "IN"; }
else if ($adeiValue[6][9] == 0 && $adeiValue[6][10] == 0) { $pic = $pic . "Off"; $text = "IN"; }
$link = $adeiChannel[6][9] . "," . $adeiChannel[6][10];
placePicWithLink(340, 1505, $pic . ".png", 30, "status FPD sources (electron and gamma source)
green: retracted (out), red: inserted (in), grey: undefined", $link);
placeTextWithLink(367, 1485, $text, 70, 4, "#000000", "status FPD sources (electron and gamma source)", $link);
// ########## AIR COILS ##########
$tol = 0.5;
for ($coil = 0; $coil < 16; $coil++)
{
$value = $adeiValue[0][$coil];
$color = "#000000";
if (abs($value) < $adeiValue[21][$coil] - $tol || abs($value) > $adeiValue[21][$coil] + $tol) $color = "#FF0000";
if ($value < -$tol && $adeiValue[22][$coil] != 1) $color = "#FF0000";
if ($value > $tol && $adeiValue[22][$coil] != 0) $color = "#FF0000";
if ($coil == 15) $value = -$value; // coil 14 is inverted
$value = sprintf('%.1F', $value);
if ($value <= -100 || $value >= 100) $value = sprintf('%.0F', $value);
if ($value >= -0.1 && $value <= 0.1) $value = sprintf('%.1F', 0.0);
// $status = $adeiValue[1][$coil];
$status = 1;
// $lem = $adeiValue[2][$coil];
$lem = 1;
if ($coil == 0) $pos = 270;
else if ($coil == 1) $pos = 320;
else if ($coil == 2) $pos = 521;
else if ($coil == 15) $pos = 1167;
else $pos = 609 + ($coil - 3) * 42.9;
if ($status == 0 || $lem == 0) $color = "#FF0000";
if ($status == 0) $value = "OVP";
if ($lem == 0) $value = "LEM";
$label = ($coil - 1);
if ($coil == 0) $label = "VER";
else if ($coil == 1) $label = "HOR";
$color = "#006400";
placeTextWithLink(-13, $pos, $value, 70, 4, $color, "air-coil current [A]
OVP: over-voltage protection triggered, LEM: DCCT offline", $adeiChannel[0][$coil]);
placeText(5, $pos, $label, 70, 2, "#000000");
$color = "#000000";
$label = "";
if ($adeiValue[22][$coil] == 1 && $adeiValue[23][16] == 0) { $color = "#FF0000"; $label = "FLIP"; }
if ($adeiValue[22][$coil] == 0 && $adeiValue[23][16] == 1 && $adeiValue[23][$coil] == 1) { $color = "#FF0000"; $label = "PULS"; }
if ($adeiValue[22][$coil] == 1 && $adeiValue[23][16] == 1 && $adeiValue[23][$coil] == 1) { $color = "#FF0000"; $label = "PULS"; } // F+P
placeTextWithLink(22 + 12, $pos, $label, 70, 2, $color, "air-coil status
FLIP: flipped, PULS: pulsed, F+P: both", $adeiChannel[23][$coil]);
}
// EMCS
placeText(-15, 200, "EMCS", 70, 5, "#000000");
$tol = 0.5;
$text = "???";
$color = "#FFD800";
$EMCSver = 46.46;
$EMCShor = 7.1;
if ($adeiValue[0][0] > $EMCSver - $tol && $adeiValue[0][0] < $EMCSver + $tol && $adeiValue[0][1] > $EMCShor - $tol && $adeiValue[0][1] < $EMCShor + $tol) { $text = "ON"; $color = "#4CFF00"; }
else if ($adeiValue[0][0] < $tol && $adeiValue[0][1] < $tol && $adeiValue[0][0] > -$tol && $adeiValue[0][1] > -$tol) { $text = "OFF"; $color = "#FF0000"; }
placeBox(-12, 160, $text, 35, 3, $color);
// LFCS
placeText(-15, 467, "LFCS", 70, 5, "#000000");
$tol = 0.5;
$text = "ON ???";
$color = "#FFD800";
$lfcs = array( // current 14 is inverted, negative value in definition must be positive here
array( "0.0", 0.000, 0.000, 0.000, 0.000, 0.000,0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000),
array( "STD 20%", 32.3, 3.6, 4.8, 0.4, 27.4, 25.1, 2.5, 2.7, 34.9, 0.9, 22.4, 10.7, 11.4, 10.0 ),
array( "2.7 70%", 0.0, 9.3, 1.5, 0.8, 12.9, 22.9, 36.7, 43.0, 14.7, 20.3, 9.2, 10.7, 11.0, 25.5 ),
array( "2.7 100%", 38.09, 43.70, 24.34, 24.84, 44.50, 54.14, 19.45, 37.08, 47.81, 36.43, 39.24, 25.78, 40.46, 30.82 ),
array( "1.0 100%", 30.0, 20.0, 25.0, 10.0, 0.0, 12.0, 20.0, 20.0, 12.0, 0.0, 5.0, 13.0, 20.0, 25.0),
array( "1.0 70%", -24.4, -19.0, -21.4, -8.3, -1.8, 6.2, 21.5, 9.1, 11.5, 6.5, 4.4, -15.9, -25.0, 25.6),
array( "10G 100%", 33.0, 159.0, 135.3, 78.8, 75.4, 116.7, 98.7, 86.3, 128.0, 57.4, 92.6, 150.7, 94.8, 33.7),
array( "10G 70%", 31.4, 138.4, 112.2, 72.9, 110.8, 119.9, 96.6, 103.4, 140.0, 56.2, 86.0, 137.8, 110.1, 22.8),
array( "2.0 70%", -11.9, -9.0, 5.8, -6.6, 15.3, 0.8, 34.1, 44.6, 5.5, 5.4, -8.6, 13.0, -10.0, 19.4),
array( "9.7 70%", 28.4, 98.7, 93.0, 76.8, 95.6, 132.6, 103.4, 98.5, 149.1, 66.8, 84.4, 94.6, 95.0, 25.7),
array( "14G 70%", 100, 94.8, 157.6, 143.9, 170, 130.1, 150.0, 150.0, 145, 162.5, 170, 100, 100, 0),
array( "5/7 14G", 51.02, 48.37, 80.41, 73.42, 86.73, 66.38, 76.53, 76.53, 73.98, 82.91, 86.73, 51.02, 51.02, 0.00),
array( "3.8G", 21.6, 21.3, 33.2, 7.4, 55.9, 32.0, 61.0, 56.8, 35.8, 36.0, 42.3, 33.9, 15.8, 45.2),
array( "5G", 31.2, 45.8, 41.3, 33.7, 47.7, 53.0, 75.2, 65.6, 61.5, 35.0, 48.6, 49.9, 24.2, 32.3),
array( "9G", 70.3, 84.0, 65.9, 106.4, 87.5, 142.3, 81.0, 103.1, 98.0, 112.7, 100.7, 90.1, 94.8, 54.0)
);
for ($pp = 0; $pp < 15; $pp++)
{
for ($id = 0; $id < 14; $id++)
{
$tol = abs($tol);
//echo $pp . ", " . $id . ", " . $adeiValue[0][$id + 2] . ", " . $lfcs[$pp][$id + 1] .", ". $tol . "
";
//if ($adeiValue[0][$id + 2] > $lfcs[$pp][$id + 1] - $tol && $adeiValue[0][$id + 2] < $lfcs[$pp][$id + 1] + $tol)
if (abs($adeiValue[0][$id + 2] - $lfcs[$pp][$id + 1]) < $tol)
{
if ($id == 13) { $text = $lfcs[$pp][0]; $color = "#4CFF00"; }
}
else break;
}
}
if ($text == "0.0") { $text = "OFF"; $color = "#FF0000"; }
placeBox(-12, 400, $text, 67, 3, $color);
// ########## HIGH VOLTAGE ##########
// load patch-panel configuration
$handle = fopen("patchpanel/ringstoadei.txt", "r");
if ($handle)
{
while (($buffer = fgets($handle, 4096)) !== false)
{
$buffer = trim($buffer);
$ringsToAdei[count($ringsToAdei)] = $buffer;
}
fclose($handle);
}
// labels
$posY = 12; // offset between labels and voltages (13)
$posX = 6; // down/bottom (7)
// voltage monitoring readout
$color = "#000000";
$factor_m = 1972.4531;
$offset = 3.104e-6;
$gain = 0.9999992578;
$value = ($adeiValue[30][0] - $offset) * $gain * $factor_m;
$voltage_error = abs($value * 2e-3);
if ($voltage_error < 1) { $voltage_error = 1; }
$link = $adeiChannel[30][0];
$text = "K35 divider readout, precision value";
placeText(385, 816, "K35 Voltage Reading", 130, 2, $color); // K35 voltage reading
placeTextWithLink(363, 796, sprintf('%.3F', $value ) . "(" . sprintf('%.0F', $voltage_error ) .") V" , 170, 4, $color, $text, $link);
//placeText(180, 845, "MS WEST IE", 70, 2,"#808080"); // west IE being displayed in loop below
//placeText(450, 845, "MS EAST IE", 70, 2,"#808080"); // east IE
placeText(265, 815, "MS IE COMMON", 130, 2, "#000000"); // mainspec IE Common
placeText(265, 170, "PS TANK", 70, 2, "#000000"); // prespec tank
placeText(305, 150, "PS CONES IE", 110, 2, "#505050"); // prespec west IE
placeText(345, 150, "PS CENTER IE", 110, 2, "#505050"); // prespec east IE
// MS Tank from Precision HCP Supply or Standard HCN
$text = "MS TANK";
$ms_hcn_soll = $adeiValue[10][1];
$ms_hcp_soll = $adeiValue[10][21];
if ($ms_hcn_soll == 0) {
if ($ms_hcp_soll == 0) { $text = $text . " OFF";}
else { $text = $text . " HCP"; $HCP = true; }
} else { $text = $text . " HCN"; $HCP = false; }
placeText(70, 830, $text, 100, 2, "#000000"); // mainspec tank
// switch values here between HCN and HCP in Value and Channel Array !!!
if ($HCP) { $adeiValue[10][0] = -$adeiValue[10][20]; $adeiValue[10][1] = $adeiValue[10][21];
$adeiChannel[10][0] = $adeiChannel[10][20]; $adeiChannel[10][1] = $adeiChannel[10][21]; }
placeText(110-$posY, 845, "W7-11", 70, 2, "#000000"); // w7-11
placeText(503+$posY+$posX, 845, "E7-11", 70, 2, "#000000"); // e7-11
placeText(126-$posY, 600, "W6", 70, 2, "#000000"); // w6
placeText(487+$posY+$posX, 600, "E6", 70, 2, "#000000"); // e6
placeText(126-$posY, 1090, "W12", 70, 2, "#000000"); // w12
placeText(487+$posY+$posX, 1090, "E12", 70, 2, "#000000"); // e12
placeText(161-$posY, 516, "W5", 70, 2, "#000000"); // w5
placeText(452+$posY+$posX, 516, "E5", 70, 2, "#000000"); // e5
placeText(161-$posY, 1174, "W13", 70, 2, "#000000"); // w13
placeText(452+$posY+$posX, 1174, "E13", 70, 2, "#000000"); // e13
placeText(194-$posY, 434, "W4", 70, 2, "#000000"); // w4
placeText(419+$posY+$posX, 434, "E4", 70, 2, "#000000"); // e4
placeText(194-$posY, 1256, "W14", 70, 2, "#000000"); // w14
placeText(419+$posY+$posX, 1256, "E14", 70, 2, "#000000"); // e14
placeText(225-$posY, 385, "W3", 70, 2, "#000000"); // w3
placeText(388+$posY+$posX, 385, "E3", 70, 2, "#000000"); // e3
placeText(225-$posY, 1305, "W15", 70, 2, "#000000"); // w15
placeText(388+$posY+$posX, 1305, "E15", 70, 2, "#000000"); // e15
placeText(273-$posY, 352, "W2", 70, 2, "#000000"); // w2
placeText(340+$posY+$posX, 352, "E2", 70, 2, "#000000"); // e2
placeText(273-$posY, 1338, "W16", 70, 2, "#000000"); // w16
placeText(340+$posY+$posX, 1338, "E16", 70, 2, "#000000"); // e16
if ($adeiValue[10][8] > 10.0) placeText(309, 359, "APE", 70, 2, "#000000"); // ape south
if ($adeiValue[10][10] > 10.0) placeText(309, 1331, "APE", 70, 2, "#000000"); // ape north
// offset voltages
$posY = 16; // offset between outer and inner voltages
$ringsPosY = array( 273, 273+$posY, 225, 225+$posY, 194, 194+$posY, 161, 161+$posY, 126, 126+$posY, 110, 110+$posY, 126, 126+$posY, 161, 161+$posY, 194, 194+$posY, 225, 225+$posY, 273, 273+$posY, 340, 340-$posY, 388, 388-$posY, 419, 419-$posY, 452, 452-$posY, 487, 487-$posY, 503, 503-$posY, 487, 487-$posY, 452, 452-$posY, 419, 419-$posY, 388, 388-$posY, 340, 340-$posY );
$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 );
$tol = 0.2;
for ($pp = 0; $pp < 2; $pp++) // west (0), east (1)
{
for ($id = 0; $id < 22; $id++) // rings: o, i, o, i, ...
{
// show voltage if not shorted to IE
if ($ringsToAdei[$id + 22*$pp] != "IE" && $ringsToAdei[$id + 22*$pp] != "")
{
// color
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";
else
$color = "#FF0000";
// show voltage
if ( ($id % 2 == 0) || ($id % 2 == 1 && $ringsToAdei[$id + 22*$pp] != $ringsToAdei[$id + 22*$pp - 1]) )
{
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]]);
}
}
}
}
// tank, ie, dipole, ape
$ringsPosY = array( 45, 240, 155, 425, 306, 306, 0, 240, 280, 320 );
$ringsPosX = array( 805, 805, 805, 805, 319, 1371, 0, 130, 130, 130 );
$tolA = array ( 15, 2, 1, 1, 1, 1, 0, 250, 1, 1 );
// MS voltages
for ($pp = 0; $pp < 6; $pp++) // tank (0), ie (1), ie west (2), ie east (3), ape south (4), ape north (5)
{
// color
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";
else
$color = "#FF0000";
// show voltage
$value = $adeiValue[10][2*$pp];
$link = $adeiChannel[10][2*$pp];
$dipolestatus = $adeiValue[2][16];
$dipolelink = $adeiChannel[2][16];
if ($pp == 0) { $text = "absolute tank potential"; }
else if ($pp == 1) { $text = "IE common offset potential"; }
else if ($pp == 2) { $text = "relative voltage potential west IE"; }
else if ($pp == 3) { $text = "relative voltage potential east IE"; }
else if ($pp == 4) { $text = "relative voltage potential south APE"; }
else if ($pp == 5) { $text = "relative voltage potential north APE"; }
if ($pp == 2 || $pp == 3)
{
if ($dipolestatus == 1) // dipole enabled
{
$color = "#990000";
$value = $adeiValue[10][2*$pp];
if ($pp == 2)
{
placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000" );
}
else if ($pp == 3)
{
placeText($ringsPosY[$pp] + 40, $ringsPosX[$pp], "DIPOLE", 150, 4, "#CC0000");
}
}
else
{
$value = $adeiValue[10][2*$pp]; // dipole disabled
$color = "#909090";
}
if ($pp == 2) placeText(180, 825, "MS WEST IE", 110, 2, $color); // west IE
else if ($pp == 3) placeText(450, 825, "MS EAST IE", 110, 2, $color); // east IE
$link = $adeiChannel[10][2*$pp+1] . "," . $adeiChannel[10][2*$pp] . "," . $dipolelink;
}
// tank potential
if ($pp == 0) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 150, 5, $color, $text, $link);
// IE common and dipoles
else if ($pp == 1 || $pp == 2 || $pp == 3) placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.2F V', -$value), 150, 5, $color, $text, $link);
// APE
else if ($pp == 4 || $pp == 5)
{
if ($adeiValue[10][2*$pp] > 10.0) { placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp] , sprintf('%.1F', $value), 70, 4, $color, $text, $link); }
}
}
// PS voltages (add $pp < 10 for PS IE )
for ($pp = 7; $pp < 10; $pp++) // PS tank (channel 7 = array entry 14 + 15), IE west (8), IE east (9)
{
// color
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";
else
$color = "#FF0000";
// show voltage
$value = $adeiValue[10][2*$pp];
$link = $adeiChannel[10][2*$pp];
if ($pp == 7) { $text = "absolute ps tank potential"; }
else if ($pp == 8) { $text = "relative voltage potential PS IE west"; $color = "#505050";}
else if ($pp == 9) { $text = "relative voltage potential PS IE west"; $color = "#505050";}
placeTextWithLink($ringsPosY[$pp], $ringsPosX[$pp], sprintf('%.1F V', -$value), 150, 5, $color, $text, $link);
}
/*
// voltage test
$tol = 5.0;
for ($pp = 0; $pp < 3; $pp++)
{
if ($pp == 0) $idMax = 2;
else $idMax = 11;
for ($id = 0; $id < $idMax; $id++)
{
if ( ($adeiValue[10 + $pp][$id] > $adeiValue[10 + $pp][$id + $idMax] - $tol) && ($adeiValue[10 + $pp][$id] < $adeiValue[10 + $pp][$id + $idMax] + $tol) )
$adeiColor[10 + $pp][$id] = "#000000";
else
$adeiColor[10 + $pp][$id] = "#FF0000";
}
}
// voltages
placeTextWithLink(103, 805, sprintf('%.1F', -$adeiValue[10][0] - $adeiValue[10][1]) . " V", 150, 5, $adeiColor[10][1], "absolute IE potential", $adeiChannel[10][1]); // IE
placeTextWithLink(53, 805, sprintf('%.1F', -$adeiValue[10][0]) . " V", 150, 5, $adeiColor[10][0], "absolute tank potential", $adeiChannel[10][0]); // tank
placeTextWithLink(120, 590, "+" . sprintf('%.1F', $adeiValue[11][4]), 70, 4, $adeiColor[11][4], "relative voltage offset ring west-6", $adeiChannel[11][4]); // w6
placeTextWithLink(490, 590, "+" . sprintf('%.1F', $adeiValue[12][4]), 70, 4, $adeiColor[12][4], "relative voltage offset ring east-6", $adeiChannel[12][4]); // e6
placeTextWithLink(120, 1100, "+" . sprintf('%.1F', $adeiValue[11][6]), 70, 4, $adeiColor[11][6], "relative voltage offset ring west-12", $adeiChannel[11][6]); // w12
placeTextWithLink(490, 1100, "+" . sprintf('%.1F', $adeiValue[12][6]), 70, 4, $adeiColor[12][6], "relative voltage offset ring east-12", $adeiChannel[12][6]); // e12
placeTextWithLink(155, 506, "+" . sprintf('%.1F', $adeiValue[11][3]), 70, 4, $adeiColor[11][3], "relative voltage offset ring west-5", $adeiChannel[11][3]); // w5
placeTextWithLink(455, 506, "+" . sprintf('%.1F', $adeiValue[12][3]), 70, 4, $adeiColor[12][3], "relative voltage offset ring east-5", $adeiChannel[12][3]); // e5
placeTextWithLink(155, 1184, "+" . sprintf('%.1F', $adeiValue[11][7]), 70, 4, $adeiColor[11][7], "relative voltage offset ring west-13", $adeiChannel[11][7]); // w13
placeTextWithLink(455, 1184, "+" . sprintf('%.1F', $adeiValue[12][7]), 70, 4, $adeiColor[12][7], "relative voltage offset ring east-13", $adeiChannel[12][7]); // e13
placeTextWithLink(188, 424, "+" . sprintf('%.1F', $adeiValue[11][2]), 70, 4, $adeiColor[11][2], "relative voltage offset ring west-4", $adeiChannel[11][2]); // w4
placeTextWithLink(422, 424, "+" . sprintf('%.1F', $adeiValue[12][2]), 70, 4, $adeiColor[12][2], "relative voltage offset ring east-4", $adeiChannel[12][2]); // e4
placeTextWithLink(188, 1266, "+" . sprintf('%.1F', $adeiValue[11][8]), 70, 4, $adeiColor[11][8], "relative voltage offset ring west-14", $adeiChannel[11][8]); // w14
placeTextWithLink(422, 1266, "+" . sprintf('%.1F', $adeiValue[12][8]), 70, 4, $adeiColor[12][8], "relative voltage offset ring east-14", $adeiChannel[12][8]); // e14
placeTextWithLink(225, 385, "+" . sprintf('%.1F', $adeiValue[11][1]), 70, 4, $adeiColor[11][1], "relative voltage offset ring west-3", $adeiChannel[11][1]); // w3
placeTextWithLink(385, 385, "+" . sprintf('%.1F', $adeiValue[12][1]), 70, 4, $adeiColor[12][1], "relative voltage offset ring east-3", $adeiChannel[12][1]); // e3
placeTextWithLink(225, 1305, "+" . sprintf('%.1F', $adeiValue[11][9]), 70, 4, $adeiColor[11][9], "relative voltage offset ring west-15", $adeiChannel[11][9]); // w15
placeTextWithLink(385, 1305, "+" . sprintf('%.1F', $adeiValue[12][9]), 70, 4, $adeiColor[12][9], "relative voltage offset ring east-15", $adeiChannel[12][9]); // e15
placeTextWithLink(275, 350, "+" . sprintf('%.1F', $adeiValue[11][0]), 70, 4, $adeiColor[11][0], "relative voltage offset ring west-2", $adeiChannel[11][0]); // w2
placeTextWithLink(335, 350, "+" . sprintf('%.1F', $adeiValue[12][0]), 70, 4, $adeiColor[12][0], "relative voltage offset ring east-2", $adeiChannel[12][0]); // e2
placeTextWithLink(275, 1340, "+" . sprintf('%.1F', $adeiValue[11][10]), 70, 4, $adeiColor[11][10], "relative voltage offset ring west-16", $adeiChannel[11][10]); // w16
placeTextWithLink(335, 1340, "+" . sprintf('%.1F', $adeiValue[12][10]), 70, 4, $adeiColor[12][10], "relative voltage offset ring east-16", $adeiChannel[12][10]); // e16
$posY = 16; // offset between outer and inner voltages
placeTextWithLink(126, 600, "+200.0", 70, 4, $adeiColor[11][4], "relative voltage offset ring west-6-outer", $adeiChannel[11][4]); // w6o
placeTextWithLink(487, 600, "+200.0", 70, 4, $adeiColor[12][4], "relative voltage offset ring east-6-outer", $adeiChannel[12][4]); // e6o
placeTextWithLink(126, 1090, "+200.0", 70, 4, $adeiColor[11][6], "relative voltage offset ring west-12-outer", $adeiChannel[11][6]); // w12o
placeTextWithLink(487, 1090, "+200.0", 70, 4, $adeiColor[12][6], "relative voltage offset ring east-12-outer", $adeiChannel[12][6]); // e12o
placeTextWithLink(126+$posY, 600, "+200.0", 70, 4, $adeiColor[11][4], "relative voltage offset ring west-6", $adeiChannel[11][4]); // w6i
placeTextWithLink(487-$posY, 600, "+200.0", 70, 4, $adeiColor[12][4], "relative voltage offset ring east-6", $adeiChannel[12][4]); // e6i
placeTextWithLink(126+$posY, 1090, "+200.0", 70, 4, $adeiColor[11][6], "relative voltage offset ring west-12", $adeiChannel[11][6]); // w12i
placeTextWithLink(487-$posY, 1090, "+200.0", 70, 4, $adeiColor[12][6], "relative voltage offset ring east-12", $adeiChannel[12][6]); // e12i
placeTextWithLink(161, 516, "+200.0", 70, 4, $adeiColor[11][3], "relative voltage offset ring west-5", $adeiChannel[11][3]); // w5o
placeTextWithLink(452, 516, "+200.0", 70, 4, $adeiColor[12][3], "relative voltage offset ring east-5", $adeiChannel[12][3]); // e5o
placeTextWithLink(161, 1174, "+200.0", 70, 4, $adeiColor[11][7], "relative voltage offset ring west-13", $adeiChannel[11][7]); // w13o
placeTextWithLink(452, 1174, "+200.0", 70, 4, $adeiColor[12][7], "relative voltage offset ring east-13", $adeiChannel[12][7]); // e13o
placeTextWithLink(161+$posY, 516, "+200.0", 70, 4, $adeiColor[11][3], "relative voltage offset ring west-5", $adeiChannel[11][3]); // w5i
placeTextWithLink(452-$posY, 516, "+200.0", 70, 4, $adeiColor[12][3], "relative voltage offset ring east-5", $adeiChannel[12][3]); // e5i
placeTextWithLink(161+$posY, 1174, "+200.0", 70, 4, $adeiColor[11][7], "relative voltage offset ring west-13", $adeiChannel[11][7]); // w13i
placeTextWithLink(452-$posY, 1174, "+200.0", 70, 4, $adeiColor[12][7], "relative voltage offset ring east-13", $adeiChannel[12][7]); // e13i
placeTextWithLink(194, 434, "+200.0", 70, 4, $adeiColor[11][2], "relative voltage offset ring west-4", $adeiChannel[11][2]); // w4o
placeTextWithLink(419, 434, "+200.0", 70, 4, $adeiColor[12][2], "relative voltage offset ring east-4", $adeiChannel[12][2]); // e4o
placeTextWithLink(194, 1256, "+200.0", 70, 4, $adeiColor[11][8], "relative voltage offset ring west-14", $adeiChannel[11][8]); // w14o
placeTextWithLink(419, 1256, "+200.0", 70, 4, $adeiColor[12][8], "relative voltage offset ring east-14", $adeiChannel[12][8]); // e14o
placeTextWithLink(194+$posY, 434, "+200.0", 70, 4, $adeiColor[11][2], "relative voltage offset ring west-4", $adeiChannel[11][2]); // w4i
placeTextWithLink(419-$posY, 434, "+200.0", 70, 4, $adeiColor[12][2], "relative voltage offset ring east-4", $adeiChannel[12][2]); // e4i
placeTextWithLink(194+$posY, 1256, "+200.0", 70, 4, $adeiColor[11][8], "relative voltage offset ring west-14", $adeiChannel[11][8]); // w14i
placeTextWithLink(419-$posY, 1256, "+200.0", 70, 4, $adeiColor[12][8], "relative voltage offset ring east-14", $adeiChannel[12][8]); // e14i
placeTextWithLink(225, 385, "+200.0", 70, 4, $adeiColor[11][1], "relative voltage offset ring west-3", $adeiChannel[11][1]); // w3o
placeTextWithLink(388, 385, "+200.0", 70, 4, $adeiColor[12][1], "relative voltage offset ring east-3", $adeiChannel[12][1]); // e3o
placeTextWithLink(225, 1305, "+200.0", 70, 4, $adeiColor[11][9], "relative voltage offset ring west-15", $adeiChannel[11][9]); // w15o
placeTextWithLink(388, 1305, "+200.0", 70, 4, $adeiColor[12][9], "relative voltage offset ring east-15", $adeiChannel[12][9]); // e15o
placeTextWithLink(225+$posY, 385, "+200.0", 70, 4, $adeiColor[11][1], "relative voltage offset ring west-3", $adeiChannel[11][1]); // w3i
placeTextWithLink(388-$posY, 385, "+200.0", 70, 4, $adeiColor[12][1], "relative voltage offset ring east-3", $adeiChannel[12][1]); // e3i
placeTextWithLink(225+$posY, 1305, "+200.0", 70, 4, $adeiColor[11][9], "relative voltage offset ring west-15", $adeiChannel[11][9]); // w15i
placeTextWithLink(388-$posY, 1305, "+200.0", 70, 4, $adeiColor[12][9], "relative voltage offset ring east-15", $adeiChannel[12][9]); // e15i
placeTextWithLink(273, 352, "+200.0", 70, 4, $adeiColor[11][0], "relative voltage offset ring west-2", $adeiChannel[11][0]); // w2o
placeTextWithLink(340, 352, "+200.0", 70, 4, $adeiColor[12][0], "relative voltage offset ring east-2", $adeiChannel[12][0]); // e2o
placeTextWithLink(273, 1338, "+200.0", 70, 4, $adeiColor[11][10], "relative voltage offset ring west-16", $adeiChannel[11][10]); // w16o
placeTextWithLink(340, 1338, "+200.0", 70, 4, $adeiColor[12][10], "relative voltage offset ring east-16", $adeiChannel[12][10]); // e16o
placeTextWithLink(273+$posY, 352, "+200.0", 70, 4, $adeiColor[11][0], "relative voltage offset ring west-2", $adeiChannel[11][0]); // w2i
placeTextWithLink(340-$posY, 352, "+200.0", 70, 4, $adeiColor[12][0], "relative voltage offset ring east-2", $adeiChannel[12][0]); // e2i
placeTextWithLink(273+$posY, 1338, "+200.0", 70, 4, $adeiColor[11][10], "relative voltage offset ring west-16", $adeiChannel[11][10]); // w16i
placeTextWithLink(340-$posY, 1338, "+200.0", 70, 4, $adeiColor[12][10], "relative voltage offset ring east-16", $adeiChannel[12][10]); // e16i
placeTextWithLink(306, 319, "-200.0", 70, 4, $adeiColor[12][10], "relative voltage offset ring east-16", $adeiChannel[12][10]); // apes
placeTextWithLink(306, 1371, "-200.0", 70, 4, $adeiColor[11][10], "relative voltage offset ring west-16", $adeiChannel[11][10]); // apen
*/
// ########## DETECTOR ##########
// detector powered
$lowVoltage = array( 12, 8, 6, 6, 120 );
$link = "";
$pic = "fpdOn";
$text = "ON";
for ($id = 0; $id < 5; $id++)
{
$value = $adeiValue[6][4 + $id];
if (!($value < $lowVoltage[$id] + 0.2 && $value > $lowVoltage[$id] - 0.2))
{
$pic = "fpdOff";
$text = "OFF";
}
$link = $link . $adeiChannel[6][4 + $id] . ",";
}
$link = substr($link, 0, strlen($link) - 1);
placePicWithLink(200, 1600, $pic . ".png", 30, "status FPD power
green: on, red: off, grey: undefined", $link);
placeTextWithLink(227, 1580, $text, 70, 4, "#000000", "status FPD power", $link);
// carousel
$value = $adeiValue[6][11];
$color = "#000000";
if ($value < -95) $value = "---";
else $value = sprintf('%.0F', $adeiValue[6][11]) . " °C";
placeTextWithLink(255, 1565, $value, 100, 4, $color, "temperature FPD carousel/electronics", $adeiChannel[6][11]);
placeText(275, 1565, "carousel", 100, 2, "#000000");
// ########## MAGNETOMETERS ##########
$mag = array(4, 6, 4);
for ($pp = 0; $pp < 3; $pp++)
{
$bx = 0;
$by = 0;
$bz = 0;
$link = "";
for ($id = 0; $id < $mag[$pp]; $id++)
{
$bx = $bx + $adeiValue[16 + $pp][3 * $id];
$by = $by + $adeiValue[16 + $pp][3 * $id + 1];
$bz = $bz + $adeiValue[16 + $pp][3 * $id + 2];
$link = $link . $adeiChannel[16 + $pp][3 * $id + 2] . ",";
//echo $bx . " " . $by . " " . $bz . "
";
}
$bx = $bx / $mag[$pp];
$by = $by / $mag[$pp];
$bz = $bz / $mag[$pp];
$link = substr($link, 0, strlen($link) - 1);
$value = sqrt($bx * $bx + $by * $by + $bz * $bz);
$text = "averaged field precise magnetometers ";
if ($pp == 0) $text = $text . "north ";
else if ($pp == 1) $text = $text . "middle ";
else if ($pp == 2) $text = $text . "south ";
$text = $text . "ring";
placeTextWithLink(553, 1015 - 170 * $pp, sprintf('%.1F G', $value), 70, 5, "#000000", $text, $link);
}
// dipole
$pic = "status";
if ($pulserId[0] == "dipole" && $daqElapsed[0] > 30)
{
if ($pulserCounts[0] > 0) $pic = $pic . "On";
else if ($pulserCounts[0] == 0) $pic = $pic . "Off";
}
//placePic($posY + 34 + 25, $posX + 80, $pic . ".png", 17, "status dipole sync pulser
green: on, red: off, grey: undefined");
// egun
$pic = "status";
if ($pulserId[1] == "egun" && $daqElapsed[0] > 30)
{
if ($pulserCounts[1] > 0) $pic = $pic . "On";
else if ($pulserCounts[1] == 0) $pic = $pic . "Off";
}
//placePic($posY + 34 + 50, $posX + 80, $pic . ".png", 17, "status egun sync pulser
green: on, red: off, grey: undefined");
// muon
// $pic = "status";
// if ($pulserId[3] == "muon" && $daqElapsed[0] > 30)
// {
// if ($pulserCounts[3] > 0) $pic = $pic . "On";
// else if ($pulserCounts[3] == 0) $pic = $pic . "Off";
// }
// placePic($posY + 34 + 75, $posX + 80, $pic . ".png", 17, "status muon sync pulser
green: on, red: off, grey: undefined");
// ########## HALL ##########
placePicWithLink(-30-3, 1800, "newTemperature.png", 23, "temperature in KATRIN hall", $adeiChannel[19][1]);
placeTextWithLink(-30-3, 1820, sprintf('%.1F °C', $adeiValue[19][1]), 80, 4, "#000000", "temperature in KATRIN hall", $adeiChannel[19][1]);
placePicWithLink(-2-3, 1800, "newPressure.png", 23, "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
placeTextWithLink(-2-3, 1820, sprintf('%.0F hPa', $adeiValue[19][0] * 0.0689475729 * 1000.0), 80, 4, "#000000", "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
//placeTextWithLink(-2-3, 1820, sprintf('%.3F bar', $adeiValue[19][0] * 0.0689475729), 80, 4, "#000000", "atmospheric pressure in KATRIN hall", $adeiChannel[19][0]);
placePicWithLink(26-3, 1800, "newHumidity.png", 23, "relative humidity in KATRIN hall", $adeiChannel[19][2]);
placeTextWithLink(26-3, 1820, sprintf('%.1F %', $adeiValue[19][2]), 80, 4, "#000000", "relative humidity in KATRIN hall", $adeiChannel[19][2]);
// ########## HIGH PRESSURE ##########
if (getValveStatus($adeiValue[9][6]) == -1 && getValveStatus($adeiValue[9][7]) == 1 && getValveStatus($adeiValue[9][8]) == 1 && getValveStatus($adeiValue[9][9]) == 0)
{
$pic = "bottleBlinking.gif";
$text = "ON";
$color = "#000000";
if ($adeiValue[9][4] != 64) $color = "#FF0000";
placeTextWithLink(135, 1387, sprintf('%.1F %', $adeiValue[9][5]), 70, 4, $color, "gas flow leak valve", $adeiChannel[9][5]);
placeTextWithLink(160, 1387, sprintf('%.1E', $adeiValue[9][3]), 70, 4, $color, "pressure [mbar] MKS Baratron", $adeiChannel[9][3]);
}
else
{
if (getValveStatus($adeiValue[9][7]) == 1)
{
$pic = "bottleOn.png";
$text = "OPEN";
}
else
{
$pic = "bottleOn.png";
$text = "OFF";
}
}
$link = $adeiChannel[9][3] . "," . $adeiChannel[9][4] . "," . $adeiChannel[9][5] . "," . $adeiChannel[9][6] . "," . $adeiChannel[9][7] . "," . $adeiChannel[9][8] . "," . $adeiChannel[9][9];
placePicWithLink(135, 1358, $pic, 48, "status gas injection system
green: off, blinking: on, grey: undefined
Should be off for nominal pressure measurements!!!", $link);
placeTextWithLink(180, 1347, $text, 70, 4, "#000000", "status gas injection system", $link);
// ########## PS VESSEL TEMPERATURES ##########
$min = 18;
$max = 30;
// mean of 4020, 4030, 4040
$link = $adeiChannel[29][0] . "," . $adeiChannel[29][1] . "," . $adeiChannel[29][2];
$value = ($adeiValue[29][0] + $adeiValue[29][1] + $adeiValue[29][2])/3.0;
$color = "#000000";
if ($value < $min) $color = "#0026FF";
else if ($value > $max) $color = "#FF0000";
if ($value < 400) placeTextWithLink(303, 170, sprintf('%.1F °C', $value), 90, 4, $color, "PS mean temperature of 4020..30..40", $link);
// ########## MS VESSEL TEMPERATURES ##########
$min = 14;
$max = 24;
// 0066
$value = $adeiValue[20][0];
$color = "#000000";
if ($value < $min) $color = "#0026FF";
else if ($value > $max) $color = "#FF0000";
if ($value < 400) placeTextWithLink(110, 933, "T
IE0066 = " . sprintf('%.1F °C', $value), 170, 4, $color, "IE temperature 0066", $adeiChannel[20][0]);
// 0076
$value = $adeiValue[20][1];
$color = "#000000";
if ($value < $min) $color = "#0026FF";
else if ($value > $max) $color = "#FF0000";
if ($value < 400) placeTextWithLink(110+20, 933, "T
IE0076 = " . sprintf('%.1F °C', $value), 170, 4, $color, "IE temperature 0076", $adeiChannel[20][1]);
// 0270
$value = $adeiValue[20][2];
$color = "#000000";
if ($value < $min) $color = "#0026FF";
else if ($value > $max) $color = "#FF0000";
if ($value < 400) placeTextWithLink(307, 805, "T
0270 = " . sprintf('%.1F °C', $value), 160, 4, $color, "tank temperature 0270", $adeiChannel[20][2]);
// 0283
$value = $adeiValue[20][3];
$color = "#000000";
if ($value < $min) $color = "#0026FF";
else if ($value > $max) $color = "#FF0000";
if ($value < 400) placeTextWithLink(307, 963, "T
0283 = " . sprintf('%.1F °C', $value), 160, 4, $color, "tank temperature 0283", $adeiChannel[20][3]);
/*
// 0066
$value = $adeiValue[20][0] - $adeiValue[20][4];
$color = "#000000";
if ($value < 50) placeTextWithLink(110+16, 973-30, sprintf('(%.2F °C/h)', $value), 130, 4, $color, "IE temperature 0066 (ramp speed)", $adeiChannel[20][0]);
// 0076
$value = $adeiValue[20][1] - $adeiValue[20][5];
$color = "#000000";
if ($value < 50) placeTextWithLink(126+24+16, 973-30, sprintf('(%.2F °C/h)', $value), 130, 4, $color, "IE temperature 0076 (ramp speed)", $adeiChannel[20][1]);
// 0270
$value = $adeiValue[20][2] - $adeiValue[20][6];
$color = "#000000";
if ($value < 50) placeTextWithLink(307+16, 845-30, sprintf('(%.2F °C/h)', $value), 130, 4, $color, "tank temperature 0270 (ramp speed)", $adeiChannel[20][2]);
// 0283
$value = $adeiValue[20][3] - $adeiValue[20][7];
$color = "#000000";
if ($value < 50) placeTextWithLink(307+16, 973-30, sprintf('(%.2F °C/h)', $value), 130, 4, $color, "tank temperature 0283 (ramp speed)", $adeiChannel[20][3]);
*/
$color = "#000000";
// ########## 60s counter ##########
$date= date("Ymdgis");
if ($onsite) placePic(5, 5, "countdown60.gif?".$date, 100, "60s counter");
// ########## STS ##########
placeTextWithWebsiteLink(360, 5, "←STS", 60, 5, $color, "Link to STS Status Overview", "../stsstatus");
// ########## FPD Status ##########
placeTextWithWebsiteLink(-10, 1450, "→ FPD Status", 155, 4, $color, "Link to FPD Status Overview", "../fpdstatus");
// ########## MoS und HV Status ##########
placeTextWithWebsiteLink(20, 1440, "→ MoS and HV Status", 240, 4, $color, "Link to Monitor Spectrometer and High Voltage Status Overview", "http://ipepc57.ipe.kit.edu:5858/mos/status");
// ########## Run Summary ##########
placeTextWithWebsiteLink(50, 1440, "→ Run Summary Page", 240, 4, $color, "Link to Run Summary Page", "http://katana.npl.washington.edu/~sanshiro/kaffee/Krypton/");
// ########## 10s readout link ##########
if ($ip == "141.52.12.164") placeTextWithWebsiteLink(80, 1475, "→ Switch to quick refresh", 195, 4, $color, "Link to 10s readout page", "./index_q.php");
if ($ip == "141.52.16.94") placeTextWithWebsiteLink(80, 1475, "→ Switch to quick refresh", 195, 4, $color, "Link to 10s readout page", "./index_q.php");
// ########## PS ##########
// placeText(100, 170, "PS", 60, 30, $color);
// ########## HIGH VOLTAGE SWITCH ##########
/*
$value = $adeiValue[10][4]; // HAS CHANGED!!!!!
$pic = "switch";
if ($value == 1) $pic = $pic . "Open";
else if ($value == 0) $pic = $pic . "Closed";
placePicWithLink(498, 501, $pic . ".png", 80, "status high-voltage ground switch", $adeiChannel[10][4]);
*/
?>