added beamStatus.py, called every 5 sec
This commit is contained in:
parent
3ccf64424b
commit
45af719e29
25
beamStatus.py
Executable file
25
beamStatus.py
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
|
||||
url="http://localhost:8086/write?db=accel"
|
||||
|
||||
import random
|
||||
|
||||
num = random.random()*100
|
||||
|
||||
cmd = "curl -XPOST " + url + " --data-binary " + "\'testing value=" + str(num) + "\'"
|
||||
|
||||
|
||||
|
||||
print("Content-type:text/html\r\n\r\n")
|
||||
|
||||
|
||||
print(cmd)
|
||||
|
||||
os.system(cmd)
|
||||
|
||||
|
||||
|
||||
#print('</body>')
|
||||
#print('</html>')
|
14
geo.js
14
geo.js
|
@ -326,9 +326,9 @@ let sourceLine;
|
|||
{
|
||||
let RFSource1a = new beamRectElement([windowSize[0]*0.9, windowSize[1]*0.9], 0, 40, 100, color.RFsourcce);
|
||||
let RFSource1b = new beamRectElement(RFSource1a.exitPos, 0, 40, 20, color.RFsourcce);
|
||||
let s0 = new beamSpliter(RFSource1b.GetExitPos(120), 50, Math.PI, color.Dipole);
|
||||
let s0 = new beamSpliter(RFSource1b.GetExitPos(120), 80, Math.PI, color.Dipole);
|
||||
|
||||
let tandem = new tandemClass(RFSource1b.GetExitPos(200), 300, 100, color.Tandem);
|
||||
let tandem = new tandemClass(RFSource1b.GetExitPos(200), 300, 200, color.Tandem);
|
||||
|
||||
let q0 = new beamRectElement(tandem.GetExitPos(50), 0, 60, 60, color.Qpole);
|
||||
let df0a = new beamRectElement(q0.GetExitPos(50), 0, 30, 40, color.Deflector);
|
||||
|
@ -341,7 +341,7 @@ let sourceLine;
|
|||
let targetRoom1;
|
||||
{
|
||||
let dipole = new beamDipole(sourceLine.tandem.GetExitPos(300), 80, Math.PI/2, 0, color.Dipole);
|
||||
let fan = new beamSpliter(dipole.GetExitPos(100), 50, -100 * deg, color.Deflector);
|
||||
let fan = new beamSpliter(dipole.GetExitPos(100), 80, -100 * deg, color.Deflector);
|
||||
|
||||
let upperLine;
|
||||
{
|
||||
|
@ -498,7 +498,7 @@ let posArray; // thsi is a collection of the position of beamlines
|
|||
|
||||
let Resolut = [
|
||||
sourceLine.RFSource1b.GetExitPos(0),
|
||||
sourceLine.RFSource1b.GetExitPos(1500),
|
||||
targetRoom2.d2.entracePos,
|
||||
targetRoom2.d2.GetExitPos(0),
|
||||
targetRoom2.d2.GetExitPos(1700),
|
||||
targetRoom2.fan2.GetExitPos(0.7, 500),
|
||||
|
@ -508,7 +508,7 @@ let posArray; // thsi is a collection of the position of beamlines
|
|||
|
||||
let Anasen = [
|
||||
sourceLine.RFSource1b.GetExitPos(0),
|
||||
sourceLine.RFSource1b.GetExitPos(1500),
|
||||
targetRoom2.d2.entracePos,
|
||||
targetRoom2.d2.GetExitPos(0),
|
||||
targetRoom2.d2.GetExitPos(1700),
|
||||
targetRoom2.fan2.GetExitPos(0.5, 500)
|
||||
|
@ -516,7 +516,7 @@ let posArray; // thsi is a collection of the position of beamlines
|
|||
|
||||
let SPS = [
|
||||
sourceLine.RFSource1b.GetExitPos(0),
|
||||
sourceLine.RFSource1b.GetExitPos(1500),
|
||||
targetRoom2.d2.entracePos,
|
||||
targetRoom2.d2.GetExitPos(0),
|
||||
targetRoom2.d2.GetExitPos(1700),
|
||||
targetRoom2.fan2.GetExitPos(0.3, 500),
|
||||
|
@ -525,7 +525,7 @@ let posArray; // thsi is a collection of the position of beamlines
|
|||
|
||||
let Clarion2 = [
|
||||
sourceLine.RFSource1b.GetExitPos(0),
|
||||
sourceLine.RFSource1b.GetExitPos(1500),
|
||||
targetRoom2.d2.entracePos,
|
||||
targetRoom2.d2.GetExitPos(0),
|
||||
targetRoom2.d2.GetExitPos(1700),
|
||||
targetRoom2.fan2.GetExitPos(0.3, 500),
|
||||
|
|
18
index.html
18
index.html
|
@ -190,7 +190,7 @@ function GetBeamSetting(){
|
|||
beam_Line = data[9];
|
||||
SwitchMagnet = data[10];
|
||||
}
|
||||
client.open('GET', "test.py", false);
|
||||
client.open('GET', "beamInfo.py", false);
|
||||
client.send();
|
||||
}
|
||||
|
||||
|
@ -241,6 +241,22 @@ setInterval(BeamSettings, updateTime * 60 * 1000);
|
|||
|
||||
lineMotion();
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function GetBeamStatus(){
|
||||
let client = new XMLHttpRequest();
|
||||
client.onreadystatechange = function() {
|
||||
let data = client.responseText;
|
||||
}
|
||||
client.open('GET', "beamStatus.py", false);
|
||||
client.send();
|
||||
}
|
||||
|
||||
setInterval(GetBeamStatus, 5* 1000);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Reference in New Issue
Block a user