控制网复测平面基准归算程序(包含控制网复测平面基准计算,平面控制网稳定性计算,水准测段高差稳定计算三个程序功能)
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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