控制网复测平面基准归算程序(包含控制网复测平面基准计算,平面控制网稳定性计算,水准测段高差稳定计算三个程序功能)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. # ///////////////////////////////////////////////////////////////
  2. #
  3. # BY: WANDERSON M.PIMENTA
  4. # PROJECT MADE WITH: Qt Designer and PySide6
  5. # V: 1.0.0
  6. #
  7. # This project can be used freely for all uses, as long as they maintain the
  8. # respective credits only in the Python scripts, any information in the visual
  9. # interface (GUI) can be modified without any implication.
  10. #
  11. # There are limitations on Qt licenses if you want to use your products
  12. # commercially, I recommend reading them on the official website:
  13. # https://doc.qt.io/qtforpython/licenses.html
  14. #
  15. # ///////////////////////////////////////////////////////////////
  16. from PySide6.QtCore import *
  17. from PySide6.QtGui import *
  18. from PySide6.QtWidgets import *
  19. class CustomGrip(QWidget):
  20. def __init__(self, parent, position, disable_color = False):
  21. # SETUP UI
  22. QWidget.__init__(self)
  23. self.parent = parent
  24. self.setParent(parent)
  25. self.wi = Widgets()
  26. # SHOW TOP GRIP
  27. if position == Qt.TopEdge:
  28. self.wi.top(self)
  29. self.setGeometry(0, 0, self.parent.width(), 10)
  30. self.setMaximumHeight(10)
  31. # GRIPS
  32. top_left = QSizeGrip(self.wi.top_left)
  33. top_right = QSizeGrip(self.wi.top_right)
  34. # RESIZE TOP
  35. def resize_top(event):
  36. delta = event.pos()
  37. height = max(self.parent.minimumHeight(), self.parent.height() - delta.y())
  38. geo = self.parent.geometry()
  39. geo.setTop(geo.bottom() - height)
  40. self.parent.setGeometry(geo)
  41. event.accept()
  42. self.wi.top.mouseMoveEvent = resize_top
  43. # ENABLE COLOR
  44. if disable_color:
  45. self.wi.top_left.setStyleSheet("background: transparent")
  46. self.wi.top_right.setStyleSheet("background: transparent")
  47. self.wi.top.setStyleSheet("background: transparent")
  48. # SHOW BOTTOM GRIP
  49. elif position == Qt.BottomEdge:
  50. self.wi.bottom(self)
  51. self.setGeometry(0, self.parent.height() - 10, self.parent.width(), 10)
  52. self.setMaximumHeight(10)
  53. # GRIPS
  54. self.bottom_left = QSizeGrip(self.wi.bottom_left)
  55. self.bottom_right = QSizeGrip(self.wi.bottom_right)
  56. # RESIZE BOTTOM
  57. def resize_bottom(event):
  58. delta = event.pos()
  59. height = max(self.parent.minimumHeight(), self.parent.height() + delta.y())
  60. self.parent.resize(self.parent.width(), height)
  61. event.accept()
  62. self.wi.bottom.mouseMoveEvent = resize_bottom
  63. # ENABLE COLOR
  64. if disable_color:
  65. self.wi.bottom_left.setStyleSheet("background: transparent")
  66. self.wi.bottom_right.setStyleSheet("background: transparent")
  67. self.wi.bottom.setStyleSheet("background: transparent")
  68. # SHOW LEFT GRIP
  69. elif position == Qt.LeftEdge:
  70. self.wi.left(self)
  71. self.setGeometry(0, 10, 10, self.parent.height())
  72. self.setMaximumWidth(10)
  73. # RESIZE LEFT
  74. def resize_left(event):
  75. delta = event.pos()
  76. width = max(self.parent.minimumWidth(), self.parent.width() - delta.x())
  77. geo = self.parent.geometry()
  78. geo.setLeft(geo.right() - width)
  79. self.parent.setGeometry(geo)
  80. event.accept()
  81. self.wi.leftgrip.mouseMoveEvent = resize_left
  82. # ENABLE COLOR
  83. if disable_color:
  84. self.wi.leftgrip.setStyleSheet("background: transparent")
  85. # RESIZE RIGHT
  86. elif position == Qt.RightEdge:
  87. self.wi.right(self)
  88. self.setGeometry(self.parent.width() - 10, 10, 10, self.parent.height())
  89. self.setMaximumWidth(10)
  90. def resize_right(event):
  91. delta = event.pos()
  92. width = max(self.parent.minimumWidth(), self.parent.width() + delta.x())
  93. self.parent.resize(width, self.parent.height())
  94. event.accept()
  95. self.wi.rightgrip.mouseMoveEvent = resize_right
  96. # ENABLE COLOR
  97. if disable_color:
  98. self.wi.rightgrip.setStyleSheet("background: transparent")
  99. def mouseReleaseEvent(self, event):
  100. self.mousePos = None
  101. def resizeEvent(self, event):
  102. if hasattr(self.wi, 'container_top'):
  103. self.wi.container_top.setGeometry(0, 0, self.width(), 10)
  104. elif hasattr(self.wi, 'container_bottom'):
  105. self.wi.container_bottom.setGeometry(0, 0, self.width(), 10)
  106. elif hasattr(self.wi, 'leftgrip'):
  107. self.wi.leftgrip.setGeometry(0, 0, 10, self.height() - 20)
  108. elif hasattr(self.wi, 'rightgrip'):
  109. self.wi.rightgrip.setGeometry(0, 0, 10, self.height() - 20)
  110. class Widgets(object):
  111. def top(self, Form):
  112. if not Form.objectName():
  113. Form.setObjectName(u"Form")
  114. self.container_top = QFrame(Form)
  115. self.container_top.setObjectName(u"container_top")
  116. self.container_top.setGeometry(QRect(0, 0, 500, 10))
  117. self.container_top.setMinimumSize(QSize(0, 10))
  118. self.container_top.setMaximumSize(QSize(16777215, 10))
  119. self.container_top.setFrameShape(QFrame.NoFrame)
  120. self.container_top.setFrameShadow(QFrame.Raised)
  121. self.top_layout = QHBoxLayout(self.container_top)
  122. self.top_layout.setSpacing(0)
  123. self.top_layout.setObjectName(u"top_layout")
  124. self.top_layout.setContentsMargins(0, 0, 0, 0)
  125. self.top_left = QFrame(self.container_top)
  126. self.top_left.setObjectName(u"top_left")
  127. self.top_left.setMinimumSize(QSize(10, 10))
  128. self.top_left.setMaximumSize(QSize(10, 10))
  129. self.top_left.setCursor(QCursor(Qt.SizeFDiagCursor))
  130. self.top_left.setStyleSheet(u"background-color: rgb(33, 37, 43);")
  131. self.top_left.setFrameShape(QFrame.NoFrame)
  132. self.top_left.setFrameShadow(QFrame.Raised)
  133. self.top_layout.addWidget(self.top_left)
  134. self.top = QFrame(self.container_top)
  135. self.top.setObjectName(u"top")
  136. self.top.setCursor(QCursor(Qt.SizeVerCursor))
  137. self.top.setStyleSheet(u"background-color: rgb(85, 255, 255);")
  138. self.top.setFrameShape(QFrame.NoFrame)
  139. self.top.setFrameShadow(QFrame.Raised)
  140. self.top_layout.addWidget(self.top)
  141. self.top_right = QFrame(self.container_top)
  142. self.top_right.setObjectName(u"top_right")
  143. self.top_right.setMinimumSize(QSize(10, 10))
  144. self.top_right.setMaximumSize(QSize(10, 10))
  145. self.top_right.setCursor(QCursor(Qt.SizeBDiagCursor))
  146. self.top_right.setStyleSheet(u"background-color: rgb(33, 37, 43);")
  147. self.top_right.setFrameShape(QFrame.NoFrame)
  148. self.top_right.setFrameShadow(QFrame.Raised)
  149. self.top_layout.addWidget(self.top_right)
  150. def bottom(self, Form):
  151. if not Form.objectName():
  152. Form.setObjectName(u"Form")
  153. self.container_bottom = QFrame(Form)
  154. self.container_bottom.setObjectName(u"container_bottom")
  155. self.container_bottom.setGeometry(QRect(0, 0, 500, 10))
  156. self.container_bottom.setMinimumSize(QSize(0, 10))
  157. self.container_bottom.setMaximumSize(QSize(16777215, 10))
  158. self.container_bottom.setFrameShape(QFrame.NoFrame)
  159. self.container_bottom.setFrameShadow(QFrame.Raised)
  160. self.bottom_layout = QHBoxLayout(self.container_bottom)
  161. self.bottom_layout.setSpacing(0)
  162. self.bottom_layout.setObjectName(u"bottom_layout")
  163. self.bottom_layout.setContentsMargins(0, 0, 0, 0)
  164. self.bottom_left = QFrame(self.container_bottom)
  165. self.bottom_left.setObjectName(u"bottom_left")
  166. self.bottom_left.setMinimumSize(QSize(10, 10))
  167. self.bottom_left.setMaximumSize(QSize(10, 10))
  168. self.bottom_left.setCursor(QCursor(Qt.SizeBDiagCursor))
  169. self.bottom_left.setStyleSheet(u"background-color: rgb(33, 37, 43);")
  170. self.bottom_left.setFrameShape(QFrame.NoFrame)
  171. self.bottom_left.setFrameShadow(QFrame.Raised)
  172. self.bottom_layout.addWidget(self.bottom_left)
  173. self.bottom = QFrame(self.container_bottom)
  174. self.bottom.setObjectName(u"bottom")
  175. self.bottom.setCursor(QCursor(Qt.SizeVerCursor))
  176. self.bottom.setStyleSheet(u"background-color: rgb(85, 170, 0);")
  177. self.bottom.setFrameShape(QFrame.NoFrame)
  178. self.bottom.setFrameShadow(QFrame.Raised)
  179. self.bottom_layout.addWidget(self.bottom)
  180. self.bottom_right = QFrame(self.container_bottom)
  181. self.bottom_right.setObjectName(u"bottom_right")
  182. self.bottom_right.setMinimumSize(QSize(10, 10))
  183. self.bottom_right.setMaximumSize(QSize(10, 10))
  184. self.bottom_right.setCursor(QCursor(Qt.SizeFDiagCursor))
  185. self.bottom_right.setStyleSheet(u"background-color: rgb(33, 37, 43);")
  186. self.bottom_right.setFrameShape(QFrame.NoFrame)
  187. self.bottom_right.setFrameShadow(QFrame.Raised)
  188. self.bottom_layout.addWidget(self.bottom_right)
  189. def left(self, Form):
  190. if not Form.objectName():
  191. Form.setObjectName(u"Form")
  192. self.leftgrip = QFrame(Form)
  193. self.leftgrip.setObjectName(u"left")
  194. self.leftgrip.setGeometry(QRect(0, 10, 10, 480))
  195. self.leftgrip.setMinimumSize(QSize(10, 0))
  196. self.leftgrip.setCursor(QCursor(Qt.SizeHorCursor))
  197. self.leftgrip.setStyleSheet(u"background-color: rgb(255, 121, 198);")
  198. self.leftgrip.setFrameShape(QFrame.NoFrame)
  199. self.leftgrip.setFrameShadow(QFrame.Raised)
  200. def right(self, Form):
  201. if not Form.objectName():
  202. Form.setObjectName(u"Form")
  203. Form.resize(500, 500)
  204. self.rightgrip = QFrame(Form)
  205. self.rightgrip.setObjectName(u"right")
  206. self.rightgrip.setGeometry(QRect(0, 0, 10, 500))
  207. self.rightgrip.setMinimumSize(QSize(10, 0))
  208. self.rightgrip.setCursor(QCursor(Qt.SizeHorCursor))
  209. self.rightgrip.setStyleSheet(u"background-color: rgb(255, 0, 127);")
  210. self.rightgrip.setFrameShape(QFrame.NoFrame)
  211. self.rightgrip.setFrameShadow(QFrame.Raised)