浏览代码

Merge remote-tracking branch 'origin/master'

wzp 5 个月前
父节点
当前提交
ea68c86d64

+ 12
- 0
.idea/20241211.iml 查看文件

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="PYTHON_MODULE" version="4">
3
+  <component name="NewModuleRootManager">
4
+    <content url="file://$MODULE_DIR$" />
5
+    <orderEntry type="inheritedJdk" />
6
+    <orderEntry type="sourceFolder" forTests="false" />
7
+  </component>
8
+  <component name="PyDocumentationSettings">
9
+    <option name="format" value="PLAIN" />
10
+    <option name="myDocStringFormat" value="Plain" />
11
+  </component>
12
+</module>

+ 6
- 0
.idea/inspectionProfiles/profiles_settings.xml 查看文件

@@ -0,0 +1,6 @@
1
+<component name="InspectionProjectProfileManager">
2
+  <settings>
3
+    <option name="USE_PROJECT_PROFILE" value="false" />
4
+    <version value="1.0" />
5
+  </settings>
6
+</component>

+ 7
- 0
.idea/misc.xml 查看文件

@@ -0,0 +1,7 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Black">
4
+    <option name="sdkName" value="Python 3.12" />
5
+  </component>
6
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
7
+</project>

+ 8
- 0
.idea/modules.xml 查看文件

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/20241211.iml" filepath="$PROJECT_DIR$/.idea/20241211.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml 查看文件

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="" vcs="Git" />
5
+  </component>
6
+</project>

+ 135
- 0
.idea/workspace.xml 查看文件

@@ -0,0 +1,135 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="AutoImportSettings">
4
+    <option name="autoReloadType" value="SELECTIVE" />
5
+  </component>
6
+  <component name="ChangeListManager">
7
+    <list default="true" id="6d1a886d-ec9c-4f93-8633-d9bd0340f3de" name="Changes" comment="">
8
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/Back/GS/GSshow.py" beforeDir="false" afterPath="$PROJECT_DIR$/Back/GS/GSshow.py" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/Back/Program_Run/data_show.py" beforeDir="false" afterPath="$PROJECT_DIR$/Back/Program_Run/data_show.py" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/Back/WD/WDshow.py" beforeDir="false" afterPath="$PROJECT_DIR$/Back/WD/WDshow.py" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/Front/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/Front/main.py" afterDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/Front/modules/ui_functions.py" beforeDir="false" afterPath="$PROJECT_DIR$/Front/modules/ui_functions.py" afterDir="false" />
14
+      <change beforePath="$PROJECT_DIR$/Front/modules/ui_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/Front/modules/ui_main.py" afterDir="false" />
15
+      <change beforePath="$PROJECT_DIR$/SQL/1.db" beforeDir="false" afterPath="$PROJECT_DIR$/SQL/1.db" afterDir="false" />
16
+    </list>
17
+    <option name="SHOW_DIALOG" value="false" />
18
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
19
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
20
+    <option name="LAST_RESOLUTION" value="IGNORE" />
21
+  </component>
22
+  <component name="Git.Settings">
23
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
24
+  </component>
25
+  <component name="ProjectColorInfo">{
26
+  &quot;associatedIndex&quot;: 8
27
+}</component>
28
+  <component name="ProjectId" id="2q9K972QFOVEF4xxviaXNtlrMe1" />
29
+  <component name="ProjectViewState">
30
+    <option name="hideEmptyMiddlePackages" value="true" />
31
+    <option name="showLibraryContents" value="true" />
32
+  </component>
33
+  <component name="PropertiesComponent">{
34
+  &quot;keyToString&quot;: {
35
+    &quot;Python.main.executor&quot;: &quot;Run&quot;,
36
+    &quot;Python.main_new.executor&quot;: &quot;Run&quot;,
37
+    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
38
+    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
39
+    &quot;last_opened_file_path&quot;: &quot;D:/4work_now/20240819GS/pyside6_test/treewidget.py&quot;,
40
+    &quot;settings.editor.selected.configurable&quot;: &quot;File.Encoding&quot;
41
+  }
42
+}</component>
43
+  <component name="RunManager" selected="Python.main">
44
+    <configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
45
+      <module name="20241211" />
46
+      <option name="ENV_FILES" value="" />
47
+      <option name="INTERPRETER_OPTIONS" value="" />
48
+      <option name="PARENT_ENVS" value="true" />
49
+      <envs>
50
+        <env name="PYTHONUNBUFFERED" value="1" />
51
+      </envs>
52
+      <option name="SDK_HOME" value="" />
53
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Front" />
54
+      <option name="IS_MODULE_SDK" value="true" />
55
+      <option name="ADD_CONTENT_ROOTS" value="true" />
56
+      <option name="ADD_SOURCE_ROOTS" value="true" />
57
+      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Front/main.py" />
58
+      <option name="PARAMETERS" value="" />
59
+      <option name="SHOW_COMMAND_LINE" value="false" />
60
+      <option name="EMULATE_TERMINAL" value="false" />
61
+      <option name="MODULE_MODE" value="false" />
62
+      <option name="REDIRECT_INPUT" value="false" />
63
+      <option name="INPUT_FILE" value="" />
64
+      <method v="2" />
65
+    </configuration>
66
+    <configuration name="main_new" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
67
+      <module name="20241211" />
68
+      <option name="ENV_FILES" value="" />
69
+      <option name="INTERPRETER_OPTIONS" value="" />
70
+      <option name="PARENT_ENVS" value="true" />
71
+      <envs>
72
+        <env name="PYTHONUNBUFFERED" value="1" />
73
+      </envs>
74
+      <option name="SDK_HOME" value="" />
75
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Front" />
76
+      <option name="IS_MODULE_SDK" value="true" />
77
+      <option name="ADD_CONTENT_ROOTS" value="true" />
78
+      <option name="ADD_SOURCE_ROOTS" value="true" />
79
+      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Front/main_new.py" />
80
+      <option name="PARAMETERS" value="" />
81
+      <option name="SHOW_COMMAND_LINE" value="false" />
82
+      <option name="EMULATE_TERMINAL" value="false" />
83
+      <option name="MODULE_MODE" value="false" />
84
+      <option name="REDIRECT_INPUT" value="false" />
85
+      <option name="INPUT_FILE" value="" />
86
+      <method v="2" />
87
+    </configuration>
88
+    <recent_temporary>
89
+      <list>
90
+        <item itemvalue="Python.main" />
91
+        <item itemvalue="Python.main_new" />
92
+      </list>
93
+    </recent_temporary>
94
+  </component>
95
+  <component name="SharedIndexes">
96
+    <attachedChunks>
97
+      <set>
98
+        <option value="bundled-python-sdk-ce3d9afa04ac-ba05f1cad1b1-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-242.20224.347" />
99
+      </set>
100
+    </attachedChunks>
101
+  </component>
102
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
103
+  <component name="TaskManager">
104
+    <task active="true" id="Default" summary="Default task">
105
+      <changelist id="6d1a886d-ec9c-4f93-8633-d9bd0340f3de" name="Changes" comment="" />
106
+      <created>1734069197314</created>
107
+      <option name="number" value="Default" />
108
+      <option name="presentableId" value="Default" />
109
+      <updated>1734069197314</updated>
110
+    </task>
111
+    <servers />
112
+  </component>
113
+  <component name="Vcs.Log.Tabs.Properties">
114
+    <option name="TAB_STATES">
115
+      <map>
116
+        <entry key="MAIN">
117
+          <value>
118
+            <State />
119
+          </value>
120
+        </entry>
121
+      </map>
122
+    </option>
123
+  </component>
124
+  <component name="XDebuggerManager">
125
+    <breakpoint-manager>
126
+      <breakpoints>
127
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
128
+          <url>file://$PROJECT_DIR$/Front/main_new.py</url>
129
+          <line>725</line>
130
+          <option name="timeStamp" value="10" />
131
+        </line-breakpoint>
132
+      </breakpoints>
133
+    </breakpoint-manager>
134
+  </component>
135
+</project>

二进制
Back/GC/__pycache__/GCExport.cpython-312.pyc 查看文件


+ 103
- 4
Back/GS/GSshow.py 查看文件

@@ -13,10 +13,15 @@ def main_function(ui, db_path, utf_en):
13 13
     ui.tabWidget.setTabText(0, '复测成果表')
14 14
     ui.tabWidget.setTabText(1, '基准归算模型')
15 15
     ui.tabWidget.setTabText(2, '复测基准归算表')
16
+
16 17
     # 连接到数据库
17 18
     db1 = sqlite3.connect(db_path)
18 19
     db1.text_factory = lambda x: str(x, 'utf-8')
19 20
     cursor1 = db1.cursor()
21
+    # 隐藏 QLabel
22
+    ui.default_remind.hide()
23
+
24
+
20 25
     # 查询表内符合的所有数据(分成两个结果分别显示)
21 26
     # 注意查询中的tablename,数据库中如果没有相同的表名,会报错,所以需要先判断一下
22 27
     # 复测成果表
@@ -33,8 +38,6 @@ def main_function(ui, db_path, utf_en):
33 38
     nlist1, plist1 = Arrange_Data1(result1)
34 39
     nlist2, plist2 = Arrange_Data2(result2)
35 40
 
36
-    # 创建一个数据模型(复测成果表)
37
-    model1 = QStandardItemModel()
38 41
     model1 = Data_in_Cell1(plist1)
39 42
     model1.setHorizontalHeaderLabels(
40 43
         ['点名', '前期X', '前期Y', '本期X', '本期Y', '前期-本期X', '前期-本期Y', '前期-本期P', '位移判定'])
@@ -46,8 +49,6 @@ def main_function(ui, db_path, utf_en):
46 49
     # 隐藏 QLabel
47 50
     ui.default_remind.hide()
48 51
 
49
-    # 创建一个数据模型(基准归算表)
50
-    model2 = QStandardItemModel()
51 52
     model2 = Data_in_Cell2(plist2)
52 53
     model2.setHorizontalHeaderLabels(
53 54
         ['点名', '基准归算X', '基准归算Y', '前期-归算X', '前期-归算Y', '前期-归算P', '位移判定'])
@@ -83,3 +84,101 @@ li.checked::marker {{ content: "\\2612"; }}
83 84
 <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为{str1}已知系统的{str2}归算坐标。</span></p></body></html>"""
84 85
 
85 86
     ui.printTableView.setHtml(str0)
87
+
88
+def main_function1(ui, db_path, utf_en):
89
+    # 就用已有的选项卡
90
+    ui.View.setTabVisible(0, True)
91
+    ui.View.setTabVisible(1, True)
92
+    ui.View.setTabVisible(2, True)
93
+    ui.View.setTabVisible(3, True)
94
+    # 重新设置文字名称
95
+    ui.View.setTabText(0, '输入数据')
96
+    ui.View.setTabText(1, '基准归算模型')
97
+    ui.View.setTabText(2, '复测基准归算表')
98
+    ui.View.setTabText(3, '复测成果表')
99
+
100
+    # 连接到数据库
101
+    db1 = sqlite3.connect(db_path)
102
+    db1.text_factory = lambda x: str(x, 'utf-8')
103
+    cursor1 = db1.cursor()
104
+
105
+    #输入数据
106
+    sqlstr00 = 'select PointName,Last_X,Last_Y,New_X,New_Y,cgcs from GS_Input_Point WHERE TableName = ?'
107
+    sqlstr10 = 'select Last_ResultName,New_ResultName,Avg_SL,Ms_Dir,Ms_WSL,SL_Count,Dir_Count,Scale_Value from GS_Input_Param WHERE TableName = ?'
108
+    cursor1.execute(sqlstr00, (utf_en,))
109
+    result00 = cursor1.fetchall()
110
+    cursor1.execute(sqlstr10, (utf_en,))
111
+    result10 = cursor1.fetchall()
112
+    model0,nlist0 = GS_In_Data(result00,result10[0])
113
+    model0.setHorizontalHeaderLabels(
114
+        ['点名', '前期X', '前期Y', '本期X', '本期Y','成果次数','上期成果名','本期成果名','平均边长','方向值中误差','最弱边边长相对中误差','总测边数','总方向观测数','缩放值'])
115
+    model0.setVerticalHeaderLabels(nlist0)
116
+    # 展示表格
117
+    ui.resultTableView1.setModel(model0)
118
+    ui.resultTableView1.show()
119
+    # 隐藏 QLabel
120
+    ui.default_remind1.hide()
121
+
122
+
123
+    # 查询表内符合的所有数据(分成两个结果分别显示)
124
+    # 注意查询中的tablename,数据库中如果没有相同的表名,会报错,所以需要先判断一下
125
+    # 复测成果表
126
+    sqlstr1 = 'select PointName,Last_X,Last_Y,Result_X,Result_Y,Last_ResultX,Last_ResultY,Last_ResultP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
127
+    cursor1.execute(sqlstr1, (utf_en,))
128
+    result1 = cursor1.fetchall()
129
+
130
+    # 基准归算表
131
+    sqlstr11 = 'select PointName,Cal_X,Cal_Y,Last_CalX,Last_CalY,Last_CalP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
132
+    cursor1.execute(sqlstr11, (utf_en,))
133
+    result2 = cursor1.fetchall()
134
+
135
+    # 对结果集进行处理,把汉字转换过来, 添加表头部分
136
+    nlist1, plist1 = Arrange_Data1(result1)
137
+    nlist2, plist2 = Arrange_Data2(result2)
138
+
139
+    model1 = Data_in_Cell1(plist1)
140
+    model1.setHorizontalHeaderLabels(
141
+        ['点名', '前期X', '前期Y', '本期X', '本期Y', '前期-本期X', '前期-本期Y', '前期-本期P', '位移判定'])
142
+    model1.setVerticalHeaderLabels(nlist1)
143
+
144
+    # 展示表格
145
+    ui.inputTableView1.setModel(model1)
146
+    ui.inputTableView1.show()
147
+    # 隐藏 QLabel
148
+    ui.default_remind1.hide()
149
+
150
+    model2 = Data_in_Cell2(plist2)
151
+    model2.setHorizontalHeaderLabels(
152
+        ['点名', '基准归算X', '基准归算Y', '前期-归算X', '前期-归算Y', '前期-归算P', '位移判定'])
153
+    model2.setVerticalHeaderLabels(nlist2)
154
+
155
+    # 展示表格
156
+    ui.reconTableView1.setModel(model2)
157
+    ui.reconTableView1.show()
158
+
159
+    # 富文本的html
160
+    sqlstr2 = 'select Last_ResultName, New_ResultName, Formula_X1, Formula_X2, Formula_X3, Formula_Y1, Formula_Y2, Formula_Y3 from GS_Trans_Param WHERE TableName = ?'
161
+    cursor1.execute(sqlstr2, (utf_en,))
162
+    result3 = cursor1.fetchone()
163
+    # 检查 result3 是否为 None
164
+    if result3 is None:
165
+        str0 = "<p>未找到相关数据。</p>"
166
+    else:
167
+        str1 = result3[0].decode('utf-8') if isinstance(result3[0], bytes) else result3[0]
168
+        str2 = result3[1].decode('utf-8') if isinstance(result3[1], bytes) else result3[1]
169
+        n1, n2, n3, n4, n5, n6 = result3[2], result3[3], result3[4], result3[5], result3[6], result3[7]
170
+
171
+        str0 = f"""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
172
+<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
173
+p, li {{ white-space: pre-wrap; }}
174
+hr {{ height: 1px; border-width: 0; }}
175
+li.unchecked::marker {{ content: "\\2610"; }}
176
+li.checked::marker {{ content: "\\2612"; }}
177
+</style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
178
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; color:#000000;">{str2}--{str1}</span><span style=" font-size:14pt;">已知系统转换公式:</span></p>
179
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">X</span><span style=" font-size:14pt;">=({n1})</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+({n2})</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+({n3})</span></p>
180
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">Y</span><span style=" font-size:14pt;">=({n4})</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+({n5})</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+({n6})</span></p>
181
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为{str2}坐标;</span></p>
182
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为{str1}已知系统的{str2}归算坐标。</span></p></body></html>"""
183
+
184
+    ui.printTableView1.setHtml(str0)

二进制
Back/GS/__pycache__/GSExport.cpython-312.pyc 查看文件


二进制
Back/Program_Run/__pycache__/__init__.cpython-312.pyc 查看文件


二进制
Back/Program_Run/__pycache__/data_show.cpython-312.pyc 查看文件


二进制
Back/Program_Run/__pycache__/database_operations.cpython-312.pyc 查看文件


二进制
Back/Program_Run/__pycache__/file_system_watching.cpython-312.pyc 查看文件


+ 240
- 1
Back/Program_Run/data_show.py 查看文件

@@ -1,4 +1,6 @@
1 1
 # 数据处理相关代码
2
+from time import process_time_ns
3
+
2 4
 from PySide6.QtGui import QStandardItemModel, QStandardItem
3 5
 # 稳定性成果表
4 6
 def Arrange_Data(list1):
@@ -240,4 +242,241 @@ def Data_in_Cell2(list1):
240 242
         item = QStandardItem(cell1)
241 243
         model.setItem(xx, 6, item)
242 244
         xx = xx + 1
243
-    return model
245
+    return model
246
+
247
+#稳定性分析输入显示
248
+def WD_In_Data(list1,list0):
249
+    # 最终return的
250
+    list2 = []
251
+    # 点号部分
252
+    nlist = []
253
+    ii = 0
254
+    for data1 in list1:
255
+        # 点名
256
+        # 存每一行的数据
257
+        resultlist = []
258
+        pn = data1[0].decode('utf-8')
259
+        resultlist.append(pn)
260
+        nlist.append(pn)
261
+        resultlist.append(data1[1])
262
+        resultlist.append(data1[2])
263
+        resultlist.append(data1[3])
264
+        resultlist.append(data1[4])
265
+        resultlist.append(data1[5])
266
+        resultlist.append(data1[6])
267
+        resultlist.append(data1[7])
268
+        if ii == 0:
269
+            frn = list0[0].decode('utf-8')
270
+            resultlist.append(frn)
271
+            prn = list0[1].decode('utf-8')
272
+            resultlist.append(prn)
273
+            nrn = list0[2].decode('utf-8')
274
+            resultlist.append(nrn)
275
+            resultlist.append(list0[3])
276
+            resultlist.append(list0[4])
277
+            resultlist.append(list0[5])
278
+            resultlist.append(list0[6])
279
+            resultlist.append(list0[7])
280
+            ii = ii + 1
281
+        else:
282
+            resultlist.append('')
283
+            resultlist.append('')
284
+            resultlist.append('')
285
+            resultlist.append(0)
286
+            resultlist.append(0)
287
+            resultlist.append(0)
288
+            resultlist.append(0)
289
+            resultlist.append(0)
290
+        list2.append(resultlist)
291
+    model = QStandardItemModel()
292
+    xx = 0
293
+    while xx < len(list2):
294
+        data1 = list2[xx]
295
+        # 点号
296
+        cell1 = str(data1[0])
297
+        item = QStandardItem(cell1)
298
+        model.setItem(xx, 0, item)
299
+        # 首期
300
+        cell1 = str(round(data1[1], 4))
301
+        item = QStandardItem(cell1)
302
+        model.setItem(xx, 1, item)
303
+        cell1 = str(round(data1[2], 4))
304
+        item = QStandardItem(cell1)
305
+        model.setItem(xx, 2, item)
306
+        # 上期
307
+        cell1 = str(round(data1[3], 4))
308
+        item = QStandardItem(cell1)
309
+        model.setItem(xx, 3, item)
310
+        cell1 = str(round(data1[4], 4))
311
+        item = QStandardItem(cell1)
312
+        model.setItem(xx, 4, item)
313
+        # 权
314
+        cell1 = str(int(data1[5]))
315
+        item = QStandardItem(cell1)
316
+        model.setItem(xx, 5, item)
317
+        # 本期
318
+        cell1 = str(round(data1[6], 4))
319
+        item = QStandardItem(cell1)
320
+        model.setItem(xx, 6, item)
321
+        cell1 = str(round(data1[7], 4))
322
+        item = QStandardItem(cell1)
323
+        model.setItem(xx, 7, item)
324
+        # 几个参数
325
+        cell1 = str(data1[8])
326
+        item = QStandardItem(cell1)
327
+        model.setItem(xx, 8, item)
328
+        cell1 = str(data1[9])
329
+        item = QStandardItem(cell1)
330
+        model.setItem(xx, 9, item)
331
+        cell1 = str(data1[10])
332
+        item = QStandardItem(cell1)
333
+        model.setItem(xx, 10, item)
334
+        if data1[11] == 0 and data1[12] == 0:
335
+            cell1 = str('')
336
+            item = QStandardItem(cell1)
337
+            model.setItem(xx, 11, item)
338
+            cell1 = str('')
339
+            item = QStandardItem(cell1)
340
+            model.setItem(xx, 12, item)
341
+            cell1 = str('')
342
+            item = QStandardItem(cell1)
343
+            model.setItem(xx, 13, item)
344
+            cell1 = str('')
345
+            item = QStandardItem(cell1)
346
+            model.setItem(xx, 14, item)
347
+            cell1 = str('')
348
+            item = QStandardItem(cell1)
349
+            model.setItem(xx, 15, item)
350
+        else:
351
+            cell1 = str(round(data1[11], 2))
352
+            item = QStandardItem(cell1)
353
+            model.setItem(xx, 11, item)
354
+            cell1 = str(round(data1[12], 2))
355
+            item = QStandardItem(cell1)
356
+            model.setItem(xx, 12, item)
357
+            cell1 = str(round(data1[13], 2))
358
+            item = QStandardItem(cell1)
359
+            model.setItem(xx, 13, item)
360
+            cell1 = str(round(data1[14], 2))
361
+            item = QStandardItem(cell1)
362
+            model.setItem(xx, 14, item)
363
+            cell1 = str(round(data1[15], 2))
364
+            item = QStandardItem(cell1)
365
+            model.setItem(xx, 15, item)
366
+        xx = xx + 1
367
+    return model,nlist
368
+
369
+#改算计算输入显示
370
+def GS_In_Data(list1,list0):
371
+    # 最终return的
372
+    list2 = []
373
+    # 点号部分
374
+    nlist = []
375
+    ii = 0
376
+    for data1 in list1:
377
+        # 点名
378
+        # 存每一行的数据
379
+        resultlist = []
380
+        pn = data1[0].decode('utf-8')
381
+        resultlist.append(pn)
382
+        nlist.append(pn)
383
+        resultlist.append(data1[1])
384
+        resultlist.append(data1[2])
385
+        resultlist.append(data1[3])
386
+        resultlist.append(data1[4])
387
+        resultlist.append(data1[5])
388
+        if ii == 0:
389
+            prn = list0[0].decode('utf-8')
390
+            resultlist.append(prn)
391
+            nrn = list0[1].decode('utf-8')
392
+            resultlist.append(nrn)
393
+            resultlist.append(list0[2])
394
+            resultlist.append(list0[3])
395
+            resultlist.append(list0[4])
396
+            resultlist.append(list0[5])
397
+            resultlist.append(list0[6])
398
+            resultlist.append(list0[7])
399
+            ii = ii + 1
400
+        else:
401
+            resultlist.append('')
402
+            resultlist.append('')
403
+            resultlist.append(0)
404
+            resultlist.append(0)
405
+            resultlist.append(0)
406
+            resultlist.append(0)
407
+            resultlist.append(0)
408
+            resultlist.append(0)
409
+        list2.append(resultlist)
410
+    model = QStandardItemModel()
411
+    xx = 0
412
+    while xx < len(list2):
413
+        data1 = list2[xx]
414
+        # 点号
415
+        cell1 = str(data1[0])
416
+        item = QStandardItem(cell1)
417
+        model.setItem(xx, 0, item)
418
+        # 首期
419
+        cell1 = str(round(data1[1], 4))
420
+        item = QStandardItem(cell1)
421
+        model.setItem(xx, 1, item)
422
+        cell1 = str(round(data1[2], 4))
423
+        item = QStandardItem(cell1)
424
+        model.setItem(xx, 2, item)
425
+        # 上期
426
+        cell1 = str(round(data1[3], 4))
427
+        item = QStandardItem(cell1)
428
+        model.setItem(xx, 3, item)
429
+        cell1 = str(round(data1[4], 4))
430
+        item = QStandardItem(cell1)
431
+        model.setItem(xx, 4, item)
432
+        # 权
433
+        cell1 = str(int(data1[5]))
434
+        item = QStandardItem(cell1)
435
+        model.setItem(xx, 5, item)
436
+        #几个参数
437
+        cell1 = str(data1[6])
438
+        item = QStandardItem(cell1)
439
+        model.setItem(xx, 6, item)
440
+        cell1 = str(data1[7])
441
+        item = QStandardItem(cell1)
442
+        model.setItem(xx, 7, item)
443
+        if data1[8] == 0 and data1[9] == 0:
444
+            cell1 = str('')
445
+            item = QStandardItem(cell1)
446
+            model.setItem(xx, 8, item)
447
+            cell1 = str('')
448
+            item = QStandardItem(cell1)
449
+            model.setItem(xx, 9, item)
450
+            cell1 = str('')
451
+            item = QStandardItem(cell1)
452
+            model.setItem(xx, 10, item)
453
+            cell1 = str('')
454
+            item = QStandardItem(cell1)
455
+            model.setItem(xx, 11, item)
456
+            cell1 = str('')
457
+            item = QStandardItem(cell1)
458
+            model.setItem(xx, 12, item)
459
+            cell1 = str('')
460
+            item = QStandardItem(cell1)
461
+            model.setItem(xx, 13, item)
462
+        else:
463
+            cell1 = str(round(data1[8], 2))
464
+            item = QStandardItem(cell1)
465
+            model.setItem(xx, 8, item)
466
+            cell1 = str(round(data1[9], 2))
467
+            item = QStandardItem(cell1)
468
+            model.setItem(xx, 9, item)
469
+            cell1 = str(format(data1[10], '.3e') )
470
+            item = QStandardItem(cell1)
471
+            model.setItem(xx, 10, item)
472
+            cell1 = str(round(data1[11], 2))
473
+            item = QStandardItem(cell1)
474
+            model.setItem(xx, 11, item)
475
+            cell1 = str(round(data1[12], 2))
476
+            item = QStandardItem(cell1)
477
+            model.setItem(xx, 12, item)
478
+            cell1 = str(round(data1[13], 2))
479
+            item = QStandardItem(cell1)
480
+            model.setItem(xx, 13, item)
481
+        xx = xx + 1
482
+    return model,nlist

+ 92
- 3
Back/WD/WDshow.py 查看文件

@@ -3,7 +3,7 @@ import sqlite3
3 3
 
4 4
 from PySide6.QtGui import QStandardItemModel
5 5
 
6
-
6
+#计算结束后的显示
7 7
 def main_function(ui, db_path, utf_en):
8 8
     # 只显示头两个tab
9 9
     ui.tabWidget.setTabVisible(0, True)
@@ -18,6 +18,7 @@ def main_function(ui, db_path, utf_en):
18 18
     db1 = sqlite3.connect(db_path)
19 19
     # 获取游标
20 20
     cursor1 = db1.cursor()
21
+
21 22
     # 查询表内符合的所有数据
22 23
     sqlstr1 = 'select PointName,First_X,First_Y,Last_X,Last_Y,Last_Wight,Result_X,Result_Y,New_Wight,New_FirstX,New_FirstY,New_FirstP,NFDis_Ass,New_LastX,New_LastY,New_LastP,NLDis_Ass from WD_Result_Point WHERE TableName = ?'
23 24
     cursor1.execute(sqlstr1, (utf_en,))
@@ -25,8 +26,6 @@ def main_function(ui, db_path, utf_en):
25 26
     result = cursor1.fetchall()
26 27
     # 对结果集进行处理,把汉字转换过来,添加表头部分
27 28
     nlist, plist = Arrange_Data(result)
28
-    # 创建一个数据模型
29
-    model = QStandardItemModel()
30 29
     # 把数据放进去
31 30
     model1 = Data_in_Cell(plist)
32 31
     # 设置表头
@@ -73,3 +72,93 @@ li.checked::marker { content: "\2612"; }
73 72
 <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为</span><span style=" font-size:14pt; color:#000000;">""" + str2 + """</span><span style=" font-size:14pt;">坐标;</span></p>
74 73
 <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为""" + str1 + """已知系统的""" + str2 + """归算坐标。</span></p></body></html>"""
75 74
     ui.printTableView.setHtml(str0)
75
+
76
+def main_function1(ui, db_path, utf_en):
77
+    # 只显示头两个tab
78
+    ui.View.setTabVisible(0, True)
79
+    ui.View.setTabVisible(1, True)
80
+    ui.View.setTabVisible(2, True)
81
+    ui.View.setTabVisible(3, False)
82
+    # 重新设置文字名称
83
+    ui.View.setTabText(1, '自由网成果归算模型')
84
+    ui.View.setTabText(2, '稳定性分析成果表')
85
+    ui.View.setTabText(0, '输入数据')
86
+    # 链接数据库并显示
87
+    # 连接到数据库
88
+    # 将结果输出到数据库
89
+    db1 = sqlite3.connect(db_path)
90
+    # 获取游标
91
+    cursor1 = db1.cursor()
92
+    # 查询表内符合的所有输入数据
93
+    sqlstr00 = 'select PointName,First_X,First_Y,Last_X,Last_Y,Wight,New_X,New_Y from WD_Input_Point WHERE TableName = ?'
94
+    cursor1.execute(sqlstr00, (utf_en,))
95
+    # 获取结果集
96
+    result0 = cursor1.fetchall()
97
+    #参数部分
98
+    sqlstr10 = 'select First_ResultName,Last_ResultName,New_ResultName,Avg_SL,Ms_Dir,SL_Count,Dir_Count,Scale_Value from WD_Input_Param WHERE TableName = ?'
99
+    cursor1.execute(sqlstr10, (utf_en,))
100
+    # 获取结果集
101
+    result1 = cursor1.fetchall()
102
+    # 把结果集放进去,把汉字转换过来,添加表头部分
103
+    model0,nlist0 = WD_In_Data(result0,result1[0])
104
+    # 设置表头(先用统称吧,后期修改)
105
+    model0.setHorizontalHeaderLabels(
106
+        ['点名', '首期X', '首期Y', '上期X', '上期Y', '权', '本期X', '本期Y','首期成果名','上期成果名','本期成果名','平均边长','方向值中误差','总边数','总方向数','缩放值'])
107
+    model0.setVerticalHeaderLabels(nlist0)
108
+    # QTableView并将数据模型与之关联
109
+    ui.resultTableView1.setModel(model0)
110
+    ui.resultTableView1.show()
111
+
112
+    # 查询表内符合的所有数据
113
+    sqlstr1 = 'select PointName,First_X,First_Y,Last_X,Last_Y,Last_Wight,Result_X,Result_Y,New_Wight,New_FirstX,New_FirstY,New_FirstP,NFDis_Ass,New_LastX,New_LastY,New_LastP,NLDis_Ass from WD_Result_Point WHERE TableName = ?'
114
+    cursor1.execute(sqlstr1, (utf_en,))
115
+    # 获取结果集
116
+    result = cursor1.fetchall()
117
+    # 对结果集进行处理,把汉字转换过来,添加表头部分
118
+    nlist, plist = Arrange_Data(result)
119
+    # 把数据放进去
120
+    model1 = Data_in_Cell(plist)
121
+    # 设置表头
122
+    model1.setHorizontalHeaderLabels(
123
+        ['点名', '首期X', '首期Y', '上期X', '上期Y', '权', '本期X', '本期Y', '权', '本期-首期X', '本期-首期Y',
124
+         '本期-首期P', '位移判定', '本期-上期X', '本期-上期Y', '本期-上期P', '位移判定'])
125
+    model1.setVerticalHeaderLabels(nlist)
126
+
127
+    # QTableView并将数据模型与之关联
128
+    ui.reconTableView1.setModel(model1)
129
+    ui.reconTableView1.show()
130
+
131
+    # 隐藏 QLabel(默认提示语言)
132
+    ui.default_remind1.hide()
133
+    # 富文本的html
134
+    sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from WD_Result_Param WHERE TableName = ?'
135
+    cursor1.execute(sqlstr2, (utf_en,))
136
+    # 获取结果集
137
+    result2 = cursor1.fetchall()
138
+    str1 = result2[0][0].decode('utf-8')
139
+    str2 = result2[0][1].decode('utf-8')
140
+    n1 = result2[0][2]
141
+    n2 = result2[0][3]
142
+    n3 = result2[0][4]
143
+    n4 = result2[0][5]
144
+    n5 = result2[0][6]
145
+    n6 = result2[0][7]
146
+    str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
147
+<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
148
+p, li { white-space: pre-wrap; }
149
+hr { height: 1px; border-width: 0; }
150
+li.unchecked::marker { content: "\2610"; }
151
+li.checked::marker { content: "\2612"; }
152
+</style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
153
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; color:#000000;">""" + str2 + """--""" + str1 + """</span><span style=" font-size:14pt;">已知系统转换公式:</span></p>
154
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">X</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">""" + str(
155
+        n1) + """</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">""" + str(
156
+        n2) + """</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">""" + str(
157
+        n3) + """</span><span style=" font-size:14pt;">)</span></p>
158
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">Y</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">""" + str(
159
+        n4) + """</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">""" + str(
160
+        n5) + """</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">""" + str(
161
+        n6) + """</span><span style=" font-size:14pt;">)</span></p>
162
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为</span><span style=" font-size:14pt; color:#000000;">""" + str2 + """</span><span style=" font-size:14pt;">坐标;</span></p>
163
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为""" + str1 + """已知系统的""" + str2 + """归算坐标。</span></p></body></html>"""
164
+    ui.printTableView1.setHtml(str0)

二进制
Back/WD/__pycache__/WDExport.cpython-312.pyc 查看文件


+ 357
- 1
Front/main.py 查看文件

@@ -15,7 +15,11 @@
15 15
 # ///////////////////////////////////////////////////////////////
16 16
 import time
17 17
 
18
-from PySide6.QtWidgets import QFileDialog
18
+from PySide6.QtWidgets import QFileDialog,QWidget, QVBoxLayout, QTreeWidget, QApplication, QTreeWidgetItem
19
+from PySide6.QtCore import Signal,  Qt, Slot, QObject
20
+from PySide6.QtSql import QSqlTableModel,QSqlDatabase
21
+import sqlite3
22
+from PySide6.QtGui import QIcon
19 23
 
20 24
 import sys
21 25
 import os
@@ -32,7 +36,12 @@ os.environ["QT_FONT_DPI"] = "96"  # FIX Problem for High DPI and Scale above 100
32 36
 # SET AS GLOBAL WIDGETS
33 37
 # ///////////////////////////////////////////////////////////////
34 38
 widgets = None
39
+excelname = ''
35 40
 
41
+# 获取项目根目录
42
+project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
43
+# 将项目根目录添加到 sys.path
44
+sys.path.append(project_root)
36 45
 
37 46
 # 表格的模型
38 47
 class MyTableModel(QAbstractTableModel):
@@ -56,6 +65,146 @@ class MyTableModel(QAbstractTableModel):
56 65
             return self._data[index.row()][index.column()]
57 66
         return None
58 67
 
68
+#数据一览树状
69
+class TreeWidgetItem:
70
+    def __init__(self, id: any, parent_id: any, name: str, icon: QIcon = None, extend: object = None):
71
+        """
72
+        菜单数据接口
73
+        :param id: ID
74
+        :param parent_id: 父ID
75
+        :param name: 菜单名称
76
+        :param icon: 图标
77
+        :param extend: 扩展数据
78
+        """
79
+        self.id: any = id
80
+        self.parent_id: any = parent_id
81
+        self.name: str = name
82
+        self.extend: object = extend
83
+        # 实例化
84
+        self.treeWidgetItem = QTreeWidgetItem([self.name])
85
+        # 存储相关数据
86
+        self.treeWidgetItem.setData(0, Qt.UserRole + 1, extend)
87
+        self.treeWidgetItem.setIcon(0, QIcon(':/icons/default.png'))
88
+        if icon is not None:
89
+            self.treeWidgetItem.setIcon(0, icon)
90
+
91
+
92
+class ElTreeData(QObject):
93
+    """
94
+    Data Model
95
+    """
96
+    items_changed: Signal = Signal(str)
97
+    styleSheet_changed: Signal = Signal(str)
98
+
99
+    def __init__(self, items: list[TreeWidgetItem] = None, styleSheet: str = None):
100
+        super(ElTreeData, self).__init__()
101
+        # 定义数据
102
+        self._items: list[TreeWidgetItem]
103
+        self._styleSheet: str
104
+        # 初始化数据
105
+        self.items = items
106
+        self.styleSheet = styleSheet
107
+
108
+    @property
109
+    def items(self):
110
+        return self._items
111
+
112
+    @items.setter
113
+    def items(self, value):
114
+        self._items = value
115
+        # 数据改变时发出信号
116
+        self.items_changed.emit(self.items)
117
+
118
+    @property
119
+    def styleSheet(self):
120
+        return self._styleSheet
121
+
122
+    @styleSheet.setter
123
+    def styleSheet(self, value):
124
+        self._styleSheet = value
125
+        # 数据改变时发出信号
126
+        self.styleSheet_changed.emit(self.styleSheet)
127
+
128
+# 全数据库
129
+class ElTree(QWidget):
130
+    """
131
+    Control
132
+    """
133
+    itemClicked: Signal = Signal(object)
134
+    itemDoubleClicked: Signal = Signal(object)
135
+
136
+    def __init__(self, treeData: ElTreeData, parent=None):
137
+        super(ElTree, self).__init__(parent=parent)
138
+
139
+        self.data = treeData
140
+        # 将按钮的点击信号绑定到当前类的点击信号
141
+        widgets.allTreeWidget.itemClicked.connect(lambda item: self.itemClicked.emit(item.data(0, Qt.UserRole + 1)))
142
+        widgets.allTreeWidget.itemDoubleClicked.connect(
143
+            lambda item: self.itemDoubleClicked.emit(item.data(0, Qt.UserRole + 1)))
144
+        self.__render_items(True)
145
+
146
+    def __render_items(self, is_clear: bool):
147
+        if is_clear:
148
+            widgets.allTreeWidget.clear()
149
+            widgets.qureyTreeWidget.clear()
150
+        widgets.allTreeWidget.setColumnCount(1)
151
+        widgets.allTreeWidget.setHeaderHidden(True)
152
+        widgets.qureyTreeWidget.setColumnCount(1)
153
+        widgets.qureyTreeWidget.setHeaderHidden(True)
154
+        if self.data.items is not None:
155
+            # 转为字典
156
+            mapping: dict[any, TreeWidgetItem] = dict(zip([i.id for i in self.data.items], self.data.items))
157
+            # 树容器
158
+            treeWidgetItems: list[QTreeWidgetItem] = []
159
+            for d in self.data.items:
160
+                # 如果找不到父级项,则是根节点
161
+                parent: TreeWidgetItem = mapping.get(d.parent_id)
162
+                if parent is None:
163
+                    treeWidgetItems.append(d.treeWidgetItem)
164
+                else:
165
+                    parent.treeWidgetItem.addChild(d.treeWidgetItem)
166
+
167
+            # 挂载到树上
168
+            widgets.allTreeWidget.insertTopLevelItems(0, treeWidgetItems)
169
+
170
+# 查询
171
+class ElTree1(QWidget):
172
+    """
173
+    Control
174
+    """
175
+    itemClicked: Signal = Signal(object)
176
+    itemDoubleClicked: Signal = Signal(object)
177
+
178
+    def __init__(self, treeData: ElTreeData, parent=None):
179
+        super(ElTree1, self).__init__(parent=parent)
180
+        self.data = treeData
181
+        # 将按钮的点击信号绑定到当前类的点击信号
182
+        widgets.qureyTreeWidget.itemClicked.connect(lambda item: self.itemClicked.emit(item.data(0, Qt.UserRole + 1)))
183
+        widgets.qureyTreeWidget.itemDoubleClicked.connect(
184
+            lambda item: self.itemDoubleClicked.emit(item.data(0, Qt.UserRole + 1)))
185
+        self.__render_items(True)
186
+
187
+    def __render_items(self, is_clear: bool):
188
+        if is_clear:
189
+            widgets.qureyTreeWidget.clear()
190
+        widgets.qureyTreeWidget.setColumnCount(1)
191
+        widgets.qureyTreeWidget.setHeaderHidden(True)
192
+        if self.data.items is not None:
193
+            # 转为字典
194
+            mapping: dict[any, TreeWidgetItem] = dict(zip([i.id for i in self.data.items], self.data.items))
195
+            # 树容器
196
+            treeWidgetItems: list[QTreeWidgetItem] = []
197
+            for d in self.data.items:
198
+                # 如果找不到父级项,则是根节点
199
+                parent: TreeWidgetItem = mapping.get(d.parent_id)
200
+                if parent is None:
201
+                    treeWidgetItems.append(d.treeWidgetItem)
202
+                else:
203
+                    parent.treeWidgetItem.addChild(d.treeWidgetItem)
204
+
205
+            # 挂载到树上
206
+            widgets.qureyTreeWidget.insertTopLevelItems(0, treeWidgetItems)
207
+
59 208
 
60 209
 class MainWindow(QMainWindow):
61 210
 
@@ -117,6 +266,8 @@ class MainWindow(QMainWindow):
117 266
         widgets.upload.clicked.connect(self.buttonClick)
118 267
         # 文件计算
119 268
         widgets.compute.clicked.connect(self.buttonClick)
269
+        #数据一览的搜索键
270
+        widgets.search.clicked.connect(self.buttonClick)
120 271
 
121 272
         # 拓展左侧栏
122 273
         # def openCloseLeftBox():
@@ -159,6 +310,11 @@ class MainWindow(QMainWindow):
159 310
         widgets.btn_home.setStyleSheet(UIFunctions.selectMenu(widgets.btn_home.styleSheet()))
160 311
         # self.bind()
161 312
 
313
+        # 初始化树状数据库
314
+        tree_button = self.sql_init()
315
+        tree_button.itemClicked.connect(self.itembuttonClick)
316
+        tree_button.itemDoubleClicked.connect(self.itembuttonClick)
317
+
162 318
     # 绑定组件
163 319
     def bind(self):
164 320
         # 计算
@@ -238,6 +394,10 @@ class MainWindow(QMainWindow):
238 394
             else:
239 395
                 QMessageBox.warning(self, '警告', '请先选择项目并上传文件')
240 396
 
397
+        #树状查询
398
+        if btnName == "search":
399
+            self.searchClick()
400
+
241 401
         # 输出点击回馈
242 402
         print(f'Button "{btnName}" pressed!')
243 403
 
@@ -279,6 +439,202 @@ class MainWindow(QMainWindow):
279 439
         if event.buttons() == Qt.RightButton:
280 440
             print('Mouse click: RIGHT CLICK')
281 441
 
442
+    # 设一个全局变量,存数据库中所有的包含内容(数据库-三种方法-表)
443
+    dblist = []
444
+
445
+    # 初始化数据一览(数据库全展示)
446
+    def sql_init(self):
447
+        # 初始化全部数据库
448
+        # inpath = r'D:\4work_now\20240819GS\20241211\SQL'
449
+        inpath = os.path.abspath('../SQL')
450
+        # 读取所有的数据库名
451
+        sqlitem = []
452
+        id = 1
453
+        for filename in os.listdir(inpath):
454
+            # 数据库
455
+            dbname = filename.split('.', -1)[0]
456
+            dbpath = os.path.join(inpath, filename)
457
+            sqlitem.append(TreeWidgetItem(id, 0, dbname, icon=QIcon(
458
+                os.path.abspath(os.path.join(self.absPath, "images/icons/cil-clone.png")))))
459
+            pid = id
460
+            id = id + 1
461
+            # 三种方法
462
+            sqlitem.append(TreeWidgetItem(id, pid, '水准测段高差稳定计算', icon=QIcon(
463
+                os.path.join(self.absPath, "images/icons/cil-description.png"))))
464
+            gcid = id
465
+            id = id + 1
466
+            sqlitem.append(TreeWidgetItem(id, pid, '控制网复测平面基准计算', icon=QIcon(
467
+                os.path.join(self.absPath, "images/icons/cil-description.png"))))
468
+            gsid = id
469
+            id = id + 1
470
+            sqlitem.append(TreeWidgetItem(id, pid, '平面控制网稳定性计算', icon=QIcon(
471
+                os.path.join(self.absPath, "images/icons/cil-description.png"))))
472
+            wdid = id
473
+            id = id + 1
474
+            # 读取所有的表名(三种方式往下)
475
+            db1 = sqlite3.connect(dbpath)
476
+            # 获取游标
477
+            cursor1 = db1.cursor()
478
+            sqlstr1 = 'SELECT TableName FROM GC_Input_Param;'
479
+            cursor1.execute(sqlstr1)
480
+            result1 = cursor1.fetchall()
481
+            for re1 in result1:
482
+                str1 = re1[0].decode('utf-8')
483
+                list1 = []
484
+                list1.append(dbname)
485
+                list1.append('水准测段高差稳定计算')
486
+                list1.append(str1)
487
+                self.dblist.append(list1)
488
+                sqlitem.append(TreeWidgetItem(id, gcid, str1, icon=QIcon(
489
+                    os.path.join(self.absPath, "images/icons/cil-file.png")), extend={'listData': list1}))
490
+                id = id + 1
491
+            sqlstr2 = 'SELECT TableName FROM GS_Input_Param;'
492
+            cursor1.execute(sqlstr2)
493
+            result2 = cursor1.fetchall()
494
+            for re2 in result2:
495
+                str2 = re2[0].decode('utf-8')
496
+                list2 = []
497
+                list2.append(dbname)
498
+                list2.append('控制网复测平面基准计算')
499
+                list2.append(str2)
500
+                self.dblist.append(list2)
501
+                sqlitem.append(TreeWidgetItem(id, gsid, str2,
502
+                                              icon=QIcon(os.path.join(self.absPath, "images/icons/cil-file.png")),
503
+                                              extend={'listData': list2}))
504
+                id = id + 1
505
+            sqlstr3 = 'SELECT TableName FROM WD_Input_Param;'
506
+            cursor1.execute(sqlstr3)
507
+            result3 = cursor1.fetchall()
508
+            for re3 in result3:
509
+                str3 = re3[0].decode('utf-8')
510
+                list3 = []
511
+                list3.append(dbname)
512
+                list3.append('平面控制网稳定性计算')
513
+                list3.append(str3)
514
+                self.dblist.append(list3)
515
+                sqlitem.append(TreeWidgetItem(id, wdid, str3,
516
+                                              icon=QIcon(os.path.join(self.absPath, "images/icons/cil-file.png")),
517
+                                              extend={'listData': list3}))
518
+                id = id + 1
519
+        button = ElTree(ElTreeData(sqlitem))
520
+        return button
521
+
522
+    # 关键词查询
523
+    def searchClick(self):
524
+        # GET BUTTON CLICKED
525
+        btn = self.sender()
526
+        btnName = btn.objectName()
527
+        # 获取文本
528
+        text1 = self.ui.lineEdit_2.text()
529
+        # 符合的list
530
+        fhlist = []
531
+        # 查询(待优化)
532
+        for list1 in self.dblist:
533
+            for li in list1:
534
+                if text1 in li:
535
+                    fhlist.append(list1)
536
+                    break
537
+        # 更新item值
538
+        sqlitem = []
539
+        # 前两层是否一致
540
+        str1 = ''
541
+        str2 = ''
542
+        id = 1
543
+        pid = 0
544
+        fid = 0
545
+        zdy = []
546
+        for list2 in fhlist:
547
+            dbname = list2[0]
548
+            if dbname != str1:
549
+                str1 = dbname
550
+                pid = id
551
+                str2 = ''
552
+                sqlitem.append(TreeWidgetItem(id, 0, dbname, icon=QIcon(
553
+                    os.path.join(self.absPath, "images/icons/cil-clone.png"))))
554
+            zdy1 = []
555
+            zdy1.append(id)
556
+            zdy1.append(0)
557
+            zdy1.append(dbname)
558
+            zdy.append(zdy1)
559
+            id = id + 1
560
+            mename = list2[1]
561
+            if mename != str2:
562
+                str2 = mename
563
+                fid = id
564
+                sqlitem.append(TreeWidgetItem(id, pid, mename, icon=QIcon(
565
+                    os.path.join(self.absPath, "images/icons/cil-description.png"))))
566
+            zdy1 = []
567
+            zdy1.append(id)
568
+            zdy1.append(pid)
569
+            zdy1.append(mename)
570
+            zdy.append(zdy1)
571
+            id = id + 1
572
+            sqlitem.append(TreeWidgetItem(id, fid, list2[2], icon=QIcon(
573
+                os.path.join(self.absPath, "images/icons/cil-file.png")), extend={'listData': list2}))
574
+            zdy1 = []
575
+            zdy1.append(id)
576
+            zdy1.append(fid)
577
+            zdy1.append(list2[2])
578
+            zdy.append(zdy1)
579
+            id = id + 1
580
+        search_button = ElTree1(ElTreeData(sqlitem))
581
+        search_button.itemClicked.connect(self.itembuttonClick1)
582
+        search_button.itemDoubleClicked.connect(self.itembuttonClick1)
583
+
584
+    # 全树的item展示
585
+    def itembuttonClick(self):
586
+        # 判定是否获取的是根节点
587
+        pd = 1
588
+        select_item = self.ui.allTreeWidget.currentItem()
589
+        # 获取点击的item的text和它对应的上两个节点
590
+        str1 = select_item.text(0)
591
+        try:
592
+            pa_item = select_item.parent()
593
+            current_text = pa_item.text(0)
594
+            z_item = pa_item.parent()
595
+            str3 = z_item.text(0)
596
+        except:
597
+            pd = -1
598
+        if current_text == '':
599
+            pd = -1
600
+        if str3 == '':
601
+            pd = -1
602
+        if pd == -1:
603
+            pass
604
+        else:
605
+            # 数据库目录
606
+            inpath = os.path.abspath('../SQL')
607
+            file_path = inpath + '/' + str3 + '.db'
608
+            # 数据库路径,哪种方法,表名
609
+            UIFunctions.search_data_to_show(self, file_path, current_text, str1)
610
+
611
+    #搜索的item展示
612
+    def itembuttonClick1(self):
613
+        # 判定是否获取的是根节点
614
+        pd = 1
615
+        select_item = self.ui.qureyTreeWidget.currentItem()
616
+        # 获取点击的item的text和它对应的上两个节点
617
+        str1 = select_item.text(0)
618
+        try:
619
+            pa_item = select_item.parent()
620
+            current_text = pa_item.text(0)
621
+            z_item = pa_item.parent()
622
+            str3 = z_item.text(0)
623
+        except:
624
+            pd = -1
625
+        if current_text == '':
626
+            pd = -1
627
+        if str3 == '':
628
+            pd = -1
629
+        if pd == -1:
630
+            pass
631
+        else:
632
+            # 数据库目录
633
+            inpath = os.path.abspath('../SQL')
634
+            file_path = inpath + '/' + str3 + '.db'
635
+            #数据库路径,哪种方法,表名
636
+            UIFunctions.search_data_to_show(self, file_path,current_text,str1)
637
+
282 638
 
283 639
 if __name__ == "__main__":
284 640
     app = QApplication(sys.argv)

+ 180
- 176
Front/main_new.py 查看文件

@@ -305,8 +305,8 @@ class MainWindow(QMainWindow):
305 305
 
306 306
         #初始化树状数据库
307 307
         tree_button = self.sql_init()
308
-        tree_button.itemClicked.connect(lambda extend: print("单击->扩展数据为:", extend))
309
-        tree_button.itemDoubleClicked.connect(lambda extend: print("双击->扩展数据为:", extend))
308
+        tree_button.itemClicked.connect(self.computeClick)
309
+        tree_button.itemDoubleClicked.connect(self.computeClick)
310 310
 
311 311
         self.bind()
312 312
 
@@ -694,7 +694,7 @@ class MainWindow(QMainWindow):
694 694
             zdy.append(zdy1)
695 695
             id = id + 1
696 696
         search_button = ElTree1(ElTreeData(sqlitem))
697
-        search_button.itemClicked.connect(lambda extend: print("单击->扩展数据为:", extend))
697
+        search_button.itemClicked.connect(self.computeClick)
698 698
         search_button.itemDoubleClicked.connect(self.computeClick)
699 699
 
700 700
     #直接这个基础上改点选输出表格(未改)
@@ -702,181 +702,185 @@ class MainWindow(QMainWindow):
702 702
         # GET BUTTON CLICKED
703 703
         btn = self.sender()
704 704
         btnName = btn.objectName()
705
-        #获取点击的item的text和它对应的上两个节点
705
+        #判定是否获取的是根节点
706
+        pd = 1
706 707
         select_item = self.ui.qureyTreeWidget.currentItem()
708
+        #获取点击的item的text和它对应的上两个节点
707 709
         str1 = select_item.text(0)
708
-        pa_item = select_item.parent()
709
-        str2 = pa_item.text(0)
710
-        z_item = pa_item.parent()
711
-        str3 = z_item.text(0)
712
-        #数据库目录
713
-        inpath= os.path.abspath('../SQL')
714
-        dbpath= inpath + '/'+str3
715
-
716
-        jj = 0
717
-        #处理选中的文件
718
-        # print(file_path)
719
-        # print(self.extend)
720
-#         file_path = ''
721
-#         UIFunctions.compute_show_process_excel_file(self, file_path)
722
-#         current_text = self.ui.comboBox_2.currentText()
723
-#         db_path = r"D:\4work_now\20240819GS\ControlNetwork\ControlNetwork\UI\SQL\DataBase.db"
724
-#         #转换下
725
-#         excelname = os.path.basename(file_path)
726
-#         utf_en = excelname.encode('utf-8')
727
-#         # file_path = file_path
728
-#         if current_text == "水准测段高差稳定计算":
729
-#             #只显示一个tab
730
-#             self.ui.tabWidget.setTabVisible(0,True)
731
-#             self.ui.tabWidget.setTabVisible(1,False)
732
-#             self.ui.tabWidget.setTabVisible(2,False)
733
-#             #重新设置文字名称
734
-#             self.ui.tabWidget.setTabText(0,'测段高差计算表')
735
-#
736
-#             # 计算结束自动跳转结果页面,并保留查询内容,以便输出
737
-#             widgets.stackedWidget.setCurrentWidget(widgets.new_page)  # SET PAGE
738
-#             UIFunctions.resetStyle(self, btnName)  # RESET ANOTHERS BUTTONS SELECTED
739
-#             btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet()))  # SELECT MENU
740
-#         elif current_text == "控制网复测平面基准计算":
741
-#             #就用已有的选项卡
742
-#             self.ui.tabWidget.setTabVisible(0,True)
743
-#             self.ui.tabWidget.setTabVisible(1,True)
744
-#             self.ui.tabWidget.setTabVisible(2,True)
745
-#             #重新设置文字名称
746
-#             self.ui.tabWidget.setTabText(0,'复测成果表')
747
-#             self.ui.tabWidget.setTabText(1,'基准归算模型')
748
-#             self.ui.tabWidget.setTabText(2,'复测基准归算表')
749
-#
750
-#             #链接数据库并显示
751
-#             # 连接到数据库
752
-#             #将结果输出到数据库
753
-#             db1 = sqlite3.connect(db_path)
754
-#             #获取游标
755
-#             cursor1 = db1.cursor()
756
-#             #查询表内符合的所有数据(分成两个结果分别显示)
757
-#             #复测成果表
758
-#             sqlstr1 = 'select PointName,Last_X,Last_Y,Result_X,Result_Y,Last_ResultX,Last_ResultY,Last_ResultP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
759
-#             cursor1.execute(sqlstr1,(utf_en,))
760
-#             #获取结果集
761
-#             result1 = cursor1.fetchall()
762
-#             #基准归算表
763
-#             sqlstr11 = 'select PointName,Cal_X,Cal_Y,Last_CalX,Last_CalY,Last_CalP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
764
-#             cursor1.execute(sqlstr11,(utf_en,))
765
-#             #获取结果集
766
-#             result2 = cursor1.fetchall()
767
-#             #对结果集进行处理,把汉字转换过来,添加表头部分
768
-#             nlist1,plist1 = self.Arrange_Data1(result1)
769
-#             nlist2,plist2 = self.Arrange_Data2(result2)
770
-#             # 创建一个数据模型(复测成果表)
771
-#             self.model1 = QStandardItemModel()
772
-#             #把数据放进去
773
-#             model1 = self.Data_in_Cell1(plist1)
774
-#             model2 = self.Data_in_Cell2(plist2)
775
-#             #设置表头
776
-#             model1.setHorizontalHeaderLabels(['点名', '前期X','前期Y','本期X', '本期Y','前期-本期X','前期-本期Y','前期-本期P','位移判定'])
777
-#             model1.setVerticalHeaderLabels(nlist1)
778
-#             #QTableView并将数据模型与之关联
779
-#             self.ui.resultTableView.setModel(model1)
780
-#             self.ui.resultTableView.show()
781
-#             #设置表头
782
-#             model2.setHorizontalHeaderLabels(['点名', '基准归算X','基准归算Y','前期-归算X','前期-归算Y','前期-归算P','位移判定'])
783
-#             model2.setVerticalHeaderLabels(nlist2)
784
-#             #QTableView并将数据模型与之关联
785
-#             self.ui.reconTableView.setModel(model2)
786
-#             self.ui.reconTableView.show()
787
-#
788
-#             #富文本的html
789
-#             sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from GS_Trans_Param WHERE TableName = ?'
790
-#             cursor1.execute(sqlstr2,(utf_en,))
791
-#             #获取结果集
792
-#             result1 = cursor1.fetchall()
793
-#             str1 = result1[0][0].decode('utf-8')
794
-#             str2 = result1[0][1].decode('utf-8')
795
-#             n1 = result1[0][2]
796
-#             n2 = result1[0][3]
797
-#             n3 = result1[0][4]
798
-#             n4 = result1[0][5]
799
-#             n5 = result1[0][6]
800
-#             n6 = result1[0][7]
801
-#             str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
802
-# <html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
803
-# p, li { white-space: pre-wrap; }
804
-# hr { height: 1px; border-width: 0; }
805
-# li.unchecked::marker { content: "\2610"; }
806
-# li.checked::marker { content: "\2612"; }
807
-# </style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
808
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; color:#000000;">"""+str2+"""--"""+str1+"""</span><span style=" font-size:14pt;">已知系统转换公式:</span></p>
809
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">X</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n1)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n2)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n3)+"""</span><span style=" font-size:14pt;">)</span></p>
810
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">Y</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n4)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n5)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n6)+"""</span><span style=" font-size:14pt;">)</span></p>
811
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为</span><span style=" font-size:14pt; color:#000000;">"""+str2+"""</span><span style=" font-size:14pt;">坐标;</span></p>
812
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为"""+str1+"""已知系统的"""+str2+"""归算坐标。</span></p></body></html>"""
813
-#             self.ui.printTableView.setHtml(str0)
814
-#
815
-#             # 计算结束自动跳转结果页面,并保留查询内容,以便输出
816
-#             widgets.stackedWidget.setCurrentWidget(widgets.new_page)  # SET PAGE
817
-#             UIFunctions.resetStyle(self, btnName)  # RESET ANOTHERS BUTTONS SELECTED
818
-#             btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet()))  # SELECT MENU
819
-#         # GS.main_function(file_path, db_path)
820
-#         # 添加控制网执行代码
821
-#         elif current_text=="平面控制网稳定性计算":
822
-#             #只显示头两个tab
823
-#             self.ui.tabWidget.setTabVisible(0,True)
824
-#             self.ui.tabWidget.setTabVisible(1,True)
825
-#             self.ui.tabWidget.setTabVisible(2,False)
826
-#             #重新设置文字名称
827
-#             self.ui.tabWidget.setTabText(0,'稳定性分析成果表')
828
-#             self.ui.tabWidget.setTabText(1,'自由网成果归算模型')
829
-#             #链接数据库并显示
830
-#             # 连接到数据库
831
-#             #将结果输出到数据库
832
-#             db1 = sqlite3.connect(db_path)
833
-#             #获取游标
834
-#             cursor1 = db1.cursor()
835
-#             #查询表内符合的所有数据
836
-#             sqlstr1 = 'select PointName,First_X,First_Y,Last_X,Last_Y,Last_Wight,Result_X,Result_Y,New_Wight,New_FirstX,New_FirstY,New_FirstP,NFDis_Ass,New_LastX,New_LastY,New_LastP,NLDis_Ass from WD_Result_Point WHERE TableName = ?'
837
-#             cursor1.execute(sqlstr1,(utf_en,))
838
-#             #获取结果集
839
-#             result = cursor1.fetchall()
840
-#             #对结果集进行处理,把汉字转换过来,添加表头部分
841
-#             nlist,plist = self.Arrange_Data(result)
842
-#             # 创建一个数据模型
843
-#             self.model = QStandardItemModel()
844
-#             #把数据放进去
845
-#             model1 = self.Data_in_Cell(plist)
846
-#             #设置表头
847
-#             model1.setHorizontalHeaderLabels(['点名', '首期X','首期Y','上期X', '上期Y','权','本期X','本期Y','权','本期-首期X','本期-首期Y','本期-首期P','位移判定', '本期-上期X','本期-上期Y','本期-上期P','位移判定'])
848
-#             model1.setVerticalHeaderLabels(nlist)
849
-#             #QTableView并将数据模型与之关联
850
-#             self.ui.resultTableView.setModel(model1)
851
-#             self.ui.resultTableView.show()
852
-#
853
-#             #富文本的html
854
-#             sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from WD_Result_Param WHERE TableName = ?'
855
-#             cursor1.execute(sqlstr2,(utf_en,))
856
-#             #获取结果集
857
-#             result1 = cursor1.fetchall()
858
-#             str1 = result1[0][0].decode('utf-8')
859
-#             str2 = result1[0][1].decode('utf-8')
860
-#             n1 = result1[0][2]
861
-#             n2 = result1[0][3]
862
-#             n3 = result1[0][4]
863
-#             n4 = result1[0][5]
864
-#             n5 = result1[0][6]
865
-#             n6 = result1[0][7]
866
-#             str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
867
-# <html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
868
-# p, li { white-space: pre-wrap; }
869
-# hr { height: 1px; border-width: 0; }
870
-# li.unchecked::marker { content: "\2610"; }
871
-# li.checked::marker { content: "\2612"; }
872
-# </style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
873
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; color:#000000;">"""+str2+"""--"""+str1+"""</span><span style=" font-size:14pt;">已知系统转换公式:</span></p>
874
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">X</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n1)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n2)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n3)+"""</span><span style=" font-size:14pt;">)</span></p>
875
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">Y</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n4)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n5)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n6)+"""</span><span style=" font-size:14pt;">)</span></p>
876
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为</span><span style=" font-size:14pt; color:#000000;">"""+str2+"""</span><span style=" font-size:14pt;">坐标;</span></p>
877
-# <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为"""+str1+"""已知系统的"""+str2+"""归算坐标。</span></p></body></html>"""
878
-#             self.ui.printTableView.setHtml(str0)
879
-#
710
+        try:
711
+            pa_item = select_item.parent()
712
+            current_text = pa_item.text(0)
713
+            z_item = pa_item.parent()
714
+            str3 = z_item.text(0)
715
+        except:
716
+            pd = -1
717
+        if current_text == '':
718
+            pd = -1
719
+        if str3 == '':
720
+            pd = -1
721
+        if pd == -1:
722
+            pass
723
+        else:
724
+            #数据库目录
725
+            inpath= os.path.abspath('../SQL')
726
+            file_path= inpath + '/'+str3
727
+    #         UIFunctions.compute_show_process_excel_file(self, file_path)
728
+    #         #转换下
729
+    #         excelname = os.path.basename(file_path)
730
+    #         utf_en = excelname.encode('utf-8')
731
+    #         # file_path = file_path
732
+    #         if current_text == "水准测段高差稳定计算":
733
+    #             #只显示一个tab
734
+    #             self.ui.tabWidget.setTabVisible(0,True)
735
+    #             self.ui.tabWidget.setTabVisible(1,False)
736
+    #             self.ui.tabWidget.setTabVisible(2,False)
737
+    #             #重新设置文字名称
738
+    #             self.ui.tabWidget.setTabText(0,'测段高差计算表')
739
+    #
740
+    #             # 计算结束自动跳转结果页面,并保留查询内容,以便输出
741
+    #             widgets.stackedWidget.setCurrentWidget(widgets.new_page)  # SET PAGE
742
+    #             UIFunctions.resetStyle(self, btnName)  # RESET ANOTHERS BUTTONS SELECTED
743
+    #             btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet()))  # SELECT MENU
744
+    #         elif current_text == "控制网复测平面基准计算":
745
+    #             #就用已有的选项卡
746
+    #             self.ui.tabWidget.setTabVisible(0,True)
747
+    #             self.ui.tabWidget.setTabVisible(1,True)
748
+    #             self.ui.tabWidget.setTabVisible(2,True)
749
+    #             #重新设置文字名称
750
+    #             self.ui.tabWidget.setTabText(0,'复测成果表')
751
+    #             self.ui.tabWidget.setTabText(1,'基准归算模型')
752
+    #             self.ui.tabWidget.setTabText(2,'复测基准归算表')
753
+    #
754
+    #             #链接数据库并显示
755
+    #             # 连接到数据库
756
+    #             #将结果输出到数据库
757
+    #             db1 = sqlite3.connect(db_path)
758
+    #             #获取游标
759
+    #             cursor1 = db1.cursor()
760
+    #             #查询表内符合的所有数据(分成两个结果分别显示)
761
+    #             #复测成果表
762
+    #             sqlstr1 = 'select PointName,Last_X,Last_Y,Result_X,Result_Y,Last_ResultX,Last_ResultY,Last_ResultP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
763
+    #             cursor1.execute(sqlstr1,(utf_en,))
764
+    #             #获取结果集
765
+    #             result1 = cursor1.fetchall()
766
+    #             #基准归算表
767
+    #             sqlstr11 = 'select PointName,Cal_X,Cal_Y,Last_CalX,Last_CalY,Last_CalP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
768
+    #             cursor1.execute(sqlstr11,(utf_en,))
769
+    #             #获取结果集
770
+    #             result2 = cursor1.fetchall()
771
+    #             #对结果集进行处理,把汉字转换过来,添加表头部分
772
+    #             nlist1,plist1 = self.Arrange_Data1(result1)
773
+    #             nlist2,plist2 = self.Arrange_Data2(result2)
774
+    #             # 创建一个数据模型(复测成果表)
775
+    #             self.model1 = QStandardItemModel()
776
+    #             #把数据放进去
777
+    #             model1 = self.Data_in_Cell1(plist1)
778
+    #             model2 = self.Data_in_Cell2(plist2)
779
+    #             #设置表头
780
+    #             model1.setHorizontalHeaderLabels(['点名', '前期X','前期Y','本期X', '本期Y','前期-本期X','前期-本期Y','前期-本期P','位移判定'])
781
+    #             model1.setVerticalHeaderLabels(nlist1)
782
+    #             #QTableView并将数据模型与之关联
783
+    #             self.ui.resultTableView.setModel(model1)
784
+    #             self.ui.resultTableView.show()
785
+    #             #设置表头
786
+    #             model2.setHorizontalHeaderLabels(['点名', '基准归算X','基准归算Y','前期-归算X','前期-归算Y','前期-归算P','位移判定'])
787
+    #             model2.setVerticalHeaderLabels(nlist2)
788
+    #             #QTableView并将数据模型与之关联
789
+    #             self.ui.reconTableView.setModel(model2)
790
+    #             self.ui.reconTableView.show()
791
+    #
792
+    #             #富文本的html
793
+    #             sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from GS_Trans_Param WHERE TableName = ?'
794
+    #             cursor1.execute(sqlstr2,(utf_en,))
795
+    #             #获取结果集
796
+    #             result1 = cursor1.fetchall()
797
+    #             str1 = result1[0][0].decode('utf-8')
798
+    #             str2 = result1[0][1].decode('utf-8')
799
+    #             n1 = result1[0][2]
800
+    #             n2 = result1[0][3]
801
+    #             n3 = result1[0][4]
802
+    #             n4 = result1[0][5]
803
+    #             n5 = result1[0][6]
804
+    #             n6 = result1[0][7]
805
+    #             str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
806
+    # <html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
807
+    # p, li { white-space: pre-wrap; }
808
+    # hr { height: 1px; border-width: 0; }
809
+    # li.unchecked::marker { content: "\2610"; }
810
+    # li.checked::marker { content: "\2612"; }
811
+    # </style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
812
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; color:#000000;">"""+str2+"""--"""+str1+"""</span><span style=" font-size:14pt;">已知系统转换公式:</span></p>
813
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">X</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n1)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n2)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n3)+"""</span><span style=" font-size:14pt;">)</span></p>
814
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">Y</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n4)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n5)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n6)+"""</span><span style=" font-size:14pt;">)</span></p>
815
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为</span><span style=" font-size:14pt; color:#000000;">"""+str2+"""</span><span style=" font-size:14pt;">坐标;</span></p>
816
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为"""+str1+"""已知系统的"""+str2+"""归算坐标。</span></p></body></html>"""
817
+    #             self.ui.printTableView.setHtml(str0)
818
+    #
819
+    #             # 计算结束自动跳转结果页面,并保留查询内容,以便输出
820
+    #             widgets.stackedWidget.setCurrentWidget(widgets.new_page)  # SET PAGE
821
+    #             UIFunctions.resetStyle(self, btnName)  # RESET ANOTHERS BUTTONS SELECTED
822
+    #             btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet()))  # SELECT MENU
823
+    #         # GS.main_function(file_path, db_path)
824
+    #         # 添加控制网执行代码
825
+    #         elif current_text=="平面控制网稳定性计算":
826
+    #             #只显示头两个tab
827
+    #             self.ui.tabWidget.setTabVisible(0,True)
828
+    #             self.ui.tabWidget.setTabVisible(1,True)
829
+    #             self.ui.tabWidget.setTabVisible(2,False)
830
+    #             #重新设置文字名称
831
+    #             self.ui.tabWidget.setTabText(0,'稳定性分析成果表')
832
+    #             self.ui.tabWidget.setTabText(1,'自由网成果归算模型')
833
+    #             #链接数据库并显示
834
+    #             # 连接到数据库
835
+    #             #将结果输出到数据库
836
+    #             db1 = sqlite3.connect(db_path)
837
+    #             #获取游标
838
+    #             cursor1 = db1.cursor()
839
+    #             #查询表内符合的所有数据
840
+    #             sqlstr1 = 'select PointName,First_X,First_Y,Last_X,Last_Y,Last_Wight,Result_X,Result_Y,New_Wight,New_FirstX,New_FirstY,New_FirstP,NFDis_Ass,New_LastX,New_LastY,New_LastP,NLDis_Ass from WD_Result_Point WHERE TableName = ?'
841
+    #             cursor1.execute(sqlstr1,(utf_en,))
842
+    #             #获取结果集
843
+    #             result = cursor1.fetchall()
844
+    #             #对结果集进行处理,把汉字转换过来,添加表头部分
845
+    #             nlist,plist = self.Arrange_Data(result)
846
+    #             # 创建一个数据模型
847
+    #             self.model = QStandardItemModel()
848
+    #             #把数据放进去
849
+    #             model1 = self.Data_in_Cell(plist)
850
+    #             #设置表头
851
+    #             model1.setHorizontalHeaderLabels(['点名', '首期X','首期Y','上期X', '上期Y','权','本期X','本期Y','权','本期-首期X','本期-首期Y','本期-首期P','位移判定', '本期-上期X','本期-上期Y','本期-上期P','位移判定'])
852
+    #             model1.setVerticalHeaderLabels(nlist)
853
+    #             #QTableView并将数据模型与之关联
854
+    #             self.ui.resultTableView.setModel(model1)
855
+    #             self.ui.resultTableView.show()
856
+    #
857
+    #             #富文本的html
858
+    #             sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from WD_Result_Param WHERE TableName = ?'
859
+    #             cursor1.execute(sqlstr2,(utf_en,))
860
+    #             #获取结果集
861
+    #             result1 = cursor1.fetchall()
862
+    #             str1 = result1[0][0].decode('utf-8')
863
+    #             str2 = result1[0][1].decode('utf-8')
864
+    #             n1 = result1[0][2]
865
+    #             n2 = result1[0][3]
866
+    #             n3 = result1[0][4]
867
+    #             n4 = result1[0][5]
868
+    #             n5 = result1[0][6]
869
+    #             n6 = result1[0][7]
870
+    #             str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
871
+    # <html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
872
+    # p, li { white-space: pre-wrap; }
873
+    # hr { height: 1px; border-width: 0; }
874
+    # li.unchecked::marker { content: "\2610"; }
875
+    # li.checked::marker { content: "\2612"; }
876
+    # </style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
877
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; color:#000000;">"""+str2+"""--"""+str1+"""</span><span style=" font-size:14pt;">已知系统转换公式:</span></p>
878
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">X</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n1)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n2)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n3)+"""</span><span style=" font-size:14pt;">)</span></p>
879
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:700;">Y</span><span style=" font-size:14pt;">=(</span><span style=" font-size:14pt; color:#aa0000;">"""+str(n4)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">x</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00aa00;">"""+str(n5)+"""</span><span style=" font-size:14pt;">)</span><span style=" font-size:14pt; font-weight:700;">y</span><span style=" font-size:14pt;">+(</span><span style=" font-size:14pt; color:#00007f;">"""+str(n6)+"""</span><span style=" font-size:14pt;">)</span></p>
880
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">式中:</span><span style=" font-size:14pt; font-weight:700; color:#000000;">x、y</span><span style=" font-size:14pt;">为</span><span style=" font-size:14pt; color:#000000;">"""+str2+"""</span><span style=" font-size:14pt;">坐标;</span></p>
881
+    # <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt;">          </span><span style=" font-size:14pt; font-weight:700;">X、Y</span><span style=" font-size:14pt;">为"""+str1+"""已知系统的"""+str2+"""归算坐标。</span></p></body></html>"""
882
+    #             self.ui.printTableView.setHtml(str0)
883
+    #
880 884
 #         #----------------------------------------------------------
881 885
 #         # 计算结束自动跳转结果页面,并保留查询内容,以便输出
882 886
 #             widgets.stackedWidget.setCurrentWidget(widgets.new_page)  # SET PAGE

+ 11
- 0
Front/modules/ui_functions.py 查看文件

@@ -362,4 +362,15 @@ class UIFunctions(MainWindow):
362 362
             pass
363 363
         else:
364 364
             QMessageBox.warning(self, '警告', '请选择有效的计算类型')
365
+
366
+    #数据一览,点击查询
367
+    def search_data_to_show(self,file_path,current_text,tablename):
368
+        utf_en = tablename.encode('utf-8')  # 转换文件名为utf-8编码形式
369
+        #高差部分我没改
370
+        if current_text == "水准测段高差稳定计算":
371
+            GCshow.main_function(self.ui, file_path, utf_en)
372
+        elif current_text == "控制网复测平面基准计算":
373
+            GSshow.main_function1(self.ui, file_path, utf_en)
374
+        elif current_text == "平面控制网稳定性计算":
375
+            WDshow.main_function1(self.ui, file_path, utf_en)
365 376
     # END - GUI DEFINITIONS

+ 90
- 109
Front/modules/ui_main.py 查看文件

@@ -1546,7 +1546,7 @@ class Ui_MainWindow(object):
1546 1546
 
1547 1547
         self.reconTable = QWidget()
1548 1548
         self.reconTable.setObjectName(u"reconTable")
1549
-        self.reconTable.setCursor(QCursor(Qt.CursorShape.UpArrowCursor))
1549
+        # self.reconTable.setCursor(QCursor(Qt.CursorShape.UpArrowCursor))
1550 1550
         self.reconTable.setMouseTracking(False)
1551 1551
         self.reconTable.setTabletTracking(False)
1552 1552
         self.verticalLayout_26 = QVBoxLayout(self.reconTable)
@@ -1589,6 +1589,7 @@ class Ui_MainWindow(object):
1589 1589
         self.tabWidget.setTabVisible(1, False)
1590 1590
         self.tabWidget.setTabVisible(2, False)
1591 1591
 
1592
+
1592 1593
         self.search = QPushButton(self.datainfo)
1593 1594
         self.search.setObjectName(u"search")
1594 1595
         sizePolicy4 = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
@@ -1647,108 +1648,109 @@ class Ui_MainWindow(object):
1647 1648
         self.verticalLayout_30.setObjectName(u"verticalLayout_30")
1648 1649
         self.horizontalLayout_11 = QHBoxLayout()
1649 1650
         self.horizontalLayout_11.setObjectName(u"horizontalLayout_11")
1650
-        self.label_11 = QLabel(self.datainfo)
1651
-        self.label_11.setObjectName(u"label_11")
1652
-        self.label_11.setStyleSheet(u"border: 2px solid #7284b9;\n"
1653
-                                    "border-radius: 5px;\n"
1654
-                                    "background-color: #6272a4;\n"
1655
-                                    "color:#FFFFFF")
1656
-
1657
-        self.horizontalLayout_11.addWidget(self.label_11)
1658
-
1659
-        self.checkBox_2 = QCheckBox(self.datainfo)
1660
-        self.checkBox_2.setObjectName(u"checkBox_2")
1661
-
1662
-        self.horizontalLayout_11.addWidget(self.checkBox_2)
1663
-
1664
-        self.checkBox = QCheckBox(self.datainfo)
1665
-        self.checkBox.setObjectName(u"checkBox")
1666
-
1667
-        self.horizontalLayout_11.addWidget(self.checkBox)
1668
-
1669
-        self.checkBox_3 = QCheckBox(self.datainfo)
1670
-        self.checkBox_3.setObjectName(u"checkBox_3")
1671
-
1672
-        self.horizontalLayout_11.addWidget(self.checkBox_3)
1673
-
1674
-        self.checkBox_4 = QCheckBox(self.datainfo)
1675
-        self.checkBox_4.setObjectName(u"checkBox_4")
1676
-
1677
-        self.horizontalLayout_11.addWidget(self.checkBox_4)
1651
+        #留个空,什么编辑排序筛选可以放在这儿
1652
+        self.edit_button = QPushButton(self.datainfo)
1653
+        self.edit_button.setObjectName(u"edit_button")
1654
+        sizePolicy4 = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
1655
+        sizePolicy4.setHorizontalStretch(0)
1656
+        sizePolicy4.setVerticalStretch(0)
1657
+        sizePolicy4.setHeightForWidth(self.edit_button.sizePolicy().hasHeightForWidth())
1658
+        self.edit_button.setSizePolicy(sizePolicy4)
1659
+        self.edit_button.setMinimumSize(QSize(10, 10))
1660
+        self.edit_button.setMaximumSize(QSize(30, 24))
1661
+        self.edit_button.setStyleSheet(u"")
1678 1662
 
1663
+        self.horizontalLayout_11.addWidget(self.edit_button)
1679 1664
         self.verticalLayout_30.addLayout(self.horizontalLayout_11)
1680 1665
 
1681 1666
         self.horizontalLayout_14 = QHBoxLayout()
1682 1667
         self.horizontalLayout_14.setObjectName(u"horizontalLayout_14")
1683
-        self.label_12 = QLabel(self.datainfo)
1684
-        self.label_12.setObjectName(u"label_12")
1685
-        self.label_12.setStyleSheet(u"border: 2px solid #7284b9;\n"
1686
-                                    "border-radius: 5px;\n"
1687
-                                    "background-color: #6272a4;\n"
1688
-                                    "color:#FFFFFF")
1689
-
1690
-        self.horizontalLayout_14.addWidget(self.label_12)
1691
-
1692
-        self.checkBox_5 = QCheckBox(self.datainfo)
1693
-        self.checkBox_5.setObjectName(u"checkBox_5")
1694
-
1695
-        self.horizontalLayout_14.addWidget(self.checkBox_5)
1696
-
1697
-        self.checkBox_6 = QCheckBox(self.datainfo)
1698
-        self.checkBox_6.setObjectName(u"checkBox_6")
1699
-
1700
-        self.horizontalLayout_14.addWidget(self.checkBox_6)
1701
-
1702
-        self.checkBox_7 = QCheckBox(self.datainfo)
1703
-        self.checkBox_7.setObjectName(u"checkBox_7")
1704
-
1705
-        self.horizontalLayout_14.addWidget(self.checkBox_7)
1706
-
1707
-        self.checkBox_8 = QCheckBox(self.datainfo)
1708
-        self.checkBox_8.setObjectName(u"checkBox_8")
1709
-
1710
-        self.horizontalLayout_14.addWidget(self.checkBox_8)
1711
-
1712 1668
         self.verticalLayout_30.addLayout(self.horizontalLayout_14)
1713 1669
 
1714 1670
         self.horizontalLayout_15 = QHBoxLayout()
1715 1671
         self.horizontalLayout_15.setObjectName(u"horizontalLayout_15")
1716
-        self.label_13 = QLabel(self.datainfo)
1717
-        self.label_13.setObjectName(u"label_13")
1718
-        self.label_13.setStyleSheet(u"border: 2px solid #7284b9;\n"
1719
-                                    "border-radius: 5px;\n"
1720
-                                    "background-color: #6272a4;\n"
1721
-                                    "color:#FFFFFF")
1722
-
1723
-        self.horizontalLayout_15.addWidget(self.label_13)
1724
-
1725
-        self.checkBox_9 = QCheckBox(self.datainfo)
1726
-        self.checkBox_9.setObjectName(u"checkBox_9")
1727
-
1728
-        self.horizontalLayout_15.addWidget(self.checkBox_9)
1729
-
1730
-        self.checkBox_10 = QCheckBox(self.datainfo)
1731
-        self.checkBox_10.setObjectName(u"checkBox_10")
1732
-
1733
-        self.horizontalLayout_15.addWidget(self.checkBox_10)
1734
-
1735
-        self.checkBox_11 = QCheckBox(self.datainfo)
1736
-        self.checkBox_11.setObjectName(u"checkBox_11")
1737
-
1738
-        self.horizontalLayout_15.addWidget(self.checkBox_11)
1739
-
1740
-        self.checkBox_12 = QCheckBox(self.datainfo)
1741
-        self.checkBox_12.setObjectName(u"checkBox_12")
1742
-
1743
-        self.horizontalLayout_15.addWidget(self.checkBox_12)
1744
-
1745 1672
         self.verticalLayout_30.addLayout(self.horizontalLayout_15)
1746 1673
 
1747
-        self.View = QTableView(self.datainfo)
1674
+        self.View = QTabWidget(self.datainfo)
1748 1675
         self.View.setObjectName(u"View")
1676
+        self.View.setCursor(QCursor(Qt.CursorShape.ArrowCursor))
1677
+        self.View.setTabPosition(QTabWidget.TabPosition.North)
1678
+        self.View.setTabShape(QTabWidget.TabShape.Rounded)
1679
+        self.View.setElideMode(Qt.TextElideMode.ElideRight)
1680
+        self.View.setTabsClosable(False)
1681
+        self.View.setTabBarAutoHide(False)
1749 1682
 
1750 1683
         self.verticalLayout_30.addWidget(self.View)
1751 1684
 
1685
+        self.resultTable1 = QWidget()
1686
+        self.resultTable1.setObjectName(u"resultTable1")
1687
+        self.verticalLayout_34 = QVBoxLayout(self.resultTable1)
1688
+        self.verticalLayout_34.setObjectName(u"verticalLayout_34")
1689
+        self.resultTableView1 = QTableView(self.resultTable1)
1690
+        self.resultTableView1.setObjectName(u"resultTableView1")
1691
+
1692
+        # 隐藏 resultTableView
1693
+        self.resultTableView1.hide()
1694
+
1695
+        # 创建一个 QLabel 并设置文本(第三页文本中心默认提醒)
1696
+        self.default_remind1 = QLabel("左侧点击具体表即可显示", self.resultTable1)
1697
+        self.default_remind1.setAlignment(Qt.AlignCenter)  # 设置文本居中对齐
1698
+        # 将 QLabel 添加到布局中
1699
+        self.verticalLayout_34.addWidget(self.default_remind1)
1700
+        # 表格显示
1701
+        self.verticalLayout_34.addWidget(self.resultTableView1)
1702
+
1703
+        icon51 = QIcon()
1704
+        icon51.addFile(u":/icons/images/icons/1.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
1705
+        self.View.addTab(self.resultTable1, icon51, "")
1706
+
1707
+        self.printTable1 = QWidget()
1708
+        self.printTable1.setObjectName(u"printTable1")
1709
+        self.printTable1.setMouseTracking(False)
1710
+        self.printTable1.setTabletTracking(False)
1711
+        self.verticalLayout_35 = QVBoxLayout(self.printTable1)
1712
+        self.verticalLayout_35.setObjectName(u"verticalLayout_35")
1713
+        self.printTableView1 = QTextEdit(self.printTable1)
1714
+        self.printTableView1.setObjectName(u"printTableView1")
1715
+        self.printTableView1.setReadOnly(True)
1716
+        self.verticalLayout_35.addWidget(self.printTableView1)
1717
+        icon6 = QIcon()
1718
+        icon6.addFile(u":/icons/images/icons/2.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
1719
+        self.View.addTab(self.printTable1, icon6, "")
1720
+
1721
+        self.reconTable1 = QWidget()
1722
+        self.reconTable1.setObjectName(u"reconTable1")
1723
+        # self.reconTable.setCursor(QCursor(Qt.CursorShape.UpArrowCursor))
1724
+        self.reconTable1.setMouseTracking(False)
1725
+        self.reconTable1.setTabletTracking(False)
1726
+        self.verticalLayout_36 = QVBoxLayout(self.reconTable1)
1727
+        self.verticalLayout_36.setObjectName(u"verticalLayout_36")
1728
+        self.reconTableView1 = QTableView(self.reconTable1)
1729
+        self.reconTableView1.setObjectName(u"modelTableView1")
1730
+        self.verticalLayout_36.addWidget(self.reconTableView1)
1731
+        icon7 = QIcon()
1732
+        icon7.addFile(u":/icons/images/icons/3.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
1733
+        self.View.addTab(self.reconTable1, icon7, "")
1734
+
1735
+        self.inputTable1 = QWidget()
1736
+        self.inputTable1.setObjectName(u"inputTable1")
1737
+        # self.inputTable.setCursor(QCursor(Qt.CursorShape.UpArrowCursor))
1738
+        self.inputTable1.setMouseTracking(False)
1739
+        self.inputTable1.setTabletTracking(False)
1740
+        self.verticalLayout_37 = QVBoxLayout(self.inputTable1)
1741
+        self.verticalLayout_37.setObjectName(u"verticalLayout_37")
1742
+        self.inputTableView1 = QTableView(self.inputTable1)
1743
+        self.inputTableView1.setObjectName(u"inputTableView1")
1744
+        self.verticalLayout_37.addWidget(self.inputTableView1)
1745
+        icon8 = QIcon()
1746
+        icon8.addFile(u":/icons/images/icons/4.png", QSize(), QIcon.Mode.Normal, QIcon.State.Off)
1747
+        self.View.addTab(self.inputTable1, icon8, "")
1748
+
1749
+        # 设置到处结果显示页面(View)的默认隐藏2.3页
1750
+        self.View.setTabVisible(1, False)
1751
+        self.View.setTabVisible(2, False)
1752
+        self.View.setTabVisible(3, False)
1753
+
1752 1754
         self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.verticalLayout_30)
1753 1755
 
1754 1756
         self.stackedWidget.addWidget(self.datainfo)
@@ -2024,27 +2026,6 @@ class Ui_MainWindow(object):
2024 2026
         self.comboBox_3.setPlaceholderText(
2025 2027
             QCoreApplication.translate("MainWindow", u"\u7b26\u5408\u67e5\u8be2\u8981\u6c42\u7684\u8868", None))
2026 2028
         self.comboBox_4.setPlaceholderText(QCoreApplication.translate("MainWindow", u"\u6240\u6709\u8868", None))
2027
-        self.label_11.setText(QCoreApplication.translate("MainWindow",
2028
-                                                         u"<html><head/><body><p><img src=\":/icons/images/icons/cil-chart-line.png\"/>\u8868\u9009\u62e9</p></body></html>",
2029
-                                                         None))
2030
-        self.checkBox_2.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2031
-        self.checkBox.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2032
-        self.checkBox_3.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2033
-        self.checkBox_4.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2034
-        self.label_12.setText(QCoreApplication.translate("MainWindow",
2035
-                                                         u"<html><head/><body><p><img src=\":/icons/images/icons/cil-justify-left.png\"/>\u6392\u5e8f</p></body></html>",
2036
-                                                         None))
2037
-        self.checkBox_5.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2038
-        self.checkBox_6.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2039
-        self.checkBox_7.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2040
-        self.checkBox_8.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2041
-        self.label_13.setText(QCoreApplication.translate("MainWindow",
2042
-                                                         u"<html><head/><body><p><img src=\":/icons/images/icons/cil-task.png\"/>\u7b5b\u9009</p></body></html>",
2043
-                                                         None))
2044
-        self.checkBox_9.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2045
-        self.checkBox_10.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2046
-        self.checkBox_11.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2047
-        self.checkBox_12.setText(QCoreApplication.translate("MainWindow", u"CheckBox", None))
2048 2029
         self.btn_message.setText(QCoreApplication.translate("MainWindow", u"\u5207\u6362\u4e3b\u9898", None))
2049 2030
         self.creditsLabel.setText(QCoreApplication.translate("MainWindow", u"\u7248\u6743\u4fe1\u606f", None))
2050 2031
         self.version.setText(QCoreApplication.translate("MainWindow", u"v1.0.0", None))

二进制
SQL/1.db 查看文件


二进制
SQL/测试.db 查看文件


正在加载...
取消
保存