main.qml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import QtQuick
  2. import QtQuick.Layouts
  3. import QtQuick.Controls
  4. import QtDataVisualization 1.2
  5. import "components"
  6. /*
  7. 软件显示界面框架逻辑
  8. */
  9. Item {
  10. id: rootItem
  11. width: 1920
  12. height: 1080
  13. property string textTitle: '大冶智能驾驶系统'
  14. property string mainTextColor: '#29b6fb'
  15. property string mainAppColor: '#29b6fb'
  16. property string textClickedColor: '#7ad4ff'
  17. property string textColorGreen: '#00FFFF'
  18. property color popupBgColorErr: "#b44"
  19. property color popupBgColorWarn: "#f7bd3e"
  20. property color popupBgColorOK: "#29b6fb"
  21. property color popupTextColor: "#ffffff"
  22. FontLoader {
  23. id: alibaba
  24. source: "qrc:/components/font/Alibaba-PuHuiTi-Bold.ttf"
  25. }
  26. FontLoader {
  27. id: fontawesome
  28. source: "qrc:/components/font/fontawesome-webfont.ttf"
  29. }
  30. FontLoader {
  31. id: digtalFont
  32. source: "qrc:/components/font/DS-DIGIB.ttf"
  33. }
  34. Popup {
  35. id: popup
  36. property alias popMessage: message.text
  37. property alias popColor: popupBg.color
  38. background: Rectangle {
  39. id: popupBg
  40. implicitWidth: rootItem.width
  41. implicitHeight: 60
  42. }
  43. y: (rootItem.height - 60)
  44. modal: true
  45. focus: true
  46. closePolicy: Popup.CloseOnPressOutside
  47. Text {
  48. id: message
  49. anchors.centerIn: parent
  50. font.pointSize: 12
  51. color: popupTextColor
  52. font.family: '黑体'
  53. }
  54. onOpened: popupClose.start()
  55. }
  56. signal qmlSignalMaxWindow
  57. signal qmlSignalQuit
  58. state: "loading"
  59. states: [
  60. State {
  61. name: "loading"
  62. PropertyChanges {
  63. target: panelView
  64. opacity: 0
  65. }
  66. },
  67. State {
  68. name: "loaded"
  69. PropertyChanges {
  70. target: panelView
  71. opacity: 1
  72. }
  73. }
  74. ]
  75. Item {
  76. id: panelView
  77. width: 1920
  78. height: 1080
  79. visible: true
  80. x: 0
  81. y: 0
  82. Dialog {
  83. id: closeDialog
  84. visible: false
  85. modal: true
  86. x: (parent.width - width) / 2
  87. y: (parent.height - height) / 2
  88. closePolicy: Popup.NoAutoClose
  89. implicitWidth: 500
  90. implicitHeight: 300
  91. Text {
  92. text: "该账号已登录,程序将自动退出"
  93. font.pointSize: 24
  94. font.family: alibaba.name
  95. color: mainAppColor
  96. anchors.horizontalCenter: parent.horizontalCenter
  97. y: 100
  98. }
  99. onOpened: {
  100. closeWinTimer.start()
  101. }
  102. }
  103. Dialog {
  104. id: panelDialog
  105. visible: false
  106. modal: true
  107. x: (parent.width - width) / 2
  108. y: (parent.height - height) / 2
  109. closePolicy: Popup.NoAutoClose
  110. implicitWidth: 500
  111. implicitHeight: 300
  112. Text {
  113. text: "确认退出吗?"
  114. font.pointSize: 24
  115. font.family: alibaba.name
  116. color: mainAppColor
  117. anchors.horizontalCenter: parent.horizontalCenter
  118. y: 100
  119. }
  120. Row {
  121. height: parent.height
  122. anchors.horizontalCenter: parent.horizontalCenter
  123. y: 200
  124. CButton {
  125. id: cancelBtn
  126. textHeight: 50
  127. fontHeight: 0.4
  128. width: 150
  129. height: 50
  130. color: pressed ? textClickedColor : mainAppColor
  131. text: "取消"
  132. onClicked: panelDialog.visible = false
  133. }
  134. spacing: 50
  135. CButton {
  136. id: quitButton
  137. textHeight: 50
  138. fontHeight: 0.4
  139. width: 150
  140. height: 50
  141. color: pressed ? textClickedColor : mainAppColor
  142. text: "退出"
  143. onClicked: {
  144. videoWindow.close()
  145. rootItem.qmlSignalQuit()
  146. }
  147. }
  148. }
  149. }
  150. PanelWindow {
  151. id: subPage
  152. focus: true
  153. Keys.enabled: true
  154. Keys.onEscapePressed: {
  155. panelDialog.visible = true
  156. }
  157. }
  158. Window {
  159. id: videoWindow
  160. property int wndIndex: 0
  161. visible: true
  162. width: 3840
  163. height: 1080
  164. //原版
  165. x: 1920
  166. //屏幕移动调整位置
  167. //x: 1920+650
  168. //x: 1920+1920
  169. //档位显示
  170. //x: 0-1500
  171. //灯显示
  172. //x:800
  173. title: qsTr("Hyper vision remote control System")
  174. flags: Qt.Window | Qt.FramelessWindowHint
  175. screen: Qt.application.screens[wndIndex]
  176. MainWindow {}
  177. Component.onCompleted: {
  178. appModel.radar1 = 5000
  179. appModel.radar2 = 5000
  180. appModel.radar3 = 5000
  181. appModel.radar4 = 5000
  182. appModel.radar5 = 5000
  183. appModel.radar6 = 5000
  184. appModel.radar7 = 5000
  185. appModel.radar8 = 5000
  186. appModel.radar9 = 5000
  187. appModel.ping = 0
  188. appModel.ready = 0
  189. }
  190. }
  191. }
  192. Timer {
  193. id: splashScreenClose
  194. interval: 1000
  195. onTriggered: {
  196. splashScreenLoader.item.visible = false
  197. splashScreenLoader.source = ""
  198. rootItem.qmlSignalMaxWindow()
  199. rootItem.state = "loaded"
  200. }
  201. }
  202. Loader {
  203. id: splashScreenLoader
  204. source: "qrc:/components/SplashScreen.qml"
  205. onLoaded: {
  206. splashScreenClose.start()
  207. }
  208. }
  209. }