update 更新图片处理,点位比较方法,夹爪控制
This commit is contained in:
30
main.py
30
main.py
@ -397,8 +397,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
continue
|
||||
position_model = PositionModel(i)
|
||||
break
|
||||
if position_model.id == 999:
|
||||
print("d")
|
||||
if self.tableWidget_line_positions.currentRow()==-1:
|
||||
row_i = self.tableWidget_line_positions.rowCount()
|
||||
else:
|
||||
@ -814,12 +812,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
def start_Runing(self):
|
||||
self.main_threading = Thread(target=self.run)
|
||||
self.robot_connect_threading = Thread(target=self.robotClient.run)
|
||||
self.main_UI_threading = Thread(target=self.updateUI)
|
||||
|
||||
self.detect_person_thread = Thread(target=self.run_detect_persion)
|
||||
|
||||
self.main_threading.start()
|
||||
self.robot_connect_threading.start()
|
||||
|
||||
self.main_UI_threading = Thread(target=self.updateUI)
|
||||
self.main_UI_threading.start()
|
||||
self.detect_person_thread = Thread(target=self.run_detect_persion)
|
||||
self.detect_person_thread.start()
|
||||
pass
|
||||
def check_continue(self):
|
||||
@ -1207,8 +1206,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
log.log_message(logging.ERROR, Constant.str_feed_reset_no_line_error)
|
||||
return
|
||||
self.feeding.reset_status = ResetStatus.RStart
|
||||
dialog_reset = StopDialog()
|
||||
dialog_reset.stop_thread_signal.connect(self.stop_reset_thread)
|
||||
# dialog_reset = StopDialog()
|
||||
# dialog_reset.stop_thread_signal.connect(self.stop_reset_thread)
|
||||
else:
|
||||
log.log_message(logging.ERROR, Constant.str_feed_reset_no_line_error)
|
||||
return
|
||||
@ -1564,7 +1563,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
clear_command = CMDInstructRequest()
|
||||
request_command = clear_command.toString()
|
||||
log.log_message(logging.INFO, Constant.str_sys_clearAlarm)
|
||||
self.command_quene.put(request_command)
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
# self.command_quene.put(request_command)
|
||||
|
||||
def send_position_command(self, x1, x2, x3, x4, x5, x6, move_type: MoveType = MoveType.WORLD):
|
||||
|
||||
@ -1598,12 +1598,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
else:
|
||||
pause_command.cmdData.append("0")
|
||||
request_command = pause_command.toString()
|
||||
print(request_command)
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
|
||||
def send_emergency_alarm_command(self):
|
||||
self.feeding.feedStatus = FeedStatus.FNone
|
||||
self.feeding.feedConfig.num = 0
|
||||
|
||||
stop_command = CMDRequest()
|
||||
stop_command.cmdData.append("actionStop")
|
||||
stop_command.cmdData.append("1")
|
||||
@ -1611,18 +1610,17 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.send_clear_auto_command()
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
self.feeding.send_emergency_sound()
|
||||
self.feeding.feedConfig.num = 0
|
||||
log.log_message(logging.INFO, Constant.str_sys_emergencyStop)
|
||||
#TODO
|
||||
|
||||
|
||||
def send_clear_alarm_command(self, pause: bool):
|
||||
self.send_start_tool_command()
|
||||
self.send_clear_auto_command()
|
||||
pause_command = CMDRequest()
|
||||
pause_command.cmdData.append("StopButton")
|
||||
pause_command.cmdData.append("1")
|
||||
request_command = pause_command.toString()
|
||||
print(request_command)
|
||||
log_str = f'暂停:{pause}'
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
|
||||
def send_switch_tool_command(self):
|
||||
@ -1630,8 +1628,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
switch_command.cmdData.append("switchTool")
|
||||
switch_command.cmdData.append("2")
|
||||
request_command = switch_command.toString()
|
||||
print(request_command)
|
||||
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
|
||||
def send_start_tool_command(self):
|
||||
@ -1639,8 +1635,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
switch_command.cmdData.append("startButton")
|
||||
switch_command.cmdData.append("1")
|
||||
request_command = switch_command.toString()
|
||||
print(request_command)
|
||||
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
|
||||
def show_messagebox_of_person(self):
|
||||
@ -1845,6 +1839,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.configReader.write(open(Constant.set_ini, 'w', encoding='utf-8'))
|
||||
log.log_message(logging.INFO, f'设置原点:{x},{y},{z}')
|
||||
except:
|
||||
log.log_message(logging.ERROR, f'设置原点失败')
|
||||
self.show_infomessage_box("设置原点失败")
|
||||
|
||||
|
||||
@ -1970,7 +1965,6 @@ def handle_exception(exc_type, exc_value, exc_tb):
|
||||
log.log_message(logging.INFO, "用户主动退出程序")
|
||||
return
|
||||
log.log_message(logging.ERROR, exc_value)
|
||||
print("未处理的异常:", exc_type, exc_value)
|
||||
traceback.print_exception(exc_type, exc_value, exc_tb)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user