'; echo ''; echo ''; } function placePicWithLink($posY, $posX, $pic, $size, $title, $link) { echo ''; placePic($posY, $posX, $pic, $size, $title); echo ''; } function placeText($posY, $posX, $text, $width, $size, $color) { echo '
'; echo ''; echo $text; echo '
'; } function placeTextWithLink($posY, $posX, $text, $width, $size, $color, $title, $link) { echo '
'; echo ''; echo ''; echo $text; echo '
'; } function placeBox($posY, $posX, $text, $width, $size, $color) { echo '
'; echo ''; echo $text; echo '
'; } function getValveStatus($value) { $value = decbin($value); $value = substr("00000000000", 0, 11 - strlen($value)) . $value; if (substr($value, 3, 1) == 1) return 1; else if (substr($value, 2, 1) == 1) return 0; else return -1; } ?> array( 'header' => "Authorization: Basic " . base64_encode("$username:$password"), "Connection: close\r\n" ) )); for ($id = 0; $id < sizeof($adeiChannel); $id++) { $adeiChannels = ""; for ($id2 = 0; $id2 < sizeof($adeiChannel[$id]); $id2++) { $adeiChannels = $adeiChannels . $adeiChannel[$id][$id2] . ","; } $adeiChannels = substr($adeiChannels, 0, strlen($adeiChannels) - 1); //$fileip = file_get_contents("http://katrin.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&window=60&format=csv", false, $context); $fileip = file_get_contents("http://ipekatrinbackupserv1.ipe.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&window=60&format=csv", false, $context); //echo $fileip . "
"; for ($id2 = sizeof($adeiChannel[$id]) - 1 ; $id2 > -1; $id2--) { $pos = strrpos($fileip, ","); $adeiValue[$id][$id2] = floatval(substr($fileip, $pos + 2)); $fileip = substr($fileip, 0, $pos); //echo $id . "," . $id2 . "," . $adeiValue[$id][$id2] . "
"; } } ?> STS Status Overview
'; echo '' . date(DATE_RFC822) . '
'; ?>
$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); } ?>