diff --git a/dashboard.py b/dashboard.py index c01605c..3666a1a 100755 --- a/dashboard.py +++ b/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) diff --git a/testing.html b/index.html similarity index 71% rename from testing.html rename to index.html index 8d8d144..d13eaaf 100644 --- a/testing.html +++ b/index.html @@ -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 @@
- + + Your browser doe snot support HTML canvas Your browser doe snot support HTML canvas @@ -98,5 +108,6 @@ setInterval(time, 1000); +