|
@@ -8,6 +8,8 @@
|
8
|
8
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
9
|
9
|
################################################################################
|
10
|
10
|
|
|
11
|
+import sqlite3
|
|
12
|
+import os
|
11
|
13
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
12
|
14
|
QMetaObject, QObject, QPoint, QRect,
|
13
|
15
|
QSize, QTime, QUrl, Qt)
|
|
@@ -19,16 +21,61 @@ from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFormLayout,
|
19
|
21
|
QFrame, QGridLayout, QHBoxLayout, QHeaderView,
|
20
|
22
|
QLabel, QLineEdit, QListView, QMainWindow,
|
21
|
23
|
QPushButton, QSizePolicy, QStackedWidget, QTabWidget,
|
22
|
|
- QTableView, QTextEdit, QVBoxLayout, QWidget)
|
|
24
|
+ QTableView, QTextEdit, QVBoxLayout, QWidget, QMessageBox)
|
|
25
|
+from Back.Program_Run.data_show import Arrange_Data, Arrange_Data1, Arrange_Data2, Data_in_Cell, Data_in_Cell1, Data_in_Cell2
|
|
26
|
+from Back.Program_Run.database_operations import create_database_and_tables
|
|
27
|
+from Back.Program_Run.file_system_watching import ComboBoxUpdater
|
|
28
|
+from watchdog.observers import Observer
|
|
29
|
+
|
23
|
30
|
from .resources_rc import *
|
24
|
31
|
|
25
|
32
|
|
|
33
|
+# class ComboBoxUpdater(FileSystemEventHandler):
|
|
34
|
+# def __init__(self, comboBox, sql_folder):
|
|
35
|
+# super().__init__()
|
|
36
|
+# self.comboBox = comboBox
|
|
37
|
+# self.sql_folder = sql_folder
|
|
38
|
+#
|
|
39
|
+# def on_modified(self, event):
|
|
40
|
+# if event.is_directory:
|
|
41
|
+# return
|
|
42
|
+# if event.src_path.endswith('.db'):
|
|
43
|
+# self.update_combo_box()
|
|
44
|
+#
|
|
45
|
+# def on_created(self, event):
|
|
46
|
+# if event.is_directory:
|
|
47
|
+# return
|
|
48
|
+# if event.src_path.endswith('.db'):
|
|
49
|
+# self.update_combo_box()
|
|
50
|
+#
|
|
51
|
+# def on_deleted(self, event):
|
|
52
|
+# if event.is_directory:
|
|
53
|
+# return
|
|
54
|
+# if event.src_path.endswith('.db'):
|
|
55
|
+# self.update_combo_box()
|
|
56
|
+#
|
|
57
|
+# def update_combo_box(self):
|
|
58
|
+# # 清空现有的 comboBox 内容
|
|
59
|
+# self.comboBox.clear()
|
|
60
|
+#
|
|
61
|
+# # 列出 SQL 文件夹中的所有 .db 文件
|
|
62
|
+# db_files = [f for f in os.listdir(self.sql_folder) if f.endswith('.db')]
|
|
63
|
+#
|
|
64
|
+# # 将数据库文件名添加到 comboBox 中
|
|
65
|
+# for db_file in db_files:
|
|
66
|
+# self.comboBox.addItem(QCoreApplication.translate("MainWindow", db_file, None))
|
|
67
|
+#
|
|
68
|
+# # 如果没有找到任何数据库文件,显示提示信息
|
|
69
|
+# if not db_files:
|
|
70
|
+# self.comboBox.addItem(QCoreApplication.translate("MainWindow", "未找到数据库文件", None))
|
|
71
|
+
|
26
|
72
|
|
27
|
73
|
|
28
|
74
|
|
29
|
75
|
class Ui_MainWindow(object):
|
30
|
76
|
# UI界面
|
31
|
77
|
def setupUi(self, MainWindow):
|
|
78
|
+ self.main_window = MainWindow
|
32
|
79
|
if not MainWindow.objectName():
|
33
|
80
|
MainWindow.setObjectName(u"MainWindow")
|
34
|
81
|
MainWindow.resize(940, 620)
|
|
@@ -1286,15 +1333,6 @@ class Ui_MainWindow(object):
|
1286
|
1333
|
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
1287
|
1334
|
|
1288
|
1335
|
self.comboBox = QComboBox(self.frame_content_wid_1)
|
1289
|
|
- self.comboBox.addItem("")
|
1290
|
|
- self.comboBox.addItem("")
|
1291
|
|
- self.comboBox.addItem("")
|
1292
|
|
- self.comboBox.addItem("")
|
1293
|
|
- self.comboBox.addItem("")
|
1294
|
|
- self.comboBox.addItem("")
|
1295
|
|
- self.comboBox.addItem("")
|
1296
|
|
- self.comboBox.addItem("")
|
1297
|
|
- self.comboBox.addItem("")
|
1298
|
1336
|
self.comboBox.setObjectName(u"comboBox")
|
1299
|
1337
|
self.comboBox.setMaximumSize(QSize(350, 16777215))
|
1300
|
1338
|
self.comboBox.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
|
@@ -1306,6 +1344,27 @@ class Ui_MainWindow(object):
|
1306
|
1344
|
" min-width: 9em; \n"
|
1307
|
1345
|
"}\n"
|
1308
|
1346
|
"")
|
|
1347
|
+ # 获取当前脚本所在的目录
|
|
1348
|
+ current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
1349
|
+
|
|
1350
|
+ # 构建 SQL 文件夹的相对路径(上一级的上一级中的 SQL 文件夹)
|
|
1351
|
+ sql_folder = os.path.join(current_dir, '..', '..', 'SQL')
|
|
1352
|
+
|
|
1353
|
+ # 将相对路径转换为绝对路径
|
|
1354
|
+ sql_folder = os.path.abspath(sql_folder)
|
|
1355
|
+
|
|
1356
|
+ # 确保 SQL 文件夹存在
|
|
1357
|
+ if not os.path.exists(sql_folder):
|
|
1358
|
+ QMessageBox.critical(MainWindow, "错误", "SQL 文件夹不存在")
|
|
1359
|
+ return
|
|
1360
|
+ # 初始化 ComboBoxUpdater
|
|
1361
|
+ self.updater = ComboBoxUpdater(self.comboBox, sql_folder)
|
|
1362
|
+ self.observer = Observer()
|
|
1363
|
+ self.observer.schedule(self.updater, path=sql_folder, recursive=False)
|
|
1364
|
+ self.observer.start()
|
|
1365
|
+
|
|
1366
|
+ # 更新 comboBox 的初始内容
|
|
1367
|
+ self.updater.update_combo_box()
|
1309
|
1368
|
|
1310
|
1369
|
self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 1)
|
1311
|
1370
|
|
|
@@ -1324,6 +1383,8 @@ class Ui_MainWindow(object):
|
1324
|
1383
|
self.createFile.setFont(font)
|
1325
|
1384
|
self.createFile.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
1326
|
1385
|
self.createFile.setStyleSheet(u"background-color: rgb(52, 59, 72);")
|
|
1386
|
+ # 将 createFile 按钮的点击事件与 自身的create_database_and_tables 函数关联,用于创建数据库
|
|
1387
|
+ self.createFile.clicked.connect(create_database_and_tables)
|
1327
|
1388
|
icon4 = QIcon()
|
1328
|
1389
|
icon4.addFile(u":/icons/images/icons/cil-folder-open.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
|
1329
|
1390
|
self.createFile.setIcon(icon4)
|
|
@@ -1844,6 +1905,7 @@ class Ui_MainWindow(object):
|
1844
|
1905
|
self.tabWidget.setCurrentIndex(0)
|
1845
|
1906
|
# setupUi
|
1846
|
1907
|
|
|
1908
|
+ # UI中的文字样式以及文字内容,Unicode编码的形式进行文字编辑的
|
1847
|
1909
|
def retranslateUi(self, MainWindow):
|
1848
|
1910
|
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
1849
|
1911
|
self.titleLeftApp.setText(
|
|
@@ -1937,15 +1999,6 @@ class Ui_MainWindow(object):
|
1937
|
1999
|
u"<html><head/><body><p><span style=\" font-weight:700;\">\u5bfc\u5165Excel\u8868\u683c</span></p></body></html>",
|
1938
|
2000
|
None))
|
1939
|
2001
|
self.label.setText(QCoreApplication.translate("MainWindow", u"\u9009\u62e9\u9879\u76ee\uff1a", None))
|
1940
|
|
- self.comboBox.setItemText(0, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1941
|
|
- self.comboBox.setItemText(1, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1942
|
|
- self.comboBox.setItemText(2, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1943
|
|
- self.comboBox.setItemText(3, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1944
|
|
- self.comboBox.setItemText(4, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1945
|
|
- self.comboBox.setItemText(5, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1946
|
|
- self.comboBox.setItemText(6, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1947
|
|
- self.comboBox.setItemText(7, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1948
|
|
- self.comboBox.setItemText(8, QCoreApplication.translate("MainWindow", u"\u65b0\u5efa\u9879\u76ee", None))
|
1949
|
2002
|
|
1950
|
2003
|
self.lineEdit.setText("")
|
1951
|
2004
|
self.lineEdit.setPlaceholderText(QCoreApplication.translate("MainWindow",
|
|
@@ -1954,6 +2007,7 @@ class Ui_MainWindow(object):
|
1954
|
2007
|
self.createFile.setText(QCoreApplication.translate("MainWindow", u"\u65b0\u5efa", None))
|
1955
|
2008
|
self.label_4.setText(
|
1956
|
2009
|
QCoreApplication.translate("MainWindow", u"\u9009\u62e9\u8ba1\u7b97\u65b9\u5f0f\uff1a", None))
|
|
2010
|
+
|
1957
|
2011
|
self.comboBox_2.setItemText(0, QCoreApplication.translate("MainWindow",
|
1958
|
2012
|
u"\u63a7\u5236\u7f51\u590d\u6d4b\u5e73\u9762\u57fa\u51c6\u8ba1\u7b97",
|
1959
|
2013
|
None))
|
|
@@ -1977,7 +2031,7 @@ class Ui_MainWindow(object):
|
1977
|
2031
|
u"<html><head/><body><p><span style=\" font-size:11pt; font-weight:700;\">\u8868\u683c\u793a\u4f8b</span></p></body></html>",
|
1978
|
2032
|
None))
|
1979
|
2033
|
self.label_5.setText(QCoreApplication.translate("MainWindow",
|
1980
|
|
- u"<html><head/><body><p><span style=\" font-size:8pt;\">1.\u8bf7\u6309\u5982\u4e0b\u683c\u5f0f\u4fdd\u5b58\u6570\u636e\u8868\uff0c\u53ef\u8bc6\u522bxls\u3001xlsx\u6587\u4ef6\u3002</span></p><p><span style=\" font-size:8pt;\">2.\u7cfb\u7edf\u5c06\u8bc6\u522b\u7b2c\u4e00\u4e2asheet\u6587\u4ef6\uff0c\u6309\u5bf9\u5e94\u5355\u5143\u683c\u8bfb\u53d6\u6570\u636e\uff08\u5982\u5355\u5143\u683c\u9519\u4f4d\uff0c\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u65e0\u6cd5\u8bc6\u522b\uff09</span></p><p><span style=\" font-size:8pt;\">3.\u6700\u5f31\u8fb9\u8fb9\u957f\u76f8\u5bf9\u4e2d\u8bef\u5dee\u53ef\u8bc6\u522b\u5206\u6570\u5f62\u5f0f\uff0c\u4ec5\u652f\u6301\u82f1\u6587\u72b6\u6001\u4e0b\u201c/\u201d\u4f5c\u4e3a\u5206\u9694\u7b26\u3002</span></p><p><span style=\" font-size:8pt;\">4.\u603b\u8fb9\u6570\u8ba1\u7b97\u65f6\uff0c\u5f80\u8fd4\u7b97\u4e24\u6761\u8fb9\u3002</span></p></body></html>",
|
|
2034
|
+ u"<html><head/><body><p><span style=\" font-size:8pt;\">1.\u8bf7\u6309\u5982\u4e0b\u683c\u5f0f\u4fdd\u5b58\u6570\u636e\u8868\uff0c\u53ef\u8bc6\u522bxls\u3001xlsx\u6587\u4ef6\u3002(*\u6c34\u51c6\u6d4b\u6bb5\u9ad8\u5dee\u7a33\u5b9a\u6027\u8ba1\u7b97\u76ee\u524d\u4ec5\u652f\u6301.xlsx\u6587\u4ef6)</span></p><p><span style=\" font-size:8pt;\">2.\u7cfb\u7edf\u5c06\u8bc6\u522b\u7b2c\u4e00\u4e2asheet\u6587\u4ef6\uff0c\u6309\u5bf9\u5e94\u5355\u5143\u683c\u8bfb\u53d6\u6570\u636e\uff08\u5982\u5355\u5143\u683c\u9519\u4f4d\uff0c\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u65e0\u6cd5\u8bc6\u522b\uff09</span></p><p><span style=\" font-size:8pt;\">3.\u6700\u5f31\u8fb9\u8fb9\u957f\u76f8\u5bf9\u4e2d\u8bef\u5dee\u53ef\u8bc6\u522b\u5206\u6570\u5f62\u5f0f\uff0c\u4ec5\u652f\u6301\u82f1\u6587\u72b6\u6001\u4e0b\u201c/\u201d\u4f5c\u4e3a\u5206\u9694\u7b26\u3002</span></p><p><span style=\" font-size:8pt;\">4.\u603b\u8fb9\u6570\u8ba1\u7b97\u65f6\uff0c\u5f80\u8fd4\u7b97\u4e24\u6761\u8fb9\u3002</span></p></body></html>",
|
1981
|
2035
|
None))
|
1982
|
2036
|
self.download_1.setText(QCoreApplication.translate("MainWindow", u"\u793a\u4f8b\u4e0b\u8f7d1", None))
|
1983
|
2037
|
self.download_2.setText(QCoreApplication.translate("MainWindow", u"\u793a\u4f8b\u4e0b\u8f7d2", None))
|
|
@@ -2033,251 +2087,4 @@ class Ui_MainWindow(object):
|
2033
|
2087
|
self.btn_message.setText(QCoreApplication.translate("MainWindow", u"\u5207\u6362\u4e3b\u9898", None))
|
2034
|
2088
|
self.creditsLabel.setText(QCoreApplication.translate("MainWindow", u"\u7248\u6743\u4fe1\u606f", None))
|
2035
|
2089
|
self.version.setText(QCoreApplication.translate("MainWindow", u"v1.0.0", None))
|
2036
|
|
- # retranslateUi
|
2037
|
|
- # 默认第一个参数是self,所以使用时只有一个参数
|
2038
|
|
- # 稳定性成果表
|
2039
|
|
- def Arrange_Data(self, list1):
|
2040
|
|
- # 最终return的
|
2041
|
|
- list2 = []
|
2042
|
|
- # 点号部分
|
2043
|
|
- nlist = []
|
2044
|
|
- for data1 in list1:
|
2045
|
|
- # 点名
|
2046
|
|
- # 存每一行的数据
|
2047
|
|
- resultlist = []
|
2048
|
|
- pn = data1[0].decode('utf-8')
|
2049
|
|
- resultlist.append(pn)
|
2050
|
|
- nlist.append(pn)
|
2051
|
|
- resultlist.append(data1[1])
|
2052
|
|
- resultlist.append(data1[2])
|
2053
|
|
- resultlist.append(data1[3])
|
2054
|
|
- resultlist.append(data1[4])
|
2055
|
|
- resultlist.append(data1[5])
|
2056
|
|
- resultlist.append(data1[6])
|
2057
|
|
- resultlist.append(data1[7])
|
2058
|
|
- resultlist.append(data1[8])
|
2059
|
|
- resultlist.append(data1[9])
|
2060
|
|
- resultlist.append(data1[10])
|
2061
|
|
- resultlist.append(data1[11])
|
2062
|
|
- # 判定1
|
2063
|
|
- an1 = data1[12].decode('utf-8')
|
2064
|
|
- resultlist.append(an1)
|
2065
|
|
- resultlist.append(data1[13])
|
2066
|
|
- resultlist.append(data1[14])
|
2067
|
|
- resultlist.append(data1[15])
|
2068
|
|
- # 判定2
|
2069
|
|
- an2 = data1[16].decode('utf-8')
|
2070
|
|
- resultlist.append(an2)
|
2071
|
|
- list2.append(resultlist)
|
2072
|
|
-
|
2073
|
|
- return nlist, list2
|
2074
|
|
-
|
2075
|
|
- # GS复测成果表
|
2076
|
|
- def Arrange_Data1(self, list1):
|
2077
|
|
- # 最终return的
|
2078
|
|
- list2 = []
|
2079
|
|
- # 点号部分
|
2080
|
|
- nlist = []
|
2081
|
|
- for data1 in list1:
|
2082
|
|
- # 点名
|
2083
|
|
- # 存每一行的数据
|
2084
|
|
- resultlist = []
|
2085
|
|
- pn = data1[0].decode('utf-8')
|
2086
|
|
- resultlist.append(pn)
|
2087
|
|
- nlist.append(pn)
|
2088
|
|
- resultlist.append(data1[1])
|
2089
|
|
- resultlist.append(data1[2])
|
2090
|
|
- resultlist.append(data1[3])
|
2091
|
|
- resultlist.append(data1[4])
|
2092
|
|
- resultlist.append(data1[5])
|
2093
|
|
- resultlist.append(data1[6])
|
2094
|
|
- resultlist.append(data1[7])
|
2095
|
|
- # 判定
|
2096
|
|
- an1 = data1[8].decode('utf-8')
|
2097
|
|
- resultlist.append(an1)
|
2098
|
|
- list2.append(resultlist)
|
2099
|
|
-
|
2100
|
|
- return nlist, list2
|
2101
|
|
-
|
2102
|
|
- # GS基准归算表
|
2103
|
|
- def Arrange_Data2(self, list1):
|
2104
|
|
- # 最终return的
|
2105
|
|
- list2 = []
|
2106
|
|
- # 点号部分
|
2107
|
|
- nlist = []
|
2108
|
|
- for data1 in list1:
|
2109
|
|
- # 点名
|
2110
|
|
- # 存每一行的数据
|
2111
|
|
- resultlist = []
|
2112
|
|
- pn = data1[0].decode('utf-8')
|
2113
|
|
- resultlist.append(pn)
|
2114
|
|
- nlist.append(pn)
|
2115
|
|
- resultlist.append(data1[1])
|
2116
|
|
- resultlist.append(data1[2])
|
2117
|
|
- resultlist.append(data1[3])
|
2118
|
|
- resultlist.append(data1[4])
|
2119
|
|
- resultlist.append(data1[5])
|
2120
|
|
- # 判定
|
2121
|
|
- an1 = data1[6].decode('utf-8')
|
2122
|
|
- resultlist.append(an1)
|
2123
|
|
- list2.append(resultlist)
|
2124
|
|
-
|
2125
|
|
- return nlist, list2
|
2126
|
|
-
|
2127
|
|
- # GC水准测段高差计算成果表
|
2128
|
|
-
|
2129
|
|
-
|
2130
|
|
-
|
2131
|
|
- def Data_in_Cell(self, list1):
|
2132
|
|
- model = QStandardItemModel()
|
2133
|
|
- xx = 0
|
2134
|
|
- while xx < len(list1):
|
2135
|
|
- data1 = list1[xx]
|
2136
|
|
- # 点号
|
2137
|
|
- cell1 = str(data1[0])
|
2138
|
|
- item = QStandardItem(cell1)
|
2139
|
|
- model.setItem(xx, 0, item)
|
2140
|
|
- # 首期
|
2141
|
|
- cell1 = str(round(data1[1], 4))
|
2142
|
|
- item = QStandardItem(cell1)
|
2143
|
|
- model.setItem(xx, 1, item)
|
2144
|
|
- cell1 = str(round(data1[2], 4))
|
2145
|
|
- item = QStandardItem(cell1)
|
2146
|
|
- model.setItem(xx, 2, item)
|
2147
|
|
- # 上期
|
2148
|
|
- cell1 = str(round(data1[3], 4))
|
2149
|
|
- item = QStandardItem(cell1)
|
2150
|
|
- model.setItem(xx, 3, item)
|
2151
|
|
- cell1 = str(round(data1[4], 4))
|
2152
|
|
- item = QStandardItem(cell1)
|
2153
|
|
- model.setItem(xx, 4, item)
|
2154
|
|
- # 权
|
2155
|
|
- cell1 = str(int(data1[5]))
|
2156
|
|
- item = QStandardItem(cell1)
|
2157
|
|
- model.setItem(xx, 5, item)
|
2158
|
|
- # 本期
|
2159
|
|
- cell1 = str(round(data1[6], 4))
|
2160
|
|
- item = QStandardItem(cell1)
|
2161
|
|
- model.setItem(xx, 6, item)
|
2162
|
|
- cell1 = str(round(data1[7], 4))
|
2163
|
|
- item = QStandardItem(cell1)
|
2164
|
|
- model.setItem(xx, 7, item)
|
2165
|
|
- # 权
|
2166
|
|
- cell1 = str(int(data1[8]))
|
2167
|
|
- item = QStandardItem(cell1)
|
2168
|
|
- model.setItem(xx, 8, item)
|
2169
|
|
- # 本-首
|
2170
|
|
- cell1 = str(round(data1[9], 1))
|
2171
|
|
- item = QStandardItem(cell1)
|
2172
|
|
- model.setItem(xx, 9, item)
|
2173
|
|
- cell1 = str(round(data1[10], 1))
|
2174
|
|
- item = QStandardItem(cell1)
|
2175
|
|
- model.setItem(xx, 10, item)
|
2176
|
|
- cell1 = str(round(data1[11], 1))
|
2177
|
|
- item = QStandardItem(cell1)
|
2178
|
|
- model.setItem(xx, 11, item)
|
2179
|
|
- # 判定(如果是稳定则不显示)
|
2180
|
|
- cell1 = str(data1[12])
|
2181
|
|
- if cell1 == '稳定':
|
2182
|
|
- cell1 = ''
|
2183
|
|
- item = QStandardItem(cell1)
|
2184
|
|
- model.setItem(xx, 12, item)
|
2185
|
|
- # 本-上
|
2186
|
|
- cell1 = str(round(data1[13], 1))
|
2187
|
|
- item = QStandardItem(cell1)
|
2188
|
|
- model.setItem(xx, 13, item)
|
2189
|
|
- cell1 = str(round(data1[14], 1))
|
2190
|
|
- item = QStandardItem(cell1)
|
2191
|
|
- model.setItem(xx, 14, item)
|
2192
|
|
- cell1 = str(round(data1[15], 1))
|
2193
|
|
- item = QStandardItem(cell1)
|
2194
|
|
- model.setItem(xx, 15, item)
|
2195
|
|
- # 判定
|
2196
|
|
- cell1 = str(data1[16])
|
2197
|
|
- if cell1 == '稳定':
|
2198
|
|
- cell1 = ''
|
2199
|
|
- item = QStandardItem(cell1)
|
2200
|
|
- model.setItem(xx, 16, item)
|
2201
|
|
- xx = xx + 1
|
2202
|
|
- return model
|
2203
|
|
-
|
2204
|
|
- # GS复测成果表
|
2205
|
|
- def Data_in_Cell1(self, list1):
|
2206
|
|
- model = QStandardItemModel()
|
2207
|
|
- xx = 0
|
2208
|
|
- while xx < len(list1):
|
2209
|
|
- data1 = list1[xx]
|
2210
|
|
- # 点号
|
2211
|
|
- cell1 = str(data1[0])
|
2212
|
|
- item = QStandardItem(cell1)
|
2213
|
|
- model.setItem(xx, 0, item)
|
2214
|
|
- # 上期
|
2215
|
|
- cell1 = str(round(data1[1], 4))
|
2216
|
|
- item = QStandardItem(cell1)
|
2217
|
|
- model.setItem(xx, 1, item)
|
2218
|
|
- cell1 = str(round(data1[2], 4))
|
2219
|
|
- item = QStandardItem(cell1)
|
2220
|
|
- model.setItem(xx, 2, item)
|
2221
|
|
- # 本期
|
2222
|
|
- cell1 = str(round(data1[3], 4))
|
2223
|
|
- item = QStandardItem(cell1)
|
2224
|
|
- model.setItem(xx, 3, item)
|
2225
|
|
- cell1 = str(round(data1[4], 4))
|
2226
|
|
- item = QStandardItem(cell1)
|
2227
|
|
- model.setItem(xx, 4, item)
|
2228
|
|
- # 上-本
|
2229
|
|
- cell1 = str(round(data1[5], 1))
|
2230
|
|
- item = QStandardItem(cell1)
|
2231
|
|
- model.setItem(xx, 5, item)
|
2232
|
|
- cell1 = str(round(data1[6], 1))
|
2233
|
|
- item = QStandardItem(cell1)
|
2234
|
|
- model.setItem(xx, 6, item)
|
2235
|
|
- cell1 = str(round(data1[7], 1))
|
2236
|
|
- item = QStandardItem(cell1)
|
2237
|
|
- model.setItem(xx, 7, item)
|
2238
|
|
- # 判定(如果是稳定则不显示)
|
2239
|
|
- cell1 = str(data1[8])
|
2240
|
|
- if cell1 == '稳定':
|
2241
|
|
- cell1 = ''
|
2242
|
|
- item = QStandardItem(cell1)
|
2243
|
|
- model.setItem(xx, 8, item)
|
2244
|
|
- xx = xx + 1
|
2245
|
|
- return model
|
2246
|
|
-
|
2247
|
|
- # GS基准归算表
|
2248
|
|
- def Data_in_Cell2(self, list1):
|
2249
|
|
- model = QStandardItemModel()
|
2250
|
|
- xx = 0
|
2251
|
|
- while xx < len(list1):
|
2252
|
|
- data1 = list1[xx]
|
2253
|
|
- # 点号
|
2254
|
|
- cell1 = str(data1[0])
|
2255
|
|
- item = QStandardItem(cell1)
|
2256
|
|
- model.setItem(xx, 0, item)
|
2257
|
|
- # 计算
|
2258
|
|
- cell1 = str(round(data1[1], 4))
|
2259
|
|
- item = QStandardItem(cell1)
|
2260
|
|
- model.setItem(xx, 1, item)
|
2261
|
|
- cell1 = str(round(data1[2], 4))
|
2262
|
|
- item = QStandardItem(cell1)
|
2263
|
|
- model.setItem(xx, 2, item)
|
2264
|
|
- # 上-计
|
2265
|
|
- cell1 = str(round(data1[3], 1))
|
2266
|
|
- item = QStandardItem(cell1)
|
2267
|
|
- model.setItem(xx, 3, item)
|
2268
|
|
- cell1 = str(round(data1[4], 1))
|
2269
|
|
- item = QStandardItem(cell1)
|
2270
|
|
- model.setItem(xx, 4, item)
|
2271
|
|
- cell1 = str(round(data1[5], 1))
|
2272
|
|
- item = QStandardItem(cell1)
|
2273
|
|
- model.setItem(xx, 5, item)
|
2274
|
|
- # 判定(如果是稳定则不显示)
|
2275
|
|
- cell1 = str(data1[6])
|
2276
|
|
- if cell1 == '稳定':
|
2277
|
|
- cell1 = ''
|
2278
|
|
- item = QStandardItem(cell1)
|
2279
|
|
- model.setItem(xx, 6, item)
|
2280
|
|
- xx = xx + 1
|
2281
|
|
- return model
|
2282
|
|
-
|
2283
|
2090
|
|