def __init__(self, pattern, align_type=ALIGN_TYPE_LBOW, parent = None, name = None, modal = 0, fl = 0): Align10Form_Base.__init__(self,parent,name,modal,fl) self.Icon.setPixmap(load_pixmap('align10')) self.controls = maint.align10and11and14Controls(pattern, align_type) for line in self.controls: if not self.controls[line][0]: eval('self.comboBox%s.setEnabled(False)' % line) else: for x in range(self.controls[line][1]): eval('self.comboBox%s.insertItem("%s%d")' % (line, line, x+1))
def type10and11and14Align(pattern, align_type): controls = maint.align10and11and14Controls(pattern, align_type) values = [] s_controls = controls.keys() s_controls.sort() for line in s_controls: if not controls[line][0]: values.append(0) else: ok, value = tui.enter_range("Enter the numbered box on line %s where the inner lines best line up with the outer lines (1-%d): " % (line, controls[line][1]), 1, controls[line][1]) values.append(value) if not ok: sys.exit(0) return values
def __init__(self, pattern, align_type=ALIGN_TYPE_LBOW, parent=None, name=None, modal=0, fl=0): Align10Form_Base.__init__(self, parent, name, modal, fl) self.Icon.setPixmap(load_pixmap('align10')) self.controls = maint.align10and11and14Controls(pattern, align_type) for line in self.controls: if not self.controls[line][0]: eval('self.comboBox%s.setEnabled(False)' % line) else: for x in range(self.controls[line][1]): eval('self.comboBox%s.insertItem("%s%d")' % (line, line, x + 1))
def showLBowPage(self, pattern): self.LBowIcon.setPixmap(load_pixmap('align10', 'other')) if self.align_type == ALIGN_TYPE_LBOW: pattern = maint.alignType10SetPattern(self.dev) elif self.align_type == ALIGN_TYPE_LIDIL_DJ_D1600: pattern = maint.alignType14SetPattern(self.dev) else: # ALIGN_TYPE_LIDIL_0_5_4 pattern = maint.alignType11SetPattern(self.dev) if pattern is None: log.error("Invalid pattern!") # TODO: ... self.controls = maint.align10and11and14Controls( pattern, self.align_type) keys = self.controls.keys() keys.sort() max_line = 'A' for line in keys: if self.controls[line][0]: max_line = line else: break self.LBowTitle.setText( self.__tr( "For each row A - %1, select the label representing the box in which in the inner lines are the <b>least</b> visible." ).arg(max_line)) for line in self.controls: if not self.controls[line][0]: eval('self.%sComboBox.setEnabled(False)' % line.lower()) else: for x in range(self.controls[line][1]): eval('self.%sComboBox.addItem("%s%d")' % (line.lower(), line, x + 1)) self.displayPage(PAGE_LBOW)
def showLBowPage(self, pattern): self.LBowIcon.setPixmap(load_pixmap('align10', 'other')) if self.align_type == ALIGN_TYPE_LBOW: pattern = maint.alignType10SetPattern(self.dev) elif self.align_type == ALIGN_TYPE_LIDIL_DJ_D1600: pattern = maint.alignType14SetPattern(self.dev) else: # ALIGN_TYPE_LIDIL_0_5_4 pattern = maint.alignType11SetPattern(self.dev) if pattern is None: log.error("Invalid pattern!") # TODO: ... self.controls = maint.align10and11and14Controls(pattern, self.align_type) keys = list(self.controls.keys()) keys.sort() max_line = 'A' for line in keys: if self.controls[line][0]: max_line = line else: break self.LBowTitle.setText(self.__tr("For each row A - %s, select the label representing the box in which in the inner lines are the <b>least</b> visible." % max_line)) for line in self.controls: if not self.controls[line][0]: eval('self.%sComboBox.setEnabled(False)' % line.lower()) else: for x in range(self.controls[line][1]): eval('self.%sComboBox.addItem("%s%d")' % (line.lower(), line, x + 1)) self.displayPage(PAGE_LBOW)