$thres && $adeiValue[0][2*($pp-1)] + $adeiValue[0][1 + 2*($pp-1)] < $tol && $adeiValue[0][2*($pp-1)] + $adeiValue[0][1 + 2*($pp-1)] > -$tol)
{
$posOffset = 0;
if ($pp == 2) $posOffset = 1;
else if ($pp == 4) $posOffset = -1;
$text = "magnetic field [T] DPS magnet " . $pp;
placeTextWithLink($posY + 13, $posX - 5 + $posOffset, sprintf('%.1F', $value), 30, 2, "#FF0000", $text, $link);
$pic = $pic . "On";
$color = "#FF0000";
}
$text = "status DPS magnet " . $pp . "
red: ramped, white: off";
placePicWithLink($posY, $posX, $pic . ".png", 20, $text, $link);
placeText(100, $posX, "M" . $pp, 20, 5, $color);
}
// ########## CPS ##########
placeText(-100, 1650, "CPS", 70, 30, $color);
for ($index = 1; $index < 8; $index++)
{
placeText(0, 1570+50*($index-1), "M" . $index, 30, 5, $color);
}
?>