Skip to content

Commit

Permalink
Parsing and display of benchtest reply in the bench test qml, which d…
Browse files Browse the repository at this point in the history
…isplays the remaining events, and current event on a stopBenchTest request.
  • Loading branch information
malcom2073 committed Mar 11, 2014
1 parent 6d59bd4 commit b76f49d
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
109 changes: 109 additions & 0 deletions core/wizards/BenchTest.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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):"
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
}
}
}



Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions plugins/freeems/freeemscomms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
1 change: 1 addition & 0 deletions plugins/freeems/freeemscomms.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions plugins/freeems/packetdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions plugins/freeems/packetdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b76f49d

Please sign in to comment.