main.qml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. import QtQuick 2.7
  2. import QtQuick.Window 2.2
  3. import gfa.plugins.qml.tivaflash 1.0
  4. Window {
  5. visible: true
  6. width: 640
  7. height: 480
  8. property int statNr: 1
  9. property int mbAddr: 100
  10. Rectangle {
  11. anchors.fill: parent
  12. gradient: Gradient {
  13. GradientStop { position: 0.0; color: "gray" }
  14. GradientStop { position: 0.5; color: "black" }
  15. GradientStop { position: 1.0; color: "dimgray" }
  16. }
  17. }
  18. Text {
  19. id: headline
  20. x: 250
  21. y: 5
  22. color: "white"
  23. font.pixelSize: 24
  24. text: qsTr("GfA Tiva Flash Utility")
  25. }
  26. Rectangle {
  27. id: line
  28. x: 5
  29. y: 40
  30. width: 790
  31. height: 2
  32. color: "white"
  33. }
  34. Rectangle
  35. {
  36. x: 100
  37. y: 75
  38. width: 100
  39. height: 40
  40. color: "darkred"
  41. Text {
  42. text: statNr
  43. anchors.centerIn: parent
  44. color: "white"
  45. }
  46. }
  47. Rectangle
  48. {
  49. x: 500
  50. y: 75
  51. width: 200
  52. height: 40
  53. color: "green"
  54. Text {
  55. text: "getMatSer"
  56. anchors.centerIn: parent
  57. color: "white"
  58. }
  59. MouseArea
  60. {
  61. anchors.fill: parent
  62. onClicked: idTivaFlash.getMatSer(statNr)
  63. }
  64. }
  65. Text {
  66. id: materialEepromText
  67. x: 500
  68. y: 125
  69. color: "white"
  70. font.pixelSize: 14
  71. text: idTivaFlash.materialEeprom[statNr]
  72. }
  73. Text {
  74. id: serialEepromText
  75. x: 500
  76. y: 145
  77. color: "white"
  78. font.pixelSize: 14
  79. text: idTivaFlash.serialEeprom[statNr]
  80. }
  81. Rectangle
  82. {
  83. x: 500
  84. y: 200
  85. width: 200
  86. height: 40
  87. color: "green"
  88. Text {
  89. text: "getTargetImgInfo"
  90. anchors.centerIn: parent
  91. color: "white"
  92. }
  93. MouseArea
  94. {
  95. anchors.fill: parent
  96. onClicked: idTivaFlash.getTargetImgInfo(statNr)
  97. }
  98. }
  99. Text {
  100. id: imgSizeAppText
  101. x: 500
  102. y: 250
  103. color: "white"
  104. font.pixelSize: 14
  105. text: idTivaFlash.imgSizeApp[statNr]
  106. }
  107. Text {
  108. id: imgCRC32AppText
  109. x: 500
  110. y: 270
  111. color: "white"
  112. font.pixelSize: 14
  113. text: idTivaFlash.imgCRC32App[statNr].toString(16)
  114. }
  115. Text {
  116. id: imgMaterialAppText
  117. x: 500
  118. y: 290
  119. color: "white"
  120. font.pixelSize: 14
  121. text: idTivaFlash.imgMaterialApp[statNr]
  122. }
  123. Text {
  124. id: imgBuildAppText
  125. x: 500
  126. y: 310
  127. color: "white"
  128. font.pixelSize: 14
  129. text: idTivaFlash.imgBuildApp[statNr]
  130. }
  131. Text {
  132. id: idExecOut
  133. x: 5
  134. y: 200
  135. width: 630
  136. height: 300
  137. color: "white"
  138. font.pixelSize: 14
  139. text: "Test"
  140. }
  141. TivaFlash {
  142. id: idTivaFlash
  143. tivaFlashUtilPath: "/opt/GfA/tivaflashutil/gfativaflashutil"
  144. itfName: "/dev/ttyO4"
  145. slvIdIsNodeAddr: false
  146. imgFile: "/opt/GfA/tivaflashutil/OLS-1V1_0009_crc.bin"
  147. verbosity: 3
  148. onMaterialFileChanged:
  149. {
  150. // materialEepromText.text = materialEeprom[1];
  151. }
  152. onExecOut:
  153. {
  154. idExecOut.text += msg + "\n";
  155. idExecOut.update();
  156. console.log(msg);
  157. }
  158. }
  159. MouseArea {
  160. x: 0
  161. y: 0
  162. width: 400
  163. height: 480
  164. // anchors.fill: parent
  165. onClicked:
  166. {
  167. // var statNr = 1;
  168. // var mbAddr = 100;
  169. var ret = false;
  170. idExecOut.text = "";
  171. ret = idTivaFlash.pingTarget(statNr);
  172. // ret = idTivaFlash.startBootloader(statNr, mbAddr);
  173. // ret = idTivaFlash.resetBootloader(statNr, mbAddr);
  174. // ret = idTivaFlash.validateImgFile(statNr, mbAddr);
  175. ret = false;
  176. }
  177. }
  178. }