update 完成所有投料逻辑,IO点位控制,急停控制
This commit is contained in:
35
main.py
35
main.py
@ -155,6 +155,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.pushButton_set_p5.clicked.connect(self.set_p5_button_click)
|
||||
|
||||
self.pushButton_clearAlarm.clicked.connect(self.send_clear_alarm_command)
|
||||
self.pushButton_emergency.clicked.connect(self.send_emergency_alarm_command)
|
||||
self.pushButton_reset.clicked.connect(self.send_reset_button_click)
|
||||
self.pushButton_speed.setText(str(Constant.speed))
|
||||
|
||||
@ -221,9 +222,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
int(self.configReader.get('Robot_Feed', 'photo_u5')),int(self.configReader.get('Robot_Feed', 'photo_v5')),int(self.configReader.get('Robot_Feed', 'photo_w5'))
|
||||
)
|
||||
]
|
||||
solenoid_valve1_addr = int(self.configReader.get('Robot_Feed', 'solenoid_valve1_addr'))
|
||||
solenoid_valve2_addr = int(self.configReader.get('Robot_Feed', 'solenoid_valve2_addr'))
|
||||
solenoid_valve3_addr = int(self.configReader.get('Robot_Feed', 'solenoid_valve3_addr'))
|
||||
#TODO
|
||||
#dropDelay_time = int(self.configReader.get('Robot_Feed', 'dropDelay_time'))
|
||||
self.robotClient = RobotClient(ip, port, photo_locs, self.command_position_quene, self.status_address)
|
||||
self.robotClient = RobotClient(ip, port, photo_locs, self.command_position_quene, self.status_address,[solenoid_valve1_addr, solenoid_valve2_addr, solenoid_valve3_addr])
|
||||
self.feeding = Feeding(self.robotClient, self.detection) # 临时
|
||||
self.last_time = time.time()
|
||||
self.remain_lineName = self.configReader.get('Robot_Feed', 'remain_lineName')
|
||||
@ -473,6 +477,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
return
|
||||
|
||||
def send_startFeed_button_click(self):
|
||||
if self.feeding.feedStatus != FeedStatus.FNone:
|
||||
self.show_infomessage_box("正在执行")
|
||||
return
|
||||
# 触发自动运行
|
||||
if self.robotClient.status_model.curMode != 7:
|
||||
self.send_switch_tool_command()
|
||||
@ -1013,7 +1020,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def set_run_status_button(self, isRuning: bool):
|
||||
self.pushButton_pauseFeed.setText("暂停")
|
||||
|
||||
##self.pushButton_startFeed.setEnabled(False)
|
||||
|
||||
# if isRuning:
|
||||
# self.pushButton_pauseFeed.show()
|
||||
@ -1026,12 +1033,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def send_clear_auto_command(self):
|
||||
clear_command = CMDInstructRequest()
|
||||
io_instruction= Instruction()
|
||||
io_instruction.IO = True
|
||||
io_instruction.point=0 #{"dsID":"HCRemoteCommand","reqType":"AddRCC","emptyList":"1","instructions":[{"oneshot":"1","action":"200","type":"0","io_status":"1","point":"15","delay":"0"}]}
|
||||
io_instruction.delay=1
|
||||
clear_command.dsID = 'HCRemoteCommand'
|
||||
clear_command.instructions.append(io_instruction)
|
||||
request_command = clear_command.toString()
|
||||
log.log_message(logging.INFO, Constant.str_sys_clearAlarm)
|
||||
self.command_quene.put(request_command)
|
||||
@ -1071,15 +1072,19 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
print(request_command)
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
|
||||
def send_clear_alarm_command(self, pause: bool):
|
||||
switch_command = CMDRequest()
|
||||
switch_command.cmdData.append("modifyGSPD")
|
||||
switch_command.cmdData.append("2")
|
||||
request_command = switch_command.toString()
|
||||
print(request_command)
|
||||
|
||||
def send_emergency_alarm_command(self):
|
||||
stop_command = CMDRequest()
|
||||
stop_command.cmdData.append("actionStop")
|
||||
stop_command.cmdData.append("1")
|
||||
request_command = stop_command.toString()
|
||||
self.robotClient.add_sendQuene(request_command)
|
||||
self.feeding.send_emergency_sound()
|
||||
log.log_message(logging.INFO, Constant.str_sys_emergencyStop)
|
||||
#TODO
|
||||
|
||||
|
||||
def send_clear_alarm_command(self, pause: bool):
|
||||
self.send_start_tool_command()
|
||||
pause_command = CMDRequest()
|
||||
pause_command.cmdData.append("clearAlarmContinue")
|
||||
pause_command.cmdData.append("1")
|
||||
|
||||
Reference in New Issue
Block a user