add grafana panel
This commit is contained in:
parent
3c49d126ae
commit
4e3e52234e
49
dashboard.py
49
dashboard.py
|
@ -275,25 +275,32 @@ def SetActiveBeamLine(BeamLineName):
|
|||
|
||||
class IsotopeInfo():
|
||||
def __init__(self, A, Sym, energy, rate):
|
||||
self.Label1 = Label(canvas, text = A, fg = 'White', bg = 'black', bd = 0, font = ("Arial", 48))
|
||||
self.Label2 = Label(canvas, text = Sym, fg = 'White', bg = 'black', bd = 0, font = ("Arial", 96))
|
||||
self.Label1.place(x = 1600, y = 500, anchor = NE)
|
||||
self.Label2.place(x = 1600, y = 500, anchor = NW)
|
||||
|
||||
self.Energy = Label(canvas, text = " @ " + str(energy) + " MeV/u", fg = 'White', bg = 'black', bd = 0, font = ("Arial", 96))
|
||||
self.Energy.place(x = 1700, y = 500, anchor = NW)
|
||||
|
||||
self.rateOrder = int(math.log(rate, 10));
|
||||
self.rateDigi = rate/ math.pow(10, self.rateOrder)
|
||||
|
||||
self.rate1 = Label(canvas, text = ("%.2f x 10" % self.rateDigi), fg = 'White', bg = 'black', bd = 0, font = ("Arial", 70))
|
||||
self.rate1.place(x = 2000, y = 700, anchor = NE)
|
||||
|
||||
self.rate2 = Label(canvas, text = ("%d" % self.rateOrder), fg = 'White', bg = 'black', bd = 0, font = ("Arial", 35))
|
||||
self.rate2.place(x = 2000, y = 700, anchor = NW)
|
||||
|
||||
self.rate3 = Label(canvas, text = "pps", fg = 'White', bg = 'black', bd = 0, font = ("Arial", 70))
|
||||
self.rate3.place(x = 2050, y = 700, anchor = NW)
|
||||
if A > 0 :
|
||||
self.Label1 = Label(canvas, text = A, fg = 'White', bg = 'black', bd = 0, font = ("Arial", 48))
|
||||
self.Label2 = Label(canvas, text = Sym, fg = 'White', bg = 'black', bd = 0, font = ("Arial", 96))
|
||||
self.Label1.place(x = 1600, y = 500, anchor = NE)
|
||||
self.Label2.place(x = 1600, y = 500, anchor = NW)
|
||||
|
||||
self.Energy = Label(canvas, text = " @ " + str(energy) + " MeV/u", fg = 'White', bg = 'black', bd = 0, font = ("Arial", 96))
|
||||
self.Energy.place(x = 1770, y = 500, anchor = NW)
|
||||
|
||||
self.rateOrder = int(math.log(rate, 10));
|
||||
self.rateDigi = rate/ math.pow(10, self.rateOrder)
|
||||
|
||||
self.rate1 = Label(canvas, text = ("%.2f x 10" % self.rateDigi), fg = 'White', bg = 'black', bd = 0, font = ("Arial", 70))
|
||||
self.rate1.place(x = 2000, y = 700, anchor = NE)
|
||||
|
||||
self.rate2 = Label(canvas, text = ("%d" % self.rateOrder), fg = 'White', bg = 'black', bd = 0, font = ("Arial", 35))
|
||||
self.rate2.place(x = 2000, y = 700, anchor = NW)
|
||||
|
||||
self.rate3 = Label(canvas, text = "pps", fg = 'White', bg = 'black', bd = 0, font = ("Arial", 70))
|
||||
self.rate3.place(x = 2050, y = 700, anchor = NW)
|
||||
|
||||
else:
|
||||
self.Label2 = Label(canvas, text = "No Beam", fg = 'White', bg = 'black', bd = 0, font = ("Arial", 96))
|
||||
self.Label2.place(x = 1600, y = 500, anchor = NW)
|
||||
|
||||
|
||||
class Clock():
|
||||
def __init__(self):
|
||||
|
@ -524,7 +531,11 @@ Clarion2 = DetectorStation( bl2c_2.GetExitPos(), 100, "CLARION-2", BeamElementCo
|
|||
#==================== Labels and info
|
||||
clock = Clock()
|
||||
|
||||
IsotopeInfo(2, "H", 4.6, 6.1e+9)
|
||||
#BeamInfo = IsotopeInfo(2, "H", 4.6, 6.1e+9)
|
||||
BeamInfo = IsotopeInfo(3, "He", 5, 6.1e+9)
|
||||
#BeamInfo = IsotopeInfo( 0, "Off", 0, 0)
|
||||
|
||||
|
||||
|
||||
label = Label(canvas, text='hahaha')
|
||||
label.place(x = windowSize[0] * 0.9, y = blS.GetExitPos()[1] - 100)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
background-color : black;
|
||||
}
|
||||
|
||||
#iframe{
|
||||
#iframe1{
|
||||
position:absolute;
|
||||
top : 60%;
|
||||
left : 10%;
|
||||
|
@ -19,6 +19,15 @@
|
|||
height: 35%;
|
||||
z-index:1000;
|
||||
border: 1px solid green;
|
||||
}
|
||||
#iframe2{
|
||||
position:absolute;
|
||||
top : 60%;
|
||||
left : 10%;
|
||||
width: 100;
|
||||
height: 100;
|
||||
z-index:1001;
|
||||
border: 1px solid green;
|
||||
}
|
||||
|
||||
canvas{
|
||||
|
@ -51,7 +60,8 @@
|
|||
|
||||
<div id='clock'></div>
|
||||
|
||||
<iframe src='https://fsunuc.physics.fsu.edu/grafana/' frameborder='2' id="iframe"></iframe>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
@ -98,5 +108,6 @@ setInterval(time, 1000);
|
|||
</script>
|
||||
|
||||
<script src="geo.js"></script>
|
||||
<script src="FoxLabDashBoard/geo.js"></script>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user