Beispiel #1
0
def chooseElement(fam):
    elems = ap.getElements(fam)
    allelems = [(e.name, Qt.Checked) if e.isEnabled() else
                (e.name, Qt.Unchecked) for e in elems]
    enabled_0 = [i for i, e in enumerate(elems) if e.isEnabled()]
    extra_cols = [('s [m]', [e.sb for e in elems])]
    form = ElementPickDlg(allelems,
                          title="Choose {0}".format(fam),
                          extra_cols=extra_cols)

    if form.exec_():
        enabled = form.checkedIndices()
        el0, el1 = [], []
        for i, e in enumerate(elems):
            if i in enabled_0 and i not in enabled:
                el0.append(i)
            elif i not in enabled_0 and i in enabled:
                el1.append(i)
            if i in enabled: e.setEnabled(True)
            else: e.setEnabled(False)

        if el0:
            _logger.info("{0} {1} '{2}' are disabled".format(
                len(el0), fam, [elems[i].name for i in el0]))
        if el1:
            _logger.info("{0} {1} '{2}' are enabled".format(
                len(el1), fam, [elems[i].name for i in el1]))
Beispiel #2
0
def chooseElement(fam):
    elems = ap.getElements(fam)
    allelems  = [(e.name, Qt.Checked) if e.isEnabled()
                 else (e.name, Qt.Unchecked) for e in elems]
    enabled_0 = [i for i,e in enumerate(elems) if e.isEnabled()]
    extra_cols = [('s [m]', [e.sb for e in elems])]
    form = ElementPickDlg(allelems, title="Choose {0}".format(fam),
                          extra_cols = extra_cols)

    if form.exec_(): 
        enabled = form.checkedIndices()
        el0, el1 = [], []
        for i,e in enumerate(elems):
            if i in enabled_0 and i not in enabled:
                el0.append(i)
            elif i not in enabled_0 and i in enabled:
                el1.append(i)
            if i in enabled: e.setEnabled(True)
            else: e.setEnabled(False)

        if el0:
            _logger.info("{0} {1} '{2}' are disabled".format(
                len(el0), fam, [elems[i].name for i in el0]))
        if el1:
            _logger.info("{0} {1} '{2}' are enabled".format(
                len(el1), fam, [elems[i].name for i in el1]))
Beispiel #3
0
    def chooseBpm(self):
        #print self.bpm
        bpm = []
        bpmmask = self.plot1.curve1.mask[:]
        for i in range(len(self.bpm)):
            if bpmmask[i]:
                bpm.append((self.bpm[i], Qt.Unchecked))
            else:
                bpm.append((self.bpm[i], Qt.Checked))

        form = ElementPickDlg(bpm, 'BPM', self)

        if form.exec_():
            choice = form.result()
            for i in range(len(self.bpm)):
                if self.bpm[i] in choice:
                    self.plot1.setMask(i, 0)
                    self.plot2.setMask(i, 0)
                else:
                    self.plot1.setMask(i, 1)
                    self.plot2.setMask(i, 1)
Beispiel #4
0
    def chooseBpm(self):
        # print self.bpm
        bpm = []
        bpmmask = self.plot1.curve1.mask[:]
        for i in range(len(self.bpm)):
            if bpmmask[i]:
                bpm.append((self.bpm[i], Qt.Unchecked))
            else:
                bpm.append((self.bpm[i], Qt.Checked))

        form = ElementPickDlg(bpm, "BPM", self)

        if form.exec_():
            choice = form.result()
            for i in range(len(self.bpm)):
                if self.bpm[i] in choice:
                    self.plot1.setMask(i, 0)
                    self.plot2.setMask(i, 0)
                else:
                    self.plot1.setMask(i, 1)
                    self.plot2.setMask(i, 1)