Loading PacketLib.xcodeproj/project.pbxproj +2 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ DD8A42121A95C11700565702 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; DD8A42131A95C11700565702 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = "<group>"; }; DD8A42151A95C11700565702 /* packetlib_example.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = packetlib_example.cpp; sourceTree = "<group>"; }; DD8A42161A95CE4500565702 /* rta_fadc_all.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = rta_fadc_all.xml; sourceTree = "<group>"; }; DDB3B86B18CA2F8700918955 /* ByteStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteStream.h; sourceTree = "<group>"; }; DDB3B86C18CA2F8700918955 /* ConfigurationFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigurationFile.h; sourceTree = "<group>"; }; DDB3B86D18CA2F8700918955 /* DataFieldHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataFieldHeader.h; sourceTree = "<group>"; }; Loading Loading @@ -317,6 +318,7 @@ DD8A42141A95C11700565702 /* xml */ = { isa = PBXGroup; children = ( DD8A42161A95CE4500565702 /* rta_fadc_all.xml */, DD8A42151A95C11700565702 /* packetlib_example.cpp */, ); path = xml; Loading PacketLib.xcodeproj/project.xcworkspace/xcuserdata/bulgarelli.xcuserdatad/UserInterfaceState.xcuserstate +7 B (45.8 KiB) File changed.No diff preview for this file type. View original file View changed file examples/xml/packetlib_example.cpp +10 −9 Original line number Diff line number Diff line Loading @@ -36,12 +36,12 @@ int main(int argc, char* argv[]) try { packetType = ps.getPacketType("triggered_telescope1_30GEN"); PacketLib::Field* apid = packetType->getPacketHeader()->getField("APID"); PacketLib::Field* apid = packetType->pheader()->getField("APID"); std::cout << apid->getType() << std::endl; //assert(apid->getType() == PacketLib::LogicalFieldDataType::UINT11); //assert(apid->getName().compare("APID") == 0); PacketLib::Field* arrayID = packetType->getPacketDataFieldHeader()->getField("ArrayID"); PacketLib::Field* arrayID = packetType->dfheader()->getField("ArrayID"); //assert(arrayID->getType() == PacketLib::LogicalFieldDataType::UINT16); //assert(arrayID->getName().compare("ArrayID") == 0); Loading @@ -59,23 +59,24 @@ int main(int argc, char* argv[]) PacketLib::ByteStreamPtr rawPacket = rawPackets.getNext(); PacketLib::Packet* packet = ps.getPacket(rawPacket); //PacketLib::Field* blockfield = packet->getPacketSourceDataField()->getBlock(0)->getField("FADC00"); //PacketLib::Field* blockfield = packet->sdf()->getBlock(0)->getField("FADC00"); //assert(blockfield->getType() == PacketLib::LogicalFieldDataType::UINT16); // use reflection interface to read content uint16_t apid = packet->getPacketHeader()->getFieldValue("APID"); uint16_t arrayID = packet->getPacketDataFieldHeader()->getFieldValue("ArrayID"); uint16_t npixels = packet->getPacketSourceDataField()->getFieldValue("Number of pixels"); uint16_t nsamples = packet->getPacketSourceDataField()->getFieldValue("Number of samples"); uint16_t apid = packet->pheader()->getFieldValue("APID"); uint16_t arrayID = packet->dfheader()->getFieldValue("ArrayID"); uint16_t npixels = packet->sdf()->getFieldValue("Number of pixels"); uint16_t nsamples = packet->sdf()->getFieldValue("Number of samples"); std::cout << apid << " " << arrayID << " " << npixels << " " << nsamples << std::endl; //get each single pixel as a 1-dimensional array for(unsigned int j=0; j<npixels; j++) { uint16_t* pix = (uint16_t*) packet->getPacketSourceDataField()->getBlock(j)->getByteStream()->getStream(); uint16_t* pix = (uint16_t*) packet->sdf()->getBlock(j)->getBytes(); for(uint16_t sample=0; sample<nsamples; sample++) cout << pix[sample] << " "; cout << endl; Loading @@ -85,7 +86,7 @@ int main(int argc, char* argv[]) //access to each single sample for(uint16_t pixel=0; pixel<npixels; pixel++) { for(uint16_t sample=0; sample<nsamples; sample++) { cout << packet->getPacketSourceDataField()->getBlock(pixel)->getFieldValue(sample) << " "; cout << packet->sdf()->getBlock(pixel)->getFieldValue(sample) << " "; } cout << endl; } Loading include/Packet.h +12 −0 Original line number Diff line number Diff line Loading @@ -135,15 +135,27 @@ public: ///Get the header PacketHeader* getPacketHeader(); ///Get the header PacketHeader* pheader(); ///Get the data field header DataFieldHeader* getPacketDataFieldHeader(); ///Get the data field header DataFieldHeader* dfheader(); ///Get the source data field SourceDataField* getPacketSourceDataField(); ///Get the source data field SourceDataField* sdf(); ///Get the tail PartOfPacket* getPacketTail(); ///Get the tail PartOfPacket* tail(); /// Gets the dimension in byte of the current packet (header + datafield (data field header + sdf + tail) dword size(); Loading include/PartOfPacket.h +6 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,12 @@ public: return stream; } /// Get the current array of bytes from ByteStream virtual byte* getBytes() { return stream->getStream(); } virtual void memByteStream(ByteStreamPtr stream); /// Represent current stream writes to output. Loading Loading
PacketLib.xcodeproj/project.pbxproj +2 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ DD8A42121A95C11700565702 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; DD8A42131A95C11700565702 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = "<group>"; }; DD8A42151A95C11700565702 /* packetlib_example.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = packetlib_example.cpp; sourceTree = "<group>"; }; DD8A42161A95CE4500565702 /* rta_fadc_all.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = rta_fadc_all.xml; sourceTree = "<group>"; }; DDB3B86B18CA2F8700918955 /* ByteStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteStream.h; sourceTree = "<group>"; }; DDB3B86C18CA2F8700918955 /* ConfigurationFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigurationFile.h; sourceTree = "<group>"; }; DDB3B86D18CA2F8700918955 /* DataFieldHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataFieldHeader.h; sourceTree = "<group>"; }; Loading Loading @@ -317,6 +318,7 @@ DD8A42141A95C11700565702 /* xml */ = { isa = PBXGroup; children = ( DD8A42161A95CE4500565702 /* rta_fadc_all.xml */, DD8A42151A95C11700565702 /* packetlib_example.cpp */, ); path = xml; Loading
PacketLib.xcodeproj/project.xcworkspace/xcuserdata/bulgarelli.xcuserdatad/UserInterfaceState.xcuserstate +7 B (45.8 KiB) File changed.No diff preview for this file type. View original file View changed file
examples/xml/packetlib_example.cpp +10 −9 Original line number Diff line number Diff line Loading @@ -36,12 +36,12 @@ int main(int argc, char* argv[]) try { packetType = ps.getPacketType("triggered_telescope1_30GEN"); PacketLib::Field* apid = packetType->getPacketHeader()->getField("APID"); PacketLib::Field* apid = packetType->pheader()->getField("APID"); std::cout << apid->getType() << std::endl; //assert(apid->getType() == PacketLib::LogicalFieldDataType::UINT11); //assert(apid->getName().compare("APID") == 0); PacketLib::Field* arrayID = packetType->getPacketDataFieldHeader()->getField("ArrayID"); PacketLib::Field* arrayID = packetType->dfheader()->getField("ArrayID"); //assert(arrayID->getType() == PacketLib::LogicalFieldDataType::UINT16); //assert(arrayID->getName().compare("ArrayID") == 0); Loading @@ -59,23 +59,24 @@ int main(int argc, char* argv[]) PacketLib::ByteStreamPtr rawPacket = rawPackets.getNext(); PacketLib::Packet* packet = ps.getPacket(rawPacket); //PacketLib::Field* blockfield = packet->getPacketSourceDataField()->getBlock(0)->getField("FADC00"); //PacketLib::Field* blockfield = packet->sdf()->getBlock(0)->getField("FADC00"); //assert(blockfield->getType() == PacketLib::LogicalFieldDataType::UINT16); // use reflection interface to read content uint16_t apid = packet->getPacketHeader()->getFieldValue("APID"); uint16_t arrayID = packet->getPacketDataFieldHeader()->getFieldValue("ArrayID"); uint16_t npixels = packet->getPacketSourceDataField()->getFieldValue("Number of pixels"); uint16_t nsamples = packet->getPacketSourceDataField()->getFieldValue("Number of samples"); uint16_t apid = packet->pheader()->getFieldValue("APID"); uint16_t arrayID = packet->dfheader()->getFieldValue("ArrayID"); uint16_t npixels = packet->sdf()->getFieldValue("Number of pixels"); uint16_t nsamples = packet->sdf()->getFieldValue("Number of samples"); std::cout << apid << " " << arrayID << " " << npixels << " " << nsamples << std::endl; //get each single pixel as a 1-dimensional array for(unsigned int j=0; j<npixels; j++) { uint16_t* pix = (uint16_t*) packet->getPacketSourceDataField()->getBlock(j)->getByteStream()->getStream(); uint16_t* pix = (uint16_t*) packet->sdf()->getBlock(j)->getBytes(); for(uint16_t sample=0; sample<nsamples; sample++) cout << pix[sample] << " "; cout << endl; Loading @@ -85,7 +86,7 @@ int main(int argc, char* argv[]) //access to each single sample for(uint16_t pixel=0; pixel<npixels; pixel++) { for(uint16_t sample=0; sample<nsamples; sample++) { cout << packet->getPacketSourceDataField()->getBlock(pixel)->getFieldValue(sample) << " "; cout << packet->sdf()->getBlock(pixel)->getFieldValue(sample) << " "; } cout << endl; } Loading
include/Packet.h +12 −0 Original line number Diff line number Diff line Loading @@ -135,15 +135,27 @@ public: ///Get the header PacketHeader* getPacketHeader(); ///Get the header PacketHeader* pheader(); ///Get the data field header DataFieldHeader* getPacketDataFieldHeader(); ///Get the data field header DataFieldHeader* dfheader(); ///Get the source data field SourceDataField* getPacketSourceDataField(); ///Get the source data field SourceDataField* sdf(); ///Get the tail PartOfPacket* getPacketTail(); ///Get the tail PartOfPacket* tail(); /// Gets the dimension in byte of the current packet (header + datafield (data field header + sdf + tail) dword size(); Loading
include/PartOfPacket.h +6 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,12 @@ public: return stream; } /// Get the current array of bytes from ByteStream virtual byte* getBytes() { return stream->getStream(); } virtual void memByteStream(ByteStreamPtr stream); /// Represent current stream writes to output. Loading