Updates to the DTSC analyser - not fully complete, but still nice.

This commit is contained in:
Thulinma 2014-05-13 12:00:26 +02:00
parent 68baed4af8
commit d459a99317

View file

@ -19,9 +19,7 @@ namespace Analysers {
///\return The return code of the analyser. ///\return The return code of the analyser.
int analyseDTSC(Util::Config conf){ int analyseDTSC(Util::Config conf){
DTSC::File F(conf.getString("filename")); DTSC::File F(conf.getString("filename"));
std::stringstream meta; F.getMeta().toPrettyString(std::cout,0, 0x03);
F.getMeta().toPrettyString(meta,0, 0x03);
std::cout << meta.str() << std::endl;
int bPos = 0; int bPos = 0;
F.seek_bpos(0); F.seek_bpos(0);
@ -29,16 +27,13 @@ namespace Analysers {
JSON::Value tmp; JSON::Value tmp;
std::string tmpStr; std::string tmpStr;
while (F.getPacket()){ while (F.getPacket()){
tmpStr = std::string(F.getPacket().getData(), F.getPacket().getDataLen());
switch (F.getPacket().getVersion()){ switch (F.getPacket().getVersion()){
case DTSC::DTSC_V1: { case DTSC::DTSC_V1: {
unsigned int i = 8; std::cout << "DTSCv1 packet: " << F.getPacket().getScan().toPrettyString() << std::endl;
JSON::fromDTMI((const unsigned char*)tmpStr.data(), tmpStr.size(), i, tmp);
break; break;
} }
case DTSC::DTSC_V2: { case DTSC::DTSC_V2: {
unsigned int i = 8; std::cout << "DTSCv2 packet: " << F.getPacket().getScan().toPrettyString() << std::endl;
JSON::fromDTMI2((const unsigned char*)tmpStr.data(), tmpStr.size(), i, tmp);
break; break;
} }
default: default: