def createEpicsPanel(self):
        pane = wx.Panel(self, name='epics panel')
        psizer = wx.GridBagSizer(4, 12) # wx.BoxSizer(wx.HORIZONTAL)

        btnpanel = wx.Panel(pane, name='buttons')

        nmca = self.nmca
        NPERROW = 6
        self.SetFont(Font(9))
        if self.det_type.lower().startswith('me-4') and nmca<5:
            btnsizer = wx.GridBagSizer(2, 2)
        else:
            btnsizer = wx.GridBagSizer(int((1.0*NPERROW)/(nmca+NPERROW-2)), NPERROW)

        style  = wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL
        rstyle = wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL
        bkg_choices = ['None']

        psizer.Add(SimpleText(pane, ' MCAs: '),  (0, 0), (1, 1), style, 1)
        for i in range(1, 1+nmca):
            bkg_choices.append("%i" % i)
            b =  Button(btnpanel, '%i' % i, size=(30, 25),
                        action=partial(self.onSelectDet, index=i))
            self.wids['det%i' % i] = b
            loc = divmod(i-1, NPERROW)
            if self.det_type.lower().startswith('me-4') and nmca<NPERROW-1:
                loc = self.me4_layout[i-1]
            btnsizer.Add(b,  loc, (1, 1), style, 1)
        pack(btnpanel, btnsizer)
        nrows = 1 + loc[0]

        if self.det_type.lower().startswith('me-4') and nmca<5:
            nrows = 2

        psizer.Add(btnpanel, (0, 1), (nrows, 1), style, 1)

        self.wids['det_status'] = SimpleText(pane, ' ', size=(120, -1), style=style)
        self.wids['deadtime']   = SimpleText(pane, ' ', size=(120, -1), style=style)

        self.wids['bkg_det'] = Choice(pane, size=(75, -1), choices=bkg_choices,
                                      action=self.onSelectDet)

        self.wids['dwelltime'] = FloatCtrl(pane, value=0.0, precision=1, minval=0,
                                           size=(80, -1), act_on_losefocus=True,
                                           action=self.onSetDwelltime)
        self.wids['elapsed']   = SimpleText(pane, ' ', size=(80, -1),  style=style)

        b1 =  Button(pane, 'Start',      size=(90, 25), action=self.onStart)
        b2 =  Button(pane, 'Stop',       size=(90, 25), action=self.onStop)
        b3 =  Button(pane, 'Erase',      size=(90, 25), action=self.onErase)
        b4 =  Button(pane, 'Continuous', size=(90, 25), action=partial(self.onStart,
                                                                      dtime=0))

        bkg_lab = SimpleText(pane, 'Background MCA:',   size=(150, -1))
        pre_lab = SimpleText(pane, 'Preset Time (s):',  size=(125, -1))
        ela_lab = SimpleText(pane, 'Elapsed Time (s):', size=(125, -1))
        sta_lab = SimpleText(pane, 'Status :',          size=(100, -1))
        dea_lab = SimpleText(pane, '% Deadtime:',       size=(100, -1))


        psizer.Add(bkg_lab,                (0, 2), (1, 1), style, 1)
        psizer.Add(self.wids['bkg_det'],   (1, 2), (1, 1), style, 1)
        psizer.Add(pre_lab,                (0, 3), (1, 1),  style, 1)
        psizer.Add(ela_lab,                (1, 3), (1, 1),  style, 1)
        psizer.Add(self.wids['dwelltime'], (0, 4), (1, 1),  style, 1)
        psizer.Add(self.wids['elapsed'],   (1, 4), (1, 1),  style, 1)

        psizer.Add(b1, (0, 5), (1, 1), style, 1)
        psizer.Add(b4, (0, 6), (1, 1), style, 1)
        psizer.Add(b2, (1, 5), (1, 1), style, 1)
        psizer.Add(b3, (1, 6), (1, 1), style, 1)

        psizer.Add(sta_lab,                  (0, 7), (1, 1), style, 1)
        psizer.Add(self.wids['det_status'],  (0, 8), (1, 1), style, 1)
        psizer.Add(dea_lab,                  (1, 7), (1, 1), style, 1)
        psizer.Add(self.wids['deadtime'],    (1, 8), (1, 1), style, 1)
        pack(pane, psizer)
        # pane.SetMinSize((500, 53))
        self.det.connect_displays(status=self.wids['det_status'],
                                  elapsed=self.wids['elapsed'],
                                  deadtime=self.wids['deadtime'])

        wx.CallAfter(self.onSelectDet, index=1, init=True)
        self.timer_counter = 0
        self.mca_timer = wx.Timer(self)
        self.Bind(wx.EVT_TIMER, self.UpdateData, self.mca_timer)
        self.mca_timer.Start(100)
        return pane

    # def update_mca(self, counts, **kws):
    #    self.det.needs_refresh = False
dataset/ETHPy150Open xraypy/xraylarch/plugins/epics/xrfcontrol.py/EpicsXRFDisplayFrame.createEpicsPanel/swapped operands of `/`