123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110 |
- import QtQml 2.3
- import QtQuick 2.6
- import QtQuick.Window 2.2
- import QtQuick.Controls 2.0
- //import QtDataVisualization 1.2
- //import QtQuick3D
- Item {
- id: mainWindow
- visible: true
- width: 3840
- height: 1080
- // signal imageEvent(string params)
- // onImageEvent: {
- // if (params === "redrawImage") {
- // cam_front_rear.signalRedraw()
- // }
- // }
- // property int mainHeight: 1000
- // property int lineWidth: 20
- // property int statusWidth: 467
- // property int leftCamWidth: 540
- // property int frontCamWidth: 1706
- // property int rightCamWidth: 540
- // property int radarWidth: 467
- // property int radarSize: 120
- property int mainHeight: 1000
- property int lineWidth: 20
- property int statusWidth: 417
- property int leftCamWidth: 490
- property int frontCamWidth: 1906
- property int rightCamWidth: 490
- property int radarWidth: 417
- property int radarSize: 120
- // property int topCamHeight: 500
- // property int bottomCamHeight: 500
- property int radarRedRange: 2000
- property int radarGreenRange: 4000
- property string radarRightFGreenImg: 'qrc:/images/right_f_green.png'
- property string radarRightFYellowImg: 'qrc:/images/right_f_yellow.png'
- property string radarRightFRedImg: 'qrc:/images/right_f_red.png'
- property string radarRightRGreenImg: 'qrc:/images/right_r_green.png'
- property string radarRightRYellowImg: 'qrc:/images/right_r_yellow.png'
- property string radarRightRRedImg: 'qrc:/images/right_r_red.png'
- property string radarLeftFGreenImg: 'qrc:/images/left_f_green.png'
- property string radarLeftFYellowImg: 'qrc:/images/left_f_yellow.png'
- property string radarLeftFRedImg: 'qrc:/images/left_f_red.png'
- property string radarLeftRGreenImg: 'qrc:/images/left_r_green.png'
- property string radarLeftRYellowImg: 'qrc:/images/left_r_yellow.png'
- property string radarLeftRRedImg: 'qrc:/images/left_r_red.png'
- property string radarBottomGreenImg: 'qrc:/images/bottom_green.png'
- property string radarBottomYellowImg: 'qrc:/images/bottom_yellow.png'
- property string radarBottomRedImg: 'qrc:/images/bottom_red.png'
- property int radarRightMargin: 40
- property int radarTopMargin: 350
- property int radarBottomMargin: 280
- property int radarleftMargin: 200
- property int radarTxtSize: 18
- FontLoader {
- id: alibaba
- source: "qrc:/components/font/Alibaba-PuHuiTi-Bold.ttf"
- }
- FontLoader {
- id: fontawesome
- source: "qrc:/components/font/fontawesome-webfont.ttf"
- }
- Rectangle {
- id: mainForm
- anchors.fill: parent
- Image {
- fillMode: Image.PreserveAspectFit
- source: 'qrc:/images/bg4k.png'
- }
- Rectangle {
- id: mainFormHeader
- width: mainForm.width
- height: 80
- color: 'transparent'
- Image {
- id: mainFormBannerBg
- anchors.top: mainFormHeader.top
- anchors.horizontalCenter: mainFormHeader.horizontalCenter
- fillMode: Image.PreserveAspectFit
- source: 'qrc:/images/banner.png'
- }
- Text {
- id: mainFormTitle
- width: mainFormHeader.width
- height: mainFormHeader.height
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- text: textTitle
- font.family: alibaba.name
- font.pointSize: 24
- color: mainTextColor
- }
- Text {
- id: delayms
- text: '网络延迟: ' + (appModel.ping / 2).toFixed(1) + ' ms'
- color: appModel.ping > 200 ? popupBgColorErr : mainTextColor
- font.family: alibaba.name
- font.pointSize: 12
- anchors.right: mainFormHeader.right
- anchors.rightMargin: 50
- anchors.top: mainFormHeader.top
- anchors.topMargin: 50
- }
- }
- Rectangle {
- id: mainFormContent
- width: mainForm.width
- height: mainForm.height - 80
- anchors.top: mainFormHeader.bottom
- color: 'transparent'
- Row {
- Rectangle {
- id: statusData
- width: statusWidth + lineWidth
- height: mainHeight
- color: 'transparent'
- Image {
- width: lineWidth
- height: mainHeight
- anchors.left: statusData.left
- anchors.leftMargin: 20
- fillMode: Image.Stretch
- source: 'qrc:/images/border_l.png'
- }
- Column {
- id: carDataForm
- width: statusData.width - 60
- height: 300
- anchors.top: statusData.top
- anchors.topMargin: 20
- anchors.horizontalCenter: statusData.horizontalCenter
- Text {
- id: posText
- text: "车辆姿态:"
- color: mainTextColor
- anchors.left: statusData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: 20
- anchors.horizontalCenter: statusData.horizontalCenter
- }
- Image {
- id: posSideView
- anchors.top: posText.bottom
- anchors.topMargin: 50
- width: 360
- height: 240
- fillMode: Image.Stretch
- source: 'qrc:/images/side_view.png'
- anchors.horizontalCenter: statusData.horizontalCenter
- //transformOrigin: Item.Center
- Component.onCompleted: {
- posSideTimer.start()
- }
- }
- RotationAnimation {
- id: posSideAnim
- target: posSideView
- from: 0
- to: 0
- duration: 100
- }
- Timer {
- id: posSideTimer
- interval: 2000
- repeat: true
- onTriggered: {
- posSideAnim.from = 0
- posSideAnim.to = appModel.imux
- posSideAnim.start()
- }
- }
- Row {
- anchors.top: posSideView.bottom
- anchors.topMargin: 20
- Text {
- id: xAngle
- text: "横向倾角(度):"
- color: mainTextColor
- anchors.left: statusData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: 20
- anchors.horizontalCenter: statusData.horizontalCenter
- }
- spacing: 50
- Text {
- id: xAngleValue
- text: appModel.imux
- color: appModel.imux >= 30 ? 'red' : '#FFFFFF'
- font.family: digtalFont.name
- font.pointSize: 36
- }
- }
- Image {
- id: posRearView
- anchors.top: posSideView.bottom
- anchors.topMargin: 80
- width: 360
- height: 240
- fillMode: Image.Stretch
- source: 'qrc:/images/rear_view.png'
- anchors.horizontalCenter: statusData.horizontalCenter
- Component.onCompleted: {
- posRearTimer.start()
- }
- }
- RotationAnimation {
- id: posRearAnim
- target: posRearView
- from: 0
- to: 0
- duration: 100
- }
- Timer {
- id: posRearTimer
- interval: 2000
- repeat: true
- onTriggered: {
- posRearAnim.from = 0
- posRearAnim.to = appModel.imuy
- posRearAnim.start()
- }
- }
- Row {
- anchors.top: posRearView.bottom
- anchors.topMargin: 20
- Text {
- id: yAngle
- text: "纵向倾角(度):"
- color: mainTextColor
- anchors.left: statusData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: 20
- anchors.horizontalCenter: statusData.horizontalCenter
- }
- spacing: 50
- Text {
- id: yAngleValue
- text: appModel.imuy
- color: appModel.imuy >= 30 ? 'red' : '#FFFFFF'
- font.family: digtalFont.name
- font.pointSize: 36
- }
- }
- }
- Rectangle {
- id: refreshDate
- width: statusData.width - 60
- height: 50
- color: mainAppColor
- anchors.bottom: statusData.bottom
- anchors.bottomMargin: 30
- anchors.horizontalCenter: statusData.horizontalCenter
- anchors.horizontalCenterOffset: 10
- Text {
- id: localTime
- width: 140
- height: 50
- anchors.horizontalCenter: refreshDate.horizontalCenter
- color: '#FFFFFF'
- font.family: digtalFont.name
- font.pointSize: 36
- text: new Date().toLocaleTimeString()
- Component.onCompleted: {
- localTimeRefresh.start()
- }
- }
- Timer {
- id: localTimeRefresh
- interval: 1000
- repeat: true
- onTriggered: {
- localTime.text = new Date().toLocaleTimeString()
- }
- }
- }
- Image {
- width: lineWidth
- height: mainHeight
- anchors.right: statusData.right
- fillMode: Image.Stretch
- source: 'qrc:/images/border_r.png'
- }
- }
- Rectangle {
- id: leftCam
- width: leftCamWidth + lineWidth
- height: mainHeight
- color: 'transparent'
- Image {
- width: lineWidth
- height: mainHeight
- anchors.left: leftCam.left
- anchors.leftMargin: 20
- fillMode: Image.Stretch
- source: 'qrc:/images/border_l.png'
- z: 99
- }
- Column {
- anchors.left: leftCam.left
- anchors.leftMargin: 20
- // // CAM ForwardRight
- // Rectangle {
- // width: rightCamWidth
- // height: topCamHeight
- // color: 'transparent'
- // Image {
- // id: forwardRightImg
- // width: leftCamWidth
- // height: bottomCamHeight
- // //fillMode: Image.Stretch
- // fillMode: Image.PreserveAspectCrop
- // }
- // Connections {
- // target: ForwardRightImage
- // onCallQmlRefeshForwardRightImg: {
- // forwardRightImg.source = ""
- // forwardRightImg.source = "image://ForwardRightImage"
- // }
- // }
- // }
- Rectangle {
- width: leftCamWidth
- height: mainHeight
- color: 'transparent'
- anchors.left: leftCam.left
- anchors.leftMargin: 20
- // CAM Left
- Image {
- id: leftImg
- width: leftCamWidth
- height: mainHeight
- fillMode: Image.Stretch
- }
- Connections {
- target: LeftImage
- onCallQmlRefeshLeftImg: {
- leftImg.source = ""
- leftImg.source = "image://LeftImage"
- }
- }
- }
- }
- Image {
- width: lineWidth
- height: mainHeight
- anchors.right: leftCam.right
- fillMode: Image.Stretch
- source: 'qrc:/images/border_r.png'
- z: 99
- }
- }
- Rectangle {
- id: centerPanel
- width: frontCamWidth + 2 * lineWidth
- height: mainHeight
- anchors.top: mainFormContent.top
- anchors.horizontalCenter: mainFormContent.horizontalCenter
- color: 'transparent'
- MouseArea {
- anchors.fill: parent
- drag.target: backImgRect
- drag.axis: Drag.XandYAxis
- drag.minimumX: 20
- drag.maximumX: centerPanel.width - backImgRect.width - 20
- drag.minimumY: 0
- drag.maximumY: centerPanel.height - backImgRect.height
- }
- Image {
- width: lineWidth
- height: mainHeight
- anchors.left: centerPanel.left
- anchors.leftMargin: 20
- fillMode: Image.Stretch
- source: 'qrc:/images/border_l.png'
- z: 99
- }
- Rectangle {
- width: frontCamWidth
- height: mainHeight
- color: 'transparent'
- anchors.left: centerPanel.left
- anchors.leftMargin: 20
- // CAM FRONT
- Image {
- id: img
- anchors.topMargin: 140
- width: frontCamWidth
- height: mainHeight
- fillMode: Image.Stretch
- z: 97
- }
- Connections {
- target: FrontImage
- onCallQmlRefeshImg: {
- img.source = ""
- img.source = "image://FrontImage"
- }
- }
- }
- Rectangle {
- id: backImgRect
- width: frontCamWidth / 3
- height: mainHeight / 3
- color: 'transparent'
- x: 25
- border.color: mainAppColor
- border.width: 1
- Image {
- id: cautionLine
- anchors.horizontalCenter: parent.horizontalCenter
- width: parent.width / 1.5
- height: parent.height / 3
- fillMode: Image.Stretch
- z: 99
- y: 220
- source: 'qrc:/images/caution.png'
- }
- // CAM BACK REAR
- Image {
- id: backImg
- anchors.topMargin: 140
- width: parent.width
- height: parent.height
- fillMode: Image.Stretch
- z: 98
- }
- Connections {
- target: BackImage
- onCallQmlRefeshBackImg: {
- backImg.source = ""
- backImg.source = "image://BackImage"
- }
- }
- }
- Image {
- width: lineWidth
- height: mainHeight
- anchors.right: centerPanel.right
- anchors.rightMargin: 20
- fillMode: Image.Stretch
- source: 'qrc:/images/border_r.png'
- z: 99
- }
- }
- Rectangle {
- id: rightCam
- width: rightCamWidth + lineWidth
- height: mainHeight
- color: 'transparent'
- Image {
- width: lineWidth
- height: mainHeight
- anchors.left: rightCam.left
- fillMode: Image.Stretch
- source: 'qrc:/images/border_l.png'
- z: 99
- }
- Column {
- anchors.right: rightCam.right
- anchors.rightMargin: 20
- // // CAM ForwardRight
- // Rectangle {
- // width: rightCamWidth
- // height: topCamHeight
- // color: 'transparent'
- // Image {
- // id: forwardRightImg
- // width: leftCamWidth
- // height: bottomCamHeight
- // //fillMode: Image.Stretch
- // fillMode: Image.PreserveAspectCrop
- // }
- // Connections {
- // target: ForwardRightImage
- // onCallQmlRefeshForwardRightImg: {
- // forwardRightImg.source = ""
- // forwardRightImg.source = "image://ForwardRightImage"
- // }
- // }
- // }
- Rectangle {
- width: rightCamWidth
- height: mainHeight
- color: 'transparent'
- anchors.left: rightCam.left
- // CAM Right
- Image {
- id: rightImg
- width: rightCamWidth
- height: mainHeight
- fillMode: Image.Stretch
- }
- Connections {
- target: RightImage
- onCallQmlRefeshRightImg: {
- rightImg.source = ""
- rightImg.source = "image://RightImage"
- }
- }
- }
- }
- Image {
- width: lineWidth
- height: mainHeight
- anchors.right: rightCam.right
- anchors.rightMargin: 20
- fillMode: Image.Stretch
- source: 'qrc:/images/border_r.png'
- z: 99
- }
- }
- Rectangle {
- id: radarData
- width: radarWidth
- height: mainHeight
- color: 'transparent'
- Image {
- width: lineWidth
- height: mainHeight
- anchors.left: radarData.left
- fillMode: Image.Stretch
- source: 'qrc:/images/border_l.png'
- }
- Image {
- id: radar_car
- width: 600
- height: 800
- anchors.horizontalCenter: radarData.horizontalCenter
- anchors.verticalCenter: radarData.verticalCenter
- fillMode: Image.Stretch
- source: 'qrc:/images/radar_car.png'
- }
- //------------ radarRightF
- Image {
- id: radarRightF0
- width: radarSize
- height: radarSize
- anchors.right: radarData.right
- anchors.rightMargin: radarRightMargin
- anchors.top: radarData.top
- anchors.topMargin: radarTopMargin
- fillMode: Image.PreserveAspectFit
- source: radarRightFGreenImg
- visible: appModel.radar1 >= radarGreenRange
- }
- Image {
- id: radarRightF1
- width: radarSize
- height: radarSize
- anchors.right: radarData.right
- anchors.rightMargin: radarRightMargin
- anchors.top: radarData.top
- anchors.topMargin: radarTopMargin
- fillMode: Image.PreserveAspectFit
- source: radarRightFYellowImg
- visible: appModel.radar1 < radarGreenRange
- && appModel.radar1 > radarRedRange
- }
- Image {
- id: radarRightF2
- width: radarSize
- height: radarSize
- anchors.right: radarData.right
- anchors.rightMargin: radarRightMargin
- anchors.top: radarData.top
- anchors.topMargin: radarTopMargin
- fillMode: Image.PreserveAspectFit
- source: radarRightFRedImg
- visible: appModel.radar1 <= radarRedRange
- }
- //------------ radarRightR
- Image {
- id: radarRightR0
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarTopMargin
- anchors.right: radarData.right
- anchors.rightMargin: radarRightMargin
- fillMode: Image.PreserveAspectFit
- source: radarRightRGreenImg
- visible: appModel.radar2 >= radarGreenRange
- }
- Image {
- id: radarRightR1
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarTopMargin
- anchors.right: radarData.right
- anchors.rightMargin: radarRightMargin
- fillMode: Image.PreserveAspectFit
- source: radarRightRYellowImg
- visible: appModel.radar2 < radarGreenRange
- && appModel.radar2 > radarRedRange
- }
- Image {
- id: radarRightR2
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarTopMargin
- anchors.right: radarData.right
- anchors.rightMargin: radarRightMargin
- fillMode: Image.PreserveAspectFit
- source: radarRightRRedImg
- visible: appModel.radar2 <= radarRedRange
- }
- //------------ radarLeftF
- Image {
- id: radarLeftF0
- width: radarSize
- height: radarSize
- anchors.left: radarData.left
- anchors.leftMargin: radarRightMargin
- anchors.top: radarData.top
- anchors.topMargin: radarTopMargin
- fillMode: Image.PreserveAspectFit
- source: radarLeftFGreenImg
- visible: appModel.radar3 >= radarGreenRange
- }
- Image {
- id: radarLeftF1
- width: radarSize
- height: radarSize
- anchors.left: radarData.left
- anchors.leftMargin: radarRightMargin
- anchors.top: radarData.top
- anchors.topMargin: radarTopMargin
- fillMode: Image.PreserveAspectFit
- source: radarLeftFYellowImg
- visible: appModel.radar3 < radarGreenRange
- && appModel.radar3 > radarRedRange
- }
- Image {
- id: radarLeftF2
- width: radarSize
- height: radarSize
- anchors.left: radarData.left
- anchors.leftMargin: radarRightMargin
- anchors.top: radarData.top
- anchors.topMargin: radarTopMargin
- fillMode: Image.PreserveAspectFit
- source: radarLeftFRedImg
- visible: appModel.radar3 <= radarRedRange
- }
- //------------ radarLeftR
- Image {
- id: radarLeftR0
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarTopMargin
- anchors.left: radarData.left
- anchors.leftMargin: radarRightMargin
- fillMode: Image.PreserveAspectFit
- source: radarLeftRGreenImg
- visible: appModel.radar4 >= radarGreenRange
- }
- Image {
- id: radarLeftR1
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarTopMargin
- anchors.left: radarData.left
- anchors.leftMargin: radarRightMargin
- fillMode: Image.PreserveAspectFit
- source: radarLeftRYellowImg
- visible: appModel.radar4 < radarGreenRange
- && appModel.radar4 > radarRedRange
- }
- Image {
- id: radarLeftR2
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarTopMargin
- anchors.left: radarData.left
- anchors.leftMargin: radarRightMargin
- fillMode: Image.PreserveAspectFit
- source: radarLeftRRedImg
- visible: appModel.radar4 <= radarRedRange
- }
- //------------ radarBottomL
- Image {
- id: radarBottomL0
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarBottomMargin
- anchors.left: radarData.left
- anchors.leftMargin: radarleftMargin
- fillMode: Image.PreserveAspectFit
- source: radarBottomGreenImg
- visible: appModel.radar5 >= radarGreenRange
- }
- Image {
- id: radarBottomL1
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarBottomMargin
- anchors.left: radarData.left
- anchors.leftMargin: radarleftMargin
- fillMode: Image.PreserveAspectFit
- source: radarBottomYellowImg
- visible: appModel.radar5 < radarGreenRange
- && appModel.radar5 > radarRedRange
- }
- Image {
- id: radarBottomL2
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarBottomMargin
- anchors.left: radarData.left
- anchors.leftMargin: radarleftMargin
- fillMode: Image.PreserveAspectFit
- source: radarBottomRedImg
- visible: appModel.radar5 <= radarRedRange
- }
- //------------ radarBottomR
- Image {
- id: radarBottomR0
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarBottomMargin
- anchors.right: radarData.right
- anchors.rightMargin: radarleftMargin
- fillMode: Image.PreserveAspectFit
- source: radarBottomGreenImg
- visible: appModel.radar6 >= radarGreenRange
- }
- Image {
- id: radarBottomR1
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarBottomMargin
- anchors.right: radarData.right
- anchors.rightMargin: radarleftMargin
- fillMode: Image.PreserveAspectFit
- source: radarBottomYellowImg
- visible: appModel.radar6 < radarGreenRange
- && appModel.radar6 > radarRedRange
- }
- Image {
- id: radarBottomR2
- width: radarSize
- height: radarSize
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: radarBottomMargin
- anchors.right: radarData.right
- anchors.rightMargin: radarleftMargin
- fillMode: Image.PreserveAspectFit
- source: radarBottomRedImg
- visible: appModel.radar6 <= radarRedRange
- }
- // Image {
- // id: radarBottomL
- // width: radarSize
- // height: radarSize
- // anchors.bottom: radarData.bottom
- // anchors.bottomMargin: 240
- // anchors.left: radarData.left
- // anchors.leftMargin: 200
- // fillMode: Image.Stretch
- // }
- // Connections {
- // target: RadarImage
- // onCallQmlRefeshRadar2: {
- // radarBottomL.source = "image://RadarImage/" + Math.random()
- // }
- // }
- // Image {
- // id: radarBottomR
- // width: radarSize
- // height: radarSize
- // anchors.bottom: radarData.bottom
- // anchors.bottomMargin: 240
- // anchors.right: radarData.right
- // anchors.rightMargin: 200
- // fillMode: Image.Stretch
- // }
- // Connections {
- // target: RadarImage
- // onCallQmlRefeshRadar1: {
- // radarBottomR.source = "image://RadarImage/" + Math.random()
- // }
- // }
- Row {
- height: parent.height
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: radarData.top
- anchors.topMargin: 20
- Text {
- text: "雷达1:"
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- Text {
- id: radar1
- text: (appModel.radar1 / 1000).toFixed(2)
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- spacing: 30
- Text {
- text: "雷达2:"
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- Text {
- id: radar2
- text: (appModel.radar2 / 1000).toFixed(2)
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 60
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- }
- Row {
- height: parent.height
- anchors.top: radarData.top
- anchors.topMargin: 80
- anchors.horizontalCenter: parent.horizontalCenter
- Text {
- text: "雷达3:"
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- Text {
- id: radar3
- text: (appModel.radar3 / 1000).toFixed(2)
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 100
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- spacing: 30
- Text {
- text: "雷达4:"
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- Text {
- id: radar4
- text: (appModel.radar4 / 1000).toFixed(2)
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 140
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- }
- Row {
- height: parent.height
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: radarData.top
- anchors.topMargin: 140
- Text {
- text: "雷达5:"
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- Text {
- id: radar5
- text: (appModel.radar5 / 1000).toFixed(2)
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 180
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- spacing: 30
- Text {
- text: "雷达6:"
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 20
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- Text {
- id: radar6
- text: (appModel.radar6 / 1000).toFixed(2)
- color: mainTextColor
- anchors.left: radarData.left
- anchors.leftMargin: 220
- font.family: alibaba.name
- font.pointSize: radarTxtSize
- }
- }
- Rectangle {
- id: warning
- width: radarData.width - 60
- height: 50
- color: popupBgColorErr
- anchors.bottom: radarData.bottom
- anchors.bottomMargin: 30
- anchors.horizontalCenter: radarData.horizontalCenter
- Text {
- id: warningtxt
- text: qsTr("注意保持车距")
- color: '#FFFFFF'
- font.family: alibaba.name
- font.pointSize: 24
- anchors.horizontalCenter: warning.horizontalCenter
- }
- visible: appModel.radar1 < radarRedRange
- || appModel.radar2 < radarRedRange
- || appModel.radar3 < radarRedRange
- || appModel.radar4 < radarRedRange
- || appModel.radar5 < radarRedRange
- || appModel.radar6 < radarRedRange
- // AudioEngine {
- // id: audioengine
- // AudioSample {
- // name: "beep1"
- // source: "qrc:/sound/beep-1.wav"
- // }
- // Sound {
- // name: "explosion"
- // playType: Sound.Random
- // PlayVariation {
- // sample: "explosion01"
- // minPitch: 0.8
- // maxPitch: 1.1
- // }
- // PlayVariation {
- // sample: "explosion02"
- // minGain: 1.1
- // maxGain: 1.5
- // }
- // }
- // }
- // SoundEffect {
- // id: clickSound
- // source: "clickSound.wav"
- // loops: SoundEffect.Infinite
- // }
- // MouseArea {
- // id: playArea
- // anchors.fill: parent
- // onPressed: {
- // clickSound.play()
- // }
- // }
- // Audio {
- // id: audioPlayer
- // source: "qrc:/sound/beep-1.wav"
- // }
- // MouseArea {
- // id: playArea
- // anchors.fill: parent
- // onPressed: {
- // audioPlayer.play()
- // }
- // }
- }
- // Rectangle {
- // width: radarData.width
- // height: rightPanel.height
- // color: 'transparent'
- // Rectangle {
- // width: radarData.width - 300
- // height: radarData.height
- // color: 'lightblue'
- // Image {
- // width: 800
- // height: 1200
- // anchors.left: radarData.left
- // fillMode: Image.Stretch
- // source: 'qrc:/images/radar_car.png'
- // }
- // }
- // }
- Image {
- width: lineWidth
- height: mainHeight
- anchors.right: radarData.right
- fillMode: Image.Stretch
- source: 'qrc:/images/border_r.png'
- }
- }
- }
- }
- }
- }
|