控制网复测平面基准归算程序(包含控制网复测平面基准计算,平面控制网稳定性计算,水准测段高差稳定计算三个程序功能)
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

WDshow.py 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. from Back.Program_Run.data_show import *
  2. import sqlite3
  3. from PySide6.QtGui import QStandardItemModel
  4. def main_function(ui, db_path, utf_en):
  5. #只显示头两个tab
  6. ui.tabWidget.setTabVisible(0,True)
  7. ui.tabWidget.setTabVisible(1,True)
  8. ui.tabWidget.setTabVisible(2,False)
  9. #重新设置文字名称
  10. ui.tabWidget.setTabText(0,'稳定性分析成果表')
  11. ui.tabWidget.setTabText(1,'自由网成果归算模型')
  12. #链接数据库并显示
  13. # 连接到数据库
  14. #将结果输出到数据库
  15. db1 = sqlite3.connect(db_path)
  16. #获取游标
  17. cursor1 = db1.cursor()
  18. #查询表内符合的所有数据
  19. 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 = ?'
  20. cursor1.execute(sqlstr1,(utf_en,))
  21. #获取结果集
  22. result = cursor1.fetchall()
  23. #对结果集进行处理,把汉字转换过来,添加表头部分
  24. nlist,plist = Arrange_Data(result)
  25. # 创建一个数据模型
  26. model = QStandardItemModel()
  27. #把数据放进去
  28. model1 = Data_in_Cell(plist)
  29. #设置表头
  30. model1.setHorizontalHeaderLabels(['点名', '首期X','首期Y','上期X', '上期Y','权','本期X','本期Y','权','本期-首期X','本期-首期Y','本期-首期P','位移判定', '本期-上期X','本期-上期Y','本期-上期P','位移判定'])
  31. model1.setVerticalHeaderLabels(nlist)
  32. #QTableView并将数据模型与之关联
  33. ui.resultTableView.setModel(model1)
  34. ui.resultTableView.show()
  35. #富文本的html
  36. sqlstr2 = 'select Last_ResultName,New_ResultName,Formula_X1,Formula_X2,Formula_X3,Formula_Y1,Formula_Y2,Formula_Y3 from WD_Result_Param WHERE TableName = ?'
  37. cursor1.execute(sqlstr2,(utf_en,))
  38. #获取结果集
  39. result1 = cursor1.fetchall()
  40. str1 = result1[0][0].decode('utf-8')
  41. str2 = result1[0][1].decode('utf-8')
  42. n1 = result1[0][2]
  43. n2 = result1[0][3]
  44. n3 = result1[0][4]
  45. n4 = result1[0][5]
  46. n5 = result1[0][6]
  47. n6 = result1[0][7]
  48. str0 = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
  49. <html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
  50. p, li { white-space: pre-wrap; }
  51. hr { height: 1px; border-width: 0; }
  52. li.unchecked::marker { content: "\2610"; }
  53. li.checked::marker { content: "\2612"; }
  54. </style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
  55. <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>
  56. <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>
  57. <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>
  58. <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>
  59. <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>"""
  60. ui.printTableView.setHtml(str0)