|
@@ -13,6 +13,7 @@
|
13
|
13
|
# https://doc.qt.io/qtforpython/licenses.html
|
14
|
14
|
#
|
15
|
15
|
# ///////////////////////////////////////////////////////////////
|
|
16
|
+from idlelib.searchengine import search_reverse
|
16
|
17
|
|
17
|
18
|
from PySide6.QtWidgets import QFileDialog,QWidget, QVBoxLayout, QTreeWidget, QApplication, QTreeWidgetItem
|
18
|
19
|
from PySide6.QtCore import Signal, Qt, Slot, QObject
|
|
@@ -312,7 +313,7 @@ class MainWindow(QMainWindow):
|
312
|
313
|
#绑定组件
|
313
|
314
|
def bind(self):
|
314
|
315
|
# 计算
|
315
|
|
- widgets.compute.clicked.connect(self.computeClick)
|
|
316
|
+ # widgets.compute.clicked.connect(self.computeClick)
|
316
|
317
|
widgets.search.clicked.connect(self.searchClick)
|
317
|
318
|
|
318
|
319
|
#删除tableview
|
|
@@ -694,179 +695,193 @@ class MainWindow(QMainWindow):
|
694
|
695
|
id = id + 1
|
695
|
696
|
search_button = ElTree1(ElTreeData(sqlitem))
|
696
|
697
|
search_button.itemClicked.connect(lambda extend: print("单击->扩展数据为:", extend))
|
697
|
|
- search_button.itemDoubleClicked.connect(lambda extend: print("双击->扩展数据为:", extend))
|
|
698
|
+ search_button.itemDoubleClicked.connect(self.computeClick)
|
698
|
699
|
|
699
|
700
|
#直接这个基础上改点选输出表格(未改)
|
700
|
701
|
def computeClick(self):
|
701
|
702
|
# GET BUTTON CLICKED
|
702
|
703
|
btn = self.sender()
|
703
|
704
|
btnName = btn.objectName()
|
|
705
|
+ #获取点击的item的text和它对应的上两个节点
|
|
706
|
+ select_item = self.ui.qureyTreeWidget.currentItem()
|
|
707
|
+ 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
|
704
|
717
|
#处理选中的文件
|
705
|
718
|
# print(file_path)
|
706
|
|
- UIFunctions.compute_show_process_excel_file(self, file_path)
|
707
|
|
- current_text = self.ui.comboBox_2.currentText()
|
708
|
|
- db_path = r"D:\4work_now\20240819GS\ControlNetwork\ControlNetwork\UI\SQL\DataBase.db"
|
709
|
|
- #转换下
|
710
|
|
- excelname = os.path.basename(file_path)
|
711
|
|
- utf_en = excelname.encode('utf-8')
|
712
|
|
- # file_path = file_path
|
713
|
|
- if current_text == "水准测段高差稳定计算":
|
714
|
|
- #只显示一个tab
|
715
|
|
- self.ui.tabWidget.setTabVisible(0,True)
|
716
|
|
- self.ui.tabWidget.setTabVisible(1,False)
|
717
|
|
- self.ui.tabWidget.setTabVisible(2,False)
|
718
|
|
- #重新设置文字名称
|
719
|
|
- self.ui.tabWidget.setTabText(0,'测段高差计算表')
|
720
|
|
-
|
721
|
|
- # 计算结束自动跳转结果页面,并保留查询内容,以便输出
|
722
|
|
- widgets.stackedWidget.setCurrentWidget(widgets.new_page) # SET PAGE
|
723
|
|
- UIFunctions.resetStyle(self, btnName) # RESET ANOTHERS BUTTONS SELECTED
|
724
|
|
- btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet())) # SELECT MENU
|
725
|
|
- elif current_text == "控制网复测平面基准计算":
|
726
|
|
- #就用已有的选项卡
|
727
|
|
- self.ui.tabWidget.setTabVisible(0,True)
|
728
|
|
- self.ui.tabWidget.setTabVisible(1,True)
|
729
|
|
- self.ui.tabWidget.setTabVisible(2,True)
|
730
|
|
- #重新设置文字名称
|
731
|
|
- self.ui.tabWidget.setTabText(0,'复测成果表')
|
732
|
|
- self.ui.tabWidget.setTabText(1,'基准归算模型')
|
733
|
|
- self.ui.tabWidget.setTabText(2,'复测基准归算表')
|
734
|
|
-
|
735
|
|
- #链接数据库并显示
|
736
|
|
- # 连接到数据库
|
737
|
|
- #将结果输出到数据库
|
738
|
|
- db1 = sqlite3.connect(db_path)
|
739
|
|
- #获取游标
|
740
|
|
- cursor1 = db1.cursor()
|
741
|
|
- #查询表内符合的所有数据(分成两个结果分别显示)
|
742
|
|
- #复测成果表
|
743
|
|
- 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 = ?'
|
744
|
|
- cursor1.execute(sqlstr1,(utf_en,))
|
745
|
|
- #获取结果集
|
746
|
|
- result1 = cursor1.fetchall()
|
747
|
|
- #基准归算表
|
748
|
|
- sqlstr11 = 'select PointName,Cal_X,Cal_Y,Last_CalX,Last_CalY,Last_CalP,Dis_Ass from GS_Result_Point WHERE TableName = ?'
|
749
|
|
- cursor1.execute(sqlstr11,(utf_en,))
|
750
|
|
- #获取结果集
|
751
|
|
- result2 = cursor1.fetchall()
|
752
|
|
- #对结果集进行处理,把汉字转换过来,添加表头部分
|
753
|
|
- nlist1,plist1 = self.Arrange_Data1(result1)
|
754
|
|
- nlist2,plist2 = self.Arrange_Data2(result2)
|
755
|
|
- # 创建一个数据模型(复测成果表)
|
756
|
|
- self.model1 = QStandardItemModel()
|
757
|
|
- #把数据放进去
|
758
|
|
- model1 = self.Data_in_Cell1(plist1)
|
759
|
|
- model2 = self.Data_in_Cell2(plist2)
|
760
|
|
- #设置表头
|
761
|
|
- model1.setHorizontalHeaderLabels(['点名', '前期X','前期Y','本期X', '本期Y','前期-本期X','前期-本期Y','前期-本期P','位移判定'])
|
762
|
|
- model1.setVerticalHeaderLabels(nlist1)
|
763
|
|
- #QTableView并将数据模型与之关联
|
764
|
|
- self.ui.resultTableView.setModel(model1)
|
765
|
|
- self.ui.resultTableView.show()
|
766
|
|
- #设置表头
|
767
|
|
- model2.setHorizontalHeaderLabels(['点名', '基准归算X','基准归算Y','前期-归算X','前期-归算Y','前期-归算P','位移判定'])
|
768
|
|
- model2.setVerticalHeaderLabels(nlist2)
|
769
|
|
- #QTableView并将数据模型与之关联
|
770
|
|
- self.ui.reconTableView.setModel(model2)
|
771
|
|
- self.ui.reconTableView.show()
|
772
|
|
-
|
773
|
|
- #富文本的html
|
774
|
|
- sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from GS_Trans_Param WHERE TableName = ?'
|
775
|
|
- cursor1.execute(sqlstr2,(utf_en,))
|
776
|
|
- #获取结果集
|
777
|
|
- result1 = cursor1.fetchall()
|
778
|
|
- str1 = result1[0][0].decode('utf-8')
|
779
|
|
- str2 = result1[0][1].decode('utf-8')
|
780
|
|
- n1 = result1[0][2]
|
781
|
|
- n2 = result1[0][3]
|
782
|
|
- n3 = result1[0][4]
|
783
|
|
- n4 = result1[0][5]
|
784
|
|
- n5 = result1[0][6]
|
785
|
|
- n6 = result1[0][7]
|
786
|
|
- str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
787
|
|
-<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
788
|
|
-p, li { white-space: pre-wrap; }
|
789
|
|
-hr { height: 1px; border-width: 0; }
|
790
|
|
-li.unchecked::marker { content: "\2610"; }
|
791
|
|
-li.checked::marker { content: "\2612"; }
|
792
|
|
-</style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
793
|
|
-<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>
|
794
|
|
-<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>
|
795
|
|
-<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>
|
796
|
|
-<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>
|
797
|
|
-<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>"""
|
798
|
|
- self.ui.printTableView.setHtml(str0)
|
799
|
|
-
|
800
|
|
- # 计算结束自动跳转结果页面,并保留查询内容,以便输出
|
801
|
|
- widgets.stackedWidget.setCurrentWidget(widgets.new_page) # SET PAGE
|
802
|
|
- UIFunctions.resetStyle(self, btnName) # RESET ANOTHERS BUTTONS SELECTED
|
803
|
|
- btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet())) # SELECT MENU
|
804
|
|
- # GS.main_function(file_path, db_path)
|
805
|
|
- # 添加控制网执行代码
|
806
|
|
- elif current_text=="平面控制网稳定性计算":
|
807
|
|
- #只显示头两个tab
|
808
|
|
- self.ui.tabWidget.setTabVisible(0,True)
|
809
|
|
- self.ui.tabWidget.setTabVisible(1,True)
|
810
|
|
- self.ui.tabWidget.setTabVisible(2,False)
|
811
|
|
- #重新设置文字名称
|
812
|
|
- self.ui.tabWidget.setTabText(0,'稳定性分析成果表')
|
813
|
|
- self.ui.tabWidget.setTabText(1,'自由网成果归算模型')
|
814
|
|
- #链接数据库并显示
|
815
|
|
- # 连接到数据库
|
816
|
|
- #将结果输出到数据库
|
817
|
|
- db1 = sqlite3.connect(db_path)
|
818
|
|
- #获取游标
|
819
|
|
- cursor1 = db1.cursor()
|
820
|
|
- #查询表内符合的所有数据
|
821
|
|
- 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 = ?'
|
822
|
|
- cursor1.execute(sqlstr1,(utf_en,))
|
823
|
|
- #获取结果集
|
824
|
|
- result = cursor1.fetchall()
|
825
|
|
- #对结果集进行处理,把汉字转换过来,添加表头部分
|
826
|
|
- nlist,plist = self.Arrange_Data(result)
|
827
|
|
- # 创建一个数据模型
|
828
|
|
- self.model = QStandardItemModel()
|
829
|
|
- #把数据放进去
|
830
|
|
- model1 = self.Data_in_Cell(plist)
|
831
|
|
- #设置表头
|
832
|
|
- model1.setHorizontalHeaderLabels(['点名', '首期X','首期Y','上期X', '上期Y','权','本期X','本期Y','权','本期-首期X','本期-首期Y','本期-首期P','位移判定', '本期-上期X','本期-上期Y','本期-上期P','位移判定'])
|
833
|
|
- model1.setVerticalHeaderLabels(nlist)
|
834
|
|
- #QTableView并将数据模型与之关联
|
835
|
|
- self.ui.resultTableView.setModel(model1)
|
836
|
|
- self.ui.resultTableView.show()
|
837
|
|
-
|
838
|
|
- #富文本的html
|
839
|
|
- sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from WD_Result_Param WHERE TableName = ?'
|
840
|
|
- cursor1.execute(sqlstr2,(utf_en,))
|
841
|
|
- #获取结果集
|
842
|
|
- result1 = cursor1.fetchall()
|
843
|
|
- str1 = result1[0][0].decode('utf-8')
|
844
|
|
- str2 = result1[0][1].decode('utf-8')
|
845
|
|
- n1 = result1[0][2]
|
846
|
|
- n2 = result1[0][3]
|
847
|
|
- n3 = result1[0][4]
|
848
|
|
- n4 = result1[0][5]
|
849
|
|
- n5 = result1[0][6]
|
850
|
|
- n6 = result1[0][7]
|
851
|
|
- str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
852
|
|
-<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
853
|
|
-p, li { white-space: pre-wrap; }
|
854
|
|
-hr { height: 1px; border-width: 0; }
|
855
|
|
-li.unchecked::marker { content: "\2610"; }
|
856
|
|
-li.checked::marker { content: "\2612"; }
|
857
|
|
-</style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
858
|
|
-<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>
|
859
|
|
-<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>
|
860
|
|
-<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>
|
861
|
|
-<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>
|
862
|
|
-<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>"""
|
863
|
|
- self.ui.printTableView.setHtml(str0)
|
864
|
|
-
|
865
|
|
- #----------------------------------------------------------
|
866
|
|
- # 计算结束自动跳转结果页面,并保留查询内容,以便输出
|
867
|
|
- widgets.stackedWidget.setCurrentWidget(widgets.new_page) # SET PAGE
|
868
|
|
- UIFunctions.resetStyle(self, btnName) # RESET ANOTHERS BUTTONS SELECTED
|
869
|
|
- btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet())) # SELECT MENU
|
|
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
|
+#
|
|
880
|
+# #----------------------------------------------------------
|
|
881
|
+# # 计算结束自动跳转结果页面,并保留查询内容,以便输出
|
|
882
|
+# widgets.stackedWidget.setCurrentWidget(widgets.new_page) # SET PAGE
|
|
883
|
+# UIFunctions.resetStyle(self, btnName) # RESET ANOTHERS BUTTONS SELECTED
|
|
884
|
+# btn.setStyleSheet(UIFunctions.selectMenu(btn.styleSheet())) # SELECT MENU
|
870
|
885
|
|
871
|
886
|
|
872
|
887
|
# 点击事件
|