main.qml 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. import QtQuick 2.7
  2. import QtQuick.Window 2.2
  3. import QtQuick.Controls 1.4
  4. import com.gfa.ipc.appctrl 1.0
  5. Window {
  6. visible: true
  7. width: 640
  8. height: 480
  9. title: qsTr("GfA App Control")
  10. function stateColor(state)
  11. {
  12. switch(state)
  13. {
  14. case QGfaAppCtrl.STATE_RUNNING:
  15. return "lightgreen";
  16. case QGfaAppCtrl.STATE_PAUSED:
  17. return "lightgrey";
  18. case QGfaAppCtrl.STATE_HANGING:
  19. return "red";
  20. default:
  21. return "white";
  22. }
  23. }
  24. function sec2HMS(sec)
  25. {
  26. var h = parseInt(sec / 3600);
  27. sec -= h * 3600;
  28. var m = parseInt(sec / 60);
  29. sec -= m * 60;
  30. return "" + h + (m < 10 ? ":0" : ":") + m + (sec < 10 ? ":0" : ":") + sec;
  31. }
  32. Rectangle {
  33. x: 10
  34. y: 20
  35. width: 120
  36. height: 460
  37. Rectangle {
  38. x: 0
  39. y: 40
  40. width: parent.width
  41. height: 30
  42. Text {
  43. font.pixelSize: 14
  44. font.italic: true
  45. anchors.verticalCenter: parent.verticalCenter
  46. anchors.left: parent.left
  47. text: "State:"
  48. }
  49. }
  50. Rectangle {
  51. x: 0
  52. y: 70
  53. width: parent.width
  54. height: 30
  55. Text {
  56. font.pixelSize: 14
  57. font.italic: true
  58. anchors.verticalCenter: parent.verticalCenter
  59. anchors.left: parent.left
  60. text: "Cyc. min. μs:"
  61. }
  62. }
  63. Rectangle {
  64. x: 0
  65. y: 100
  66. width: parent.width
  67. height: 30
  68. Text {
  69. font.pixelSize: 14
  70. font.italic: true
  71. anchors.verticalCenter: parent.verticalCenter
  72. anchors.left: parent.left
  73. text: "Cyc. max. μs:"
  74. }
  75. }
  76. Rectangle {
  77. x: 0
  78. y: 130
  79. width: parent.width
  80. height: 30
  81. Text {
  82. font.pixelSize: 14
  83. font.italic: true
  84. anchors.verticalCenter: parent.verticalCenter
  85. anchors.left: parent.left
  86. text: "Cyc. cur. μs:"
  87. }
  88. }
  89. Rectangle {
  90. x: 0
  91. y: 160
  92. width: parent.width
  93. height: 30
  94. Text {
  95. font.pixelSize: 14
  96. font.italic: true
  97. anchors.verticalCenter: parent.verticalCenter
  98. anchors.left: parent.left
  99. text: "CPU Time sec.:"
  100. }
  101. }
  102. Rectangle {
  103. x: 0
  104. y: 190
  105. width: parent.width
  106. height: 30
  107. Text {
  108. font.pixelSize: 14
  109. font.italic: true
  110. anchors.verticalCenter: parent.verticalCenter
  111. anchors.left: parent.left
  112. text: "CPU avg. %:"
  113. }
  114. }
  115. Rectangle {
  116. x: 0
  117. y: 220
  118. width: parent.width
  119. height: 30
  120. Text {
  121. font.pixelSize: 14
  122. font.italic: true
  123. anchors.verticalCenter: parent.verticalCenter
  124. anchors.left: parent.left
  125. text: "CPU cur. %:"
  126. }
  127. }
  128. Rectangle {
  129. x: 0
  130. y: 250
  131. width: parent.width
  132. height: 30
  133. Text {
  134. font.pixelSize: 14
  135. font.italic: true
  136. anchors.verticalCenter: parent.verticalCenter
  137. anchors.left: parent.left
  138. text: "Uptime H:M:S:"
  139. }
  140. }
  141. Rectangle {
  142. x: 0
  143. y: 280
  144. width: parent.width
  145. height: 30
  146. Text {
  147. font.pixelSize: 14
  148. font.italic: true
  149. anchors.verticalCenter: parent.verticalCenter
  150. anchors.left: parent.left
  151. text: "</Ø pass μs"
  152. }
  153. }
  154. Rectangle {
  155. x: 0
  156. y: 330
  157. height: 30
  158. width: parent.width
  159. border.width: 1
  160. border.color: "lightgrey"
  161. radius: 5
  162. Text {
  163. font.pixelSize: 14
  164. anchors.centerIn: parent
  165. text: qGfaAppCtrl.minPass
  166. }
  167. }
  168. Rectangle {
  169. x: 0
  170. y: 370
  171. height: 30
  172. width: parent.width
  173. border.width: 1
  174. border.color: "black"
  175. radius: 5
  176. Text {
  177. font.pixelSize: 14
  178. anchors.centerIn: parent
  179. text: qGfaAppCtrl.avgPass
  180. }
  181. }
  182. Rectangle {
  183. x: 0
  184. y: 410
  185. height: 30
  186. width: parent.width
  187. Button {
  188. text: "Exit"
  189. anchors.fill: parent
  190. onClicked: Qt.quit()
  191. }
  192. }
  193. }
  194. /////////////////////////////////////////////////////////////////////////////////////////////////
  195. Rectangle {
  196. x: 140
  197. y: 20
  198. width: 120
  199. height: 460
  200. property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_REMANENT]
  201. Rectangle {
  202. x: 0
  203. y: 0
  204. width: parent.width
  205. height: 30
  206. Text {
  207. font.pixelSize: 18
  208. font.bold: true
  209. anchors.centerIn: parent
  210. text: parent.parent.appInfo.name
  211. }
  212. }
  213. Rectangle {
  214. x: 0
  215. y: 40
  216. width: parent.width
  217. height: 30
  218. border.width: 1
  219. border.color: "lightgrey"
  220. radius: 5
  221. color: stateColor(parent.appInfo.state)
  222. Text {
  223. font.pixelSize: 14
  224. font.bold: true
  225. anchors.centerIn: parent
  226. text: parent.parent.appInfo.stateText
  227. }
  228. }
  229. Rectangle {
  230. x: 0
  231. y: 70
  232. width: parent.width
  233. height: 30
  234. border.width: 1
  235. border.color: "lightgrey"
  236. radius: 5
  237. Text {
  238. font.pixelSize: 14
  239. anchors.centerIn: parent
  240. text: parent.parent.appInfo.cycMin
  241. }
  242. }
  243. Rectangle {
  244. x: 0
  245. y: 100
  246. width: parent.width
  247. height: 30
  248. border.width: 1
  249. border.color: "lightgrey"
  250. radius: 5
  251. Text {
  252. font.pixelSize: 14
  253. anchors.centerIn: parent
  254. text: parent.parent.appInfo.cycMax
  255. }
  256. }
  257. Rectangle {
  258. x: 0
  259. y: 130
  260. width: parent.width
  261. height: 30
  262. border.width: 1
  263. border.color: "black"
  264. radius: 5
  265. Text {
  266. font.pixelSize: 14
  267. anchors.centerIn: parent
  268. text: parent.parent.appInfo.cycCur
  269. }
  270. }
  271. Rectangle {
  272. x: 0
  273. y: 160
  274. width: parent.width
  275. height: 30
  276. border.width: 1
  277. border.color: "lightgrey"
  278. radius: 5
  279. Text {
  280. font.pixelSize: 14
  281. anchors.centerIn: parent
  282. text: parent.parent.appInfo.cpuTime.toFixed(1)
  283. }
  284. }
  285. Rectangle {
  286. x: 0
  287. y: 190
  288. width: parent.width
  289. height: 30
  290. border.width: 1
  291. border.color: "lightgrey"
  292. radius: 5
  293. Text {
  294. font.pixelSize: 14
  295. anchors.centerIn: parent
  296. text: parent.parent.appInfo.cpuAvg.toFixed(2)
  297. }
  298. }
  299. Rectangle {
  300. x: 0
  301. y: 220
  302. width: parent.width
  303. height: 30
  304. border.width: 1
  305. border.color: "lightgrey"
  306. radius: 5
  307. Text {
  308. font.pixelSize: 14
  309. anchors.centerIn: parent
  310. text: parent.parent.appInfo.cpuCur.toFixed(2)
  311. }
  312. }
  313. Rectangle {
  314. x: 0
  315. y: 250
  316. width: parent.width
  317. height: 30
  318. border.width: 1
  319. border.color: "lightgrey"
  320. radius: 5
  321. Text {
  322. font.pixelSize: 14
  323. anchors.centerIn: parent
  324. text: sec2HMS(parent.parent.appInfo.upTime)
  325. }
  326. }
  327. Rectangle {
  328. x: 0
  329. y: 330
  330. height: 30
  331. width: parent.width
  332. Button {
  333. text: "Pause"
  334. anchors.fill: parent
  335. onClicked: parent.parent.appInfo.pause()
  336. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_PAUSED)
  337. }
  338. }
  339. Rectangle {
  340. x: 0
  341. y: 370
  342. height: 30
  343. width: parent.width
  344. Button {
  345. text: "Resume"
  346. anchors.fill: parent
  347. onClicked: parent.parent.appInfo.resume()
  348. enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED)
  349. }
  350. }
  351. Rectangle {
  352. x: 0
  353. y: 410
  354. height: 30
  355. width: parent.width
  356. Button {
  357. text: "Stop"
  358. anchors.fill: parent
  359. onClicked: parent.parent.appInfo.stop()
  360. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING)
  361. }
  362. }
  363. }
  364. /////////////////////////////////////////////////////////////////////////////////////////////////
  365. Rectangle {
  366. x: 270
  367. y: 20
  368. width: 120
  369. height: 460
  370. property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_MQTTCL]
  371. Rectangle {
  372. x: 0
  373. y: 0
  374. width: parent.width
  375. height: 30
  376. Text {
  377. font.pixelSize: 18
  378. font.bold: true
  379. anchors.centerIn: parent
  380. text: parent.parent.appInfo.name
  381. }
  382. }
  383. Rectangle {
  384. x: 0
  385. y: 40
  386. width: parent.width
  387. height: 30
  388. border.width: 1
  389. border.color: "lightgrey"
  390. radius: 5
  391. color: stateColor(parent.appInfo.state)
  392. Text {
  393. font.pixelSize: 14
  394. font.bold: true
  395. anchors.centerIn: parent
  396. text: parent.parent.appInfo.stateText
  397. }
  398. }
  399. Rectangle {
  400. x: 0
  401. y: 70
  402. width: parent.width
  403. height: 30
  404. border.width: 1
  405. border.color: "lightgrey"
  406. radius: 5
  407. Text {
  408. font.pixelSize: 14
  409. anchors.centerIn: parent
  410. text: parent.parent.appInfo.cycMin
  411. }
  412. }
  413. Rectangle {
  414. x: 0
  415. y: 100
  416. width: parent.width
  417. height: 30
  418. border.width: 1
  419. border.color: "lightgrey"
  420. radius: 5
  421. Text {
  422. font.pixelSize: 14
  423. anchors.centerIn: parent
  424. text: parent.parent.appInfo.cycMax
  425. }
  426. }
  427. Rectangle {
  428. x: 0
  429. y: 130
  430. width: parent.width
  431. height: 30
  432. border.width: 1
  433. border.color: "black"
  434. radius: 5
  435. Text {
  436. font.pixelSize: 14
  437. anchors.centerIn: parent
  438. text: parent.parent.appInfo.cycCur
  439. }
  440. }
  441. Rectangle {
  442. x: 0
  443. y: 160
  444. width: parent.width
  445. height: 30
  446. border.width: 1
  447. border.color: "lightgrey"
  448. radius: 5
  449. Text {
  450. font.pixelSize: 14
  451. anchors.centerIn: parent
  452. text: parent.parent.appInfo.cpuTime.toFixed(1)
  453. }
  454. }
  455. Rectangle {
  456. x: 0
  457. y: 190
  458. width: parent.width
  459. height: 30
  460. border.width: 1
  461. border.color: "lightgrey"
  462. radius: 5
  463. Text {
  464. font.pixelSize: 14
  465. anchors.centerIn: parent
  466. text: parent.parent.appInfo.cpuAvg.toFixed(2)
  467. }
  468. }
  469. Rectangle {
  470. x: 0
  471. y: 220
  472. width: parent.width
  473. height: 30
  474. border.width: 1
  475. border.color: "lightgrey"
  476. radius: 5
  477. Text {
  478. font.pixelSize: 14
  479. anchors.centerIn: parent
  480. text: parent.parent.appInfo.cpuCur.toFixed(2)
  481. }
  482. }
  483. Rectangle {
  484. x: 0
  485. y: 250
  486. width: parent.width
  487. height: 30
  488. border.width: 1
  489. border.color: "lightgrey"
  490. radius: 5
  491. Text {
  492. font.pixelSize: 14
  493. anchors.centerIn: parent
  494. text: sec2HMS(parent.parent.appInfo.upTime)
  495. }
  496. }
  497. Rectangle {
  498. x: 0
  499. y: 330
  500. height: 30
  501. width: parent.width
  502. Button {
  503. text: "Pause"
  504. anchors.fill: parent
  505. onClicked: parent.parent.appInfo.pause()
  506. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_PAUSED)
  507. }
  508. }
  509. Rectangle {
  510. x: 0
  511. y: 370
  512. height: 30
  513. width: parent.width
  514. Button {
  515. text: "Resume"
  516. anchors.fill: parent
  517. onClicked: parent.parent.appInfo.resume()
  518. enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED)
  519. }
  520. }
  521. Rectangle {
  522. x: 0
  523. y: 410
  524. height: 30
  525. width: parent.width
  526. Button {
  527. text: "Stop"
  528. anchors.fill: parent
  529. onClicked: parent.parent.appInfo.stop()
  530. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING)
  531. }
  532. }
  533. }
  534. /////////////////////////////////////////////////////////////////////////////////////////////////
  535. Rectangle {
  536. x: 400
  537. y: 20
  538. width: 120
  539. height: 460
  540. property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_REST]
  541. Rectangle {
  542. x: 0
  543. y: 0
  544. width: parent.width
  545. height: 30
  546. Text {
  547. font.pixelSize: 18
  548. font.bold: true
  549. anchors.centerIn: parent
  550. text: parent.parent.appInfo.name
  551. }
  552. }
  553. Rectangle {
  554. x: 0
  555. y: 40
  556. width: parent.width
  557. height: 30
  558. border.width: 1
  559. border.color: "lightgrey"
  560. radius: 5
  561. color: stateColor(parent.appInfo.state)
  562. Text {
  563. font.pixelSize: 14
  564. font.bold: true
  565. anchors.centerIn: parent
  566. text: parent.parent.appInfo.stateText
  567. }
  568. }
  569. Rectangle {
  570. x: 0
  571. y: 70
  572. width: parent.width
  573. height: 30
  574. border.width: 1
  575. border.color: "lightgrey"
  576. radius: 5
  577. Text {
  578. font.pixelSize: 14
  579. anchors.centerIn: parent
  580. text: parent.parent.appInfo.cycMin
  581. }
  582. }
  583. Rectangle {
  584. x: 0
  585. y: 100
  586. width: parent.width
  587. height: 30
  588. border.width: 1
  589. border.color: "lightgrey"
  590. radius: 5
  591. Text {
  592. font.pixelSize: 14
  593. anchors.centerIn: parent
  594. text: parent.parent.appInfo.cycMax
  595. }
  596. }
  597. Rectangle {
  598. x: 0
  599. y: 130
  600. width: parent.width
  601. height: 30
  602. border.width: 1
  603. border.color: "black"
  604. radius: 5
  605. Text {
  606. font.pixelSize: 14
  607. anchors.centerIn: parent
  608. text: parent.parent.appInfo.cycCur
  609. }
  610. }
  611. Rectangle {
  612. x: 0
  613. y: 160
  614. width: parent.width
  615. height: 30
  616. border.width: 1
  617. border.color: "lightgrey"
  618. radius: 5
  619. Text {
  620. font.pixelSize: 14
  621. anchors.centerIn: parent
  622. text: parent.parent.appInfo.cpuTime.toFixed(1)
  623. }
  624. }
  625. Rectangle {
  626. x: 0
  627. y: 190
  628. width: parent.width
  629. height: 30
  630. border.width: 1
  631. border.color: "lightgrey"
  632. radius: 5
  633. Text {
  634. font.pixelSize: 14
  635. anchors.centerIn: parent
  636. text: parent.parent.appInfo.cpuAvg.toFixed(2)
  637. }
  638. }
  639. Rectangle {
  640. x: 0
  641. y: 220
  642. width: parent.width
  643. height: 30
  644. border.width: 1
  645. border.color: "lightgrey"
  646. radius: 5
  647. Text {
  648. font.pixelSize: 14
  649. anchors.centerIn: parent
  650. text: parent.parent.appInfo.cpuCur.toFixed(2)
  651. }
  652. }
  653. Rectangle {
  654. x: 0
  655. y: 250
  656. width: parent.width
  657. height: 30
  658. border.width: 1
  659. border.color: "lightgrey"
  660. radius: 5
  661. Text {
  662. font.pixelSize: 14
  663. anchors.centerIn: parent
  664. text: sec2HMS(parent.parent.appInfo.upTime)
  665. }
  666. }
  667. Rectangle {
  668. x: 0
  669. y: 330
  670. height: 30
  671. width: parent.width
  672. Button {
  673. text: "Pause"
  674. anchors.fill: parent
  675. onClicked: parent.parent.appInfo.pause()
  676. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_PAUSED)
  677. }
  678. }
  679. Rectangle {
  680. x: 0
  681. y: 370
  682. height: 30
  683. width: parent.width
  684. Button {
  685. text: "Resume"
  686. anchors.fill: parent
  687. onClicked: parent.parent.appInfo.resume()
  688. enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED)
  689. }
  690. }
  691. Rectangle {
  692. x: 0
  693. y: 410
  694. height: 30
  695. width: parent.width
  696. Button {
  697. text: "Stop"
  698. anchors.fill: parent
  699. onClicked: parent.parent.appInfo.stop()
  700. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING)
  701. }
  702. }
  703. }
  704. /////////////////////////////////////////////////////////////////////////////////////////////////
  705. Rectangle {
  706. x: 530
  707. y: 20
  708. width: 120
  709. height: 460
  710. property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_DATALOGGER]
  711. Rectangle {
  712. x: 0
  713. y: 0
  714. width: parent.width
  715. height: 30
  716. Text {
  717. font.pixelSize: 18
  718. font.bold: true
  719. anchors.centerIn: parent
  720. text: parent.parent.appInfo.name
  721. }
  722. }
  723. Rectangle {
  724. x: 0
  725. y: 40
  726. width: parent.width
  727. height: 30
  728. border.width: 1
  729. border.color: "lightgrey"
  730. radius: 5
  731. color: stateColor(parent.appInfo.state)
  732. Text {
  733. font.pixelSize: 14
  734. font.bold: true
  735. anchors.centerIn: parent
  736. text: parent.parent.appInfo.stateText
  737. }
  738. }
  739. Rectangle {
  740. x: 0
  741. y: 70
  742. width: parent.width
  743. height: 30
  744. border.width: 1
  745. border.color: "lightgrey"
  746. radius: 5
  747. Text {
  748. font.pixelSize: 14
  749. anchors.centerIn: parent
  750. text: parent.parent.appInfo.cycMin
  751. }
  752. }
  753. Rectangle {
  754. x: 0
  755. y: 100
  756. width: parent.width
  757. height: 30
  758. border.width: 1
  759. border.color: "lightgrey"
  760. radius: 5
  761. Text {
  762. font.pixelSize: 14
  763. anchors.centerIn: parent
  764. text: parent.parent.appInfo.cycMax
  765. }
  766. }
  767. Rectangle {
  768. x: 0
  769. y: 130
  770. width: parent.width
  771. height: 30
  772. border.width: 1
  773. border.color: "black"
  774. radius: 5
  775. Text {
  776. font.pixelSize: 14
  777. anchors.centerIn: parent
  778. text: parent.parent.appInfo.cycCur
  779. }
  780. }
  781. Rectangle {
  782. x: 0
  783. y: 160
  784. width: parent.width
  785. height: 30
  786. border.width: 1
  787. border.color: "lightgrey"
  788. radius: 5
  789. Text {
  790. font.pixelSize: 14
  791. anchors.centerIn: parent
  792. text: parent.parent.appInfo.cpuTime.toFixed(1)
  793. }
  794. }
  795. Rectangle {
  796. x: 0
  797. y: 190
  798. width: parent.width
  799. height: 30
  800. border.width: 1
  801. border.color: "lightgrey"
  802. radius: 5
  803. Text {
  804. font.pixelSize: 14
  805. anchors.centerIn: parent
  806. text: parent.parent.appInfo.cpuAvg.toFixed(2)
  807. }
  808. }
  809. Rectangle {
  810. x: 0
  811. y: 220
  812. width: parent.width
  813. height: 30
  814. border.width: 1
  815. border.color: "lightgrey"
  816. radius: 5
  817. Text {
  818. font.pixelSize: 14
  819. anchors.centerIn: parent
  820. text: parent.parent.appInfo.cpuCur.toFixed(2)
  821. }
  822. }
  823. Rectangle {
  824. x: 0
  825. y: 250
  826. width: parent.width
  827. height: 30
  828. border.width: 1
  829. border.color: "lightgrey"
  830. radius: 5
  831. Text {
  832. font.pixelSize: 14
  833. anchors.centerIn: parent
  834. text: sec2HMS(parent.parent.appInfo.upTime)
  835. }
  836. }
  837. Rectangle {
  838. x: 0
  839. y: 330
  840. height: 30
  841. width: parent.width
  842. Button {
  843. text: "Pause"
  844. anchors.fill: parent
  845. onClicked: parent.parent.appInfo.pause()
  846. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_PAUSED)
  847. }
  848. }
  849. Rectangle {
  850. x: 0
  851. y: 370
  852. height: 30
  853. width: parent.width
  854. Button {
  855. text: "Resume"
  856. anchors.fill: parent
  857. onClicked: parent.parent.appInfo.resume()
  858. enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED)
  859. }
  860. }
  861. Rectangle {
  862. x: 0
  863. y: 410
  864. height: 30
  865. width: parent.width
  866. Button {
  867. text: "Stop"
  868. anchors.fill: parent
  869. onClicked: parent.parent.appInfo.stop()
  870. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING)
  871. }
  872. }
  873. }
  874. /////////////////////////////////////////////////////////////////////////////////////////////////
  875. Rectangle {
  876. x: 660
  877. y: 20
  878. width: 120
  879. height: 460
  880. property var appInfo: qGfaAppCtrl.appInfo[QGfaAppCtrl.APP_INDEX_SUMMARIST]
  881. Rectangle {
  882. x: 0
  883. y: 0
  884. width: parent.width
  885. height: 30
  886. Text {
  887. font.pixelSize: 18
  888. font.bold: true
  889. anchors.centerIn: parent
  890. text: parent.parent.appInfo.name
  891. }
  892. }
  893. Rectangle {
  894. x: 0
  895. y: 40
  896. width: parent.width
  897. height: 30
  898. border.width: 1
  899. border.color: "lightgrey"
  900. radius: 5
  901. color: stateColor(parent.appInfo.state)
  902. Text {
  903. font.pixelSize: 14
  904. font.bold: true
  905. anchors.centerIn: parent
  906. text: parent.parent.appInfo.stateText
  907. }
  908. }
  909. Rectangle {
  910. x: 0
  911. y: 70
  912. width: parent.width
  913. height: 30
  914. border.width: 1
  915. border.color: "lightgrey"
  916. radius: 5
  917. Text {
  918. font.pixelSize: 14
  919. anchors.centerIn: parent
  920. text: parent.parent.appInfo.cycMin
  921. }
  922. }
  923. Rectangle {
  924. x: 0
  925. y: 100
  926. width: parent.width
  927. height: 30
  928. border.width: 1
  929. border.color: "lightgrey"
  930. radius: 5
  931. Text {
  932. font.pixelSize: 14
  933. anchors.centerIn: parent
  934. text: parent.parent.appInfo.cycMax
  935. }
  936. }
  937. Rectangle {
  938. x: 0
  939. y: 130
  940. width: parent.width
  941. height: 30
  942. border.width: 1
  943. border.color: "black"
  944. radius: 5
  945. Text {
  946. font.pixelSize: 14
  947. anchors.centerIn: parent
  948. text: parent.parent.appInfo.cycCur
  949. }
  950. }
  951. Rectangle {
  952. x: 0
  953. y: 160
  954. width: parent.width
  955. height: 30
  956. border.width: 1
  957. border.color: "lightgrey"
  958. radius: 5
  959. Text {
  960. font.pixelSize: 14
  961. anchors.centerIn: parent
  962. text: parent.parent.appInfo.cpuTime.toFixed(1)
  963. }
  964. }
  965. Rectangle {
  966. x: 0
  967. y: 190
  968. width: parent.width
  969. height: 30
  970. border.width: 1
  971. border.color: "lightgrey"
  972. radius: 5
  973. Text {
  974. font.pixelSize: 14
  975. anchors.centerIn: parent
  976. text: parent.parent.appInfo.cpuAvg.toFixed(2)
  977. }
  978. }
  979. Rectangle {
  980. x: 0
  981. y: 220
  982. width: parent.width
  983. height: 30
  984. border.width: 1
  985. border.color: "lightgrey"
  986. radius: 5
  987. Text {
  988. font.pixelSize: 14
  989. anchors.centerIn: parent
  990. text: parent.parent.appInfo.cpuCur.toFixed(2)
  991. }
  992. }
  993. Rectangle {
  994. x: 0
  995. y: 250
  996. width: parent.width
  997. height: 30
  998. border.width: 1
  999. border.color: "lightgrey"
  1000. radius: 5
  1001. Text {
  1002. font.pixelSize: 14
  1003. anchors.centerIn: parent
  1004. text: sec2HMS(parent.parent.appInfo.upTime)
  1005. }
  1006. }
  1007. Rectangle {
  1008. x: 0
  1009. y: 330
  1010. height: 30
  1011. width: parent.width
  1012. Button {
  1013. text: "Pause"
  1014. anchors.fill: parent
  1015. onClicked: parent.parent.appInfo.pause()
  1016. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING) && (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_PAUSED)
  1017. }
  1018. }
  1019. Rectangle {
  1020. x: 0
  1021. y: 370
  1022. height: 30
  1023. width: parent.width
  1024. Button {
  1025. text: "Resume"
  1026. anchors.fill: parent
  1027. onClicked: parent.parent.appInfo.resume()
  1028. enabled: (parent.parent.appInfo.state === QGfaAppCtrl.STATE_PAUSED)
  1029. }
  1030. }
  1031. Rectangle {
  1032. x: 0
  1033. y: 410
  1034. height: 30
  1035. width: parent.width
  1036. Button {
  1037. text: "Stop"
  1038. anchors.fill: parent
  1039. onClicked: parent.parent.appInfo.stop()
  1040. enabled: (parent.parent.appInfo.state !== QGfaAppCtrl.STATE_NOT_RUNNING)
  1041. }
  1042. }
  1043. }
  1044. }