def __init__(self, parent=None): super(PictureView, self).__init__(parent) self.setupUi(self) self.dlg = MessageView() self.dlg.show() self.button_list = [ self.dlg.pushButton_0, self.dlg.pushButton_1, self.dlg.pushButton_2, self.dlg.pushButton_3, self.dlg.pushButton_4, self.dlg.pushButton_5 ] self.code_list = ["", "", "", "", "", ""] for button in self.button_list: button.move(BUTTON_NONE_X, button.y()) self.dlg.pushButton_0.clicked.connect(lambda: setfocus.open_code( self.code_list[0], self.window_info, self.dlg)) self.dlg.pushButton_1.clicked.connect(lambda: setfocus.open_code( self.code_list[1], self.window_info, self.dlg)) self.dlg.pushButton_2.clicked.connect(lambda: setfocus.open_code( self.code_list[2], self.window_info, self.dlg)) self.dlg.pushButton_3.clicked.connect(lambda: setfocus.open_code( self.code_list[3], self.window_info, self.dlg)) self.dlg.pushButton_4.clicked.connect(lambda: setfocus.open_code( self.code_list[4], self.window_info, self.dlg)) self.dlg.pushButton_5.clicked.connect(lambda: setfocus.open_code( self.code_list[5], self.window_info, self.dlg)) self.window_info = setfocus.init_fs() self.timer = QTimer(self) self.timer.timeout.connect(self.checkall) self.i = 0 self.b1_v_prev = dict() self.broken_signal = dict() self.codes = [] self.timer.start(INTERVAL) self.started = False
def click_code(self, code_slot): setfocus.open_code(self.code_list[code_slot], self.window_info) self.recent_codes.append(self.code_list[code_slot]) self.clear_signals.append(self.code_list[code_slot]) self.replay_code = self.code_list[code_slot]
def replay(self): setfocus.open_code(self.replay_code, self.window_info)
def bid5(self): setfocus.open_code('.-5', self.window_info)
def bid4(self): setfocus.open_code('.-4', self.window_info)
def bid3(self): setfocus.open_code('.-3', self.window_info)
def bid2(self): setfocus.open_code('.-2', self.window_info)
def bid1(self): setfocus.open_code('.-1', self.window_info)
def ask1(self): setfocus.open_code('.+1', self.window_info)
def ask2(self): setfocus.open_code('.+2', self.window_info)
def ask3(self): setfocus.open_code('.+3', self.window_info)
def ask4(self): setfocus.open_code('.+4', self.window_info)
def ask5(self): setfocus.open_code('.+5', self.window_info)