MainWindow.qml 84 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027
  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: 20
  16. property int statusWidth: 417
  17. property int leftCamWidth: 470
  18. property int frontCamWidth: 1906
  19. property int frontCamWidth1: 1736
  20. property int rightCamWidth: 491
  21. property int radarWidth: 417
  22. property int radarSize: 120
  23. //property int radarRedRange: 2000
  24. //property int radarGreenRange: 4000
  25. property int radarRedRange: 1500
  26. property int radarGreenRange: 3000
  27. property int radarGreenOutRange: 5000
  28. property string radarFrontGreenImg: 'qrc:/images/front_green.png'
  29. property string radarFrontYellowImg: 'qrc:/images/front_yellow.png'
  30. property string radarFrontRedImg: 'qrc:/images/front_red.png'
  31. property string radarRightFGreenImg: 'qrc:/images/right_f_green.png'
  32. property string radarRightFYellowImg: 'qrc:/images/right_f_yellow.png'
  33. property string radarRightFRedImg: 'qrc:/images/right_f_red.png'
  34. property string radarRightRGreenImg: 'qrc:/images/right_r_green.png'
  35. property string radarRightRYellowImg: 'qrc:/images/right_r_yellow.png'
  36. property string radarRightRRedImg: 'qrc:/images/right_r_red.png'
  37. property string radarLeftFGreenImg: 'qrc:/images/left_f_green.png'
  38. property string radarLeftFYellowImg: 'qrc:/images/left_f_yellow.png'
  39. property string radarLeftFRedImg: 'qrc:/images/left_f_red.png'
  40. property string radarLeftRGreenImg: 'qrc:/images/left_r_green.png'
  41. property string radarLeftRYellowImg: 'qrc:/images/left_r_yellow.png'
  42. property string radarLeftRRedImg: 'qrc:/images/left_r_red.png'
  43. property string radarBottomGreenImg: 'qrc:/images/bottom_green.png'
  44. property string radarBottomYellowImg: 'qrc:/images/bottom_yellow.png'
  45. property string radarBottomRedImg: 'qrc:/images/bottom_red.png'
  46. property int radarRightMargin: 40
  47. property int radarTopMargin: 350
  48. property int radarBottomMargin: 280
  49. property int radarleftMargin: 200
  50. property int radarTxtSize: 14
  51. property bool m_bIfDisplayLine: true
  52. property bool m_bIfDisplayLine_2: true
  53. property int currentIndex: 0
  54. FontLoader {
  55. id: alibaba
  56. source: "qrc:/components/font/Alibaba-PuHuiTi-Bold.ttf"
  57. }
  58. FontLoader {
  59. id: fontawesome
  60. source: "qrc:/components/font/fontawesome-webfont.ttf"
  61. }
  62. FontLoader {
  63. id: digtalFont
  64. source: "qrc:/components/font/fontawesome-webfont.ttf"
  65. }
  66. Rectangle {
  67. id: mainForm
  68. anchors.fill: parent
  69. anchors.horizontalCenter: mainForm.horizontalCenter
  70. Image {
  71. fillMode: Image.PreserveAspectFit
  72. source: 'qrc:/images/bg4k.png'
  73. }
  74. Rectangle {
  75. id: mainFormHeader
  76. width: mainForm.width
  77. height: 80
  78. color: 'transparent'
  79. //visible:false
  80. Image {
  81. id: mainFormBannerBg
  82. anchors.top: mainFormHeader.top
  83. anchors.right: mainFormHeader.right
  84. anchors.rightMargin: 990
  85. fillMode: Image.PreserveAspectFit
  86. source: 'qrc:/images/banner.png'
  87. }
  88. Text {
  89. id: mainFormTitle
  90. width: mainFormHeader.width
  91. height: mainFormHeader.height
  92. horizontalAlignment: Text.AlignHCenter
  93. verticalAlignment: Text.AlignVCenter
  94. anchors.right: mainFormHeader.right
  95. anchors.rightMargin: 10
  96. text: textTitle
  97. font.family: alibaba.name
  98. font.pointSize: 24
  99. color: mainTextColor
  100. }
  101. Text {
  102. id: delayms
  103. text: '网络延迟: ' + (appModel.ping / 2).toFixed(1) + ' ms'
  104. color: appModel.ping/2 > 200 ? popupBgColorErr : mainTextColor
  105. font.family: alibaba.name
  106. font.pointSize: 16
  107. anchors.right: mainFormHeader.right
  108. anchors.rightMargin: 150
  109. anchors.top: mainFormHeader.top
  110. anchors.topMargin: 25
  111. }
  112. //时间显示
  113. Rectangle {
  114. id: refreshDate
  115. width: statusData.width - 100
  116. height: 50
  117. color: mainAppColor
  118. anchors.top: mainFormHeader.top
  119. anchors.topMargin: 25
  120. anchors.left: mainFormHeader.left
  121. anchors.leftMargin: 130
  122. Text {
  123. id: localTime
  124. width: 140
  125. height: 50
  126. anchors.horizontalCenter: refreshDate.horizontalCenter
  127. color: '#FFFFFF'
  128. font.family: digtalFont.name
  129. font.pointSize: 20
  130. text: new Date().toLocaleTimeString()
  131. Component.onCompleted: {
  132. localTimeRefresh.start()
  133. }
  134. }
  135. Timer {
  136. id: localTimeRefresh
  137. interval: 1000
  138. repeat: true
  139. onTriggered: {
  140. localTime.text = new Date().toLocaleTimeString()
  141. }
  142. }
  143. }
  144. }
  145. Rectangle {
  146. id: mainFormContent
  147. width: mainForm.width
  148. height: mainForm.height - 80
  149. anchors.top: mainFormHeader.bottom
  150. color: 'transparent'
  151. Row {
  152. /*
  153. Rectangle {
  154. id: statusData
  155. width: statusWidth + lineWidth -100
  156. height: mainHeight
  157. color: 'transparent'
  158. /*
  159. Image {
  160. width: lineWidth
  161. height: mainHeight
  162. anchors.left: statusData.left
  163. anchors.leftMargin: 20
  164. fillMode: Image.Stretch
  165. source: 'qrc:/images/border_l.png'
  166. }
  167. Rectangle {
  168. id: carImage
  169. width: statusData.width - 200
  170. height: 300
  171. color: 'transparent'
  172. anchors.horizontalCenter: statusData.horizontalCenter
  173. anchors.top: statusData.top
  174. anchors.topMargin: 50
  175. anchors.left: statusData.left
  176. anchors.horizontalCenterOffset: 10
  177. Image {
  178. width: 360
  179. height: 240
  180. fillMode: Image.Stretch
  181. source: 'qrc:/images/wagon.png'
  182. anchors.horizontalCenter: carImage.horizontalCenter
  183. }
  184. }
  185. Row {
  186. id: driveDataForm
  187. width: statusData.width - 100
  188. height: 300
  189. anchors.top: carImage.bottom
  190. anchors.topMargin: 0
  191. anchors.left: carImage.left
  192. anchors.leftMargin: 100
  193. Text {
  194. text:"舱位:"
  195. color: mainTextColor
  196. anchors.left: statusData.left
  197. anchors.leftMargin: 20
  198. font.family: alibaba.name
  199. font.pointSize: 20
  200. }
  201. Text {
  202. id: driveOpType
  203. text: appModel.DriveName
  204. color: mainTextColor
  205. anchors.left: radarData.left
  206. anchors.leftMargin: 180
  207. font.family: digtalFont.name
  208. font.pointSize: 20
  209. }
  210. spacing: 50
  211. }
  212. Row {
  213. id: carDataForm
  214. width: statusData.width - 100
  215. height: 300
  216. anchors.top: carImage.bottom
  217. anchors.topMargin: 40
  218. anchors.left: carImage.left
  219. anchors.leftMargin: 100
  220. Text {
  221. text:"车号 :"
  222. color: mainTextColor
  223. anchors.left: statusData.left
  224. anchors.leftMargin: 20
  225. font.family: alibaba.name
  226. font.pointSize: 20
  227. }
  228. Text {
  229. id: carOpType
  230. text: appModel.CarName
  231. color: mainTextColor
  232. anchors.left: radarData.left
  233. anchors.leftMargin: 180
  234. font.family: digtalFont.name
  235. font.pointSize: 20
  236. }
  237. spacing: 50
  238. }
  239. Row {
  240. id: tempState
  241. width: statusData.width - 100
  242. height: 300
  243. anchors.top: carImage.bottom
  244. anchors.topMargin: 80
  245. anchors.left: carImage.left
  246. anchors.leftMargin: 100
  247. visible:true
  248. Text {
  249. text: "系统温度:"
  250. color: mainTextColor
  251. anchors.left: statusData.left
  252. anchors.leftMargin: 20
  253. font.family: alibaba.name
  254. font.pointSize: 20
  255. }
  256. Text {
  257. id: tempValue
  258. text: appModel.temp +"°C"
  259. color: appModel.temp<70? mainTextColor:popupBgColorErr
  260. anchors.left: radarData.left
  261. anchors.leftMargin: 180
  262. font.family: digtalFont.name
  263. font.pointSize: 24
  264. }
  265. spacing: 50
  266. }
  267. Row {
  268. id: steerState
  269. width: statusData.width - 100
  270. height: 300
  271. anchors.top: carImage.bottom
  272. anchors.topMargin: 120
  273. anchors.left: carImage.left
  274. anchors.leftMargin: 100
  275. visible:true
  276. Text {
  277. text: "转向角度 :"
  278. color: mainTextColor
  279. anchors.left: statusData.left
  280. anchors.leftMargin: 20
  281. font.family: alibaba.name
  282. font.pointSize: 20
  283. }
  284. Text {
  285. id: steer
  286. text: appModel.Steer
  287. color: mainTextColor
  288. anchors.left: radarData.left
  289. anchors.leftMargin: 180
  290. font.family: digtalFont.name
  291. font.pointSize: 24
  292. }
  293. spacing: 50
  294. }
  295. Row {
  296. id: rpmState
  297. width: statusData.width - 100
  298. height: 300
  299. anchors.top: carImage.bottom
  300. anchors.topMargin: 160
  301. anchors.left: carImage.left
  302. anchors.leftMargin: 100
  303. visible:appModel.Visible
  304. Text {
  305. text: "发动机转速:"
  306. color: mainTextColor
  307. anchors.left: statusData.left
  308. anchors.leftMargin: 20
  309. font.family: alibaba.name
  310. font.pointSize: 20
  311. }
  312. Text {
  313. id: rpmValue
  314. text: appModel.EnginRpm
  315. color: appModel.EnginRpm>200? mainTextColor:popupBgColorErr
  316. anchors.left: radarData.left
  317. anchors.leftMargin: 180
  318. font.family: digtalFont.name
  319. font.pointSize: 24
  320. }
  321. spacing: 50
  322. }
  323. Row {
  324. id: gpaState
  325. width: statusData.width - 100
  326. height: 300
  327. anchors.top: carImage.bottom
  328. anchors.topMargin: 200
  329. anchors.left: carImage.left
  330. anchors.leftMargin: 100
  331. visible:appModel.Visible
  332. Text {
  333. text: "发动机油压:"
  334. color: mainTextColor
  335. anchors.left: statusData.left
  336. anchors.leftMargin: 20
  337. font.family: alibaba.name
  338. font.pointSize: 20
  339. }
  340. Text {
  341. id: gpavalue
  342. text: appModel.EngineOilPressure
  343. color: mainTextColor
  344. anchors.left: radarData.left
  345. anchors.leftMargin: 180
  346. font.family: digtalFont.name
  347. font.pointSize: 24
  348. }
  349. spacing: 50
  350. }
  351. Row {
  352. id: coldState
  353. width: statusData.width - 100
  354. height: 300
  355. anchors.top: carImage.bottom
  356. anchors.topMargin: 240
  357. anchors.left: carImage.left
  358. anchors.leftMargin: 100
  359. visible:appModel.Visible
  360. Text {
  361. text: "冷却液温度:"
  362. color: mainTextColor
  363. anchors.left: statusData.left
  364. anchors.leftMargin: 20
  365. font.family: alibaba.name
  366. font.pointSize: 20
  367. }
  368. Text {
  369. id: coldValue
  370. text: appModel.Cold
  371. color: mainTextColor
  372. anchors.left: radarData.left
  373. anchors.leftMargin: 180
  374. font.family: digtalFont.name
  375. font.pointSize: 24
  376. }
  377. spacing: 50
  378. }
  379. Row {
  380. id: paState
  381. width: statusData.width - 100
  382. height: 300
  383. anchors.top: carImage.bottom
  384. anchors.topMargin: 280
  385. anchors.left: carImage.left
  386. anchors.leftMargin: 100
  387. visible:appModel.Visible
  388. Text {
  389. text: "变速箱油压:"
  390. color: mainTextColor
  391. anchors.left: statusData.left
  392. anchors.leftMargin: 20
  393. font.family: alibaba.name
  394. font.pointSize: 20
  395. }
  396. Text {
  397. id: paValue
  398. text: appModel.GearboxOilPressure
  399. color: appModel.GearboxOilPressure<16 || appModel.GearboxOilPressure>20? popupBgColorErr:mainTextColor
  400. anchors.left: radarData.left
  401. anchors.leftMargin: 180
  402. font.family: digtalFont.name
  403. font.pointSize: 24
  404. }
  405. spacing: 50
  406. }
  407. Row {
  408. id: gearState
  409. width: statusData.width - 100
  410. height: 300
  411. anchors.top: carImage.bottom
  412. anchors.topMargin: 320
  413. anchors.left: carImage.left
  414. anchors.leftMargin: 100
  415. visible:appModel.Visible
  416. Text {
  417. text: "变速箱油温:"
  418. color: mainTextColor
  419. anchors.left: statusData.left
  420. anchors.leftMargin: 20
  421. font.family: alibaba.name
  422. font.pointSize: 20
  423. }
  424. Text {
  425. id: gearValue
  426. text: appModel.GearboxOilTemp
  427. color: appModel.GearboxOilTemp>100 ? popupBgColorErr:mainTextColor
  428. anchors.left: radarData.left
  429. anchors.leftMargin: 180
  430. font.family: digtalFont.name
  431. font.pointSize: 24
  432. }
  433. spacing: 50
  434. }
  435. Row {
  436. id: brakeState
  437. width: statusData.width - 100
  438. height: 300
  439. anchors.top: carImage.bottom
  440. anchors.topMargin: 360
  441. anchors.left: carImage.left
  442. anchors.leftMargin: 100
  443. visible:appModel.Visible
  444. Text {
  445. text: "制动压力 :"
  446. color: mainTextColor
  447. anchors.left: statusData.left
  448. anchors.leftMargin: 20
  449. font.family: alibaba.name
  450. font.pointSize: 20
  451. }
  452. Text {
  453. id: brakeValue
  454. text: appModel.BrakePressure
  455. color: appModel.BrakePressure<6 ? popupBgColorErr:mainTextColor
  456. anchors.left: radarData.left
  457. anchors.leftMargin: 180
  458. font.family: digtalFont.name
  459. font.pointSize: 24
  460. }
  461. spacing: 50
  462. }
  463. Row {
  464. id: presState
  465. width: statusData.width - 100
  466. height: 300
  467. anchors.top: carImage.bottom
  468. anchors.topMargin: 400
  469. anchors.left: carImage.left
  470. anchors.leftMargin: 100
  471. visible:appModel.Visible
  472. Text {
  473. text: "液压压力 :"
  474. color: mainTextColor
  475. anchors.left: statusData.left
  476. anchors.leftMargin: 20
  477. font.family: alibaba.name
  478. font.pointSize: 20
  479. }
  480. Text {
  481. id: preValue
  482. text: appModel.BrakePressure
  483. color: mainTextColor
  484. anchors.left: radarData.left
  485. anchors.leftMargin: 180
  486. font.family: digtalFont.name
  487. font.pointSize: 24
  488. }
  489. spacing: 50
  490. }
  491. /*
  492. Row {
  493. id: speedState
  494. width: statusData.width - 100
  495. height: 300
  496. anchors.top: carImage.bottom
  497. anchors.topMargin: 320
  498. anchors.left: carImage.left
  499. anchors.leftMargin: 100
  500. visible:appModel.Visible
  501. Text {
  502. text: "车辆速度 :"
  503. color: mainTextColor
  504. anchors.left: statusData.left
  505. anchors.leftMargin: 20
  506. font.family: alibaba.name
  507. font.pointSize: 20
  508. }
  509. Text {
  510. id: speed
  511. text:appModel.Speed
  512. color: mainTextColor
  513. anchors.left: radarData.left
  514. anchors.leftMargin: 180
  515. font.family: digtalFont.name
  516. font.pointSize: 24
  517. }
  518. spacing: 50
  519. }
  520. /* Row {
  521. id: leftlockState
  522. width: statusData.width - 100
  523. height: 300
  524. anchors.top: carImage.bottom
  525. anchors.topMargin: 390
  526. anchors.left: carImage.left
  527. anchors.leftMargin: 100
  528. Text {
  529. text: "左锁钩状态 :"
  530. color: mainTextColor
  531. anchors.left: statusData.left
  532. anchors.leftMargin: 20
  533. font.family: alibaba.name
  534. font.pointSize: 20
  535. }
  536. Text {
  537. id: leftlock
  538. text: appModel.Steer
  539. color: mainTextColor
  540. anchors.left: radarData.left
  541. anchors.leftMargin: 180
  542. font.family: digtalFont.name
  543. font.pointSize: 24
  544. }
  545. spacing: 50
  546. }
  547. Row {
  548. id: rightlockState
  549. width: statusData.width - 100
  550. height: 300
  551. anchors.top: carImage.bottom
  552. anchors.topMargin: 425
  553. anchors.left: carImage.left
  554. anchors.leftMargin: 100
  555. Text {
  556. text: "右锁钩状态 :"
  557. color: mainTextColor
  558. anchors.left: statusData.left
  559. anchors.leftMargin: 20
  560. font.family: alibaba.name
  561. font.pointSize: 20
  562. }
  563. Text {
  564. id: rightlock
  565. text: appModel.Steer
  566. color: mainTextColor
  567. anchors.left: radarData.left
  568. anchors.leftMargin: 180
  569. font.family: digtalFont.name
  570. font.pointSize: 24
  571. }
  572. spacing: 50
  573. }
  574. Rectangle {
  575. id: refreshDate
  576. width: statusData.width - 100
  577. height: 50
  578. color: mainAppColor
  579. anchors.bottom: statusData.bottom
  580. anchors.bottomMargin: 30
  581. anchors.horizontalCenter: statusData.horizontalCenter
  582. anchors.horizontalCenterOffset: 10
  583. Text {
  584. id: localTime
  585. width: 140
  586. height: 50
  587. anchors.horizontalCenter: refreshDate.horizontalCenter
  588. color: '#FFFFFF'
  589. font.family: digtalFont.name
  590. font.pointSize: 36
  591. text: new Date().toLocaleTimeString()
  592. Component.onCompleted: {
  593. localTimeRefresh.start()
  594. }
  595. }
  596. Timer {
  597. id: localTimeRefresh
  598. interval: 1000
  599. repeat: true
  600. onTriggered: {
  601. localTime.text = new Date().toLocaleTimeString()
  602. }
  603. }
  604. }
  605. /* Image {
  606. width: lineWidth
  607. height: mainHeight
  608. anchors.right: statusData.right
  609. fillMode: Image.Stretch
  610. source: 'qrc:/images/border_r.png'
  611. }
  612. }
  613. */
  614. Rectangle {
  615. id: leftCam
  616. //width: leftCamWidth + lineWidth
  617. width: leftCamWidth + lineWidth + statusWidth + lineWidth
  618. height: mainHeight
  619. color: 'transparent'
  620. /* Image {
  621. width: lineWidth
  622. height: mainHeight
  623. anchors.left: leftCam.left
  624. anchors.leftMargin: 20
  625. fillMode: Image.Stretch
  626. source: 'qrc:/images/border_l.png'
  627. z: 99
  628. }
  629. */
  630. Image {
  631. anchors.left: leftCam.right
  632. anchors.leftMargin: -130
  633. anchors.top: leftCam.top
  634. anchors.topMargin: -35
  635. fillMode: Image.Stretch
  636. //左后视镜边框
  637. source: 'qrc:/images/sideV_left1.png'
  638. z: 99
  639. }
  640. Column {
  641. anchors.left: leftCam.left
  642. anchors.leftMargin: 20
  643. Rectangle {
  644. width: leftCamWidth + statusWidth + lineWidth
  645. height: mainHeight
  646. color: 'transparent'
  647. anchors.left: leftCam.left
  648. anchors.leftMargin: 20
  649. border.color: "blue"
  650. border.width: 1
  651. // CAM Left
  652. Image {
  653. id: leftImg
  654. width: leftCamWidth + statusWidth + lineWidth
  655. height: mainHeight
  656. //fillMode: Image.Stretch//拉伸模式
  657. //fillMode: Image.PreserveAspectFit//保持宽高比例适应模式
  658. fillMode: Image.PreserveAspectCrop //保持宽高比裁剪模式
  659. //fillMode: Image.Tile//平铺模式
  660. }
  661. //左摄像头
  662. Connections {
  663. target: LeftImage
  664. onCallQmlRefeshLeftImg: {
  665. //aaa
  666. leftImg.source = ""
  667. leftImg.source = "image://LeftImage"
  668. }
  669. }
  670. Image {
  671. id: leftImg_camera1
  672. width: leftCamWidth + statusWidth + lineWidth
  673. height: mainHeight
  674. fillMode: Image.Stretch
  675. source: 'qrc:/images/left_camera1.png'
  676. }
  677. }
  678. }
  679. Image {
  680. anchors.top: leftCam.top
  681. anchors.topMargin: -30
  682. anchors.right: leftCam.left
  683. anchors.rightMargin: -100
  684. fillMode: Image.Stretch
  685. //左后视镜边框
  686. source: 'qrc:/images/sideV_right1.png'
  687. z: 99
  688. }
  689. /*
  690. Rectangle {
  691. width: leftCamWidth
  692. height: mainHeight/2
  693. y:mainHeight/2
  694. color: 'transparent'
  695. anchors.left: leftCam.left
  696. anchors.leftMargin: 20
  697. border.color: mainAppColor
  698. border.width: 1
  699. // CAM Left
  700. Image {
  701. id: leftan
  702. width: leftCamWidth
  703. height: mainHeight/2
  704. fillMode: Image.Stretch
  705. }
  706. Connections {
  707. target: LeftAnchor
  708. onCallQmlRefeshLeftAnchor: {
  709. leftan.source = ""
  710. leftan.source = "image://LeftAnchor"
  711. }
  712. }
  713. }
  714. */
  715. /* Image {
  716. width: lineWidth
  717. height: mainHeight
  718. anchors.right: leftCam.right
  719. fillMode: Image.Stretch
  720. source: 'qrc:/images/border_r.png'
  721. z: 99
  722. }
  723. */
  724. }
  725. Rectangle {
  726. id: centerPanel
  727. width: frontCamWidth + 2 * lineWidth
  728. height: mainHeight
  729. anchors.top: mainFormContent.top
  730. anchors.horizontalCenter: mainFormContent.horizontalCenter
  731. color: 'transparent'
  732. MouseArea {
  733. anchors.fill: parent
  734. drag.target: backImgRect
  735. drag.axis: Drag.XandYAxis
  736. drag.minimumX: 20
  737. drag.maximumX: centerPanel.width - backImgRect.width - 20
  738. drag.minimumY: 0
  739. drag.maximumY: centerPanel.height - backImgRect.height
  740. }
  741. //新增的边框图片
  742. Image {
  743. height: 1100
  744. anchors.left: centerPanel.left
  745. anchors.leftMargin: 0
  746. anchors.top: centerPanel.top
  747. anchors.topMargin: -75
  748. fillMode: Image.Stretch
  749. visible: true
  750. //中间屏幕边框
  751. source: 'qrc:/images/main_left.png'
  752. z: 99
  753. }
  754. Rectangle {
  755. width: frontCamWidth1
  756. height: mainHeight
  757. color: 'transparent'
  758. anchors.left: centerPanel.left
  759. anchors.leftMargin: 105
  760. border.color: "blue"
  761. border.width: 1
  762. // CAM FRONT
  763. Image {
  764. id: frontImg
  765. anchors.topMargin: 140
  766. width: frontCamWidth1
  767. height: mainHeight
  768. fillMode: Image.Stretch
  769. //fillMode: Image.PreserveAspectFit//保持宽高比例适应模式
  770. //fillMode: Image.PreserveAspectCrop //保持宽高比裁剪模式
  771. //fillMode: Image.Tile//平铺模式
  772. z: 97
  773. }
  774. Connections {
  775. target: FrontImage
  776. onCallQmlRefeshFrontImg: {
  777. //aaa
  778. frontImg.source = ""
  779. frontImg.source = "image://FrontImage"
  780. }
  781. }
  782. Image {
  783. id: img_camera1
  784. anchors.topMargin: 140
  785. width: frontCamWidth1
  786. height: mainHeight
  787. fillMode: Image.Stretch
  788. source: 'qrc:/images/middle_camera1.png'
  789. z: 97
  790. }
  791. Image {
  792. id: img_camera2
  793. visible:true
  794. anchors.top:parent.top
  795. anchors.topMargin: 640
  796. anchors.horizontalCenter: parent.horizontalCenter
  797. //anchors.verticalCenter: parent.verticalCenter
  798. width: frontCamWidth1*4/5
  799. height: mainHeight/3
  800. fillMode: Image.Stretch
  801. source: 'qrc:/images/caution2.png'
  802. z: 99
  803. }
  804. }
  805. Rectangle {
  806. id: backImgRect1
  807. width: frontCamWidth
  808. height: mainHeight
  809. color: 'transparent'
  810. x:25
  811. z:100
  812. //y:mainHeight/2+200
  813. border.color: "transparent"
  814. border.width: 1
  815. /*
  816. // CAM BACK REAR
  817. Image {
  818. id: backImg
  819. anchors.topMargin: 40
  820. anchors.horizontalCenter: parent.horizontalCenter
  821. width: parent.width/4
  822. height: parent.height/4
  823. fillMode: Image.Stretch
  824. z: 98
  825. }
  826. Connections {
  827. target: RightAnchor
  828. onCallQmlRefeshRightAnchor: {
  829. //aaa
  830. //增加的第6个摄像头-在最上面
  831. backImg.source = ""
  832. //backImg.source = "image://RightAnchor"
  833. }
  834. }*/
  835. Rectangle {
  836. Image {
  837. fillMode: Image.Stretch
  838. x: 10
  839. y: 440
  840. z: 99
  841. // visible:appModel.lightL === 1
  842. visible: true
  843. source: 'qrc:/images/left_light1.png'
  844. }
  845. Image {
  846. fillMode: Image.Stretch
  847. x: 10
  848. y: 440
  849. z: 99
  850. visible: appModel.lightL === true
  851. //visible: true
  852. source: 'qrc:/images/left_light.png'
  853. }
  854. Text {
  855. id: leftLight
  856. x: 10
  857. y: 470
  858. z: 99
  859. text: "左转"
  860. color: "#70FFFFFF"
  861. font.family: alibaba.name
  862. font.pointSize: radarTxtSize
  863. }
  864. }
  865. Rectangle {
  866. Image {
  867. x: 10
  868. y: 500
  869. z: 99
  870. fillMode: Image.Stretch
  871. // visible:appModel.lightFront === 1
  872. visible: true
  873. source: 'qrc:/images/frontlight1.png'
  874. }
  875. Image {
  876. x: 10
  877. y: 500
  878. z: 99
  879. fillMode: Image.Stretch
  880. visible: appModel.lightFront
  881. // visible: true
  882. source: 'qrc:/images/frontlight.png'
  883. }
  884. Text {
  885. id: frontlight
  886. x: 10
  887. y: 530
  888. z: 99
  889. text: "前灯"
  890. color: "#70FFFFFF"
  891. font.family: alibaba.name
  892. font.pointSize: radarTxtSize
  893. }
  894. }
  895. Rectangle {
  896. Image {
  897. fillMode: Image.Stretch
  898. x: 10
  899. y: 560
  900. z: 99
  901. // visible:appModel.carPark === 1
  902. visible: true
  903. source: 'qrc:/images/emergency1.png'
  904. }
  905. Image {
  906. fillMode: Image.Stretch
  907. x: 10
  908. y: 560
  909. z: 99
  910. visible: appModel.carPark === false
  911. //visible: true
  912. source: 'qrc:/images/emergency.png'
  913. }
  914. Text {
  915. id: emergency
  916. x: 10
  917. y: 590
  918. z: 99
  919. text: "驻停"
  920. color: "#70FFFFFF"
  921. font.family: alibaba.name
  922. font.pointSize: radarTxtSize
  923. }
  924. }
  925. Rectangle {
  926. Image {
  927. fillMode: Image.Stretch
  928. x: 10
  929. y: 620
  930. z: 99
  931. //visible:appModel.cautionLight === 1
  932. visible: true
  933. source: 'qrc:/images/buzzer1.png'
  934. }
  935. Image {
  936. fillMode: Image.Stretch
  937. x: 10
  938. y: 620
  939. z: 99
  940. visible: appModel.cautionLight === true
  941. //visible:true
  942. source: 'qrc:/images/buzzer.png'
  943. }
  944. Text {
  945. id: buzzer
  946. x: 10
  947. y: 650
  948. z: 99
  949. text: "双闪"
  950. color: "#70FFFFFF"
  951. font.family: alibaba.name
  952. font.pointSize: radarTxtSize
  953. }
  954. }
  955. Rectangle {
  956. Image {
  957. fillMode: Image.Stretch
  958. x: 10
  959. y: 680
  960. z: 99
  961. // visible:appModel.lightWork === 1
  962. visible: true
  963. source: 'qrc:/images/wiper1.png'
  964. }
  965. Image {
  966. fillMode: Image.Stretch
  967. x: 10
  968. y: 680
  969. z: 99
  970. visible: appModel.lightWork === true
  971. // visible:true
  972. source: 'qrc:/images/wiper.png'
  973. }
  974. Text {
  975. id: wiper
  976. x: 10
  977. y: 715
  978. z: 99
  979. text: "工作"
  980. color: "#70FFFFFF"
  981. font.family: alibaba.name
  982. font.pointSize: radarTxtSize
  983. }
  984. }
  985. Rectangle {
  986. Image {
  987. fillMode: Image.Stretch
  988. x: 10
  989. y: 745
  990. z: 99
  991. // visible:appModel.gearR === 0
  992. visible: true
  993. source: 'qrc:/images/backlight1.png'
  994. }
  995. Image {
  996. fillMode: Image.Stretch
  997. x: 10
  998. y: 745
  999. z: 99
  1000. visible: appModel.gearR === true
  1001. //visible:true
  1002. source: 'qrc:/images/backlight.png'
  1003. }
  1004. Text {
  1005. id: backlight
  1006. x: 10
  1007. y: 775
  1008. z: 99
  1009. text: "后灯"
  1010. color: "#70FFFFFF"
  1011. font.family: alibaba.name
  1012. font.pointSize: radarTxtSize
  1013. }
  1014. }
  1015. Rectangle {
  1016. Image {
  1017. fillMode: Image.Stretch
  1018. x: 880
  1019. y: 645
  1020. z: 100
  1021. visible: appModel.emergency1 === false
  1022. //visible:true
  1023. source: 'qrc:/images/carStop.png'
  1024. }
  1025. Text {
  1026. id: emergencyLight
  1027. x: 913
  1028. y: 775
  1029. z: 100
  1030. visible: appModel.emergency1 === false
  1031. text: "急停"
  1032. color: "red"
  1033. font.family: alibaba.name
  1034. font.pointSize: 24
  1035. }
  1036. }
  1037. Rectangle {
  1038. Image {
  1039. fillMode: Image.Stretch
  1040. x: 1845
  1041. y: 440
  1042. z: 99
  1043. visible: true
  1044. // visible:appModel.lightR === 1
  1045. source: 'qrc:/images/right_light1.png'
  1046. }
  1047. Image {
  1048. fillMode: Image.Stretch
  1049. x: 1845
  1050. y: 440
  1051. z: 99
  1052. //visible: true
  1053. visible: appModel.lightR === true
  1054. source: 'qrc:/images/right_light.png'
  1055. }
  1056. Text {
  1057. id: rightLight
  1058. x: 1845
  1059. y: 470
  1060. z: 99
  1061. text: "右转"
  1062. font.family: alibaba.name
  1063. font.pointSize: radarTxtSize
  1064. color: "#70FFFFFF"
  1065. }
  1066. }
  1067. Rectangle {
  1068. Image {
  1069. fillMode: Image.Stretch
  1070. x: 1845
  1071. y: 500
  1072. z: 99
  1073. // visible:(appModel.gear_d === 1)&&(appModel.forward !== -1)
  1074. visible: true
  1075. source: 'qrc:/images/gear_11.png'
  1076. }
  1077. Image {
  1078. fillMode: Image.Stretch
  1079. x: 1845
  1080. y: 500
  1081. z: 99
  1082. // visible:(appModel.gear_d === 1)&&(appModel.forward !== -1)
  1083. visible: true
  1084. source: 'qrc:/images/gear_1.png'
  1085. }
  1086. Text {
  1087. id: gear_d_1
  1088. x: 1845
  1089. y: 530
  1090. z: 99
  1091. text: " 1挡"
  1092. font.family: alibaba.name
  1093. font.pointSize: radarTxtSize
  1094. color: "#70FFFFFF"
  1095. }
  1096. }
  1097. Rectangle {
  1098. Image {
  1099. fillMode: Image.Stretch
  1100. x: 1845
  1101. y: 560
  1102. z: 99
  1103. // visible:appModel.gear_d === 2
  1104. visible: true
  1105. source: 'qrc:/images/gear_21.png'
  1106. }
  1107. Image {
  1108. fillMode: Image.Stretch
  1109. x: 1845
  1110. y: 560
  1111. z: 99
  1112. // visible:appModel.gear_d === 2
  1113. visible: false
  1114. source: 'qrc:/images/gear_2.png'
  1115. }
  1116. Text {
  1117. id: gear_d_2
  1118. x: 1845
  1119. y: 590
  1120. z: 99
  1121. text: " 2挡"
  1122. font.family: alibaba.name
  1123. font.pointSize: radarTxtSize
  1124. color: "#70FFFFFF"
  1125. }
  1126. }
  1127. Rectangle {
  1128. Image {
  1129. fillMode: Image.Stretch
  1130. x: 1845
  1131. y: 590
  1132. z: 99
  1133. // visible:appModel.gear_d === 3
  1134. visible: false
  1135. source: 'qrc:/images/gear_3.png'
  1136. }
  1137. Image {
  1138. fillMode: Image.Stretch
  1139. x: 1845
  1140. y: 590
  1141. z: 99
  1142. // visible:appModel.gear_d === 4
  1143. visible: false
  1144. source: 'qrc:/images/gear_4.png'
  1145. }
  1146. }
  1147. Rectangle {
  1148. Image {
  1149. fillMode: Image.Stretch
  1150. x: 1845
  1151. y: 620
  1152. z: 99
  1153. // visible:appModel.gearF === 1
  1154. visible: true
  1155. source: 'qrc:/images/gear_d1.png'
  1156. }
  1157. Image {
  1158. fillMode: Image.Stretch
  1159. x: 1845
  1160. y: 620
  1161. z: 99
  1162. visible: appModel.gearF === true
  1163. //visible: true
  1164. source: 'qrc:/images/gear_d.png'
  1165. }
  1166. Text {
  1167. id: gear_d
  1168. x: 1845
  1169. y: 650
  1170. z: 99
  1171. text: " F挡"
  1172. font.family: alibaba.name
  1173. font.pointSize: radarTxtSize
  1174. color: "#70FFFFFF"
  1175. }
  1176. }
  1177. Rectangle {
  1178. Image {
  1179. fillMode: Image.Stretch
  1180. x: 1845
  1181. y: 680
  1182. z: 99
  1183. //visible:appModel.forward === -1
  1184. visible: true
  1185. source: 'qrc:/images/gear_n1.png'
  1186. }
  1187. Image {
  1188. fillMode: Image.Stretch
  1189. x: 1845
  1190. y: 680
  1191. z: 99
  1192. visible: (appModel.gearR === false)
  1193. && (appModel.gearF === false)
  1194. //visible: true
  1195. source: 'qrc:/images/gear_n.png'
  1196. }
  1197. Text {
  1198. id: gear_n
  1199. x: 1845
  1200. y: 710
  1201. z: 99
  1202. text: " N挡"
  1203. font.family: alibaba.name
  1204. font.pointSize: radarTxtSize
  1205. color: "#70FFFFFF"
  1206. }
  1207. }
  1208. Rectangle {
  1209. Image {
  1210. fillMode: Image.Stretch
  1211. x: 1845
  1212. y: 740
  1213. z: 99
  1214. // visible:appModel.gearR === 1
  1215. visible: true
  1216. source: 'qrc:/images/gear_r1.png'
  1217. }
  1218. Image {
  1219. fillMode: Image.Stretch
  1220. x: 1845
  1221. y: 740
  1222. z: 99
  1223. visible: appModel.gearR === true
  1224. //visible: true
  1225. source: 'qrc:/images/gear_r.png'
  1226. }
  1227. Text {
  1228. id: gear_r
  1229. x: 1845
  1230. y: 770
  1231. z: 99
  1232. text: " R挡"
  1233. font.family: alibaba.name
  1234. font.pointSize: radarTxtSize
  1235. color: "#70FFFFFF"
  1236. }
  1237. }
  1238. }
  1239. /*
  1240. Image {
  1241. width: lineWidth
  1242. height: mainHeight
  1243. anchors.right: centerPanel.right
  1244. anchors.rightMargin: 20
  1245. fillMode: Image.Stretch
  1246. source: 'qrc:/images/border_r.png'
  1247. z: 99
  1248. }
  1249. */
  1250. Image {
  1251. height: 1100
  1252. anchors.right: centerPanel.right
  1253. anchors.rightMargin: 0
  1254. anchors.top: centerPanel.top
  1255. anchors.topMargin: -75
  1256. fillMode: Image.Stretch
  1257. visible: true
  1258. //中间屏幕边框
  1259. source: 'qrc:/images/main_right.png'
  1260. z: 99
  1261. }
  1262. }
  1263. Rectangle {
  1264. id: rightCam
  1265. width: rightCamWidth + lineWidth + radarWidth + lineWidth
  1266. height: mainHeight
  1267. color: 'transparent'
  1268. Image {
  1269. anchors.left: rightCam.left
  1270. anchors.leftMargin: -20
  1271. anchors.top: rightCam.top
  1272. anchors.topMargin: -32
  1273. fillMode: Image.Stretch
  1274. //右后视镜边框
  1275. source: 'qrc:/images/sideV_left.png'
  1276. z: 99
  1277. }
  1278. /*Image {
  1279. width: lineWidth
  1280. height: mainHeight
  1281. anchors.left: rightCam.left
  1282. fillMode: Image.Stretch
  1283. source: 'qrc:/images/border_l.png'
  1284. z: 99
  1285. }
  1286. */
  1287. Column {
  1288. anchors.right: rightCam.right
  1289. anchors.rightMargin: 20
  1290. Rectangle {
  1291. width: rightCamWidth + radarWidth + lineWidth
  1292. height: mainHeight
  1293. color: 'transparent'
  1294. anchors.left: rightCam.left
  1295. border.color: "blue"
  1296. border.width: 1
  1297. // CAM Right
  1298. Image {
  1299. id: rightImg
  1300. width: rightCamWidth + radarWidth + lineWidth
  1301. height: mainHeight
  1302. //fillMode: Image.Stretch//拉伸模式
  1303. //fillMode: Image.PreserveAspectFit//保持宽高比例适应模式
  1304. fillMode: Image.PreserveAspectCrop //保持宽高比裁剪模式
  1305. //fillMode: Image.Tile//平铺模式
  1306. }
  1307. //右摄像头
  1308. Connections {
  1309. target: RightImage
  1310. onCallQmlRefeshRightImg: {
  1311. //aaa
  1312. rightImg.source = ""
  1313. rightImg.source = "image://RightImage"
  1314. }
  1315. }
  1316. Image {
  1317. id: rightImg_camera1
  1318. width: rightCamWidth + radarWidth + lineWidth + lineWidth
  1319. height: mainHeight
  1320. fillMode: Image.Stretch
  1321. source: 'qrc:/images/right_camera1.png'
  1322. }
  1323. }
  1324. }
  1325. Image {
  1326. anchors.right: rightCam.right
  1327. anchors.rightMargin: -45 - lineWidth
  1328. anchors.top: rightCam.top
  1329. anchors.topMargin: -34
  1330. fillMode: Image.Stretch
  1331. visible: true
  1332. //右后视镜边框
  1333. source: 'qrc:/images/sideV_right.png'
  1334. z: 99
  1335. }
  1336. /*
  1337. Rectangle {
  1338. width: rightCamWidth
  1339. height: mainHeight/2
  1340. y:mainHeight/2
  1341. color: 'transparent'
  1342. anchors.left: rightCam.left
  1343. border.color: mainAppColor
  1344. border.width: 1
  1345. // CAM Right
  1346. Image {
  1347. id: rightan
  1348. width: rightCamWidth
  1349. height: mainHeight/2
  1350. fillMode: Image.Stretch
  1351. }
  1352. Connections {
  1353. target: RightAnchor
  1354. onCallQmlRefeshRightAnchor: {
  1355. rightan.source = ""
  1356. rightan.source = "image://RightAnchor"
  1357. }
  1358. }
  1359. }
  1360. */
  1361. /* Image {
  1362. width: lineWidth
  1363. height: mainHeight
  1364. anchors.right: rightCam.right
  1365. anchors.rightMargin: 20
  1366. fillMode: Image.Stretch
  1367. source: 'qrc:/images/border_r.png'
  1368. }
  1369. */
  1370. }
  1371. /*
  1372. Rectangle {
  1373. id: radarData
  1374. width: radarWidth -160
  1375. height: mainHeight
  1376. color: 'transparent'
  1377. /* Image {
  1378. width: lineWidth-200
  1379. height: mainHeight
  1380. anchors.left: radarData.left
  1381. fillMode: Image.Stretch
  1382. source: 'qrc:/images/border_l.png'
  1383. }
  1384. */
  1385. /*
  1386. Image {
  1387. id: radar_car
  1388. width: 600
  1389. height: 800
  1390. anchors.horizontalCenter: radarData.horizontalCenter
  1391. anchors.verticalCenter: radarData.verticalCenter
  1392. fillMode: Image.Stretch
  1393. source: 'qrc:/images/radar_car.png'
  1394. }
  1395. //------------ radarRightF
  1396. Image {
  1397. id: radarRightF0
  1398. width: radarSize
  1399. height: radarSize
  1400. anchors.right: radarData.right
  1401. anchors.rightMargin: radarRightMargin
  1402. anchors.top: radarData.top
  1403. anchors.topMargin: radarTopMargin
  1404. fillMode: Image.PreserveAspectFit
  1405. source: radarRightFGreenImg
  1406. visible: appModel.radar1 >= radarGreenRange
  1407. }
  1408. Image {
  1409. id: radarRightF1
  1410. width: radarSize
  1411. height: radarSize
  1412. anchors.right: radarData.right
  1413. anchors.rightMargin: radarRightMargin
  1414. anchors.top: radarData.top
  1415. anchors.topMargin: radarTopMargin
  1416. fillMode: Image.PreserveAspectFit
  1417. source: radarRightFYellowImg
  1418. visible: appModel.radar1 < radarGreenRange
  1419. && appModel.radar1 > radarRedRange
  1420. }
  1421. Image {
  1422. id: radarRightF2
  1423. width: radarSize
  1424. height: radarSize
  1425. anchors.right: radarData.right
  1426. anchors.rightMargin: radarRightMargin
  1427. anchors.top: radarData.top
  1428. anchors.topMargin: radarTopMargin
  1429. fillMode: Image.PreserveAspectFit
  1430. source: radarRightFRedImg
  1431. visible: appModel.radar1 <= radarRedRange
  1432. }
  1433. //------------ radarRightR
  1434. Image {
  1435. id: radarRightR0
  1436. width: radarSize
  1437. height: radarSize
  1438. anchors.bottom: radarData.bottom
  1439. anchors.bottomMargin: radarTopMargin
  1440. anchors.right: radarData.right
  1441. anchors.rightMargin: radarRightMargin
  1442. fillMode: Image.PreserveAspectFit
  1443. source: radarRightRGreenImg
  1444. visible: appModel.radar2 >= radarGreenRange
  1445. }
  1446. Image {
  1447. id: radarRightR1
  1448. width: radarSize
  1449. height: radarSize
  1450. anchors.bottom: radarData.bottom
  1451. anchors.bottomMargin: radarTopMargin
  1452. anchors.right: radarData.right
  1453. anchors.rightMargin: radarRightMargin
  1454. fillMode: Image.PreserveAspectFit
  1455. source: radarRightRYellowImg
  1456. visible: appModel.radar2 < radarGreenRange
  1457. && appModel.radar2 > radarRedRange
  1458. }
  1459. Image {
  1460. id: radarRightR2
  1461. width: radarSize
  1462. height: radarSize
  1463. anchors.bottom: radarData.bottom
  1464. anchors.bottomMargin: radarTopMargin
  1465. anchors.right: radarData.right
  1466. anchors.rightMargin: radarRightMargin
  1467. fillMode: Image.PreserveAspectFit
  1468. source: radarRightRRedImg
  1469. visible: appModel.radar2 <= radarRedRange
  1470. }
  1471. //------------ radarLeftF
  1472. Image {
  1473. id: radarLeftF0
  1474. width: radarSize
  1475. height: radarSize
  1476. anchors.left: radarData.left
  1477. anchors.leftMargin: radarRightMargin
  1478. anchors.top: radarData.top
  1479. anchors.topMargin: radarTopMargin
  1480. fillMode: Image.PreserveAspectFit
  1481. source: radarLeftFGreenImg
  1482. visible: appModel.radar3 >= radarGreenRange
  1483. }
  1484. Image {
  1485. id: radarLeftF1
  1486. width: radarSize
  1487. height: radarSize
  1488. anchors.left: radarData.left
  1489. anchors.leftMargin: radarRightMargin
  1490. anchors.top: radarData.top
  1491. anchors.topMargin: radarTopMargin
  1492. fillMode: Image.PreserveAspectFit
  1493. source: radarLeftFYellowImg
  1494. visible: appModel.radar3 < radarGreenRange
  1495. && appModel.radar3 > radarRedRange
  1496. }
  1497. Image {
  1498. id: radarLeftF2
  1499. width: radarSize
  1500. height: radarSize
  1501. anchors.left: radarData.left
  1502. anchors.leftMargin: radarRightMargin
  1503. anchors.top: radarData.top
  1504. anchors.topMargin: radarTopMargin
  1505. fillMode: Image.PreserveAspectFit
  1506. source: radarLeftFRedImg
  1507. visible: appModel.radar3 <= radarRedRange
  1508. }
  1509. //------------ radarLeftR
  1510. Image {
  1511. id: radarLeftR0
  1512. width: radarSize
  1513. height: radarSize
  1514. anchors.bottom: radarData.bottom
  1515. anchors.bottomMargin: radarTopMargin
  1516. anchors.left: radarData.left
  1517. anchors.leftMargin: radarRightMargin
  1518. fillMode: Image.PreserveAspectFit
  1519. source: radarLeftRGreenImg
  1520. visible: appModel.radar4 >= radarGreenRange
  1521. }
  1522. Image {
  1523. id: radarLeftR1
  1524. width: radarSize
  1525. height: radarSize
  1526. anchors.bottom: radarData.bottom
  1527. anchors.bottomMargin: radarTopMargin
  1528. anchors.left: radarData.left
  1529. anchors.leftMargin: radarRightMargin
  1530. fillMode: Image.PreserveAspectFit
  1531. source: radarLeftRYellowImg
  1532. visible: appModel.radar4 < radarGreenRange
  1533. && appModel.radar4 > radarRedRange
  1534. }
  1535. Image {
  1536. id: radarLeftR2
  1537. width: radarSize
  1538. height: radarSize
  1539. anchors.bottom: radarData.bottom
  1540. anchors.bottomMargin: radarTopMargin
  1541. anchors.left: radarData.left
  1542. anchors.leftMargin: radarRightMargin
  1543. fillMode: Image.PreserveAspectFit
  1544. source: radarLeftRRedImg
  1545. visible: appModel.radar4 <= radarRedRange
  1546. }
  1547. //------------ radarBottomL
  1548. Image {
  1549. id: radarBottomL0
  1550. width: radarSize
  1551. height: radarSize
  1552. anchors.bottom: radarData.bottom
  1553. anchors.bottomMargin: radarBottomMargin
  1554. anchors.left: radarData.left
  1555. anchors.leftMargin: radarleftMargin
  1556. fillMode: Image.PreserveAspectFit
  1557. source: radarBottomGreenImg
  1558. visible: appModel.radar5 >= radarGreenRange
  1559. }
  1560. Image {
  1561. id: radarBottomL1
  1562. width: radarSize
  1563. height: radarSize
  1564. anchors.bottom: radarData.bottom
  1565. anchors.bottomMargin: radarBottomMargin
  1566. anchors.left: radarData.left
  1567. anchors.leftMargin: radarleftMargin
  1568. fillMode: Image.PreserveAspectFit
  1569. source: radarBottomYellowImg
  1570. visible: appModel.radar5 < radarGreenRange
  1571. && appModel.radar5 > radarRedRange
  1572. }
  1573. Image {
  1574. id: radarBottomL2
  1575. width: radarSize
  1576. height: radarSize
  1577. anchors.bottom: radarData.bottom
  1578. anchors.bottomMargin: radarBottomMargin
  1579. anchors.left: radarData.left
  1580. anchors.leftMargin: radarleftMargin
  1581. fillMode: Image.PreserveAspectFit
  1582. source: radarBottomRedImg
  1583. visible: appModel.radar5 <= radarRedRange
  1584. }
  1585. */
  1586. //------------ radarBottomR
  1587. /*
  1588. Image {
  1589. id: radarBottomR0
  1590. width: radarSize
  1591. height: radarSize
  1592. anchors.bottom: radarData.bottom
  1593. anchors.bottomMargin: radarBottomMargin
  1594. anchors.right: radarData.right
  1595. anchors.rightMargin: radarleftMargin
  1596. fillMode: Image.PreserveAspectFit
  1597. source: radarBottomGreenImg
  1598. visible: appModel.radar6 >= radarGreenRange
  1599. }
  1600. Image {
  1601. id: radarBottomR1
  1602. width: radarSize
  1603. height: radarSize
  1604. anchors.bottom: radarData.bottom
  1605. anchors.bottomMargin: radarBottomMargin
  1606. anchors.right: radarData.right
  1607. anchors.rightMargin: radarleftMargin
  1608. fillMode: Image.PreserveAspectFit
  1609. source: radarBottomYellowImg
  1610. visible: appModel.radar6 < radarGreenRange
  1611. && appModel.radar6 > radarRedRange
  1612. }
  1613. Image {
  1614. id: radarBottomR2
  1615. width: radarSize
  1616. height: radarSize
  1617. anchors.bottom: radarData.bottom
  1618. anchors.bottomMargin: radarBottomMargin
  1619. anchors.right: radarData.right
  1620. anchors.rightMargin: radarleftMargin
  1621. fillMode: Image.PreserveAspectFit
  1622. source: radarBottomRedImg
  1623. visible: appModel.radar6 <= radarRedRange
  1624. }
  1625. Row {
  1626. height: parent.height
  1627. anchors.horizontalCenter: parent.horizontalCenter
  1628. anchors.top: radarData.top
  1629. anchors.topMargin: 60
  1630. Text {
  1631. text: "前方雷达:"
  1632. color: mainTextColor
  1633. anchors.left: radarData.left
  1634. anchors.leftMargin: 20
  1635. font.family: alibaba.name
  1636. font.pointSize: radarTxtSize
  1637. }
  1638. spacing: 50
  1639. Text {
  1640. id: radar1
  1641. text: (appModel.radar1 / 100).toFixed(2)
  1642. color: appModel.radar1>200? mainTextColor:popupBgColorErr
  1643. anchors.left: radarData.left
  1644. anchors.leftMargin: 20
  1645. font.family: alibaba.name
  1646. font.pointSize: radarTxtSize
  1647. }
  1648. }
  1649. Row {
  1650. height: parent.height
  1651. anchors.top: radarData.top
  1652. anchors.topMargin: 100
  1653. anchors.horizontalCenter: parent.horizontalCenter
  1654. Text {
  1655. text: "左前雷达:"
  1656. color: mainTextColor
  1657. anchors.left: radarData.left
  1658. anchors.leftMargin: 20
  1659. font.family: alibaba.name
  1660. font.pointSize: radarTxtSize
  1661. }
  1662. spacing: 50
  1663. Text {
  1664. id: radar2
  1665. text: (appModel.radar2 / 100).toFixed(2)
  1666. color: appModel.radar2>200? mainTextColor:popupBgColorErr
  1667. anchors.left: radarData.left
  1668. anchors.leftMargin: 60
  1669. font.family: alibaba.name
  1670. font.pointSize: radarTxtSize
  1671. }
  1672. }
  1673. Row{
  1674. height: parent.height
  1675. anchors.horizontalCenter: parent.horizontalCenter
  1676. anchors.top: radarData.top
  1677. anchors.topMargin: 140
  1678. Text {
  1679. text: "右前雷达:"
  1680. color: mainTextColor
  1681. anchors.left: radarData.left
  1682. anchors.leftMargin: 20
  1683. font.family: alibaba.name
  1684. font.pointSize: radarTxtSize
  1685. }
  1686. spacing: 50
  1687. Text {
  1688. id: radar3
  1689. text: (appModel.radar3 / 100).toFixed(2)
  1690. color: appModel.radar3>200? mainTextColor:popupBgColorErr
  1691. anchors.left: radarData.left
  1692. anchors.leftMargin: 100
  1693. font.family: alibaba.name
  1694. font.pointSize: radarTxtSize
  1695. }
  1696. }
  1697. Row {
  1698. height: parent.height
  1699. anchors.horizontalCenter: parent.horizontalCenter
  1700. anchors.top: radarData.top
  1701. anchors.topMargin: 180
  1702. Text {
  1703. text: "左后雷达:"
  1704. color: mainTextColor
  1705. anchors.left: radarData.left
  1706. anchors.leftMargin: 20
  1707. font.family: alibaba.name
  1708. font.pointSize: radarTxtSize
  1709. }
  1710. spacing: 50
  1711. Text {
  1712. id: radar4
  1713. text: (appModel.radar4 / 100).toFixed(2)
  1714. color: appModel.radar4>200? mainTextColor:popupBgColorErr
  1715. anchors.left: radarData.left
  1716. anchors.leftMargin: 140
  1717. font.family: alibaba.name
  1718. font.pointSize: radarTxtSize
  1719. }
  1720. }
  1721. Row{
  1722. // spacing: 30
  1723. height: parent.height
  1724. anchors.horizontalCenter: parent.horizontalCenter
  1725. anchors.top: radarData.top
  1726. anchors.topMargin: 220
  1727. Text {
  1728. text: "右后雷达:"
  1729. color: mainTextColor
  1730. anchors.left: radarData.left
  1731. anchors.leftMargin: 20
  1732. font.family: alibaba.name
  1733. font.pointSize: radarTxtSize
  1734. }
  1735. spacing: 50
  1736. Text {
  1737. id: radar5
  1738. text: (appModel.radar5 / 100).toFixed(2)
  1739. color: appModel.radar5>200? mainTextColor:popupBgColorErr
  1740. anchors.left: radarData.left
  1741. anchors.leftMargin: 180
  1742. font.family: alibaba.name
  1743. font.pointSize: radarTxtSize
  1744. }
  1745. }
  1746. /*
  1747. Row{
  1748. // spacing: 30
  1749. height: parent.height
  1750. anchors.horizontalCenter: parent.horizontalCenter
  1751. anchors.top: radarData.top
  1752. anchors.topMargin: 220
  1753. Text {
  1754. text: "左倒车雷达:"
  1755. color: mainTextColor
  1756. anchors.left: radarData.left
  1757. anchors.leftMargin: 0
  1758. font.family: alibaba.name
  1759. font.pointSize: radarTxtSize
  1760. }
  1761. spacing: 30
  1762. Text {
  1763. id: radar6
  1764. text: (appModel.radar6 / 100).toFixed(2)
  1765. color: appModel.radar6>200? mainTextColor:popupBgColorErr
  1766. anchors.left: radarData.left
  1767. anchors.leftMargin: 0
  1768. font.family: alibaba.name
  1769. font.pointSize: radarTxtSize
  1770. }
  1771. }
  1772. Row{
  1773. // spacing: 30
  1774. height: parent.height
  1775. anchors.horizontalCenter: parent.horizontalCenter
  1776. anchors.top: radarData.top
  1777. anchors.topMargin: 260
  1778. Text {
  1779. text: "右倒车雷达:"
  1780. color: mainTextColor
  1781. anchors.left: radarData.left
  1782. anchors.leftMargin: 0
  1783. font.family: alibaba.name
  1784. font.pointSize: radarTxtSize
  1785. }
  1786. spacing: 30
  1787. Text {
  1788. id: radar7
  1789. text: (appModel.radar7 / 100).toFixed(2)
  1790. color: appModel.radar7>200? mainTextColor:popupBgColorErr
  1791. anchors.left: radarData.left
  1792. anchors.leftMargin: 0
  1793. font.family: alibaba.name
  1794. font.pointSize: radarTxtSize
  1795. }
  1796. }
  1797. Rectangle {
  1798. id: chart
  1799. width: radarData.width
  1800. height: 400
  1801. anchors.horizontalCenter: parent.horizontalCenter
  1802. anchors.top: radarData.top
  1803. anchors.topMargin: 400
  1804. anchors.left: radarData.left
  1805. anchors.leftMargin: 0
  1806. color: 'transparent'
  1807. // anchors.topMargin: 30
  1808. ChartView {
  1809. titleColor: mainTextColor
  1810. title: "支腿高度"
  1811. anchors.fill: parent
  1812. // legend.alignment: Qt.AlignBottom
  1813. antialiasing: true
  1814. backgroundColor: "#050e34"
  1815. titleFont.pixelSize: 24
  1816. StackedBarSeries {
  1817. id: mySeries
  1818. axisX: BarCategoryAxis {
  1819. color: mainTextColor
  1820. //categories: [ "左支腿", "右支腿" ] }
  1821. categories: [ "左支腿", "右支腿" ] }
  1822. axisY: ValueAxis {
  1823. id: barY;
  1824. gridLineColor: "gray";
  1825. labelsColor: "white";
  1826. max: 400 }
  1827. BarSet {values: [ appModel.rightAngle, appModel.leftAngle ] }
  1828. // BarSet { label: "James"; values: [ 5, 8] }
  1829. }
  1830. }
  1831. }
  1832. Rectangle {
  1833. id: warning
  1834. width: radarData.width - 60
  1835. height: 50
  1836. color: popupBgColorErr
  1837. anchors.bottom: radarData.bottom
  1838. anchors.bottomMargin: 30
  1839. anchors.horizontalCenter: radarData.horizontalCenter
  1840. Text {
  1841. id: warningtxt
  1842. text: qsTr("注意保持车距")
  1843. color: '#FFFFFF'
  1844. font.family: alibaba.name
  1845. font.pointSize: 24
  1846. anchors.horizontalCenter: warning.horizontalCenter
  1847. }
  1848. visible: appModel.radar1 < radarRedRange
  1849. || appModel.radar2 < radarRedRange
  1850. || appModel.radar3 < radarRedRange
  1851. || appModel.radar4 < radarRedRange
  1852. || appModel.radar5 < radarRedRange
  1853. || appModel.radar6 < radarRedRange
  1854. }
  1855. // Rectangle {
  1856. // width: radarData.width
  1857. // height: rightPanel.height
  1858. // color: 'transparent'
  1859. // Rectangle {
  1860. // width: radarData.width - 300
  1861. // height: radarData.height
  1862. // color: 'lightblue'
  1863. // Image {
  1864. // width: 800
  1865. // height: 1200
  1866. // anchors.left: radarData.left
  1867. // fillMode: Image.Stretch
  1868. // source: 'qrc:/images/radar_car.png'
  1869. // }
  1870. // }
  1871. // }
  1872. /* Image {
  1873. width: lineWidth
  1874. height: mainHeight
  1875. anchors.right: radarData.right
  1876. fillMode: Image.Stretch
  1877. source: 'qrc:/images/border_r.png'
  1878. }
  1879. }
  1880. */
  1881. }
  1882. }
  1883. }
  1884. }