@@ -49,30 +49,11 @@ def define_test_details_column(self):
4949 columnbase = 0
5050
5151 # Adding operator name label and read entry box
52- self .operator_label = Label (self ,text = "Operator Name:" ,width = 25 )
52+ self .operator_label = Label (self ,text = "Operator Name:" ,width = 15 )
5353 self .operator_label .grid (sticky = W ,row = 1 ,column = columnbase + 0 )
5454
5555 self .operator_entry = Entry (self ,width = 25 )
56- self .operator_entry .grid (sticky = W ,row = 1 ,column = columnbase + 1 )
57-
58- # Adding electronics ID and read entry box
59- self .boxid_label = Label (self ,text = "CE Box ID:" ,width = 25 )
60- self .boxid_label .grid (sticky = W ,row = 3 ,column = columnbase + 0 )
61-
62- self .boxid_entry = Entry (self ,width = 25 )
63- self .boxid_entry .grid (sticky = W ,row = 3 ,column = columnbase + 1 )
64-
65- self .amid_label = Label (self ,text = "Analog MB ID:" ,width = 25 )
66- self .amid_label .grid (sticky = W ,row = 4 ,column = columnbase + 0 )
67-
68- self .amid_entry = Entry (self ,width = 25 )
69- self .amid_entry .grid (sticky = W ,row = 4 ,column = columnbase + 1 )
70-
71- self .fmid_label = Label (self ,text = "FPGA Mezz ID:" ,width = 25 )
72- self .fmid_label .grid (sticky = W ,row = 5 ,column = columnbase + 0 )
73-
74- self .fmid_entry = Entry (self ,width = 25 )
75- self .fmid_entry .grid (sticky = W ,row = 5 ,column = columnbase + 1 )
56+ self .operator_entry .grid (sticky = W ,row = 1 ,column = columnbase + 1 ,columnspan = 2 )
7657
7758 self .wibslot0 = IntVar ()
7859 self .wibslot1 = IntVar ()
@@ -82,40 +63,133 @@ def define_test_details_column(self):
8263 self .wibslot1_button = Checkbutton (self ,text = "WIB Slot 1" , variable = self .wibslot1 )
8364 self .wibslot2_button = Checkbutton (self ,text = "WIB Slot 2" , variable = self .wibslot2 )
8465 self .wibslot3_button = Checkbutton (self ,text = "WIB Slot 3" , variable = self .wibslot3 )
85- self .wibslot0_button .grid (sticky = W ,row = 7 ,column = columnbase )
86- self .wibslot1_button .grid (sticky = W ,row = 8 ,column = columnbase )
87- self .wibslot2_button .grid (sticky = W ,row = 9 ,column = columnbase )
88- self .wibslot3_button .grid (sticky = W ,row = 10 ,column = columnbase )
66+ self .wibslot0_button .grid (sticky = W ,row = 3 ,column = columnbase + 0 )
67+ self .wibslot1_button .grid (sticky = W ,row = 4 ,column = columnbase + 0 )
68+ self .wibslot2_button .grid (sticky = W ,row = 5 ,column = columnbase + 0 )
69+ self .wibslot3_button .grid (sticky = W ,row = 6 ,column = columnbase + 0 )
8970
9071 self .ct_bool = StringVar ()
9172 self .temp_radio1 = Radiobutton (self , text = "Room Temperature" , variable = self .ct_bool , value = 0 )
9273 self .temp_radio2 = Radiobutton (self , text = "Cryo Temperature" , variable = self .ct_bool , value = 1 )
93- self .temp_radio1 .grid (sticky = W ,row = 7 ,column = columnbase + 1 )
94- self .temp_radio2 .grid (sticky = W ,row = 8 ,column = columnbase + 1 )
95-
74+ self .temp_radio1 .grid (sticky = W ,row = 3 ,column = columnbase + 1 )
75+ self .temp_radio2 .grid (sticky = W ,row = 4 ,column = columnbase + 1 )
76+
9677 # Adding electronics ID and read entry box
78+
79+
80+ #Slot 0
81+ self .slotlabel0 = Label (self ,text = "WIB Slot 0:" )
82+ self .slotlabel0 .grid (sticky = W ,row = 8 ,column = columnbase + 0 ,pady = 10 )
83+
84+ self .boxid0_label = Label (self ,text = "CE Box 0 ID:" ,width = 15 )
85+ self .boxid0_label .grid (sticky = W ,row = 9 ,column = columnbase + 0 )
86+
87+ self .boxid0_entry = Entry (self ,width = 15 )
88+ self .boxid0_entry .grid (sticky = W ,row = 9 ,column = columnbase + 1 )
89+
90+ self .amid0_label = Label (self ,text = "Analog MB 0 ID:" ,width = 15 )
91+ self .amid0_label .grid (sticky = W ,row = 10 ,column = columnbase + 0 )
92+
93+ self .amid0_entry = Entry (self ,width = 15 )
94+ self .amid0_entry .grid (sticky = W ,row = 10 ,column = columnbase + 1 )
95+
96+ self .fmid0_label = Label (self ,text = "FPGA Mezz 0 ID:" ,width = 15 )
97+ self .fmid0_label .grid (sticky = W ,row = 11 ,column = columnbase + 0 )
98+
99+ self .fmid0_entry = Entry (self ,width = 15 )
100+ self .fmid0_entry .grid (sticky = W ,row = 11 ,column = columnbase + 1 )
101+
102+ #Slot 1
103+ self .slotlabel1 = Label (self ,text = "WIB Slot 1:" )
104+ self .slotlabel1 .grid (sticky = W ,row = 12 ,column = columnbase + 0 ,pady = 10 )
105+
106+ self .boxid1_label = Label (self ,text = "CE Box 1 ID:" ,width = 15 )
107+ self .boxid1_label .grid (sticky = W ,row = 13 ,column = columnbase + 0 )
108+
109+ self .boxid1_entry = Entry (self ,width = 15 )
110+ self .boxid1_entry .grid (sticky = W ,row = 13 ,column = columnbase + 1 )
111+
112+ self .amid1_label = Label (self ,text = "Analog MB 1 ID:" ,width = 15 )
113+ self .amid1_label .grid (sticky = W ,row = 14 ,column = columnbase + 0 )
114+
115+ self .amid1_entry = Entry (self ,width = 15 )
116+ self .amid1_entry .grid (sticky = W ,row = 14 ,column = columnbase + 1 )
117+
118+ self .fmid1_label = Label (self ,text = "FPGA Mezz 1 ID:" ,width = 15 )
119+ self .fmid1_label .grid (sticky = W ,row = 15 ,column = columnbase + 0 )
120+
121+ self .fmid1_entry = Entry (self ,width = 15 )
122+ self .fmid1_entry .grid (sticky = W ,row = 15 ,column = columnbase + 1 )
123+
124+ #Slot 2
125+ self .slotlabel2 = Label (self ,text = "WIB Slot 2:" )
126+ self .slotlabel2 .grid (sticky = W ,row = 16 ,column = columnbase + 0 ,pady = 10 )
127+
128+ self .boxid2_label = Label (self ,text = "CE Box 2 ID:" ,width = 15 )
129+ self .boxid2_label .grid (sticky = W ,row = 17 ,column = columnbase + 0 )
130+
131+ self .boxid2_entry = Entry (self ,width = 15 )
132+ self .boxid2_entry .grid (sticky = W ,row = 17 ,column = columnbase + 1 )
133+
134+ self .amid2_label = Label (self ,text = "Analog MB 2 ID:" ,width = 15 )
135+ self .amid2_label .grid (sticky = W ,row = 18 ,column = columnbase + 0 )
136+
137+ self .amid2_entry = Entry (self ,width = 15 )
138+ self .amid2_entry .grid (sticky = W ,row = 18 ,column = columnbase + 1 )
139+
140+ self .fmid2_label = Label (self ,text = "FPGA Mezz 2 ID:" ,width = 15 )
141+ self .fmid2_label .grid (sticky = W ,row = 19 ,column = columnbase + 0 )
142+
143+ self .fmid2_entry = Entry (self ,width = 15 )
144+ self .fmid2_entry .grid (sticky = W ,row = 19 ,column = columnbase + 1 )
145+
146+ #Slot 3
147+ self .slotlabel3 = Label (self ,text = "WIB Slot 3:" )
148+ self .slotlabel3 .grid (sticky = W ,row = 20 ,column = columnbase + 0 ,pady = 10 )
149+
150+ self .boxid3_label = Label (self ,text = "CE Box 3 ID:" ,width = 15 )
151+ self .boxid3_label .grid (sticky = W ,row = 21 ,column = columnbase + 0 )
152+
153+ self .boxid3_entry = Entry (self ,width = 15 )
154+ self .boxid3_entry .grid (sticky = W ,row = 21 ,column = columnbase + 1 )
155+
156+ self .amid3_label = Label (self ,text = "Analog MB 3 ID:" ,width = 15 )
157+ self .amid3_label .grid (sticky = W ,row = 22 ,column = columnbase + 0 )
158+
159+ self .amid3_entry = Entry (self ,width = 15 )
160+ self .amid3_entry .grid (sticky = W ,row = 22 ,column = columnbase + 1 )
161+
162+ self .fmid3_label = Label (self ,text = "FPGA Mezz 3 ID:" ,width = 15 )
163+ self .fmid3_label .grid (sticky = W ,row = 23 ,column = columnbase + 0 )
164+
165+ self .fmid3_entry = Entry (self ,width = 15 )
166+ self .fmid3_entry .grid (sticky = W ,row = 23 ,column = columnbase + 1 )
167+
168+ # Start button
97169 self .start_button = Button (self , text = "Start Tests" , command = self .start_measurements ,width = 25 )
98- self .start_button .grid (row = 22 ,column = columnbase ,columnspan = 2 ,pady = 30 )
170+ self .start_button .grid (row = 24 ,column = columnbase ,columnspan = 2 ,pady = 30 )
99171 self .reset_button = Button (self , text = "Reset" , command = self .reset ,width = 25 ,bg = "#FF8000" )
100- self .reset_button .grid (row = 24 ,column = columnbase ,columnspan = 2 )
101-
102- self .runid_label = Label (self , text = "" )
103- self .runid_label .grid (row = 25 ,column = columnbase ,columnspan = 2 ,pady = 20 )
172+ self .reset_button .grid (row = 26 ,column = columnbase ,columnspan = 2 )
104173
105174 self .status_label = Label (self , text = "NOT STARTED" ,bd = 1 ,relief = SUNKEN ,width = 50 )
106175 self .status_label .grid (row = 100 ,column = columnbase ,columnspan = 2 )
107176 self .bkg_color = self .status_label .cget ("background" )
108177
109178 def get_options (self ):
110179 operator = self .operator_entry .get ()
111- boxid = self .boxid_entry .get ()
112- amid = self .amid_entry .get ()
113- fmid = self .fmid_entry .get ()
180+ boxids = [ self .boxid0_entry .get (), self . boxid1_entry . get (), self . boxid2_entry . get (), self . boxid3_entry . get ()]
181+ amids = [ self .amid0_entry .get (), self . amid1_entry . get (), self . amid2_entry . get (), self . amid3_entry . get ()]
182+ fmids = [ self .fmid0_entry .get (), self . fmid1_entry . get (), self . fmid2_entry . get (), self . fmid3_entry . get ()]
114183
115184 wibslots_all = [self .wibslot0 .get (), self .wibslot1 .get (), self .wibslot2 .get (), self .wibslot3 .get ()]
116185 wibslots_filled = [x for x in range (len (wibslots_all )) if wibslots_all [x ]== 1 ]
117-
118- variables = [operator ,boxid ,amid ,fmid ,self .ct_bool ,wibslots_filled ]
186+
187+ boxids_filled = [x for x in boxids if boxids .index (x ) in wibslots_filled ]
188+ amids_filled = [x for x in amids if amids .index (x ) in wibslots_filled ]
189+ fmids_filled = [x for x in fmids if fmids .index (x ) in wibslots_filled ]
190+
191+ variables = [operator ,self .ct_bool ,wibslots_filled ]
192+
119193 if (self .ct_bool .get () == "1" ):
120194 isRoomTemp = False
121195 else :
@@ -125,17 +199,13 @@ def get_options(self):
125199 if var == "" :
126200 return
127201 print ("Operator Name: '{}'" .format (operator ))
128- print ("CE Box ID: '{}'" .format (boxid ))
129- print ("Analog MB ID: '{}'" .format (amid ))
130- print ("FPGA Mezz ID: '{}'" .format (fmid ))
131- print ("Room temp?: '{}'" .format (isRoomTemp ))
132202 print ("WIB Slots Filled: " , wibslots_filled )
133203
134204 inputOptions = {
135205 "operator" : operator ,
136- "box_id " : boxid ,
137- "fm_id " : fmid ,
138- "am_id " : amid ,
206+ "box_ids " : boxids_filled ,
207+ "fm_ids " : fmids_filled ,
208+ "am_ids " : amids_filled ,
139209 "isRoomTemp" : isRoomTemp ,
140210 "wibslots" : wibslots_filled
141211 }
@@ -157,20 +227,46 @@ def reset(self):
157227 self .status_label ["text" ] = "NOT STARTED"
158228 self .status_label ["fg" ] = "#000000"
159229 self .status_label ["bg" ] = self .bkg_color
160- self .runid_label ["text" ] = ""
161230 self .start_button ["state" ] = "normal"
162231 self .operator_label ["state" ] = "normal"
163232 self .operator_entry ["state" ] = "normal"
164- self .boxid_label ["state" ] = "normal"
165- self .boxid_entry ["state" ] = "normal"
166- self .amid_label ["state" ] = "normal"
167- self .amid_entry ["state" ] = "normal"
168- self .fmid_label ["state" ] = "normal"
169- self .fmid_entry ["state" ] = "normal"
170-
171- self .boxid_entry .delete (0 ,END )
172- self .amid_entry .delete (0 ,END )
173- self .fmid_entry .delete (0 ,END )
233+ self .boxid0_label ["state" ] = "normal"
234+ self .boxid0_entry ["state" ] = "normal"
235+ self .amid0_label ["state" ] = "normal"
236+ self .amid0_entry ["state" ] = "normal"
237+ self .fmid0_label ["state" ] = "normal"
238+ self .fmid0_entry ["state" ] = "normal"
239+ self .boxid1_label ["state" ] = "normal"
240+ self .boxid1_entry ["state" ] = "normal"
241+ self .amid1_label ["state" ] = "normal"
242+ self .amid1_entry ["state" ] = "normal"
243+ self .fmid1_label ["state" ] = "normal"
244+ self .fmid1_entry ["state" ] = "normal"
245+ self .boxid2_label ["state" ] = "normal"
246+ self .boxid2_entry ["state" ] = "normal"
247+ self .amid2_label ["state" ] = "normal"
248+ self .amid2_entry ["state" ] = "normal"
249+ self .fmid2_label ["state" ] = "normal"
250+ self .fmid2_entry ["state" ] = "normal"
251+ self .boxid3_label ["state" ] = "normal"
252+ self .boxid3_entry ["state" ] = "normal"
253+ self .amid3_label ["state" ] = "normal"
254+ self .amid3_entry ["state" ] = "normal"
255+ self .fmid3_label ["state" ] = "normal"
256+ self .fmid3_entry ["state" ] = "normal"
257+
258+ self .boxid0_entry .delete (0 ,END )
259+ self .amid0_entry .delete (0 ,END )
260+ self .fmid0_entry .delete (0 ,END )
261+ self .boxid1_entry .delete (0 ,END )
262+ self .amid1_entry .delete (0 ,END )
263+ self .fmid1_entry .delete (0 ,END )
264+ self .boxid2_entry .delete (0 ,END )
265+ self .amid2_entry .delete (0 ,END )
266+ self .fmid2_entry .delete (0 ,END )
267+ self .boxid3_entry .delete (0 ,END )
268+ self .amid3_entry .delete (0 ,END )
269+ self .fmid3_entry .delete (0 ,END )
174270
175271 self .reset_button ["bg" ] = "#FF9900"
176272 self .reset_button ["activebackground" ] = "#FFCF87"
0 commit comments