def __init__(self, spadic_controller, statusbar, _log=None): mutti.Frame.__init__(self, "Hit Logic") self._log = _log self.control_panels = [] hitlogic_list = mutti.VList() hitlogic_grid = mutti.Grid(2, 2) u = spadic_controller.hitlogic for (i, d) in enumerate([ SpadicDial(u, "threshold1", (-256, 255), 4, "Threshold 1", min_width=17), SpadicDial(u, "threshold2", (-256, 255), 4, "Threshold 2", min_width=17), SpadicDial(u, "window", (0, 63), 2, " "*7+"Hit window length", min_width=29), SpadicToggle(u, "diffmode", " "*7+"Differential mode", min_width=29), ]): d._status = statusbar hitlogic_grid.adopt(d, row=(i%2), col=(i//2)) self.control_panels.append(d) d._log = _log hitlogic_list.adopt(hitlogic_grid) selectmask = SelectMaskToggle(u, "mask", statusbar, min_width=46) hitlogic_list.adopt(selectmask) selectmask._log = _log self.control_panels.append(selectmask) self.adopt(hitlogic_list)
def __init__(self, spadic_controller, statusbar, _log=None): mutti.Frame.__init__(self, "DLM Trigger") self.control_panels = [] dlm_list = mutti.VList() u = spadic_controller.hitlogic # TODO move these settings, they # are actually not related to the hitlogic for d in [ SpadicToggle(u, "analogtrigger", "Analog trigger", min_width=20), SpadicToggle(u, "triggerout", "Trigger output", min_width=20), ]: d._status = statusbar self.control_panels.append(d) dlm_list.adopt(d) self.adopt(dlm_list)
def __init__(self, stage, *args, **kwargs): self.stage = stage SpadicToggle.__init__(self, *args, **kwargs)
def __init__(self, source_ch, target_ch, control_unit, *args, **kwargs): self._source_ch = source_ch self._target_ch = target_ch SpadicToggle.__init__(self, control_unit, '', *args, **kwargs)
def __init__(self, group, spadic_controller, statusbar, _log=None): mutti.Frame.__init__(self, "Channel settings & Neighbor trigger") self.group = group self.control_panels = [] self._log = _log upper = 3 # three rows for "upper" neighbor matrix lower = 3 # three rows for "lower" neighbor matrix col_label = 1 # one column with labels num_rows = upper + 16 + lower num_cols = 5 + col_label + upper + 16 + lower grid = mutti.Grid(num_rows, num_cols) t, b = 0, upper upper_rows = range(t, b) t, b = b, b + 16 channel_rows = range(t, b) t, b = b, b + lower lower_rows = range(t, b) l, r = 0, 5 setting_cols = range(l, r) l, r = r, r + col_label label_cols = range(l, r) l, r = r, r + upper neighbor_upper_cols = range(l, r) l, r = r, r + 16 neighbor_channel_cols = range(l, r) l, r = r, r + lower neighbor_lower_cols = range(l, r) g = self.group # channel settings for row in channel_rows: i = row - upper + (16 if g == 'B' else 0) u_ana = spadic_controller.frontend.channel[i] u_dig = spadic_controller.digital.channel[i] for (c, d) in enumerate([ SpadicToggle(u_ana, "enablecsa", "Power CSA [%s.%i]" % (g, i % 16), draw_label=False, min_width=3), SpadicDial(u_ana, "baseline", (0, 127), 3, "Baseline trim [%s.%i]" % (g, i % 16), draw_label=False, min_width=9), SpadicToggle(u_ana, "enableadc", "Connect ADC [%s.%i]" % (g, i % 16), draw_label=False, min_width=5), SpadicToggle(u_dig, "enable", "Enable logic [%s.%i]" % (g, i % 16), draw_label=False, min_width=7), SpadicToggle(u_dig, "entrigger", "Trigger input [%s.%i]" % (g, i % 16), draw_label=False, min_width=8), ]): col = c d._log = _log d._status = statusbar self.control_panels.append(d) grid.adopt(d, row, col, update_size=False) # neighbor matrix u = spadic_controller.digital.neighbor[g] # -- channels -> upper for row in upper_rows: for col in neighbor_channel_cols: src = col - col_label - 5 - lower tgt = "U%i" % row s = "%s.%i -> %s.%s" % (g, src, g, tgt) t = NeighborMatrixToggle(src, tgt, u, "Neighbor trigger [%s]" % s, draw_label=False) t._status = statusbar t._log = _log self.control_panels.append(t) grid.adopt(t, row, col, update_size=False) # -- channels -> channels for row in channel_rows: for col in neighbor_channel_cols: src = col - col_label - 5 - lower tgt = row - lower if not src == tgt: s = "%s.%i -> %s.%i" % (g, src, g, tgt) t = NeighborMatrixToggle(src, tgt, u, "Neighbor trigger [%s]" % s, draw_label=False) t._status = statusbar t._log = _log self.control_panels.append(t) grid.adopt(t, row, col, update_size=False) # -- channels -> lower for row in lower_rows: for col in neighbor_channel_cols: src = col - col_label - 5 - lower tgt = "L%i" % (row - lower - 16) s = "%s.%i -> %s.%s" % (g, src, g, tgt) t = NeighborMatrixToggle(src, tgt, u, "Neighbor trigger [%s]" % s, draw_label=False) t._status = statusbar t._log = _log self.control_panels.append(t) grid.adopt(t, row, col, update_size=False) # -- upper -> channels for row in channel_rows: for col in neighbor_upper_cols: src = "U%i" % (col - col_label - 5) tgt = row - lower s = "%s.%s -> %s.%i" % (g, src, g, tgt) t = NeighborMatrixToggle(src, tgt, u, "Neighbor trigger [%s]" % s, draw_label=False) t._status = statusbar t._log = _log self.control_panels.append(t) grid.adopt(t, row, col, update_size=False) # -- lower -> channels for row in channel_rows: for col in neighbor_lower_cols: src = "L%i" % (col - col_label - 5 - upper - 16) tgt = row - lower s = "%s.%s -> %s.%i" % (g, src, g, tgt) t = NeighborMatrixToggle(src, tgt, u, "Neighbor trigger [%s]" % s, draw_label=False) t._status = statusbar t._log = _log self.control_panels.append(t) grid.adopt(t, row, col, update_size=False) # labels for (col, setting) in zip( setting_cols, ["CSA", " Baseline", " ADC", " Logic", " Trigger "]): p = [grid._panel[(row, col)] for row in channel_rows] L = FilterLabel(p, setting) grid.adopt(L, upper - 1, col, update_size=False) label_col = label_cols[0] for row in channel_rows: p = [ grid._panel[(row, col)] for col in setting_cols + neighbor_lower_cols + neighbor_channel_cols + neighbor_upper_cols if (row, col) in grid._panel ] i = row - upper L = FilterLabel(p, "%s.%i " % (g, i)) grid.adopt(L, row, label_col, update_size=False) for row in upper_rows: p = [grid._panel[(row, col)] for col in neighbor_channel_cols] s = "U%i" % row L = FilterLabel(p, "%s.%s " % (g, s)) grid.adopt(L, row, label_col, update_size=False) for row in lower_rows: p = [grid._panel[(row, col)] for col in neighbor_channel_cols] s = "L%i" % (row - upper - 16) L = FilterLabel(p, "%s.%s " % (g, s)) grid.adopt(L, row, label_col, update_size=False) grid.update_size() self.adopt(grid)
def __init__(self, xfbpanel, *args, **kwargs): self._xfbpanel = xfbpanel SpadicToggle.__init__(self, *args, **kwargs)
def get(self): result = SpadicToggle.get(self) self._xfbpanel.label = {'P': ' nFB', 'N': ' pFB'}[result] return result