|
@@ -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
|