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%; bottom : 9.6%;
right : 10%; right : 10%;
z-index:1001; z-index:1001;
}
#InflectorInfo{
color: black;
position:absolute;
font-size: 15px;
bottom : 19%;
right : 10.1%;
z-index:1001;
} }
#TandemInfo{ #TandemInfo{
@ -79,6 +88,20 @@
bottom : 35%; bottom : 35%;
right : 10%; right : 10%;
z-index:1001; 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{ #footnote{
@ -101,6 +124,7 @@
<div id="BeamInfo"></div> <div id="BeamInfo"></div>
<div id="SrcInfo"></div> <div id="SrcInfo"></div>
<div id="InflectorInfo"></div>
<div id="TandemInfo"></div> <div id="TandemInfo"></div>
<div id="DipoleInfo"></div> <div id="DipoleInfo"></div>
<div id="SwitchInfo"></div> <div id="SwitchInfo"></div>
@ -170,36 +194,52 @@ function GetBeamSetting(){
client.send(); client.send();
} }
function BeamSettings(){ function BeamSettings(){
GetBeamSetting(); GetBeamSetting();
//format beamInfo //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"; let beamInfo = "<sup>"+ beamMass + "</sup>" + Sym + "("+ beamCharge + "<sup>+</sup>) " + beamKEA.toFixed(2) + " MeV/u";
document.getElementById("BeamInfo").innerHTML = beamInfo; document.getElementById("BeamInfo").innerHTML = beamInfo;
//srouce info //srouce info
document.getElementById("SrcInfo").innerHTML = preAccel + " kV"; document.getElementById("SrcInfo").innerHTML = preAccel + " kV";
//inflector info
document.getElementById("InflectorInfo").innerHTML = inflector + " A";
//tadem info //tadem info
document.getElementById("TandemInfo").innerHTML = TandemPot + " MV"; document.getElementById("TandemInfo").innerHTML = TandemPot + " MV";
destination = beam_Line; destination = beam_Line;
EnableDetector(); //Dipole info
lineMotion(); 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(); BeamSettings();
setInterval(BeamSettings, updateTime * 60 * 1000); setInterval(BeamSettings, updateTime * 60 * 1000);
lineMotion();
</script> </script>