diff --git a/core/wizards/BenchTest.qml b/core/wizards/BenchTest.qml index 58f7bd5..9c16cd3 100644 --- a/core/wizards/BenchTest.qml +++ b/core/wizards/BenchTest.qml @@ -63,24 +63,33 @@ Item { Text { // x:10 // y:240 + + width:200 + height:30 color: "white" text: "Events Per Cycle (1-255):" } Text { //x:370 //y:240 + width:100 + height:30 color: "white" text: "Number Of Cycles (0-65535):" } Text { //x:10 //y:280 + width:100 + height:30 color: "white" text: "Ticks Per Event (0-65535):" } Text { //x:10 //y:340 + width:100 + height:30 color: "white" text: "Events to Fire From (0-255):" } @@ -279,9 +288,68 @@ Item { Text { //x:370 //y:290 + + width:200 + height:30 + color: "white" + text: "PW Source OR value (0-65535):" + } + Text { + //x:370 + //y:290 + width:100 + height:30 color: "white" text: "PW Source OR value (0-65535):" } + Text { + //x:370 + //y:290 + width:100 + height:30 + color: "white" + text: "PW Source OR value (0-65535):" + } + Text { + //x:370 + //y:290 + width:100 + height:30 + color: "white" + text: "PW Source OR value (0-65535):" + } + Text { + //x:370 + //y:290 + width:100 + height:30 + color: "white" + text: "PW Source OR value (0-65535):" + } + Text { + //x:370 + //y:290 + width:100 + height:30 + color: "white" + text: "PW Source OR value (0-65535):" + } + Text { + //x:370 + //y:290 + width:100 + height:30 + color: "white" + text: "Events remaining" + } + Text { + //x:370 + //y:290 + width:100 + height:30 + color: "white" + text: "Current Event" + } } Column { @@ -406,6 +474,40 @@ Item { } } } + Rectangle { + width: 100 + height: 30 + color: "white" + Rectangle { + x:2 + y:2 + width:96 + height:26 + color:"grey" + Text { + id: eventsRemaining + anchors.fill:parent + color:"white" + } + } + } + Rectangle { + width:100 + height:30 + color:"white" + Rectangle { + x:2 + y:2 + width:96 + height:26 + color:"grey" + Text { + id:currentEvent + anchors.fill:parent + color:"white" + } + } + } @@ -453,12 +555,19 @@ Item { a2dArray2[3] = sourcetext4.text; a2dArray2[4] = sourcetext5.text; a2dArray2[5] = sourcetext6.text; + emscomms.benchTestReply.connect(benchTestReply); emscomms.startBenchTest(eventspercycletext.text,numberofcyclestext.text,tickspereventtext.text,a2dArray,a2dArray2); } } } } } + function benchTestReply(remaining,current) + { + currentEvent.text = current; + eventsRemaining.text = remaining; + } + Rectangle { //x:210 //y:550 diff --git a/plugins/freeems/freeemscomms.cpp b/plugins/freeems/freeemscomms.cpp index b586de7..18eba12 100644 --- a/plugins/freeems/freeemscomms.cpp +++ b/plugins/freeems/freeemscomms.cpp @@ -62,6 +62,7 @@ FreeEmsComms::FreeEmsComms(QObject *parent) : EmsComms(parent) connect(m_packetDecoder,SIGNAL(firmwareVersion(QString)),this,SLOT(firmwareVersion(QString))); connect(m_packetDecoder,SIGNAL(interfaceVersion(QString)),this,SLOT(interfaceVersion(QString))); connect(m_packetDecoder,SIGNAL(operatingSystem(QString)),this,SLOT(operatingSystem(QString))); + connect(m_packetDecoder,SIGNAL(benchTestReply(unsigned short,unsigned char)),this,SIGNAL(benchTestReply(unsigned short,unsigned char))); m_lastdatalogTimer = new QTimer(this); connect(m_lastdatalogTimer,SIGNAL(timeout()),this,SLOT(datalogTimerTimeout())); diff --git a/plugins/freeems/freeemscomms.h b/plugins/freeems/freeemscomms.h index 07b82d0..ab521c7 100644 --- a/plugins/freeems/freeemscomms.h +++ b/plugins/freeems/freeemscomms.h @@ -201,6 +201,7 @@ class FreeEmsComms : public EmsComms void configRecieved(ConfigBlock,QVariant); void memoryDirty(); void memoryClean(); + void benchTestReply(unsigned short countRemaining,unsigned char currentEvent); public slots: int updateBlockInRam(unsigned short location,unsigned short offset, unsigned short size,QByteArray data); int updateBlockInFlash(unsigned short location,unsigned short offset, unsigned short size,QByteArray data); diff --git a/plugins/freeems/packetdecoder.cpp b/plugins/freeems/packetdecoder.cpp index 54d8474..9ff3a04 100644 --- a/plugins/freeems/packetdecoder.cpp +++ b/plugins/freeems/packetdecoder.cpp @@ -415,6 +415,21 @@ void PacketDecoder::parsePacket(Packet parsedPacket) emit ramBlockUpdatePacket(parsedPacket.header,parsedPacket.payload); } } + else if (payloadid == BENCHTEST+1) + { + if (!parsedPacket.isNAK) + { + if (parsedPacket.payload.size() == 3) + { + unsigned short count = 0; + count += ((unsigned char)parsedPacket.payload.at(0)) << 8; + count += ((unsigned char)parsedPacket.payload.at(1)); + unsigned char event = 0; + event = ((unsigned char)parsedPacket.payload.at(2)); + emit benchTestReply(count,event); + } + } + } else { emit unknownPacket(parsedPacket.header,parsedPacket.payload); diff --git a/plugins/freeems/packetdecoder.h b/plugins/freeems/packetdecoder.h index 50f6ca9..7be3c22 100644 --- a/plugins/freeems/packetdecoder.h +++ b/plugins/freeems/packetdecoder.h @@ -34,6 +34,7 @@ public slots: void locationIdInfo(MemoryLocationInfo info); void flashBlockUpdatePacket(QByteArray header,QByteArray payload); void ramBlockUpdatePacket(QByteArray header,QByteArray payload); + void benchTestReply(unsigned short countRemaining,unsigned char currentEvent); }; #endif // PACKETDECODER_H