done accelerator setting info

This commit is contained in:
Ryan Tang 2023-01-05 16:25:41 -05:00
parent 81455c6d62
commit 3ccf64424b

View File

@ -70,6 +70,15 @@
bottom : 9.6%;
right : 10%;
z-index:1001;
}
#InflectorInfo{
color: black;
position:absolute;
font-size: 15px;
bottom : 19%;
right : 10.1%;
z-index:1001;
}
#TandemInfo{
@ -79,6 +88,20 @@
bottom : 35%;
right : 10%;
z-index:1001;
}
#DipoleInfo{
color: black;
position:absolute;
font-size: 15px;
z-index:1001;
}
#SwitchInfo{
color: black;
position:absolute;
font-size: 15px;
top : 15%;
left : 40%;
z-index:1001;
}
#footnote{
@ -101,6 +124,7 @@
<div id="BeamInfo"></div>
<div id="SrcInfo"></div>
<div id="InflectorInfo"></div>
<div id="TandemInfo"></div>
<div id="DipoleInfo"></div>
<div id="SwitchInfo"></div>
@ -170,36 +194,52 @@ function GetBeamSetting(){
client.send();
}
function BeamSettings(){
GetBeamSetting();
//format beamInfo
let beamKEA = beamEnergy/parseFloat(beamMass);
let beamKEA = beamEnergy/parseFloat(beamMass);'42%'
let beamInfo = "<sup>"+ beamMass + "</sup>" + Sym + "("+ beamCharge + "<sup>+</sup>) " + beamKEA.toFixed(2) + " MeV/u";
document.getElementById("BeamInfo").innerHTML = beamInfo;
//srouce info
document.getElementById("SrcInfo").innerHTML = preAccel + " kV";
//inflector info
document.getElementById("InflectorInfo").innerHTML = inflector + " A";
//tadem info
document.getElementById("TandemInfo").innerHTML = TandemPot + " MV";
destination = beam_Line;
EnableDetector();
lineMotion();
//Dipole info
if( beam_Line == 'RESOLUT'){
document.getElementById("DipoleInfo").style.left = targetRoom2.d2.entracePos[0]-80 + 'px';
document.getElementById("DipoleInfo").style.top = targetRoom2.d2.entracePos[1]-50 + 'px';
}else{
document.getElementById("DipoleInfo").style.left = targetRoom1.dipole.entracePos[0]-80 + 'px';
document.getElementById("DipoleInfo").style.top = targetRoom1.dipole.entracePos[1]-50 + 'px';
}
document.getElementById("DipoleInfo").innerHTML = dipoleField + " G";
//Switching magnet info
if( beam_Line == 'RESOLUT'){
document.getElementById("SwitchInfo").style.left = targetRoom2.fan2.entracePos[0]-80 + 'px';
document.getElementById("SwitchInfo").style.top = targetRoom2.fan2.entracePos[1] + 'px';
}else{
document.getElementById("SwitchInfo").style.left = targetRoom1.fan.entracePos[0]-80 + 'px';
document.getElementById("SwitchInfo").style.top = targetRoom1.fan.entracePos[1] + 'px';
}
document.getElementById("SwitchInfo").innerHTML = SwitchMagnet + " A";
EnableDetector();
}
BeamSettings();
setInterval(BeamSettings, updateTime * 60 * 1000);
lineMotion();
</script>