123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- import QtQuick 2.7
- import QtQuick.Window 2.2
- import gfa.plugins.qml.tivaflash 1.0
- Window {
- visible: true
- width: 640
- height: 480
- property int statNr: 1
- property int mbAddr: 100
- Rectangle {
- anchors.fill: parent
- gradient: Gradient {
- GradientStop { position: 0.0; color: "gray" }
- GradientStop { position: 0.5; color: "black" }
- GradientStop { position: 1.0; color: "dimgray" }
- }
- }
- Text {
- id: headline
- x: 250
- y: 5
- color: "white"
- font.pixelSize: 24
- text: qsTr("GfA Tiva Flash Utility")
- }
- Rectangle {
- id: line
- x: 5
- y: 40
- width: 790
- height: 2
- color: "white"
- }
- Rectangle
- {
- x: 100
- y: 75
- width: 100
- height: 40
- color: "darkred"
- Text {
- text: statNr
- anchors.centerIn: parent
- color: "white"
- }
- }
- Rectangle
- {
- x: 500
- y: 75
- width: 200
- height: 40
- color: "green"
- Text {
- text: "getMatSer"
- anchors.centerIn: parent
- color: "white"
- }
- MouseArea
- {
- anchors.fill: parent
- onClicked: idTivaFlash.getMatSer(statNr)
- }
- }
- Text {
- id: materialEepromText
- x: 500
- y: 125
- color: "white"
- font.pixelSize: 14
- text: idTivaFlash.materialEeprom[statNr]
- }
- Text {
- id: serialEepromText
- x: 500
- y: 145
- color: "white"
- font.pixelSize: 14
- text: idTivaFlash.serialEeprom[statNr]
- }
- Rectangle
- {
- x: 500
- y: 200
- width: 200
- height: 40
- color: "green"
- Text {
- text: "getTargetImgInfo"
- anchors.centerIn: parent
- color: "white"
- }
- MouseArea
- {
- anchors.fill: parent
- onClicked: idTivaFlash.getTargetImgInfo(statNr)
- }
- }
- Text {
- id: imgSizeAppText
- x: 500
- y: 250
- color: "white"
- font.pixelSize: 14
- text: idTivaFlash.imgSizeApp[statNr]
- }
- Text {
- id: imgCRC32AppText
- x: 500
- y: 270
- color: "white"
- font.pixelSize: 14
- text: idTivaFlash.imgCRC32App[statNr].toString(16)
- }
- Text {
- id: imgMaterialAppText
- x: 500
- y: 290
- color: "white"
- font.pixelSize: 14
- text: idTivaFlash.imgMaterialApp[statNr]
- }
- Text {
- id: imgBuildAppText
- x: 500
- y: 310
- color: "white"
- font.pixelSize: 14
- text: idTivaFlash.imgBuildApp[statNr]
- }
- Text {
- id: idExecOut
- x: 5
- y: 200
- width: 630
- height: 300
- color: "white"
- font.pixelSize: 14
- text: "Test"
- }
- TivaFlash {
- id: idTivaFlash
- tivaFlashUtilPath: "/opt/GfA/tivaflashutil/gfativaflashutil"
- itfName: "/dev/ttyO4"
- slvIdIsNodeAddr: false
- imgFile: "/opt/GfA/tivaflashutil/OLS-1V1_0009_crc.bin"
- verbosity: 3
- onMaterialFileChanged:
- {
- // materialEepromText.text = materialEeprom[1];
- }
- onExecOut:
- {
- idExecOut.text += msg + "\n";
- idExecOut.update();
- console.log(msg);
- }
- }
- MouseArea {
- x: 0
- y: 0
- width: 400
- height: 480
- // anchors.fill: parent
- onClicked:
- {
- // var statNr = 1;
- // var mbAddr = 100;
- var ret = false;
- idExecOut.text = "";
- ret = idTivaFlash.pingTarget(statNr);
- // ret = idTivaFlash.startBootloader(statNr, mbAddr);
- // ret = idTivaFlash.resetBootloader(statNr, mbAddr);
- // ret = idTivaFlash.validateImgFile(statNr, mbAddr);
- ret = false;
- }
- }
- }
|