mirror of
https://github.com/eddyem/bta-panels.git
synced 2025-12-06 02:35:17 +03:00
copy
This commit is contained in:
commit
2f355e3130
143
BTApanels/BTA.html
Normal file
143
BTApanels/BTA.html
Normal file
@ -0,0 +1,143 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>BTA control information</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=koi8-r">
|
||||
<meta http-equiv="refresh" content="61">
|
||||
|
||||
<!--meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="pragma" content="no-cache"-->
|
||||
|
||||
<link href="panels.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="panels.js" language="javascript"></script>
|
||||
</head>
|
||||
<body onload="init('BTA');">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th class="border" colspan="3" id="header"><h1>BTA control information</h1><br>
|
||||
<div class="topright hand" id="stop"></div>
|
||||
<div class="topleft"><div class="hand" id="menu"></div><div id="reqmsgs"></div></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><h2>Date: <span id="Date"></span></h2></td>
|
||||
<td><h2>Moscow time: <span id="Mtime"></span></h2></td>
|
||||
<td><h2>Sidereal time: <span id="Stime"></span></h2></td>
|
||||
</tr>
|
||||
</table>
|
||||
</th></tr>
|
||||
<tr>
|
||||
<td style="max-width: 800px;" width="65%" class="border">
|
||||
<img id="BigIMG" width="100%">
|
||||
<div style="visible: no;" id="BigIMGlabel"></div>
|
||||
</td>
|
||||
<td class="border" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Azimuth</td>
|
||||
<td>Zenith</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><img id="A"></td>
|
||||
<td><img id="Z"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Target</td>
|
||||
<td id="CurAzim"></td>
|
||||
<td id="CurZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Current</td>
|
||||
<td id="ValAzim" class="bold"></td>
|
||||
<td id="ValZenD" class="bold"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Difference</td>
|
||||
<td id="DiffAzim"></td>
|
||||
<td id="DiffZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Speed</td>
|
||||
<td id="VelAzim"></td>
|
||||
<td id="VelZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Correction</td>
|
||||
<td id="CorrAzim"></td>
|
||||
<td id="CorrZenD"></td>
|
||||
</tr>
|
||||
<tr height="10px"></tr>
|
||||
<tr>
|
||||
<td>Apparent place</td>
|
||||
<td class="mid">R.A.</td>
|
||||
<td class="mid">Dec</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Target</td>
|
||||
<td id="SrcAlpha"></td>
|
||||
<td id="SrcDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Current</td>
|
||||
<td id="CurAlpha" class="bold"></td>
|
||||
<td id="CurDelta" class="bold"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Input</td>
|
||||
<td id="InpAlpha"></td>
|
||||
<td id="InpDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Correction</td>
|
||||
<td id="CorrAlpha"></td>
|
||||
<td id="CorrDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">Telescope</td>
|
||||
<td id="TelAlpha"></td>
|
||||
<td id="TelDelta"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table>
|
||||
<tr><td>P2</td></tr>
|
||||
<tr><td><img id="P2"></td></tr>
|
||||
<tr><td id="CurPA"></td></tr>
|
||||
<tr><td id="ValP2"></td></tr>
|
||||
<tr><td id="DiffP2"></td></tr>
|
||||
<tr><td id="VelP2"></td></tr>
|
||||
<tr>
|
||||
<td>P2 State <span id="P2_Mode" class="border"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr><td height="20px" colspan="2"></td></tr>
|
||||
<tr>
|
||||
<td class="right">System</td>
|
||||
<td id="ACS_BTA" class="border"></td>
|
||||
<td></td>
|
||||
<td class="right">Focus</td>
|
||||
<td id="Tel_Focus" class="border"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">State</td>
|
||||
<td id="Tel_Mode" class="border"></td>
|
||||
<td></td>
|
||||
<td class="right">Focus value</td>
|
||||
<td id="ValFoc" class="border"></td>
|
||||
</tr>
|
||||
<table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
134
BTApanels/BTA.html.ru
Normal file
134
BTApanels/BTA.html.ru
Normal file
@ -0,0 +1,134 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>éÎÆÏÒÍÁÃÉÑ âôá</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=koi8-r">
|
||||
<meta http-equiv="refresh" content="600">
|
||||
|
||||
<!--meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="pragma" content="no-cache"-->
|
||||
|
||||
<link href="panels.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="panels.js" language="javascript"></script>
|
||||
</head>
|
||||
<body onload="init('BTA');">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th class="border" colspan="3" id="header"><h1>éÎÆÏÒÍÁÃÉÑ Ï âôá</h1><br>
|
||||
<div class="topright hand" id="stop"></div>
|
||||
<div class="topleft" id="reqmsgs"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>äÁÔÁ: <span id="Date"></span></td>
|
||||
<td>íÏÓËÏ×ÓËÏÅ ×ÒÅÍÑ: <span id="Mtime"></span></td>
|
||||
<td>ú×ÅÚÄÎÏÅ ×ÒÅÍÑ: <span id="Stime"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</th></tr>
|
||||
<tr>
|
||||
<td style="max-width: 800px;" width="50%" class="border">
|
||||
<img id="BigIMG" width="100%">
|
||||
</td>
|
||||
<td style="max-width: 50%;" class="border">
|
||||
<table>
|
||||
<tr>
|
||||
<td width="66%">
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>áÚÉÍÕÔ</td>
|
||||
<td>úÅÎÉÔÎÏÅ ÒÁÓÓÔÏÑÎÉÅ</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><img id="A"></td>
|
||||
<td><img id="Z"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">ãÅÌØ</td>
|
||||
<td id="CurAzim"></td>
|
||||
<td id="CurZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">ðÏÌÏÖÅÎÉÅ</td>
|
||||
<td id="ValAzim"></td>
|
||||
<td id="ValZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">òÁÚÎÏÓÔØ</td>
|
||||
<td id="DiffAzim"></td>
|
||||
<td id="DiffZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">óËÏÒÏÓÔØ</td>
|
||||
<td id="VelAzim"></td>
|
||||
<td id="VelZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">ëÏÒÒÅËÃÉÑ</td>
|
||||
<td id="CorrAzim"></td>
|
||||
<td id="CorrZenD"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>ðÒÑÍÏÅ ×ÏÓÈÏÖÄÅÎÉÅ</td>
|
||||
<td>óËÌÏÎÅÎÉÅ</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">ôÅËÕÝÉÅ</td>
|
||||
<td id="CurAlpha"></td>
|
||||
<td id="CurDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">éÓÈÏÄÎÙÅ</td>
|
||||
<td id="SrcAlpha"></td>
|
||||
<td id="SrcDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">÷×ÅÄÅÎÎÙÅ</td>
|
||||
<td id="InpAlpha"></td>
|
||||
<td id="InpDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">ëÏÒÒÅËÃÉÑ</td>
|
||||
<td id="CorrAlpha"></td>
|
||||
<td id="CorrDelta"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">ðÏÌÏÖÅÎÉÅ</td>
|
||||
<td id="TelAlpha"></td>
|
||||
<td id="TelDelta"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="padding-left: 30px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="right">óÉÓÔÅÍÁ</td>
|
||||
<td id="ACS_BTA" class="border"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">óÏÓÔÏÑÎÉÅ</td>
|
||||
<td id="Tel_Mode" class="border"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right">æÏËÕÓ</td>
|
||||
<td id="Tel_Focus" class="border"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="label">úÎÁÞÅÎÉÅ ÆÏËÕÓÁ</div>
|
||||
<div class="border" id="ValFoc"></div>
|
||||
<div class="label">P2</div>
|
||||
<img id="P2">
|
||||
<div>ãÅÌØ: <span id="CurPA"></span></div>
|
||||
<div>ðÏÌÏÖÅÎÉÅ: <span id="ValP2"></span></div>
|
||||
<div class="label">óÏÓÔÏÑÎÉÅ</div>
|
||||
<div class="border" id="P2_Mode"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
14
BTApanels/index.html
Normal file
14
BTApanels/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>éÎÆÏÒÍÁÃÉÏÎÎÙÅ ÐÁÎÅÌÉ âôá</title>
|
||||
<link href="panels.css" type="text/css" rel="stylesheet">
|
||||
<meta http-equiv="content-type" content="text/html; charset=koi8-r">
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>éÎÆÏÒÍÁÃÉÏÎÎÙÅ ÐÁÎÅÌÉ âôá</h1>
|
||||
<a href="weather.html">ðÏÇÏÄÁ</a><br>
|
||||
<a href="BTA.html">óÏÓÔÏÑÎÉÅ ÔÅÌÅÓËÏÐÁ</a>
|
||||
</div>
|
||||
</body></html>
|
||||
90
BTApanels/panels.css
Normal file
90
BTApanels/panels.css
Normal file
@ -0,0 +1,90 @@
|
||||
body{
|
||||
margin: 2px;
|
||||
background: #DDD;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
h1, h2{
|
||||
text-align: center; font-weight: bold;
|
||||
margin: -10px; padding: 0px; font-size: 250%;
|
||||
}
|
||||
|
||||
h2{ font-size: 140%; color: #FF0;}
|
||||
|
||||
h3{
|
||||
text-align: left; font-weight: bold; font-style: italic;
|
||||
margin: 0px; padding: 0px; font-size: 110%;
|
||||
}
|
||||
|
||||
div{
|
||||
text-align: center; padding: 2px; margin: 2px;
|
||||
}
|
||||
.inline{margin: -5px;}
|
||||
|
||||
.header{
|
||||
width: 100%; height: 100px; text-align: center; border: 2px solid;
|
||||
}
|
||||
|
||||
.bold {font-weight: bold;}
|
||||
|
||||
td,th {padding-bottom: 4px; padding-top: 4px; text-align: center; vertical-align: top;}
|
||||
th {background: #000; color: #FFF;}
|
||||
|
||||
.border {
|
||||
border: 2px solid; padding-left: 5px; padding-right: 5px; vertical-align: middle;
|
||||
}
|
||||
|
||||
.top {vertical-align: top;}
|
||||
.mid {text-align: center; vertical-align: middle;}
|
||||
.right{text-align: right;}
|
||||
.topright, .topleft {
|
||||
position: absolute; top: 20px;
|
||||
font-weight: normal; font-size: 70%;
|
||||
}
|
||||
.topright {right: 20px;}
|
||||
.topleft {left: 20px;}
|
||||
|
||||
.label{margin-top: 20px;}
|
||||
|
||||
.hand {color: #0F0; cursor: pointer; font-weight: bold;}
|
||||
|
||||
.Green {background: #0F0;}
|
||||
.Blue {background: #00F;}
|
||||
.Cyan {background: #0FF;}
|
||||
.Red {background: #F00;}
|
||||
.Yellow{background: #FF0;}
|
||||
.White {background: #FFF;}
|
||||
.Black {background: #000; color: #FFF;}
|
||||
|
||||
.C {text-align: center;}
|
||||
|
||||
.Cb {text-align: center; padding: 5px;
|
||||
border: solid 1px black;}
|
||||
.b {border: solid 1px black;}
|
||||
|
||||
.La {float: left;}
|
||||
|
||||
.s {width: 70px;}
|
||||
|
||||
.small{width: 25px; height: 20px;}
|
||||
|
||||
.Light {background: #DDE;}
|
||||
|
||||
.chooser{
|
||||
display: none; border-radius: 5px; position: absolute;
|
||||
left: 20px; top: 20px; border: solid 1px black; background-color: #DDD;
|
||||
}
|
||||
|
||||
.helper {position: fixed; left: 3px; top: 3px; color: green; cursor: pointer;}
|
||||
#helptip{
|
||||
position: fixed; background-color: #BFE; border-radius: 5px;
|
||||
color: black; max-width: 400px; max-height: 500px; padding: 5px;
|
||||
}
|
||||
.redtxt {color: red; margin-top: 20px;}
|
||||
|
||||
.full{width: 100%;}
|
||||
|
||||
.pre{white-space:pre; text-indent: 0px;}
|
||||
|
||||
328
BTApanels/panels.js
Normal file
328
BTApanels/panels.js
Normal file
@ -0,0 +1,328 @@
|
||||
var Stimeout, Itimeout; // ÔÁÊÍÅÒÙ ÄÌÑ ÏÂÎÏ×ÌÅÎÉÑ ×ÒÅÍÅÎÉ É ÉÚÏÂÒÁÖÅÎÉÑ
|
||||
var Rtimeout, Etimeout; // ÔÁÊÍÅÒ ÚÁÐÒÏÓÏ×, ÔÁÊÍÁÕÔ ÓÏÏÂÝ. Ï ÏÛÉÂËÅ
|
||||
const Stimeout_rate = 500, Itimeout_rate = 30000, Rtimeout_rate = 5000;
|
||||
var ImageSrc = new Array(2); // ÁÄÒÅÓ ÉÚÏÂÒÁÖÅÎÉÑ
|
||||
var Isrc = 0; // ÎÏÍÅÒ ÁÄÒÅÓÁ ÉÚÏÂÒÁÖÅÎÉÑ
|
||||
var oldDate = 0; // ÄÁÔÁ/×ÒÅÍÑ ÎÁ ÍÏÍÅÎÔ ÐÏÓÌÅÄÎÅÇÏ ÏÂÎÏ×ÌÅÎÉÑ (× ÍÓ)
|
||||
var MskTime, SidTime; // ÍÏÓËÏ×ÓËÏÅ É Ú×ÅÚÄÎÏÅ ×ÒÅÍÑ
|
||||
var PanelType;
|
||||
|
||||
const paramsURL = [ "http://tb.sao.ru/cgi-bin/eddy/bta_print.cgi",
|
||||
"http://ishtar.sao.ru/cgi-bin/bta_print.cgi"];
|
||||
const MeteoURL = [ "http://tb.sao.ru/cgi-bin/eddy/tempmon",
|
||||
"http://ishtar.sao.ru/cgi-bin/tempmon"];
|
||||
var URLcntr = 0;
|
||||
const windURL = "http://ztcs.sao.ru/meteo/wind.png";
|
||||
const BTAURL = "http://tb.sao.ru/tcs/ctrl/bta_img.cgi?size=150&mode=";
|
||||
const GuideURL = "http://n2.sao.ru/webcam/webcam_n2_0.jpeg";
|
||||
const USNOURL = "http://n2.sao.ru/ua2/gd15_ua2_jpeg.cgi?size=384&coord=cur";
|
||||
const myURL = "http://ishtar.sao.ru/BTApanels/";
|
||||
|
||||
function $(Id){
|
||||
return document.getElementById(Id);
|
||||
}
|
||||
|
||||
function _(Name){
|
||||
return document.getElementsByTagName(Name);
|
||||
}
|
||||
|
||||
function chBigImg(){
|
||||
Isrc = (Isrc == 0) ? 1:0;
|
||||
$('BigIMG').src = ImageSrc[Isrc] + "?" + Math.random();
|
||||
}
|
||||
|
||||
function init(panelName){
|
||||
$('reqmsgs').innerHTML = "Loading...";
|
||||
MskTime = new Date();
|
||||
SidTime = new Date();
|
||||
make_menu(panelName);
|
||||
PanelType = panelName;
|
||||
if(panelName == "BTA")
|
||||
ImageSrc[0] = ImageSrc[1] = "http://tb.sao.ru/webcam/webcam_sky_1_maxi.jpeg";
|
||||
else if(panelName == "meteo"){
|
||||
ImageSrc[1] = "http://zserv.sao.ru/webcam/webcam_zserv_2_maxi.jpeg";
|
||||
ImageSrc[0] = "http://zserv.sao.ru/webcam/webcam_zserv_3_maxi.jpeg";
|
||||
//ImageSrc[1] = "http://zsky.sao.ru/mjpg/4/video.mjpg";
|
||||
}
|
||||
$('BigIMG').onclick = chBigImg;
|
||||
$('BigIMGlabel').onclick = chBigImg;
|
||||
startTimers();
|
||||
}
|
||||
|
||||
function make_menu(panelName){
|
||||
var chooserTimeout;
|
||||
var names = [ "BTA", "meteo" ];
|
||||
var URLS = [ "BTA.html", "weather.html" ];
|
||||
var itemstext = [ "Bta info", "meteo info" ];
|
||||
var l = names.length, i;
|
||||
var menu = $('menu');
|
||||
menu.innerHTML = "Choose panel's info";
|
||||
var chooser = document.createElement("div");
|
||||
chooser.className = "chooser";
|
||||
chooser.id = "chooser";
|
||||
chooser.onmouseout = function(){
|
||||
chooserTimeout=setTimeout("$('chooser').style.display='none';",2000);};
|
||||
chooser.onmouseover = function(){ clearTimeout(chooserTimeout); };
|
||||
menu.appendChild(chooser);
|
||||
menu.onclick = function(){ showhide('chooser'); };
|
||||
for(i = 0; i < l; i++){
|
||||
if(names[i] == panelName) continue;
|
||||
var item = document.createElement("div");
|
||||
item.innerHTML = "<a href=\""+myURL+URLS[i]+"\">"+itemstext[i]+"</a>";
|
||||
chooser.appendChild(item);
|
||||
}
|
||||
}
|
||||
|
||||
function showhide(id){
|
||||
style = $(id).style.display;
|
||||
if(style == "block") $(id).style.display = "none";
|
||||
else $(id).style.display = "block";
|
||||
}
|
||||
|
||||
function refreshTimer(){
|
||||
var d = new Date();
|
||||
var diff = d.getTime() - oldDate;
|
||||
//oldDate = d.getTime();
|
||||
clearTimeout(Stimeout);
|
||||
$('Date').innerHTML = formatDate(MskTime);
|
||||
if(typeof(M_time) != "undefined"){
|
||||
//MskTime.setTime(MskTime.getTime() + diff);
|
||||
//$('Mtime').innerHTML = formatTime(MskTime);
|
||||
d.setTime(MskTime.getTime() + diff);
|
||||
$('Mtime').innerHTML = formatTime(d);
|
||||
}
|
||||
if(typeof(S_time) != "undefined"){
|
||||
//SidTime.setTime(SidTime.getTime() + diff);
|
||||
//$('Stime').innerHTML = formatTime(SidTime);
|
||||
d.setTime(SidTime.getTime() + diff);
|
||||
$('Stime').innerHTML = formatTime(d);
|
||||
}
|
||||
Stimeout = setTimeout(refreshTimer, Stimeout_rate);
|
||||
delete(d);
|
||||
}
|
||||
|
||||
function sendR(){
|
||||
var request;
|
||||
sendRequest(request, paramsURL[URLcntr], "", parceReqStr);
|
||||
}
|
||||
|
||||
function refreshImage(){
|
||||
var yesterday = oldDate/1000 - 86400;
|
||||
var imH = (window.innerHeight-$('header').offsetHeight-40)/4-20;
|
||||
if(imH < 100) imH = 100;
|
||||
function refreshIMG(id, URL){
|
||||
/*var oldIMG = $(id);
|
||||
var newIMG = document.createElement("img");
|
||||
var parent = oldIMG.parentNode;
|
||||
newIMG.src = URL;
|
||||
parent.insertBefore(newIMG, oldIMG);
|
||||
oldIMG.src = null;
|
||||
parent.removeChild(oldIMG);
|
||||
delete(oldIMG);
|
||||
newIMG.id = id;*/
|
||||
$(id).src = URL;
|
||||
}
|
||||
var params = MeteoURL[URLcntr] + "?Tstart=" + yesterday + "&Stat=31&height="+imH + "&Gtype=0&Graph=";
|
||||
clearTimeout(Itimeout);
|
||||
var rnd = Math.random();
|
||||
refreshIMG('BigIMG', ImageSrc[Isrc] + "?" + rnd);
|
||||
if(PanelType == "meteo"){
|
||||
// ×ÒÅÍÅÎÎÏ ×ÍÅÓÔÏ ÏÂÌÁËÏ× É ËÁÞÅÓÔ×Á ÉÚÏÂÒÁÖÅÎÉÑ ÐÉÛÅÍ ÄÁ×ÌÅÎÉÅ É ×ÌÁÖÎÏÓÔØ
|
||||
refreshIMG('clouds', params + "16");
|
||||
refreshIMG('temp', params + "7");
|
||||
refreshIMG('wind', params + "8");
|
||||
refreshIMG('seeing', params + "32");
|
||||
refreshIMG('winddir',windURL+ "?" + rnd);
|
||||
refreshIMG('GuideIMG', GuideURL + "?" + rnd);
|
||||
refreshIMG('CatIMG', USNOURL + "&" + rnd);
|
||||
}
|
||||
else if(PanelType == "BTA"){
|
||||
refreshIMG('A', BTAURL + "1&" + rnd);
|
||||
refreshIMG('Z', BTAURL + "2&" + rnd);
|
||||
refreshIMG('P2', BTAURL + "3&" + rnd);
|
||||
}
|
||||
Itimeout = setTimeout(refreshImage, Itimeout_rate);
|
||||
}
|
||||
|
||||
function handleError(msg) {
|
||||
clearTimeout(Etimeout);
|
||||
$('reqmsgs').innerHTML = "<b>ïÛÉÂËÁ xmlhttprequest:<b>" + msg;
|
||||
Etimeout = setTimeout(function(){$('reqmsgs').innerHTML = "";}, 5000);
|
||||
URLcntr++; if(URLcntr > 1) URLcntr = 0;
|
||||
sendR();
|
||||
refreshImage();
|
||||
refreshTimer();
|
||||
}
|
||||
|
||||
function sendRequest(request, CGI_PATH, req_STR, fn_OK){
|
||||
var timeout_id, str;
|
||||
if(window.XMLHttpRequest){
|
||||
request = new XMLHttpRequest();
|
||||
if(request.overrideMimeType)
|
||||
request.overrideMimeType("text/plain;");
|
||||
}else{
|
||||
if(window.ActiveXObject){
|
||||
var sign_a = ['MSXML2.XMLHTTP.6.0',
|
||||
'MSXML2.XMLHTTP.5.0',
|
||||
'MSXML2.XMLHTTP.4.0',
|
||||
'MSXML2.XMLHTTP.3.0',
|
||||
'MSXML2.XMLHTTP',
|
||||
'Microsoft.XMLHTTP'];
|
||||
for(var i=0, l=sign_a.length; i<l; i++)
|
||||
try{
|
||||
request = new ActiveXObject(sign_a[i]);
|
||||
i = l;
|
||||
}catch(e){}
|
||||
}
|
||||
}
|
||||
if(!request){
|
||||
handleError("Your browser doesn't support web requests");
|
||||
return;
|
||||
}
|
||||
request.onreadystatechange=function(){
|
||||
if(request.readyState == 4){
|
||||
if(request.status == 200){
|
||||
clearTimeout(timeout_id);
|
||||
fn_OK(request);
|
||||
}
|
||||
else{
|
||||
clearTimeout(timeout_id);
|
||||
if(request.status)
|
||||
handleError(request.statusText);
|
||||
else handleError("Data transfer error");
|
||||
}
|
||||
}
|
||||
}
|
||||
request.open("POST", CGI_PATH, true);
|
||||
request.send(req_STR);
|
||||
timeout_id = setTimeout(function(){
|
||||
request.onreadystatechange = null;request.abort();handleError("Time over");}, 5000);
|
||||
}
|
||||
|
||||
function setDate(date, dateStr){
|
||||
var tm = dateStr.split(':');
|
||||
if(tm.length != 3) return false;
|
||||
date.setSeconds(tm[2]);
|
||||
date.setMinutes(tm[1]);
|
||||
date.setHours(tm[0]);
|
||||
return true
|
||||
}
|
||||
|
||||
function _2(num){
|
||||
var A = Math.round(num).toString();
|
||||
if(A.length > 1) return A;
|
||||
else return ("00" + A).slice(-2);
|
||||
}
|
||||
|
||||
function formatDate(date){
|
||||
if(date.toLocaleFormat) return date.toLocaleFormat("%d.%m.%Y");
|
||||
else
|
||||
return _2(date.getDate())+"."+_2(1+date.getMonth())+"."+date.getFullYear();
|
||||
}
|
||||
|
||||
function formatTime(date){
|
||||
if(date.toLocaleFormat) return date.toLocaleFormat("%H:%M:%S");
|
||||
else
|
||||
return _2(date.getHours())+":"+_2(date.getMinutes())+":"+_2(date.getSeconds());
|
||||
}
|
||||
|
||||
function parceReqStr(request){
|
||||
var i, l, lines, pair, parms, el;
|
||||
clearTimeout(Stimeout);
|
||||
clearTimeout(Rtimeout);
|
||||
lines = request.responseText.split('\n');
|
||||
for(i=0, l=lines.length; i<l; i++)
|
||||
if(lines[i].search('=') != -1){
|
||||
eval(lines[i]);
|
||||
parms = lines[i].split('=');
|
||||
if(el = $(parms[0])) el.innerHTML = eval(parms[0]);
|
||||
}
|
||||
var d = new Date();
|
||||
oldDate = d.getTime();
|
||||
delete(d);
|
||||
$('Date').innerHTML = formatDate(MskTime);
|
||||
if(typeof(M_time) != "undefined"){
|
||||
if(setDate(MskTime, M_time))
|
||||
$('Mtime').innerHTML = formatTime(MskTime);
|
||||
}
|
||||
if(typeof(S_time) != "undefined"){
|
||||
if(setDate(SidTime, S_time))
|
||||
$('Stime').innerHTML = formatTime(SidTime);
|
||||
}
|
||||
Stimeout = setTimeout(refreshTimer, Stimeout_rate);
|
||||
Rtimeout = setTimeout(sendR, Rtimeout_rate);
|
||||
function showVal(elId, val, bad, good){
|
||||
$(elId).innerHTML = Number(val).toFixed(1);
|
||||
var classname = "", absval = Math.abs(val);
|
||||
if(absval >= bad) classname = "Red";
|
||||
else if(absval < good) classname = "Green";
|
||||
else classname = "Yellow";
|
||||
$(elId).className = classname + " border";
|
||||
}
|
||||
if(PanelType == "meteo"){
|
||||
showVal("tempdiff", ValTout - ValTmir, 10, 5);
|
||||
showVal("windspeed", ValWind, 15, 10);
|
||||
if(Blast15 == " " && Blast10 == " ") $('Gust').innerHTML = "no";
|
||||
else showGustTime();
|
||||
}
|
||||
else if(PanelType == "BTA"){
|
||||
$('ACS_BTA').className = "border "+((ACS_BTA!="On")?"Yellow":"Green");
|
||||
$('P2_Mode').className = "border "+((P2_Mode=="Stop")?"Yellow":"Green");
|
||||
var colr = "Yellow";
|
||||
switch(Tel_Mode){
|
||||
case "Pointing" : colr = "Blue"; break;
|
||||
case "Tracking": colr = "Green"; break;
|
||||
case "Seeking" :
|
||||
case "Correction" : colr = "Cyan"; break;
|
||||
case "Off" : colr = "Red"; break;
|
||||
case "Waiting" : colr = "White"; break;
|
||||
case "Testing" : colr = "Black"; break;
|
||||
}
|
||||
$('Tel_Mode').className = "border "+colr;
|
||||
}
|
||||
}
|
||||
|
||||
function showGustTime(){
|
||||
var Gust = $('Gust');
|
||||
var Gtime = Number(Blast15);
|
||||
var pref = ">=15 m/s";
|
||||
if (Gtime > 1440){
|
||||
var G10 = Number(Blast10);
|
||||
if(G10 < 1440){
|
||||
pref = ">=10 m/s";
|
||||
Gtime = G10;
|
||||
}else{
|
||||
Gust.innerHTML = "More than a day ago";
|
||||
return;
|
||||
}
|
||||
}
|
||||
var now = new Date();
|
||||
var h = Math.floor(Gtime/60);
|
||||
now.setTime(MskTime.getTime() - Gtime * 60000);
|
||||
var str = (Gtime < 1) ? _2(Gtime)+"s" : ((Gtime < 60)? _2(Gtime)+"m" :
|
||||
_2(h)+"h "+_2(Gtime%h)+"m");
|
||||
Gust.innerHTML = pref+"<br>"+_2(now.getHours())+":"+_2(now.getMinutes())+"<br>("+str+" ago)";
|
||||
if(Gtime >= 60) Gust.className = "border";
|
||||
else Gust.className = "Yellow border";
|
||||
delete(now);
|
||||
}
|
||||
|
||||
function stopTimers(){
|
||||
clearTimeout(Stimeout);
|
||||
clearTimeout(Itimeout);
|
||||
clearTimeout(Rtimeout);
|
||||
$('stop').innerHTML="Start refreshing";
|
||||
$('stop').onclick=startTimers;
|
||||
}
|
||||
|
||||
function startTimers(){
|
||||
sendR();
|
||||
$('stop').innerHTML="Stop refreshing";
|
||||
$('stop').onclick=stopTimers;
|
||||
var d = new Date();
|
||||
oldDate = d.getTime();
|
||||
delete(d);
|
||||
refreshImage();
|
||||
clearTimeout(Etimeout);
|
||||
Etimeout = setTimeout(function(){$('reqmsgs').innerHTML = "";}, 1000);
|
||||
}
|
||||
63
BTApanels/weather.html
Normal file
63
BTApanels/weather.html
Normal file
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Meteo data</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=koi8-r">
|
||||
<meta http-equiv="refresh" content="70">
|
||||
|
||||
<!--meta http-equiv="expires" content="Thu, 01 Jan 1970 00:00:01 GMT">
|
||||
<meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate, post-check=0, pre-check=0">
|
||||
<meta http-equiv="pragma" content="no-cache"-->
|
||||
|
||||
<link href="panels.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="panels.js" language="javascript"></script>
|
||||
</head>
|
||||
<body onload="init('meteo');">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th class="border" colspan="3" id="header"><h1>Meteo data</h1><br>
|
||||
<div class="topright hand" id="stop"></div>
|
||||
<div class="topleft"><div class="hand" id="menu"></div><div id="reqmsgs"></div></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><h2>Date: <span id="Date"></span></h2></td>
|
||||
<td><h2>Moscow time: <span id="Mtime"></span></h2></td>
|
||||
<td><h2>Sidereal time: <span id="Stime"></span></h2></td>
|
||||
</tr>
|
||||
</table>
|
||||
</th></tr>
|
||||
<tr>
|
||||
<td style="max-width: 800px;" width="45%" class="border">
|
||||
<div id="BigIMGlabel">Click on image to change videoserver</div>
|
||||
<img id="BigIMG" width="95%"><br>
|
||||
<img id="GuideIMG" width="49%">
|
||||
<img id="CatIMG" width="49%">
|
||||
</td>
|
||||
<td style="max-width: 50%;" class="border top">
|
||||
<img width="100%" id="clouds">
|
||||
<div class="inline">Temperature: external <span id="ValTout"></span><sup>o</sup>C,
|
||||
in-dome <span id="ValTind"></span><sup>o</sup>C,
|
||||
mirror <span id="ValTmir"></span><sup>o</sup>C
|
||||
</div>
|
||||
<img width="100%" id="temp">
|
||||
<img width="100%" id="wind">
|
||||
<img width="100%" id="seeing">
|
||||
</td>
|
||||
<td class="border" width="150px">
|
||||
<div class="label">Sky</div>
|
||||
<div id="weather" class="Yellow border">unknown</div>
|
||||
<div class="label">Temp. difference</div>
|
||||
<div id="tempdiff" class="border"></div>
|
||||
<div class="label">Wind speed</div>
|
||||
<div id="windspeed" class="border"></div>
|
||||
<div class="label">Last gust time</div>
|
||||
<div id="Gust" class="border"></div>
|
||||
<div class="label">Wind direction</div>
|
||||
<img width="100%" id="winddir">
|
||||
<div class="label">Seeing</div>
|
||||
<div id="seeingval" class="border">unknown</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
64
BTApanels/weather.html.ru
Normal file
64
BTApanels/weather.html.ru
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>íÅÔÅÏÒÏÌÏÇÉÞÅÓËÉÅ ÄÁÎÎÙÅ</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=koi8-r">
|
||||
<meta http-equiv="refresh" content="600">
|
||||
|
||||
<!--meta http-equiv="expires" content="Thu, 01 Jan 1970 00:00:01 GMT">
|
||||
<meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate, post-check=0, pre-check=0">
|
||||
<meta http-equiv="pragma" content="no-cache"-->
|
||||
|
||||
<link href="panels.css" rel="stylesheet" type="text/css">
|
||||
<script type="text/javascript" src="panels.js" language="javascript"></script>
|
||||
</head>
|
||||
<body onload="init('meteo');">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th class="border" colspan="3" id="header"><h1>íÅÔÅÏÒÏÌÏÇÉÞÅÓËÉÅ ÄÁÎÎÙÅ</h1><br>
|
||||
<div class="topright hand" id="stop"></div>
|
||||
<div class="topleft" id="reqmsgs"></div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>äÁÔÁ: <span id="Date"></span></td>
|
||||
<td>íÏÓËÏ×ÓËÏÅ ×ÒÅÍÑ: <span id="Mtime"></span></td>
|
||||
<td>ú×ÅÚÄÎÏÅ ×ÒÅÍÑ: <span id="Stime"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</th></tr>
|
||||
<tr>
|
||||
<td style="max-width: 800px;" width="45%" class="border">
|
||||
<img id="BigIMG" width="100%"><br>
|
||||
<img id="GuideIMG" width="49%">
|
||||
<img id="CatIMG" width="49%">
|
||||
</td>
|
||||
<td style="max-width: 50%;" class="border">
|
||||
<img width="100%" id="clouds">
|
||||
<div class="inline">ôÅÍÐÅÒÁÔÕÒÁ: ×ÎÅÛÎÑÑ <span id="ValTout"></span><sup>o</sup>C,
|
||||
×ÎÕÔÒÅÎÎÑÑ <span id="ValTind"></span><sup>o</sup>C,
|
||||
ÚÅÒËÁÌÁ <span id="ValTmir"></span><sup>o</sup>C
|
||||
</div>
|
||||
<img width="100%" id="temp">
|
||||
<img width="100%" id="wind">
|
||||
<img width="100%" id="seeing">
|
||||
</td>
|
||||
<td class="border" width="150px">
|
||||
<div class="label">ïÂÌÁÞÎÏÓÔØ</div>
|
||||
<div id="weather" class="Yellow border">--</div>
|
||||
<div class="label">òÁÚÎÏÓÔØ ÔÅÍÐÅÒÁÔÕÒ</div>
|
||||
<div id="tempdiff" class="border"></div>
|
||||
<div class="label">÷ÒÅÍÑ ÐÅÒÅÐÁÄÁ ÔÅÍÐÅÒÁÔÕÒÙ >10<sup>o</sup>C</div>
|
||||
<div id="Blast10" class="border"></div>
|
||||
<div class="label">óËÏÒÏÓÔØ ×ÅÔÒÁ</div>
|
||||
<div id="windspeed" class="border"></div>
|
||||
<div class="label">÷ÒÅÍÑ ÐÏÓÌÅÄÎÅÇÏ ÐÏÒÙ×Á >15Í/Ó</div>
|
||||
<div id="Blast15" class="border"></div>
|
||||
<div class="label">îÁÐÒÁ×ÌÅÎÉÅ ×ÅÔÒÁ</div>
|
||||
<img width="100%" id="winddir">
|
||||
<div class="label">ëÁÞÅÓÔ×Ï ÉÚÏÂÒÁÖÅÎÉÑ</div>
|
||||
<div id="seeingval" class="border">--</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
7
bta_print.cgi
Executable file
7
bta_print.cgi
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
echo "Access-Control-Allow-Origin: http://ishtar.sao.ru"
|
||||
echo "Access-Control-Allow-Headers: Content-Type, X-Requested-With"
|
||||
#echo "Access-Control-Expose-Headers: Location"
|
||||
echo "Access-Control-Allow-Methods: POST, GET"
|
||||
echo -e "Content-Type: multipart/form-data\n\n"
|
||||
/usr/local/bin/bta_print 2>/dev/null
|
||||
Loading…
x
Reference in New Issue
Block a user