1.完成了基本的程序界面
This commit is contained in:
parent
35e67a51f9
commit
e4754a3193
|
|
@ -0,0 +1,35 @@
|
|||
from ui.mainwindow import Ui_mainWindow
|
||||
|
||||
from PyQt6 import QtWidgets
|
||||
from PyQt6.QtWidgets import QMainWindow, QFileDialog, QMessageBox, QStatusBar
|
||||
from PyQt6.QtCore import QSettings, QFileInfo
|
||||
import datetime
|
||||
from PWFile import ControlFile
|
||||
|
||||
|
||||
class MainWindow(QMainWindow, Ui_mainWindow):
|
||||
def open_dialog(self):
|
||||
z_control_file_paths = QFileDialog.getOpenFileNames(
|
||||
self,
|
||||
"打开Excel文件",
|
||||
filter="Excel 文件(*.xlsx)",
|
||||
directory=self._setting.value("last_working_directory"),
|
||||
)[0]
|
||||
for z_control_file_path in z_control_file_paths:
|
||||
if z_control_file_path != "":
|
||||
cf = ControlFile(z_control_file_path)
|
||||
cf.draw()
|
||||
self.statusBar().showMessage(
|
||||
f"{datetime.datetime.now()} Finished.", 8000
|
||||
)
|
||||
file_info = QFileInfo(z_control_file_path)
|
||||
self._setting.setValue(
|
||||
"last_working_directory", file_info.absoluteDir().absolutePath()
|
||||
)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.pBOpenControlZFile.clicked.connect(self.open_dialog)
|
||||
self._setting = QSettings("NWEPDI", "Plate", self)
|
||||
pass
|
||||
14
main.py
14
main.py
|
|
@ -1,5 +1,8 @@
|
|||
from PWFile import ControlFile
|
||||
import sys
|
||||
|
||||
from PWFile import ControlFile
|
||||
from gui import MainWindow
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
|
||||
def main1():
|
||||
# continousePlate = ContinuousPlate(
|
||||
|
|
@ -19,8 +22,13 @@ def main1():
|
|||
string_impact_plate.draw()
|
||||
|
||||
def main():
|
||||
cf=ControlFile(r'd:\工程\金上线\排位\定位完排位\PW.0706\J49-158\Z156控制文件.xlsx')
|
||||
cf.draw()
|
||||
# cf=ControlFile(r'd:\工程\金上线\排位\定位完排位\PW.0706\J49-158\Z156控制文件.xlsx')
|
||||
# cf.draw()
|
||||
app=QApplication(sys.argv)
|
||||
mw=MainWindow()
|
||||
mw.show()
|
||||
app.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue