update 完成点位控制逻辑,UI可视化界面生成
This commit is contained in:
35
main.py
35
main.py
@ -5,12 +5,14 @@ import queue
|
||||
import sys
|
||||
from multiprocessing import Process
|
||||
import traceback
|
||||
|
||||
import PySide6
|
||||
from PyQt5.uic.properties import QtWidgets
|
||||
from PySide6 import QtCore
|
||||
from PySide6.QtCore import QThread, Signal, Slot, QObject, QEvent, QTimer
|
||||
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
|
||||
QTableWidgetItem, QWidget, QHBoxLayout, QAbstractItemView, QMessageBox, QSizePolicy, QComboBox
|
||||
from datetime import datetime
|
||||
|
||||
from click import clear
|
||||
@ -51,7 +53,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.init_IOPanel()
|
||||
self.start_Runing()
|
||||
self.init_log()
|
||||
|
||||
self.init_table_positions()
|
||||
|
||||
|
||||
|
||||
@ -157,7 +159,32 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
|
||||
|
||||
def init_table_positions(self):
|
||||
self.tableWidget_positions.setRowCount(9)
|
||||
self.tableWidget_positions.setColumnCount(2)
|
||||
self.tableWidget_positions.setHorizontalHeaderLabels(["名字", "删除点位"])
|
||||
self.tableWidget_positions.setSelectionBehavior(QTableWidget.SelectRows)
|
||||
self.tableWidget_positions.setAutoScroll(True)
|
||||
|
||||
# 自动调整列宽
|
||||
header = self.tableWidget_positions.horizontalHeader()
|
||||
|
||||
# 让第一列宽度根据内容自动调整
|
||||
header.setSectionResizeMode(0, PySide6.QtWidgets.QHeaderView.ResizeMode.Stretch)
|
||||
|
||||
# 第二列宽度根据内容自动调整
|
||||
header.setSectionResizeMode(1, PySide6.QtWidgets.QHeaderView.ResizeMode.Stretch)
|
||||
|
||||
|
||||
for row in range(5):
|
||||
combo = QComboBox()
|
||||
combo.addItems(["位置 A", "位置 B", "位置 C"])
|
||||
self.tableWidget_positions.setCellWidget(row, 0, combo)
|
||||
|
||||
for row in range(5):
|
||||
get_button = QPushButton("获取位置")
|
||||
# get_button.clicked.connect(self.get_location)
|
||||
self.tableWidget_positions.setCellWidget(row, 1, get_button)
|
||||
def init_qss(self):
|
||||
pass
|
||||
|
||||
@ -230,7 +257,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.pushButton_leftmenu_IO.clicked.connect(lambda _, index=1: self.send_click_change_stackView(index))
|
||||
self.pushButton_leftmenu_position.clicked.connect(lambda _, index=2: self.send_click_change_stackView(index))
|
||||
self.pushButton_leftmenu_baseSeting.clicked.connect(lambda _, index=3: self.send_click_change_stackView(index))
|
||||
self.pushButton_leftmenu_posDebug.clicked.connect(lambda _, index=4: self.send_click_change_stackView(index))
|
||||
self.pushButton_leftmenu_posDebug.clicked.connect(lambda _, index=5: self.send_click_change_stackView(index))
|
||||
self.pushButton_exit.clicked.connect(self.send_exit_button_click)
|
||||
|
||||
|
||||
@ -950,7 +977,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
if isinstance(command, FeedCommand) and command.status == Status.Prepareing:
|
||||
if self.feeding.feedStatus == FeedStatus.FNone:
|
||||
self.feeding.feedConfig = command.feed_config
|
||||
self.feeding.feedStatus = FeedStatus.FStart
|
||||
self.feeding.feedStatus = FeedStatus.FCheck
|
||||
command.status = Status.Runing
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user