123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- import QtQuick
- import QtQuick.Layouts
- import QtQuick.Controls
- import QtDataVisualization 1.2
- import "components"
- Item {
- id: rootItem
- width: 1920
- height: 1080
- property string textTitle: '湛江钢铁非视距远程操控系统'
- property string mainTextColor: '#29b6fb'
- property string mainAppColor: '#29b6fb'
- property string textClickedColor: '#7ad4ff'
- property string textColorGreen: '#00FFFF'
- property color popupBgColorErr: "#b44"
- property color popupBgColorWarn: "#f7bd3e"
- property color popupBgColorOK: "#29b6fb"
- property color popupTextColor: "#ffffff"
- FontLoader {
- id: alibaba
- source: "qrc:/components/font/Alibaba-PuHuiTi-Bold.ttf"
- }
- FontLoader {
- id: fontawesome
- source: "qrc:/components/font/fontawesome-webfont.ttf"
- }
- FontLoader {
- id: digtalFont
- source: "qrc:/components/font/fontawesome-webfont.ttf"
- }
- Popup {
- id: popup
- property alias popMessage: message.text
- property alias popColor: popupBg.color
- background: Rectangle {
- id: popupBg
- implicitWidth: rootItem.width
- implicitHeight: 60
- }
- y: (rootItem.height - 60)
- modal: true
- focus: true
- closePolicy: Popup.CloseOnPressOutside
- Text {
- id: message
- anchors.centerIn: parent
- font.pointSize: 12
- color: popupTextColor
- font.family: '黑体'
- }
- onOpened: popupClose.start()
- }
- signal qmlSignalMaxWindow
- signal qmlSignalQuit
- //在QML中定义了一个状态机(State Machine),每个状态都有一个属性更改(PropertyChanges),分别用于设置panelView的不透明度
- state: "loading"
- states: [
- //在"loading"状态下,panelView的不透明度被设置为0,即完全透明
- State {
- name: "loading"
- PropertyChanges {
- target: panelView
- opacity: 0
- }
- },
- //在"loaded"状态下,panelView的不透明度被设置为1,即完全不透明
- State {
- name: "loaded"
- PropertyChanges {
- target: panelView
- opacity: 1
- }
- }
- ]
-
- Item {
- id: panelView
- width: 1920
- height: 1080
- visible: true
- x: 0
- y: 0
- Dialog {
- id: closeDialog
- visible: false
- modal: true
- x: (parent.width - width) / 2
- y: (parent.height - height) / 2
- closePolicy: Popup.NoAutoClose
- implicitWidth: 500
- implicitHeight: 300
- Text {
- text: "该账号已登录,程序将自动退出"
- font.pointSize: 24
- font.family: alibaba.name
- color: mainAppColor
- anchors.horizontalCenter: parent.horizontalCenter
- y: 100
- }
- onOpened: {
- closeWinTimer.start()
- }
- }
- Dialog {
- id: panelDialog
- visible: false
- modal: true
- x: (parent.width - width) / 2
- y: (parent.height - height) / 2
- closePolicy: Popup.NoAutoClose
- implicitWidth: 500
- implicitHeight: 300
- Text {
- text: "确认退出吗?"
- font.pointSize: 24
- font.family: alibaba.name
- color: mainAppColor
- anchors.horizontalCenter: parent.horizontalCenter
- y: 100
- }
- Row {
- height: parent.height
- anchors.horizontalCenter: parent.horizontalCenter
- y: 200
- CButton {
- id: cancelBtn
- textHeight: 50
- fontHeight: 0.4
- width: 150
- height: 50
- color: pressed ? textClickedColor : mainAppColor
- text: "取消"
- onClicked: panelDialog.visible = false
-
- }
- spacing: 50
- CButton {
- id: quitButton
- textHeight: 50
- fontHeight: 0.4
- width: 150
- height: 50
- color: pressed ? textClickedColor : mainAppColor
- text: "退出"
- onClicked: {
- readThread.close()
- //readThread.wait()
-
-
- }
- }
- }
- }
- PanelWindow {
- id: subPage
- focus: true
- Keys.enabled: true
- Keys.onEscapePressed: {
- panelDialog.visible = true
- }
- Component.onCompleted: {
- appModel.radar1 = 5000
- appModel.radar2 = 0
- appModel.radar3 = 0
- appModel.radar4 = 0
- appModel.radar5 = 0
- appModel.radar6 = 0
- appModel.radar7 = 0
- appModel.radar8 = 0
- appModel.ping = 0
- appModel.ready = 0
- appModel.fuelLevel=666
- appModel.imux=666
- appModel.imuy=666
- appModel.engineTemperature=666
- appModel.liftPilotPressureSensor_F= true
- appModel.boomAngleSensor_F = true
- }
- }
- Connections {
- target: readThread
- onPlayState:{
- if(end){
- delete readThread
- videoWindow.close()
- rootItem.qmlSignalQuit()
- }
- }
- }
- Window {
- id: videoWindow
- property int wndIndex: 0
- visible: true
- width: 3840
- height: 1080
- //原版
- x: 1920
- //屏幕移动调整位置
- //x: 1920+650
- //x: 1920+1920
- //档位显示
- //x: 0-1500
- //灯显示
- //x: 0
- title: qsTr("Hyper vision remote control System")
- flags: Qt.Window | Qt.FramelessWindowHint
- screen: Qt.application.screens[wndIndex]
- MainWindow {}
- /*
- Component.onCompleted: {
- appModel.radar1 = 5000
- appModel.radar2 = 0
- appModel.radar3 = 0
- appModel.radar4 = 0
- appModel.radar5 = 0
- appModel.radar6 = 0
- appModel.radar7 = 0
- appModel.radar8 = 0
- appModel.ping = 0
- appModel.ready = 0
- appModel.fuelLevel=666
- appModel.imux=666
- appModel.imuy=666
- appModel.engineTemperature=666
- }*/
- }
- }
- Timer {
- id: splashScreenClose
- interval: 1000
- onTriggered: {
- splashScreenLoader.item.visible = false
- splashScreenLoader.source = ""
- rootItem.qmlSignalMaxWindow()
- rootItem.state = "loaded"
- }
- }
- Loader {
- id: splashScreenLoader
- source: "qrc:/components/SplashScreen.qml"
- onLoaded: {
- splashScreenClose.start()
- }
- }
-
- }
|