update 更新界面图标,增加余料显示,增加日志图标
This commit is contained in:
40
main.py
40
main.py
@ -8,7 +8,7 @@ from multiprocessing import Process
|
||||
from PyQt5.uic.properties import QtWidgets
|
||||
from PySide6 import QtCore
|
||||
from PySide6.QtCore import QThread, Signal, Slot, QObject, QEvent
|
||||
from PySide6.QtGui import QIntValidator, QStandardItemModel, QStandardItem, Qt, QMovie
|
||||
from PySide6.QtGui import QIntValidator, QStandardItemModel, QStandardItem, Qt, QMovie, QIcon
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QHeaderView, QTableWidget, \
|
||||
QTableWidgetItem, QWidget, QHBoxLayout, QAbstractItemView, QMessageBox, QSizePolicy
|
||||
from datetime import datetime
|
||||
@ -30,6 +30,7 @@ from Model.Position import Real_Position, Detection_Position
|
||||
from threading import Thread
|
||||
from CU.Command import Status
|
||||
from Util.util_log import log
|
||||
from Vision.detect_person import DetectionPerson
|
||||
from ui_MainWin import Ui_MainWindow
|
||||
|
||||
|
||||
@ -43,6 +44,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.init_Run()
|
||||
self.init_robot_info()
|
||||
self.init_FeedLine()
|
||||
|
||||
self.start_Runing()
|
||||
# self.init_log()
|
||||
|
||||
@ -192,6 +194,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.feedLine_dict = {}
|
||||
self.command_quene = Queue()
|
||||
self.main_threading = None
|
||||
self.detection_person = DetectionPerson()
|
||||
|
||||
self.configReader.read(Constant.set_ini)
|
||||
ip = self.configReader.get('Robot_Feed', 'IPAddress')
|
||||
@ -709,11 +712,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def send_pauseFeed_button_click(self):
|
||||
if self.pushButton_pauseFeed.text() == '暂停':
|
||||
|
||||
icon9 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.SystemReboot))
|
||||
self.pushButton_pauseFeed.setIcon(icon9)
|
||||
self.pushButton_pauseFeed.setText('继续')
|
||||
log.log_message(logging.INFO, Constant.str_feed_pause)
|
||||
self.send_pause_command(True)
|
||||
self.feeding.pause = True
|
||||
else:
|
||||
icon9 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackPause))
|
||||
self.pushButton_pauseFeed.setIcon(icon9)
|
||||
self.pushButton_pauseFeed.setText('暂停')
|
||||
self.send_pause_command(False)
|
||||
log.log_message(logging.INFO, Constant.str_feed_continue)
|
||||
@ -806,6 +814,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
if self.feeding.feedStatus != FeedStatus.FNone:
|
||||
self.horizontalSlider_feedingNum.setValue(
|
||||
self.horizontalSlider_feedingNum.maximum() - self.feeding.feedConfig.num)
|
||||
self.label_remain_num.setText(str(self.feeding.feedConfig.num))
|
||||
else:
|
||||
self.set_run_status_button(False)
|
||||
if self.feeding.feedStatus == FeedStatus.FNone:
|
||||
@ -813,11 +822,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
else:
|
||||
self.stackedWidget_num.setCurrentIndex(1)
|
||||
|
||||
# if self.feeding.feedConfig.num==2:
|
||||
# self.feeding.pause=True
|
||||
# self.send_pause_command(True)
|
||||
# self.show_messagebox_of_person()
|
||||
# log.log_message(logging.ERROR, '人员进入安全区')
|
||||
has_person,_ = self.detection_person.get_person(None)
|
||||
if has_person:
|
||||
self.feeding.pause=True
|
||||
self.send_pause_command(True)
|
||||
self.show_messagebox_of_person()
|
||||
log.log_message(logging.ERROR, '人员进入安全区')
|
||||
self.label_date.setText(datetime.now().strftime("%Y-%m-%d"))
|
||||
self.label_time.setText(datetime.now().strftime("%H:%M:%S"))
|
||||
|
||||
@ -952,14 +962,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def set_run_status_button(self, isRuning: bool):
|
||||
self.pushButton_pauseFeed.setText("暂停")
|
||||
if isRuning:
|
||||
self.pushButton_pauseFeed.show()
|
||||
self.pushButton_stopFeed.show()
|
||||
self.pushButton_startFeed.hide()
|
||||
else:
|
||||
self.pushButton_pauseFeed.hide()
|
||||
self.pushButton_stopFeed.hide()
|
||||
self.pushButton_startFeed.show()
|
||||
|
||||
|
||||
# if isRuning:
|
||||
# self.pushButton_pauseFeed.show()
|
||||
# self.pushButton_stopFeed.show()
|
||||
# self.pushButton_startFeed.hide()
|
||||
# else:
|
||||
# self.pushButton_pauseFeed.hide()
|
||||
# self.pushButton_stopFeed.hide()
|
||||
# self.pushButton_startFeed.show()
|
||||
|
||||
def send_clear_auto_command(self):
|
||||
clear_command = CMDInstructRequest()
|
||||
|
||||
Reference in New Issue
Block a user