MainWindow.qml 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432
  1. import QtQml 2.3
  2. import QtQuick 2.6
  3. import QtQuick.Window 2.2
  4. import QtQuick.Controls 2.0
  5. import QtDataVisualization 1.2
  6. import QtQuick3D
  7. import QtCharts 2.0
  8. Item {
  9. id: mainWindow
  10. visible: true
  11. width: 3840
  12. height: 1080
  13. property int mainHeight: 1000
  14. property int camHeight: 360
  15. property int lineWidth: 10
  16. property int statusWidth: 480
  17. property int leftCamWidth: 720
  18. property int frontCamWidth: 1660
  19. property int rightCamWidth: 720
  20. property int radarWidth: 480
  21. property int radarSize: 120
  22. property int radarRedRange: 2000
  23. property int radarGreenRange: 4000
  24. property string radarRightFGreenImg: 'qrc:/images/right_f_green.png'
  25. property string radarRightFYellowImg: 'qrc:/images/right_f_yellow.png'
  26. property string radarRightFRedImg: 'qrc:/images/right_f_red.png'
  27. property string radarRightRGreenImg: 'qrc:/images/right_r_green.png'
  28. property string radarRightRYellowImg: 'qrc:/images/right_r_yellow.png'
  29. property string radarRightRRedImg: 'qrc:/images/right_r_red.png'
  30. property string radarLeftFGreenImg: 'qrc:/images/left_f_green.png'
  31. property string radarLeftFYellowImg: 'qrc:/images/left_f_yellow.png'
  32. property string radarLeftFRedImg: 'qrc:/images/left_f_red.png'
  33. property string radarLeftRGreenImg: 'qrc:/images/left_r_green.png'
  34. property string radarLeftRYellowImg: 'qrc:/images/left_r_yellow.png'
  35. property string radarLeftRRedImg: 'qrc:/images/left_r_red.png'
  36. property string radarBottomGreenImg: 'qrc:/images/bottom_green.png'
  37. property string radarBottomYellowImg: 'qrc:/images/bottom_yellow.png'
  38. property string radarBottomRedImg: 'qrc:/images/bottom_red.png'
  39. property int radarRightMargin: 40
  40. property int radarTopMargin: 350
  41. property int radarBottomMargin: 280
  42. property int radarleftMargin: 200
  43. property int radarTxtSize: 18
  44. FontLoader {
  45. id: alibaba
  46. source: "qrc:/components/font/Alibaba-PuHuiTi-Bold.ttf"
  47. }
  48. FontLoader {
  49. id: fontawesome
  50. source: "qrc:/components/font/fontawesome-webfont.ttf"
  51. }
  52. Rectangle {
  53. id: mainForm
  54. anchors.fill: parent
  55. Image {
  56. fillMode: Image.PreserveAspectFit
  57. source: 'qrc:/images/bg4k.png'
  58. }
  59. Rectangle {
  60. id: mainFormHeader
  61. width: mainForm.width
  62. height: 80
  63. color: 'transparent'
  64. Image {
  65. id: mainFormBannerBg
  66. anchors.top: mainFormHeader.top
  67. anchors.horizontalCenter: mainFormHeader.horizontalCenter
  68. fillMode: Image.PreserveAspectFit
  69. source: 'qrc:/images/banner.png'
  70. }
  71. Text {
  72. id: mainFormTitle
  73. width: mainFormHeader.width
  74. height: mainFormHeader.height
  75. horizontalAlignment: Text.AlignHCenter
  76. verticalAlignment: Text.AlignVCenter
  77. text: textTitle
  78. font.family: alibaba.name
  79. font.pointSize: 24
  80. color: mainTextColor
  81. }
  82. Text {
  83. id: delayms
  84. text: '网络延迟: ' + (appModel.ping / 2).toFixed(1) + ' ms'
  85. color: appModel.ping/2 > 200 ? popupBgColorErr : mainTextColor
  86. font.family: alibaba.name
  87. font.pointSize: 12
  88. anchors.right: mainFormHeader.right
  89. anchors.rightMargin: 50
  90. anchors.top: mainFormHeader.top
  91. anchors.topMargin: 50
  92. }
  93. }
  94. Rectangle {
  95. id: mainFormContent
  96. width: mainForm.width
  97. height: mainForm.height - 80
  98. anchors.top: mainFormHeader.bottom
  99. color: 'transparent'
  100. Row {
  101. Rectangle {
  102. id: statusData
  103. width: statusWidth + lineWidth -100
  104. height: mainHeight
  105. color: 'transparent'
  106. /* Image {
  107. width: lineWidth
  108. height: mainHeight
  109. anchors.left: statusData.left
  110. anchors.leftMargin: 20
  111. fillMode: Image.Stretch
  112. source: 'qrc:/images/border_l.png'
  113. }
  114. */
  115. Rectangle {
  116. id: carImage
  117. width: statusData.width - 200
  118. height: 300
  119. color: 'transparent'
  120. anchors.horizontalCenter: statusData.horizontalCenter
  121. anchors.top: statusData.top
  122. anchors.topMargin: 50
  123. anchors.left: statusData.left
  124. anchors.horizontalCenterOffset: 10
  125. Image {
  126. width: 360
  127. height: 240
  128. fillMode: Image.Stretch
  129. source: 'qrc:/images/wagon.png'
  130. anchors.horizontalCenter: carImage.horizontalCenter
  131. }
  132. }
  133. Row {
  134. id: driveDataForm
  135. width: statusData.width - 100
  136. height: 300
  137. anchors.top: carImage.bottom
  138. anchors.topMargin: 0
  139. anchors.left: carImage.left
  140. anchors.leftMargin: 100
  141. Text {
  142. text:"舱位:"
  143. color: mainTextColor
  144. anchors.left: statusData.left
  145. anchors.leftMargin: 20
  146. font.family: alibaba.name
  147. font.pointSize: 20
  148. }
  149. Text {
  150. id: driveOpType
  151. text: appModel.DriveName
  152. color: mainTextColor
  153. anchors.left: radarData.left
  154. anchors.leftMargin: 180
  155. font.family: digtalFont.name
  156. font.pointSize: 20
  157. }
  158. spacing: 50
  159. }
  160. Row {
  161. id: carDataForm
  162. width: statusData.width - 100
  163. height: 300
  164. anchors.top: carImage.bottom
  165. anchors.topMargin: 40
  166. anchors.left: carImage.left
  167. anchors.leftMargin: 100
  168. Text {
  169. text:"车号 :"
  170. color: mainTextColor
  171. anchors.left: statusData.left
  172. anchors.leftMargin: 20
  173. font.family: alibaba.name
  174. font.pointSize: 20
  175. }
  176. Text {
  177. id: carOpType
  178. text: appModel.CarName
  179. color: mainTextColor
  180. anchors.left: radarData.left
  181. anchors.leftMargin: 180
  182. font.family: digtalFont.name
  183. font.pointSize: 20
  184. }
  185. spacing: 50
  186. }
  187. Row {
  188. id: tempState
  189. width: statusData.width - 100
  190. height: 300
  191. anchors.top: carImage.bottom
  192. anchors.topMargin: 80
  193. anchors.left: carImage.left
  194. anchors.leftMargin: 100
  195. visible:true
  196. Text {
  197. text: "系统温度:"
  198. color: mainTextColor
  199. anchors.left: statusData.left
  200. anchors.leftMargin: 20
  201. font.family: alibaba.name
  202. font.pointSize: 20
  203. }
  204. Text {
  205. id: tempValue
  206. text: appModel.temp +"°C"
  207. color: appModel.temp<70? mainTextColor:popupBgColorErr
  208. anchors.left: radarData.left
  209. anchors.leftMargin: 180
  210. font.family: digtalFont.name
  211. font.pointSize: 24
  212. }
  213. spacing: 50
  214. }
  215. Row {
  216. id: steerState
  217. width: statusData.width - 100
  218. height: 300
  219. anchors.top: carImage.bottom
  220. anchors.topMargin: 120
  221. anchors.left: carImage.left
  222. anchors.leftMargin: 100
  223. visible:true
  224. Text {
  225. text: "转向角度 :"
  226. color: mainTextColor
  227. anchors.left: statusData.left
  228. anchors.leftMargin: 20
  229. font.family: alibaba.name
  230. font.pointSize: 20
  231. }
  232. Text {
  233. id: steer
  234. text: appModel.Steer
  235. color: mainTextColor
  236. anchors.left: radarData.left
  237. anchors.leftMargin: 180
  238. font.family: digtalFont.name
  239. font.pointSize: 24
  240. }
  241. spacing: 50
  242. }
  243. Row {
  244. id: rpmState
  245. width: statusData.width - 100
  246. height: 300
  247. anchors.top: carImage.bottom
  248. anchors.topMargin: 160
  249. anchors.left: carImage.left
  250. anchors.leftMargin: 100
  251. visible:appModel.Visible
  252. Text {
  253. text: "发动机转速:"
  254. color: mainTextColor
  255. anchors.left: statusData.left
  256. anchors.leftMargin: 20
  257. font.family: alibaba.name
  258. font.pointSize: 20
  259. }
  260. Text {
  261. id: rpmValue
  262. text: appModel.EnginRpm
  263. color: appModel.EnginRpm>200? mainTextColor:popupBgColorErr
  264. anchors.left: radarData.left
  265. anchors.leftMargin: 180
  266. font.family: digtalFont.name
  267. font.pointSize: 24
  268. }
  269. spacing: 50
  270. }
  271. Row {
  272. id: gpaState
  273. width: statusData.width - 100
  274. height: 300
  275. anchors.top: carImage.bottom
  276. anchors.topMargin: 200
  277. anchors.left: carImage.left
  278. anchors.leftMargin: 100
  279. visible:appModel.Visible
  280. Text {
  281. text: "发动机油压:"
  282. color: mainTextColor
  283. anchors.left: statusData.left
  284. anchors.leftMargin: 20
  285. font.family: alibaba.name
  286. font.pointSize: 20
  287. }
  288. Text {
  289. id: gpavalue
  290. text: appModel.EngineOilPressure
  291. color: mainTextColor
  292. anchors.left: radarData.left
  293. anchors.leftMargin: 180
  294. font.family: digtalFont.name
  295. font.pointSize: 24
  296. }
  297. spacing: 50
  298. }
  299. Row {
  300. id: coldState
  301. width: statusData.width - 100
  302. height: 300
  303. anchors.top: carImage.bottom
  304. anchors.topMargin: 240
  305. anchors.left: carImage.left
  306. anchors.leftMargin: 100
  307. visible:appModel.Visible
  308. Text {
  309. text: "冷却液温度:"
  310. color: mainTextColor
  311. anchors.left: statusData.left
  312. anchors.leftMargin: 20
  313. font.family: alibaba.name
  314. font.pointSize: 20
  315. }
  316. Text {
  317. id: coldValue
  318. text: appModel.Cold
  319. color: mainTextColor
  320. anchors.left: radarData.left
  321. anchors.leftMargin: 180
  322. font.family: digtalFont.name
  323. font.pointSize: 24
  324. }
  325. spacing: 50
  326. }
  327. Row {
  328. id: paState
  329. width: statusData.width - 100
  330. height: 300
  331. anchors.top: carImage.bottom
  332. anchors.topMargin: 280
  333. anchors.left: carImage.left
  334. anchors.leftMargin: 100
  335. visible:appModel.Visible
  336. Text {
  337. text: "变速箱油压:"
  338. color: mainTextColor
  339. anchors.left: statusData.left
  340. anchors.leftMargin: 20
  341. font.family: alibaba.name
  342. font.pointSize: 20
  343. }
  344. Text {
  345. id: paValue
  346. text: appModel.GearboxOilPressure
  347. color: appModel.GearboxOilPressure<16 || appModel.GearboxOilPressure>20? popupBgColorErr:mainTextColor
  348. anchors.left: radarData.left
  349. anchors.leftMargin: 180
  350. font.family: digtalFont.name
  351. font.pointSize: 24
  352. }
  353. spacing: 50
  354. }
  355. Row {
  356. id: gearState
  357. width: statusData.width - 100
  358. height: 300
  359. anchors.top: carImage.bottom
  360. anchors.topMargin: 320
  361. anchors.left: carImage.left
  362. anchors.leftMargin: 100
  363. visible:appModel.Visible
  364. Text {
  365. text: "变速箱油温:"
  366. color: mainTextColor
  367. anchors.left: statusData.left
  368. anchors.leftMargin: 20
  369. font.family: alibaba.name
  370. font.pointSize: 20
  371. }
  372. Text {
  373. id: gearValue
  374. text: appModel.GearboxOilTemp
  375. color: appModel.GearboxOilTemp>100 ? popupBgColorErr:mainTextColor
  376. anchors.left: radarData.left
  377. anchors.leftMargin: 180
  378. font.family: digtalFont.name
  379. font.pointSize: 24
  380. }
  381. spacing: 50
  382. }
  383. Row {
  384. id: brakeState
  385. width: statusData.width - 100
  386. height: 300
  387. anchors.top: carImage.bottom
  388. anchors.topMargin: 360
  389. anchors.left: carImage.left
  390. anchors.leftMargin: 100
  391. visible:appModel.Visible
  392. Text {
  393. text: "制动压力 :"
  394. color: mainTextColor
  395. anchors.left: statusData.left
  396. anchors.leftMargin: 20
  397. font.family: alibaba.name
  398. font.pointSize: 20
  399. }
  400. Text {
  401. id: brakeValue
  402. text: appModel.BrakePressure
  403. color: appModel.BrakePressure<6 ? popupBgColorErr:mainTextColor
  404. anchors.left: radarData.left
  405. anchors.leftMargin: 180
  406. font.family: digtalFont.name
  407. font.pointSize: 24
  408. }
  409. spacing: 50
  410. }
  411. Row {
  412. id: presState
  413. width: statusData.width - 100
  414. height: 300
  415. anchors.top: carImage.bottom
  416. anchors.topMargin: 400
  417. anchors.left: carImage.left
  418. anchors.leftMargin: 100
  419. visible:appModel.Visible
  420. Text {
  421. text: "液压压力 :"
  422. color: mainTextColor
  423. anchors.left: statusData.left
  424. anchors.leftMargin: 20
  425. font.family: alibaba.name
  426. font.pointSize: 20
  427. }
  428. Text {
  429. id: preValue
  430. text: appModel.BrakePressure
  431. color: mainTextColor
  432. anchors.left: radarData.left
  433. anchors.leftMargin: 180
  434. font.family: digtalFont.name
  435. font.pointSize: 24
  436. }
  437. spacing: 50
  438. }
  439. /*
  440. Row {
  441. id: speedState
  442. width: statusData.width - 100
  443. height: 300
  444. anchors.top: carImage.bottom
  445. anchors.topMargin: 320
  446. anchors.left: carImage.left
  447. anchors.leftMargin: 100
  448. visible:appModel.Visible
  449. Text {
  450. text: "车辆速度 :"
  451. color: mainTextColor
  452. anchors.left: statusData.left
  453. anchors.leftMargin: 20
  454. font.family: alibaba.name
  455. font.pointSize: 20
  456. }
  457. Text {
  458. id: speed
  459. text:appModel.Speed
  460. color: mainTextColor
  461. anchors.left: radarData.left
  462. anchors.leftMargin: 180
  463. font.family: digtalFont.name
  464. font.pointSize: 24
  465. }
  466. spacing: 50
  467. }
  468. */
  469. /* Row {
  470. id: leftlockState
  471. width: statusData.width - 100
  472. height: 300
  473. anchors.top: carImage.bottom
  474. anchors.topMargin: 390
  475. anchors.left: carImage.left
  476. anchors.leftMargin: 100
  477. Text {
  478. text: "左锁钩状态 :"
  479. color: mainTextColor
  480. anchors.left: statusData.left
  481. anchors.leftMargin: 20
  482. font.family: alibaba.name
  483. font.pointSize: 20
  484. }
  485. Text {
  486. id: leftlock
  487. text: appModel.Steer
  488. color: mainTextColor
  489. anchors.left: radarData.left
  490. anchors.leftMargin: 180
  491. font.family: digtalFont.name
  492. font.pointSize: 24
  493. }
  494. spacing: 50
  495. }
  496. Row {
  497. id: rightlockState
  498. width: statusData.width - 100
  499. height: 300
  500. anchors.top: carImage.bottom
  501. anchors.topMargin: 425
  502. anchors.left: carImage.left
  503. anchors.leftMargin: 100
  504. Text {
  505. text: "右锁钩状态 :"
  506. color: mainTextColor
  507. anchors.left: statusData.left
  508. anchors.leftMargin: 20
  509. font.family: alibaba.name
  510. font.pointSize: 20
  511. }
  512. Text {
  513. id: rightlock
  514. text: appModel.Steer
  515. color: mainTextColor
  516. anchors.left: radarData.left
  517. anchors.leftMargin: 180
  518. font.family: digtalFont.name
  519. font.pointSize: 24
  520. }
  521. spacing: 50
  522. }*/
  523. Rectangle {
  524. id: refreshDate
  525. width: statusData.width - 100
  526. height: 50
  527. color: mainAppColor
  528. anchors.bottom: statusData.bottom
  529. anchors.bottomMargin: 30
  530. anchors.horizontalCenter: statusData.horizontalCenter
  531. anchors.horizontalCenterOffset: 10
  532. Text {
  533. id: localTime
  534. width: 140
  535. height: 50
  536. anchors.horizontalCenter: refreshDate.horizontalCenter
  537. color: '#FFFFFF'
  538. font.family: digtalFont.name
  539. font.pointSize: 36
  540. text: new Date().toLocaleTimeString()
  541. Component.onCompleted: {
  542. localTimeRefresh.start()
  543. }
  544. }
  545. Timer {
  546. id: localTimeRefresh
  547. interval: 1000
  548. repeat: true
  549. onTriggered: {
  550. localTime.text = new Date().toLocaleTimeString()
  551. }
  552. }
  553. }
  554. /* Image {
  555. width: lineWidth
  556. height: mainHeight
  557. anchors.right: statusData.right
  558. fillMode: Image.Stretch
  559. source: 'qrc:/images/border_r.png'
  560. }
  561. */
  562. }
  563. Rectangle {
  564. id: leftCam
  565. width: leftCamWidth + lineWidth
  566. height: mainHeight
  567. color: 'transparent'
  568. /* Image {
  569. width: lineWidth
  570. height: mainHeight
  571. anchors.left: leftCam.left
  572. anchors.leftMargin: 20
  573. fillMode: Image.Stretch
  574. source: 'qrc:/images/border_l.png'
  575. z: 99
  576. }
  577. */
  578. Rectangle {
  579. width: leftCamWidth
  580. height: mainHeight/2
  581. color: 'transparent'
  582. anchors.left: leftCam.left
  583. anchors.leftMargin: 20
  584. border.color: mainAppColor
  585. border.width: 1
  586. // CAM Left
  587. Image {
  588. id: leftImg
  589. width: leftCamWidth
  590. height: mainHeight/2
  591. fillMode: Image.Stretch
  592. }
  593. Connections {
  594. target: LeftImage
  595. onCallQmlRefeshLeftImg: {
  596. leftImg.source = ""
  597. leftImg.source = "image://LeftImage"
  598. }
  599. }
  600. }
  601. Rectangle {
  602. width: leftCamWidth
  603. height: mainHeight/2
  604. y:mainHeight/2
  605. color: 'transparent'
  606. anchors.left: leftCam.left
  607. anchors.leftMargin: 20
  608. border.color: mainAppColor
  609. border.width: 1
  610. // CAM Left
  611. Image {
  612. id: leftan
  613. width: leftCamWidth
  614. height: mainHeight/2
  615. fillMode: Image.Stretch
  616. }
  617. Connections {
  618. target: LeftAnchor
  619. onCallQmlRefeshLeftAnchor: {
  620. leftan.source = ""
  621. leftan.source = "image://LeftAnchor"
  622. }
  623. }
  624. }
  625. /* Image {
  626. width: lineWidth
  627. height: mainHeight
  628. anchors.right: leftCam.right
  629. fillMode: Image.Stretch
  630. source: 'qrc:/images/border_r.png'
  631. z: 99
  632. }
  633. */
  634. }
  635. Rectangle {
  636. id: centerPanel
  637. width: frontCamWidth + 3 * lineWidth
  638. height: mainHeight
  639. anchors.top: mainFormContent.top
  640. anchors.horizontalCenter: mainFormContent.horizontalCenter
  641. color: 'transparent'
  642. /*
  643. MouseArea {
  644. anchors.fill: parent
  645. drag.target: backImgRect
  646. drag.axis: Drag.XandYAxis
  647. drag.minimumX: 20
  648. drag.maximumX: centerPanel.width - backImgRect.width - 20
  649. drag.minimumY: 0
  650. drag.maximumY: centerPanel.height - backImgRect.height
  651. }
  652. */
  653. /* Image {
  654. width: lineWidth
  655. height: mainHeight
  656. anchors.left: centerPanel.left
  657. anchors.leftMargin: 20
  658. fillMode: Image.Stretch
  659. source: 'qrc:/images/border_l.png'
  660. z: 99
  661. }
  662. */
  663. Rectangle {
  664. width: frontCamWidth
  665. height: mainHeight/2+200
  666. color: 'transparent'
  667. anchors.left: centerPanel.left
  668. anchors.leftMargin: 20
  669. border.color: mainAppColor
  670. border.width: 1
  671. // CAM FRONT
  672. Image {
  673. id: frontImg
  674. anchors.topMargin: 140
  675. width: frontCamWidth
  676. height: mainHeight/2+200
  677. fillMode: Image.Stretch
  678. z: 97
  679. }
  680. Connections {
  681. target: FrontImage
  682. onCallQmlRefeshFrontImg: {
  683. frontImg.source = ""
  684. frontImg.source = "image://FrontImage"
  685. }
  686. }
  687. }
  688. Rectangle {
  689. id: backImgRect
  690. width: frontCamWidth/2
  691. height: mainHeight / 2-200
  692. color: 'transparent'
  693. x:430
  694. y:mainHeight/2+200
  695. border.color: mainAppColor
  696. border.width: 1
  697. /*
  698. Image {
  699. id: cautionLine
  700. anchors.horizontalCenter: parent.horizontalCenter
  701. width: parent.width / 1.5
  702. height: parent.height / 3
  703. fillMode: Image.Stretch
  704. x: 1000; y: 222
  705. z: 99
  706. source: 'qrc:/images/caution.png'
  707. }
  708. */
  709. // CAM BACK REAR
  710. Image {
  711. id: backImg
  712. anchors.topMargin: 140
  713. width: parent.width
  714. height: parent.height
  715. fillMode: Image.Stretch
  716. z: 98
  717. }
  718. Connections {
  719. target: BackImage
  720. onCallQmlRefeshBackImg: {
  721. backImg.source = ""
  722. backImg.source = "image://BackImage"
  723. }
  724. }
  725. }
  726. /*
  727. Image {
  728. width: lineWidth
  729. height: mainHeight
  730. anchors.right: centerPanel.right
  731. anchors.rightMargin: 20
  732. fillMode: Image.Stretch
  733. source: 'qrc:/images/border_r.png'
  734. z: 99
  735. }
  736. */
  737. }
  738. Rectangle {
  739. id: rightCam
  740. width: rightCamWidth + lineWidth
  741. height: mainHeight
  742. color: 'transparent'
  743. /*Image {
  744. width: lineWidth
  745. height: mainHeight
  746. anchors.left: rightCam.left
  747. fillMode: Image.Stretch
  748. source: 'qrc:/images/border_l.png'
  749. z: 99
  750. }
  751. */
  752. Rectangle {
  753. width: rightCamWidth
  754. height: mainHeight/2
  755. color: 'transparent'
  756. anchors.left: rightCam.left
  757. border.color: mainAppColor
  758. border.width: 1
  759. // CAM Right
  760. Image {
  761. id: rightImg
  762. width: rightCamWidth
  763. height: mainHeight/2
  764. fillMode: Image.Stretch
  765. }
  766. Connections {
  767. target: RightImage
  768. onCallQmlRefeshRightImg: {
  769. rightImg.source = ""
  770. rightImg.source = "image://RightImage"
  771. }
  772. }
  773. }
  774. Rectangle {
  775. width: rightCamWidth
  776. height: mainHeight/2
  777. y:mainHeight/2
  778. color: 'transparent'
  779. anchors.left: rightCam.left
  780. border.color: mainAppColor
  781. border.width: 1
  782. // CAM Right
  783. Image {
  784. id: rightan
  785. width: rightCamWidth
  786. height: mainHeight/2
  787. fillMode: Image.Stretch
  788. }
  789. Connections {
  790. target: RightAnchor
  791. onCallQmlRefeshRightAnchor: {
  792. rightan.source = ""
  793. rightan.source = "image://RightAnchor"
  794. }
  795. }
  796. }
  797. /* Image {
  798. width: lineWidth
  799. height: mainHeight
  800. anchors.right: rightCam.right
  801. anchors.rightMargin: 20
  802. fillMode: Image.Stretch
  803. source: 'qrc:/images/border_r.png'
  804. }
  805. */
  806. }
  807. Rectangle {
  808. id: radarData
  809. width: radarWidth -160
  810. height: mainHeight
  811. color: 'transparent'
  812. /* Image {
  813. width: lineWidth-200
  814. height: mainHeight
  815. anchors.left: radarData.left
  816. fillMode: Image.Stretch
  817. source: 'qrc:/images/border_l.png'
  818. }
  819. */
  820. /*
  821. Image {
  822. id: radar_car
  823. width: 600
  824. height: 800
  825. anchors.horizontalCenter: radarData.horizontalCenter
  826. anchors.verticalCenter: radarData.verticalCenter
  827. fillMode: Image.Stretch
  828. source: 'qrc:/images/radar_car.png'
  829. }
  830. //------------ radarRightF
  831. Image {
  832. id: radarRightF0
  833. width: radarSize
  834. height: radarSize
  835. anchors.right: radarData.right
  836. anchors.rightMargin: radarRightMargin
  837. anchors.top: radarData.top
  838. anchors.topMargin: radarTopMargin
  839. fillMode: Image.PreserveAspectFit
  840. source: radarRightFGreenImg
  841. visible: appModel.radar1 >= radarGreenRange
  842. }
  843. Image {
  844. id: radarRightF1
  845. width: radarSize
  846. height: radarSize
  847. anchors.right: radarData.right
  848. anchors.rightMargin: radarRightMargin
  849. anchors.top: radarData.top
  850. anchors.topMargin: radarTopMargin
  851. fillMode: Image.PreserveAspectFit
  852. source: radarRightFYellowImg
  853. visible: appModel.radar1 < radarGreenRange
  854. && appModel.radar1 > radarRedRange
  855. }
  856. Image {
  857. id: radarRightF2
  858. width: radarSize
  859. height: radarSize
  860. anchors.right: radarData.right
  861. anchors.rightMargin: radarRightMargin
  862. anchors.top: radarData.top
  863. anchors.topMargin: radarTopMargin
  864. fillMode: Image.PreserveAspectFit
  865. source: radarRightFRedImg
  866. visible: appModel.radar1 <= radarRedRange
  867. }
  868. //------------ radarRightR
  869. Image {
  870. id: radarRightR0
  871. width: radarSize
  872. height: radarSize
  873. anchors.bottom: radarData.bottom
  874. anchors.bottomMargin: radarTopMargin
  875. anchors.right: radarData.right
  876. anchors.rightMargin: radarRightMargin
  877. fillMode: Image.PreserveAspectFit
  878. source: radarRightRGreenImg
  879. visible: appModel.radar2 >= radarGreenRange
  880. }
  881. Image {
  882. id: radarRightR1
  883. width: radarSize
  884. height: radarSize
  885. anchors.bottom: radarData.bottom
  886. anchors.bottomMargin: radarTopMargin
  887. anchors.right: radarData.right
  888. anchors.rightMargin: radarRightMargin
  889. fillMode: Image.PreserveAspectFit
  890. source: radarRightRYellowImg
  891. visible: appModel.radar2 < radarGreenRange
  892. && appModel.radar2 > radarRedRange
  893. }
  894. Image {
  895. id: radarRightR2
  896. width: radarSize
  897. height: radarSize
  898. anchors.bottom: radarData.bottom
  899. anchors.bottomMargin: radarTopMargin
  900. anchors.right: radarData.right
  901. anchors.rightMargin: radarRightMargin
  902. fillMode: Image.PreserveAspectFit
  903. source: radarRightRRedImg
  904. visible: appModel.radar2 <= radarRedRange
  905. }
  906. //------------ radarLeftF
  907. Image {
  908. id: radarLeftF0
  909. width: radarSize
  910. height: radarSize
  911. anchors.left: radarData.left
  912. anchors.leftMargin: radarRightMargin
  913. anchors.top: radarData.top
  914. anchors.topMargin: radarTopMargin
  915. fillMode: Image.PreserveAspectFit
  916. source: radarLeftFGreenImg
  917. visible: appModel.radar3 >= radarGreenRange
  918. }
  919. Image {
  920. id: radarLeftF1
  921. width: radarSize
  922. height: radarSize
  923. anchors.left: radarData.left
  924. anchors.leftMargin: radarRightMargin
  925. anchors.top: radarData.top
  926. anchors.topMargin: radarTopMargin
  927. fillMode: Image.PreserveAspectFit
  928. source: radarLeftFYellowImg
  929. visible: appModel.radar3 < radarGreenRange
  930. && appModel.radar3 > radarRedRange
  931. }
  932. Image {
  933. id: radarLeftF2
  934. width: radarSize
  935. height: radarSize
  936. anchors.left: radarData.left
  937. anchors.leftMargin: radarRightMargin
  938. anchors.top: radarData.top
  939. anchors.topMargin: radarTopMargin
  940. fillMode: Image.PreserveAspectFit
  941. source: radarLeftFRedImg
  942. visible: appModel.radar3 <= radarRedRange
  943. }
  944. //------------ radarLeftR
  945. Image {
  946. id: radarLeftR0
  947. width: radarSize
  948. height: radarSize
  949. anchors.bottom: radarData.bottom
  950. anchors.bottomMargin: radarTopMargin
  951. anchors.left: radarData.left
  952. anchors.leftMargin: radarRightMargin
  953. fillMode: Image.PreserveAspectFit
  954. source: radarLeftRGreenImg
  955. visible: appModel.radar4 >= radarGreenRange
  956. }
  957. Image {
  958. id: radarLeftR1
  959. width: radarSize
  960. height: radarSize
  961. anchors.bottom: radarData.bottom
  962. anchors.bottomMargin: radarTopMargin
  963. anchors.left: radarData.left
  964. anchors.leftMargin: radarRightMargin
  965. fillMode: Image.PreserveAspectFit
  966. source: radarLeftRYellowImg
  967. visible: appModel.radar4 < radarGreenRange
  968. && appModel.radar4 > radarRedRange
  969. }
  970. Image {
  971. id: radarLeftR2
  972. width: radarSize
  973. height: radarSize
  974. anchors.bottom: radarData.bottom
  975. anchors.bottomMargin: radarTopMargin
  976. anchors.left: radarData.left
  977. anchors.leftMargin: radarRightMargin
  978. fillMode: Image.PreserveAspectFit
  979. source: radarLeftRRedImg
  980. visible: appModel.radar4 <= radarRedRange
  981. }
  982. //------------ radarBottomL
  983. Image {
  984. id: radarBottomL0
  985. width: radarSize
  986. height: radarSize
  987. anchors.bottom: radarData.bottom
  988. anchors.bottomMargin: radarBottomMargin
  989. anchors.left: radarData.left
  990. anchors.leftMargin: radarleftMargin
  991. fillMode: Image.PreserveAspectFit
  992. source: radarBottomGreenImg
  993. visible: appModel.radar5 >= radarGreenRange
  994. }
  995. Image {
  996. id: radarBottomL1
  997. width: radarSize
  998. height: radarSize
  999. anchors.bottom: radarData.bottom
  1000. anchors.bottomMargin: radarBottomMargin
  1001. anchors.left: radarData.left
  1002. anchors.leftMargin: radarleftMargin
  1003. fillMode: Image.PreserveAspectFit
  1004. source: radarBottomYellowImg
  1005. visible: appModel.radar5 < radarGreenRange
  1006. && appModel.radar5 > radarRedRange
  1007. }
  1008. Image {
  1009. id: radarBottomL2
  1010. width: radarSize
  1011. height: radarSize
  1012. anchors.bottom: radarData.bottom
  1013. anchors.bottomMargin: radarBottomMargin
  1014. anchors.left: radarData.left
  1015. anchors.leftMargin: radarleftMargin
  1016. fillMode: Image.PreserveAspectFit
  1017. source: radarBottomRedImg
  1018. visible: appModel.radar5 <= radarRedRange
  1019. }
  1020. */
  1021. //------------ radarBottomR
  1022. /*
  1023. Image {
  1024. id: radarBottomR0
  1025. width: radarSize
  1026. height: radarSize
  1027. anchors.bottom: radarData.bottom
  1028. anchors.bottomMargin: radarBottomMargin
  1029. anchors.right: radarData.right
  1030. anchors.rightMargin: radarleftMargin
  1031. fillMode: Image.PreserveAspectFit
  1032. source: radarBottomGreenImg
  1033. visible: appModel.radar6 >= radarGreenRange
  1034. }
  1035. Image {
  1036. id: radarBottomR1
  1037. width: radarSize
  1038. height: radarSize
  1039. anchors.bottom: radarData.bottom
  1040. anchors.bottomMargin: radarBottomMargin
  1041. anchors.right: radarData.right
  1042. anchors.rightMargin: radarleftMargin
  1043. fillMode: Image.PreserveAspectFit
  1044. source: radarBottomYellowImg
  1045. visible: appModel.radar6 < radarGreenRange
  1046. && appModel.radar6 > radarRedRange
  1047. }
  1048. Image {
  1049. id: radarBottomR2
  1050. width: radarSize
  1051. height: radarSize
  1052. anchors.bottom: radarData.bottom
  1053. anchors.bottomMargin: radarBottomMargin
  1054. anchors.right: radarData.right
  1055. anchors.rightMargin: radarleftMargin
  1056. fillMode: Image.PreserveAspectFit
  1057. source: radarBottomRedImg
  1058. visible: appModel.radar6 <= radarRedRange
  1059. }
  1060. */
  1061. Row {
  1062. height: parent.height
  1063. anchors.horizontalCenter: parent.horizontalCenter
  1064. anchors.top: radarData.top
  1065. anchors.topMargin: 60
  1066. Text {
  1067. text: "前方雷达:"
  1068. color: mainTextColor
  1069. anchors.left: radarData.left
  1070. anchors.leftMargin: 20
  1071. font.family: alibaba.name
  1072. font.pointSize: radarTxtSize
  1073. }
  1074. spacing: 50
  1075. Text {
  1076. id: radar1
  1077. text: (appModel.radar1 / 100).toFixed(2)
  1078. color: appModel.radar1>200? mainTextColor:popupBgColorErr
  1079. anchors.left: radarData.left
  1080. anchors.leftMargin: 20
  1081. font.family: alibaba.name
  1082. font.pointSize: radarTxtSize
  1083. }
  1084. }
  1085. Row {
  1086. height: parent.height
  1087. anchors.top: radarData.top
  1088. anchors.topMargin: 100
  1089. anchors.horizontalCenter: parent.horizontalCenter
  1090. Text {
  1091. text: "左前雷达:"
  1092. color: mainTextColor
  1093. anchors.left: radarData.left
  1094. anchors.leftMargin: 20
  1095. font.family: alibaba.name
  1096. font.pointSize: radarTxtSize
  1097. }
  1098. spacing: 50
  1099. Text {
  1100. id: radar2
  1101. text: (appModel.radar2 / 100).toFixed(2)
  1102. color: appModel.radar2>200? mainTextColor:popupBgColorErr
  1103. anchors.left: radarData.left
  1104. anchors.leftMargin: 60
  1105. font.family: alibaba.name
  1106. font.pointSize: radarTxtSize
  1107. }
  1108. }
  1109. Row{
  1110. height: parent.height
  1111. anchors.horizontalCenter: parent.horizontalCenter
  1112. anchors.top: radarData.top
  1113. anchors.topMargin: 140
  1114. Text {
  1115. text: "右前雷达:"
  1116. color: mainTextColor
  1117. anchors.left: radarData.left
  1118. anchors.leftMargin: 20
  1119. font.family: alibaba.name
  1120. font.pointSize: radarTxtSize
  1121. }
  1122. spacing: 50
  1123. Text {
  1124. id: radar3
  1125. text: (appModel.radar3 / 100).toFixed(2)
  1126. color: appModel.radar3>200? mainTextColor:popupBgColorErr
  1127. anchors.left: radarData.left
  1128. anchors.leftMargin: 100
  1129. font.family: alibaba.name
  1130. font.pointSize: radarTxtSize
  1131. }
  1132. }
  1133. Row {
  1134. height: parent.height
  1135. anchors.horizontalCenter: parent.horizontalCenter
  1136. anchors.top: radarData.top
  1137. anchors.topMargin: 180
  1138. Text {
  1139. text: "左后雷达:"
  1140. color: mainTextColor
  1141. anchors.left: radarData.left
  1142. anchors.leftMargin: 20
  1143. font.family: alibaba.name
  1144. font.pointSize: radarTxtSize
  1145. }
  1146. spacing: 50
  1147. Text {
  1148. id: radar4
  1149. text: (appModel.radar4 / 100).toFixed(2)
  1150. color: appModel.radar4>200? mainTextColor:popupBgColorErr
  1151. anchors.left: radarData.left
  1152. anchors.leftMargin: 140
  1153. font.family: alibaba.name
  1154. font.pointSize: radarTxtSize
  1155. }
  1156. }
  1157. Row{
  1158. // spacing: 30
  1159. height: parent.height
  1160. anchors.horizontalCenter: parent.horizontalCenter
  1161. anchors.top: radarData.top
  1162. anchors.topMargin: 220
  1163. Text {
  1164. text: "右后雷达:"
  1165. color: mainTextColor
  1166. anchors.left: radarData.left
  1167. anchors.leftMargin: 20
  1168. font.family: alibaba.name
  1169. font.pointSize: radarTxtSize
  1170. }
  1171. spacing: 50
  1172. Text {
  1173. id: radar5
  1174. text: (appModel.radar5 / 100).toFixed(2)
  1175. color: appModel.radar5>200? mainTextColor:popupBgColorErr
  1176. anchors.left: radarData.left
  1177. anchors.leftMargin: 180
  1178. font.family: alibaba.name
  1179. font.pointSize: radarTxtSize
  1180. }
  1181. }
  1182. /*
  1183. Row{
  1184. // spacing: 30
  1185. height: parent.height
  1186. anchors.horizontalCenter: parent.horizontalCenter
  1187. anchors.top: radarData.top
  1188. anchors.topMargin: 220
  1189. Text {
  1190. text: "左倒车雷达:"
  1191. color: mainTextColor
  1192. anchors.left: radarData.left
  1193. anchors.leftMargin: 0
  1194. font.family: alibaba.name
  1195. font.pointSize: radarTxtSize
  1196. }
  1197. spacing: 30
  1198. Text {
  1199. id: radar6
  1200. text: (appModel.radar6 / 100).toFixed(2)
  1201. color: appModel.radar6>200? mainTextColor:popupBgColorErr
  1202. anchors.left: radarData.left
  1203. anchors.leftMargin: 0
  1204. font.family: alibaba.name
  1205. font.pointSize: radarTxtSize
  1206. }
  1207. }
  1208. Row{
  1209. // spacing: 30
  1210. height: parent.height
  1211. anchors.horizontalCenter: parent.horizontalCenter
  1212. anchors.top: radarData.top
  1213. anchors.topMargin: 260
  1214. Text {
  1215. text: "右倒车雷达:"
  1216. color: mainTextColor
  1217. anchors.left: radarData.left
  1218. anchors.leftMargin: 0
  1219. font.family: alibaba.name
  1220. font.pointSize: radarTxtSize
  1221. }
  1222. spacing: 30
  1223. Text {
  1224. id: radar7
  1225. text: (appModel.radar7 / 100).toFixed(2)
  1226. color: appModel.radar7>200? mainTextColor:popupBgColorErr
  1227. anchors.left: radarData.left
  1228. anchors.leftMargin: 0
  1229. font.family: alibaba.name
  1230. font.pointSize: radarTxtSize
  1231. }
  1232. }*/
  1233. Rectangle {
  1234. id: chart
  1235. width: radarData.width
  1236. height: 400
  1237. anchors.horizontalCenter: parent.horizontalCenter
  1238. anchors.top: radarData.top
  1239. anchors.topMargin: 400
  1240. anchors.left: radarData.left
  1241. anchors.leftMargin: 0
  1242. color: 'transparent'
  1243. // anchors.topMargin: 30
  1244. ChartView {
  1245. titleColor: mainTextColor
  1246. title: "支腿高度"
  1247. anchors.fill: parent
  1248. // legend.alignment: Qt.AlignBottom
  1249. antialiasing: true
  1250. backgroundColor: "#050e34"
  1251. titleFont.pixelSize: 24
  1252. StackedBarSeries {
  1253. id: mySeries
  1254. axisX: BarCategoryAxis {
  1255. color: mainTextColor
  1256. //categories: [ "左支腿", "右支腿" ] }
  1257. categories: [ "左支腿", "右支腿" ] }
  1258. axisY: ValueAxis {
  1259. id: barY;
  1260. gridLineColor: "gray";
  1261. labelsColor: "white";
  1262. max: 400 }
  1263. BarSet {values: [ appModel.rightAngle, appModel.leftAngle ] }
  1264. // BarSet { label: "James"; values: [ 5, 8] }
  1265. }
  1266. }
  1267. }
  1268. Rectangle {
  1269. id: warning
  1270. width: radarData.width - 60
  1271. height: 50
  1272. color: popupBgColorErr
  1273. anchors.bottom: radarData.bottom
  1274. anchors.bottomMargin: 30
  1275. anchors.horizontalCenter: radarData.horizontalCenter
  1276. Text {
  1277. id: warningtxt
  1278. text: qsTr("注意保持车距")
  1279. color: '#FFFFFF'
  1280. font.family: alibaba.name
  1281. font.pointSize: 24
  1282. anchors.horizontalCenter: warning.horizontalCenter
  1283. }
  1284. visible: appModel.radar1 < radarRedRange
  1285. || appModel.radar2 < radarRedRange
  1286. || appModel.radar3 < radarRedRange
  1287. || appModel.radar4 < radarRedRange
  1288. || appModel.radar5 < radarRedRange
  1289. || appModel.radar6 < radarRedRange
  1290. }
  1291. // Rectangle {
  1292. // width: radarData.width
  1293. // height: rightPanel.height
  1294. // color: 'transparent'
  1295. // Rectangle {
  1296. // width: radarData.width - 300
  1297. // height: radarData.height
  1298. // color: 'lightblue'
  1299. // Image {
  1300. // width: 800
  1301. // height: 1200
  1302. // anchors.left: radarData.left
  1303. // fillMode: Image.Stretch
  1304. // source: 'qrc:/images/radar_car.png'
  1305. // }
  1306. // }
  1307. // }
  1308. /* Image {
  1309. width: lineWidth
  1310. height: mainHeight
  1311. anchors.right: radarData.right
  1312. fillMode: Image.Stretch
  1313. source: 'qrc:/images/border_r.png'
  1314. }
  1315. */
  1316. }
  1317. }
  1318. }
  1319. }
  1320. }