FoxLabDashBoard/index.html

211 lines
4.1 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
2022-12-21 21:11:57 -05:00
<title>Fox's Lab Accelerator Dashboard</title>
</head>
<style>
body{
background-color : black;
}
2022-12-21 21:11:57 -05:00
2022-12-26 17:21:27 -05:00
#iframe1{
2022-12-21 21:11:57 -05:00
position:absolute;
2022-12-22 18:17:38 -05:00
top : 60%;
left : 10%;
width: 60%;
height: 35%;
2022-12-21 21:11:57 -05:00
z-index:1000;
border: 1px solid green;
2022-12-26 17:21:27 -05:00
}
#iframe2{
position:absolute;
top : 60%;
left : 10%;
width: 100;
height: 100;
z-index:1001;
border: 1px solid green;
2022-12-21 21:11:57 -05:00
}
2022-12-22 18:17:38 -05:00
canvas{
width: 99%;
height:98%;
border: 1px solid yellow;
}
#beamLine{
position: absolute;
z-index: 0;
}
#static{
position: absolute;
z-index: 1;
}
#clock{
font-size: 30px;
color: white;
background-color: black;
position: absolute;
z-index: 3;
}
2023-01-05 14:53:50 -05:00
#BeamInfo{
color: orange;
position:absolute;
font-size: 100px;
top : 25%;
left : 35%;
z-index:1001;
}
#SrcInfo{
color: white;
position:absolute;
font-size: 15px;
bottom : 9.6%;
right : 10%;
z-index:1001;
}
#TandemInfo{
color: white;
position:absolute;
font-size: 15px;
bottom : 35%;
right : 10%;
z-index:1001;
}
#footnote{
color: aqua;
position:absolute;
2023-01-05 14:53:50 -05:00
bottom : 2%;
right : 1%;
width: 100;
height: 100;
z-index:1001;
}
</style>
<body>
<div id='clock'></div>
2023-01-05 14:53:50 -05:00
<div id='footnote'></div>
<div id="BeamInfo"></div>
<div id="SrcInfo"></div>
<div id="TandemInfo"></div>
<div id="DipoleInfo"></div>
<div id="SwitchInfo"></div>
2022-12-21 21:11:57 -05:00
<!--<iframe src="http://localhost:3000/d-solo/MFym59G4k/new-dashboard?orgId=1&from=1672071127881&to=1672092727881&theme=dark&panelId=2" id="iframe1"></iframe>-->
<!--<iframe src="http://localhost:3000/d-solo/MFym59G4k/new-dashboard?orgId=1&from=1672071308654&to=1672092908654&panelId=4" id="iframe2"></iframe>-->
<iframe src="http://192.168.0.201:3000/d/MFym59G4k/new-dashboard?orgId=1&from=1672835547268&to=1672857147269" id="iframe1"></iframe>
2022-12-21 21:11:57 -05:00
2022-12-22 18:17:38 -05:00
<canvas width="3840" height="2160" id='beamLine' > Your browser doe snot support HTML canvas</canvas>
<canvas width="3840" height="2160" id='static' > Your browser doe snot support HTML canvas</canvas>
</body>
<!-- ################################################ -->
<script>
2023-01-05 14:53:50 -05:00
function time() {
let clock = document.getElementById('clock');
let d = new Date();
clock.textContent = d;
}
time();
setInterval(time, 1000);
2023-01-05 14:53:50 -05:00
</script>
2023-01-05 14:53:50 -05:00
<script type="text/javascript" src="geo.js"></script>
<script>
let updateTime = 10; //min
document.getElementById("footnote").innerHTML = "Accelrator setting update every " + updateTime + " min.";
var Mass;
var Sym;
var preAccel;
var inflector;
var LEB_volatage;
var TandemPot;
var beamEnergy;
var beamCharge;
var dipoleField;
var beam_Line = 'RESOLUT';
var SwitchMagnet;
function GetBeamSetting(){
let client = new XMLHttpRequest();
client.onreadystatechange = function() {
2023-01-05 14:53:50 -05:00
let data = client.responseText.split(" ");
//alert(data);
2023-01-05 14:53:50 -05:00
beamMass = data[0];
Sym = data[1];
preAccel = data[2];
inflector = data[3];
LEB_volatage = data[4];
TandemPot = data[5];
beamEnergy = parseFloat(data[6]);
beamCharge = parseInt(data[7]);
dipoleField = data[8];
beam_Line = data[9];
SwitchMagnet = data[10];
}
client.open('GET', "test.py", false);
client.send();
}
2023-01-05 14:53:50 -05:00
function BeamSettings(){
GetBeamSetting();
2023-01-05 14:53:50 -05:00
//format beamInfo
let beamKEA = beamEnergy/parseFloat(beamMass);
let beamInfo = "<sup>"+ beamMass + "</sup>" + Sym + "("+ beamCharge + "<sup>+</sup>) " + beamKEA.toFixed(2) + " MeV/u";
document.getElementById("BeamInfo").innerHTML = beamInfo;
2023-01-05 14:53:50 -05:00
//srouce info
document.getElementById("SrcInfo").innerHTML = preAccel + " kV";
2023-01-05 14:53:50 -05:00
//tadem info
document.getElementById("TandemInfo").innerHTML = TandemPot + " MV";
destination = beam_Line;
2023-01-05 14:53:50 -05:00
EnableDetector();
lineMotion();
2023-01-05 14:53:50 -05:00
}
BeamSettings();
setInterval(BeamSettings, updateTime * 60 * 1000);
</script>
<!--
2022-12-26 17:21:27 -05:00
<script src="FoxLabDashBoard/geo.js"></script>
-->
</html>