def check_step(self, method_name, set_step=None): # def wrapper(): # Call server method if hasattr(self, "check_step_thread"): if self.check_step_thread.isRunning(): _print("check_step_thread is running") self.setEnabled(True) return 1 self.step = set_step if set_step else 0 self._parent.ClientObj.method_name = method_name self._parent.ClientObj.sid = get_sid(self._parent.ClientObj.client) expert = None if self._parent.ClientObj.MainWidget.MainFrameWgt.isBrief(self.step): num = None brief = True expert = True else: brief = False num = self.step view_params = get_view_params( self._parent.ClientObj.client, str(method_name + "_view"), step=num, expert=expert, brief=brief ) self.check_step_thread = ClientServiceThread( self._parent.ClientObj, str(method_name + "_view"), int(self._parent.ClientObj.sid), view_params ) self.check_step_thread.signal.connect(self.check_step_after) self.check_step_thread.start()
def wrapper(): if hasattr(self, "check_step_thread"): if self.check_step_thread.isRunning(): self.setEnabled(True) _print("check_step_thread is running") return 1 change_step = set_step if set_step else 0 if self._parent.ClientObj.param_objects[method_name]["step"] > change_step: self.check_step(method_name, set_step) # self.setEnabled(True) return try: self.calling.disconnect() except RuntimeError: pass self.calling.connect(self._parent.ClientObj.MainWidget.MainFrameWgt.calling(True, from_left_frame=True)) self.calling.emit() self.check_step(method_name, set_step)
def wrapper(): self.setDisabled(True) if hasattr(self, "check_step_thread"): if self.check_step_thread.isRunning(): _print("check_step_thread is running") self.setEnabled(True) return 1 change_step = set_step if set_step else 0 if self._parent.ClientObj.param_objects[method_name]["step"] > change_step: # self.setEnabled(True) return try: self.collect.disconnect() except RuntimeError: pass self.collect.connect(self._parent.ClientObj.MainWidget.MainFrameWgt.collect_object(False)) self.collect.emit()