diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a844c4..4cc25d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,13 +12,13 @@ daq_setup_environment() find_package(appfwk REQUIRED) find_package(logging REQUIRED) -find_package(dataformats REQUIRED) +find_package(detdataformats REQUIRED) find_package(readout REQUIRED) daq_codegen(sspcardreader.jsonnet TEMPLATES Structs.hpp.j2 Nljs.hpp.j2 ) daq_codegen( *info.jsonnet DEP_PKGS opmonlib TEMPLATES opmonlib/InfoStructs.hpp.j2 opmonlib/InfoNljs.hpp.j2 ) -set(DUNEDAQ_DEPENDENCIES readout::readout dataformats::dataformats) +set(DUNEDAQ_DEPENDENCIES appfwk::appfwk readout::readout detdataformats::detdataformats) # Provide override functionality for SSP dependencies #option(WITH_FTD2XX_AS_PACKAGE "SSP external (ftd2xx) as a dunedaq package" OFF) @@ -37,7 +37,7 @@ set(DUNEDAQ_DEPENDENCIES readout::readout dataformats::dataformats) # Note that when the ers library is linked in, it uses a "::" because # it's in an external package, not a local CMake target. The semantics # are :: -daq_add_library(anlBoard/*.cxx SSPCardWrapper.cpp LINK_LIBRARIES appfwk::appfwk ${SSP_DEPENDENCIES} ${DUNEDAQ_DEPENDENCIES}) +daq_add_library(anlBoard/*.cxx SSPCardWrapper.cpp LINK_LIBRARIES ${SSP_DEPENDENCIES} ${DUNEDAQ_DEPENDENCIES}) #daq_add_library(IntPrinter.cpp LINK_LIBRARIES ers::ers) #if(WITH_FTD2XX_AS_PACKAGE) @@ -51,7 +51,7 @@ daq_add_library(anlBoard/*.cxx SSPCardWrapper.cpp LINK_LIBRARIES appfwk::appfwk #daq_add_python_bindings(ssp_wrapper.cpp LINK_LIBRARIES ${PROJECT_NAME}) ############################################################################## -daq_add_plugin(SSPCardReader duneDAQModule LINK_LIBRARIES appfwk::appfwk sspmodules) +daq_add_plugin(SSPCardReader duneDAQModule LINK_LIBRARIES sspmodules) ############################################################################## #daq_add_application( toylibrary_test_program toylibrary_test_program.cxx TEST LINK_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY} toylibrary ) diff --git a/cmake/sspmodulesConfig.cmake.in b/cmake/sspmodulesConfig.cmake.in index 77f6c19..a9b520d 100644 --- a/cmake/sspmodulesConfig.cmake.in +++ b/cmake/sspmodulesConfig.cmake.in @@ -5,7 +5,7 @@ include(CMakeFindDependencyMacro) find_dependency(appfwk) find_dependency(logging) -find_dependency(dataformats) +find_dependency(detdataformats) find_dependency(readout) if (EXISTS ${CMAKE_SOURCE_DIR}/@PROJECT_NAME@) diff --git a/src/SSPCardWrapper.cpp b/src/SSPCardWrapper.cpp index 5c231c8..289525f 100644 --- a/src/SSPCardWrapper.cpp +++ b/src/SSPCardWrapper.cpp @@ -65,7 +65,7 @@ SSPCardWrapper::init(const data_t& args) // configuration parameters that you're looking for in args aren't available since the args you're // getting here is likely only *::Init data from the json file - m_device_interface = new dunedaq::sspmodules::DeviceInterface(dunedaq::dataformats::ssp::kEthernet); + m_device_interface = new dunedaq::sspmodules::DeviceInterface(dunedaq::detdataformats::ssp::kEthernet); m_device_interface->Initialize(args); TLOG_DEBUG(TLVL_ENTER_EXIT_METHODS) << "SSPCardWrapper::init complete."; @@ -491,7 +491,7 @@ SSPCardWrapper::process_ssp() << ", calls to GetNext " << m_num_read_event_calls << ", of which returned null " << m_num_zero_fragments << std::endl; - // std::size_t dataLength = millislice.size()-dunedaq::dataformats::MillisliceHeader::sizeInUInts; + // std::size_t dataLength = millislice.size()-dunedaq::detdataformats::MillisliceHeader::sizeInUInts; // SSPFragment::Metadata metadata; // metadata.sliceHeader=*((SSPDAQ::MillisliceHeader*)(void*)millislice.data()); diff --git a/src/SSPCardWrapper.hpp b/src/SSPCardWrapper.hpp index ddc38e7..439fc05 100644 --- a/src/SSPCardWrapper.hpp +++ b/src/SSPCardWrapper.hpp @@ -10,7 +10,7 @@ #include "sspmodules/sspcardreader/Nljs.hpp" -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include "SSPIssues.hpp" #include "anlBoard/DeviceInterface.hpp" diff --git a/src/anlBoard/DeviceInterface.cxx b/src/anlBoard/DeviceInterface.cxx index 86d106e..f3938fb 100644 --- a/src/anlBoard/DeviceInterface.cxx +++ b/src/anlBoard/DeviceInterface.cxx @@ -36,7 +36,7 @@ enum }; // SSPDAQ::DeviceInterface::DeviceInterface(SSPDAQ::Comm_t commType, unsigned long deviceId) -dunedaq::sspmodules::DeviceInterface::DeviceInterface(dunedaq::dataformats::ssp::Comm_t commType) +dunedaq::sspmodules::DeviceInterface::DeviceInterface(dunedaq::detdataformats::ssp::Comm_t commType) : fCommType(commType) , fDeviceId(0) , fState(dunedaq::sspmodules::DeviceInterface::kUninitialized) @@ -67,9 +67,9 @@ dunedaq::sspmodules::DeviceInterface::OpenSlowControl() dunedaq::sspmodules::Device* device = 0; TLOG_DEBUG(TLVL_WORK_STEPS) << "Opening " - << ((fCommType == dunedaq::dataformats::ssp::kUSB) + << ((fCommType == dunedaq::detdataformats::ssp::kUSB) ? "USB" - : ((fCommType == dunedaq::dataformats::ssp::kEthernet) ? "Ethernet" : "Emulated")) + : ((fCommType == dunedaq::detdataformats::ssp::kEthernet) ? "Ethernet" : "Emulated")) << " device #" << fDeviceId << " for slow control only..." << std::endl; device = devman.OpenDevice(fCommType, fDeviceId, true); @@ -509,7 +509,7 @@ dunedaq::sspmodules::DeviceInterface::BuildFragment(const dunedaq::sspmodules::T unsigned int dataSizeInWords = 0; - dataSizeInWords += dunedaq::dataformats::MillisliceHeader::sizeInUInts; + dataSizeInWords += dunedaq::detdataformats::MillisliceHeader::sizeInUInts; for (auto ev = eventsToWrite.begin(); ev != eventsToWrite.end(); ++ev) { dataSizeInWords += (*ev)->header.length; } @@ -518,7 +518,7 @@ dunedaq::sspmodules::DeviceInterface::BuildFragment(const dunedaq::sspmodules::T // Build slice header// //==================// - dunedaq::dataformats::MillisliceHeader sliceHeader; + dunedaq::detdataformats::MillisliceHeader sliceHeader; sliceHeader.length = dataSizeInWords; sliceHeader.nTriggers = eventsToWrite.size(); sliceHeader.startTime = theTrigger.startTime; @@ -533,16 +533,16 @@ dunedaq::sspmodules::DeviceInterface::BuildFragment(const dunedaq::sspmodules::T fragmentData.resize(dataSizeInWords); static unsigned int headerSizeInWords = - sizeof(dunedaq::dataformats::EventHeader) / sizeof(unsigned int); // Size of DAQ event header + sizeof(dunedaq::detdataformats::EventHeader) / sizeof(unsigned int); // Size of DAQ event header // Put millislice header at front of vector auto sliceDataPtr = fragmentData.begin(); unsigned int* millisliceHeaderPtr = static_cast(static_cast(&sliceHeader)); std::copy( - millisliceHeaderPtr, millisliceHeaderPtr + dunedaq::dataformats::MillisliceHeader::sizeInUInts, sliceDataPtr); + millisliceHeaderPtr, millisliceHeaderPtr + dunedaq::detdataformats::MillisliceHeader::sizeInUInts, sliceDataPtr); // Fill rest of vector with event data - sliceDataPtr += dunedaq::dataformats::MillisliceHeader::sizeInUInts; + sliceDataPtr += dunedaq::detdataformats::MillisliceHeader::sizeInUInts; for (auto ev = eventsToWrite.begin(); ev != eventsToWrite.end(); ++ev) { // DAQ event header @@ -667,7 +667,7 @@ dunedaq::sspmodules::DeviceInterface::ReadEventFromDevice(EventPacket& event) unsigned int* headerBlock = (unsigned int*)&event.header; headerBlock[0] = 0xAAAAAAAA; - static const unsigned int headerReadSize = (sizeof(dunedaq::dataformats::EventHeader) / sizeof(unsigned int) - 1); + static const unsigned int headerReadSize = (sizeof(dunedaq::detdataformats::EventHeader) / sizeof(unsigned int) - 1); // Wait for hardware queue to fill with full header data unsigned int timeWaited = 0; // in us @@ -705,7 +705,7 @@ dunedaq::sspmodules::DeviceInterface::ReadEventFromDevice(EventPacket& event) std::copy(data.begin(), data.end(), &(headerBlock[1])); // Wait for hardware queue to fill with full event data - unsigned int bodyReadSize = event.header.length - (sizeof(dunedaq::dataformats::EventHeader) / sizeof(unsigned int)); + unsigned int bodyReadSize = event.header.length - (sizeof(dunedaq::detdataformats::EventHeader) / sizeof(unsigned int)); queueLengthInUInts = 0; timeWaited = 0; // in us @@ -740,7 +740,7 @@ dunedaq::sspmodules::DeviceInterface::ReadEventFromDevice(EventPacket& event) // Copy event data into event packet event.data = std::move(data); - auto ehsize = sizeof(struct dunedaq::dataformats::EventHeader); + auto ehsize = sizeof(struct dunedaq::detdataformats::EventHeader); auto ehlength = event.header.length; TLOG_DEBUG(TLVL_WORK_STEPS) << "Event data size: " << event.data.size() << " ehsize: " << ehsize << " ehl: " << ehlength; @@ -887,17 +887,17 @@ dunedaq::sspmodules::DeviceInterface::Configure(const nlohmann::json& args) } auto m_cfg = args.get(); - int interfaceTypeCode = m_cfg.interface_type; // dunedaq::dataformats::kEthernet; + int interfaceTypeCode = m_cfg.interface_type; // dunedaq::detdataformats::kEthernet; std::stringstream ss; switch (interfaceTypeCode) { case 0: - fCommType = dunedaq::dataformats::ssp::kUSB; + fCommType = dunedaq::detdataformats::ssp::kUSB; break; case 1: - fCommType = dunedaq::dataformats::ssp::kEthernet; + fCommType = dunedaq::detdataformats::ssp::kEthernet; break; case 2: - fCommType = dunedaq::dataformats::ssp::kEmulated; + fCommType = dunedaq::detdataformats::ssp::kEmulated; break; case 999: ss << "Error: Invalid interface type set (" << interfaceTypeCode << ")!" << std::endl; @@ -909,7 +909,7 @@ dunedaq::sspmodules::DeviceInterface::Configure(const nlohmann::json& args) throw ConfigurationError(ERS_HERE, ss.str()); } // - if (fCommType != dunedaq::dataformats::ssp::kEthernet) { + if (fCommType != dunedaq::detdataformats::ssp::kEthernet) { fDeviceId = 0; std::stringstream ss; ss << "Error: Non-functioning interface type set: " << fCommType @@ -926,9 +926,9 @@ dunedaq::sspmodules::DeviceInterface::Configure(const nlohmann::json& args) dunedaq::sspmodules::Device* device = 0; TLOG_DEBUG(TLVL_WORK_STEPS) << "Configuring " - << ((fCommType == dunedaq::dataformats::ssp::kUSB) + << ((fCommType == dunedaq::detdataformats::ssp::kUSB) ? "USB" - : ((fCommType == dunedaq::dataformats::ssp::kEthernet) ? "Ethernet" : "Emulated")) + : ((fCommType == dunedaq::detdataformats::ssp::kEthernet) ? "Ethernet" : "Emulated")) << " device #" << fDeviceId << "..." << std::endl; device = devman.OpenDevice(fCommType, fDeviceId); @@ -1227,17 +1227,17 @@ dunedaq::sspmodules::DeviceInterface::GetIdentifier() std::string ident; ident += "SSP@"; - if (fCommType == dunedaq::dataformats::ssp::kUSB) { + if (fCommType == dunedaq::detdataformats::ssp::kUSB) { ident += "(USB"; ident += fDeviceId; ident += "):"; - } else if (fCommType == dunedaq::dataformats::ssp::kEthernet) { + } else if (fCommType == dunedaq::detdataformats::ssp::kEthernet) { boost::asio::ip::address ip = boost::asio::ip::address_v4(fDeviceId); std::string ipString = ip.to_string(); ident += "("; ident += ipString; ident += "):"; - } else if (fCommType == dunedaq::dataformats::ssp::kEmulated) { + } else if (fCommType == dunedaq::detdataformats::ssp::kEmulated) { ident += "(EMULATED"; ident += fDeviceId; ident += "):"; @@ -1246,7 +1246,7 @@ dunedaq::sspmodules::DeviceInterface::GetIdentifier() } unsigned long // NOLINT(runtime/int) -dunedaq::sspmodules::DeviceInterface::GetTimestamp(const dunedaq::dataformats::EventHeader& header) +dunedaq::sspmodules::DeviceInterface::GetTimestamp(const dunedaq::detdataformats::EventHeader& header) { unsigned long packetTime = 0; // NOLINT(runtime/int) TLOG_DEBUG(TLVL_WORK_STEPS) << "fUseExternalTimestamp value: " << std::boolalpha << fUseExternalTimestamp diff --git a/src/anlBoard/DeviceInterface.hpp b/src/anlBoard/DeviceInterface.hpp index e0b95fc..a4ed441 100644 --- a/src/anlBoard/DeviceInterface.hpp +++ b/src/anlBoard/DeviceInterface.hpp @@ -10,7 +10,7 @@ #include "appfwk/app/Nljs.hpp" #include "readout/ReadoutTypes.hpp" -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include "logging/Logging.hpp" #include "DeviceManager.hpp" @@ -48,7 +48,7 @@ class DeviceInterface{ //Just sets the fields needed to request the device. //Real work is done in Initialize which is called manually. - explicit DeviceInterface(dunedaq::dataformats::ssp::Comm_t commType); + explicit DeviceInterface(dunedaq::detdataformats::ssp::Comm_t commType); ~DeviceInterface(){ //if(fRequestReceiver){ @@ -174,7 +174,7 @@ class DeviceInterface{ Device* fDevice; //Whether we are using USB or Ethernet to connect to the device - dunedaq::dataformats::ssp::Comm_t fCommType; + dunedaq::detdataformats::ssp::Comm_t fCommType; //Index of the device in the hardware-returned list unsigned long fDeviceId; // NOLINT(runtime/int) @@ -189,7 +189,7 @@ class DeviceInterface{ bool GetTriggerInfo(const EventPacket& event,dunedaq::sspmodules::TriggerInfo& newTrigger); - unsigned long GetTimestamp(const dunedaq::dataformats::EventHeader& header); // NOLINT(runtime/int) + unsigned long GetTimestamp(const dunedaq::detdataformats::EventHeader& header); // NOLINT(runtime/int) //Build a millislice containing only a header and place in fQueue // void BuildEmptyMillislice(unsigned long startTime,unsigned long endTime); diff --git a/src/anlBoard/DeviceManager.cxx b/src/anlBoard/DeviceManager.cxx index 3fa0add..c9cf03e 100644 --- a/src/anlBoard/DeviceManager.cxx +++ b/src/anlBoard/DeviceManager.cxx @@ -8,7 +8,7 @@ #ifndef SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_CXX_ #define SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_CXX_ -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include "DeviceManager.hpp" //#include "ftd2xx.h" @@ -175,12 +175,12 @@ dunedaq::sspmodules::DeviceManager::RefreshDevices() } dunedaq::sspmodules::Device* -dunedaq::sspmodules::DeviceManager::OpenDevice(dunedaq::dataformats::ssp::Comm_t commType, +dunedaq::sspmodules::DeviceManager::OpenDevice(dunedaq::detdataformats::ssp::Comm_t commType, unsigned int deviceNum, bool slowControlOnly) { // Check for devices if this hasn't yet been done - if (!fHaveLookedForDevices && commType != dunedaq::dataformats::ssp::kEmulated) { + if (!fHaveLookedForDevices && commType != dunedaq::detdataformats::ssp::kEmulated) { this->RefreshDevices(); } @@ -200,7 +200,7 @@ dunedaq::sspmodules::DeviceManager::OpenDevice(dunedaq::dataformats::ssp::Comm_t // } // break; // - case dunedaq::dataformats::ssp::kEthernet: + case dunedaq::detdataformats::ssp::kEthernet: if (fEthernetDevices.find(deviceNum) == fEthernetDevices.end()) { fEthernetDevices[deviceNum] = (std::move( std::unique_ptr(new dunedaq::sspmodules::EthernetDevice(deviceNum)))); @@ -214,7 +214,7 @@ dunedaq::sspmodules::DeviceManager::OpenDevice(dunedaq::dataformats::ssp::Comm_t } break; - case dunedaq::dataformats::ssp::kEmulated: + case dunedaq::detdataformats::ssp::kEmulated: while (fEmulatedDevices.size() <= deviceNum) { fEmulatedDevices.push_back(std::move(std::unique_ptr( new dunedaq::sspmodules::EmulatedDevice(fEmulatedDevices.size())))); diff --git a/src/anlBoard/DeviceManager.hpp b/src/anlBoard/DeviceManager.hpp index f9eddcb..7c17365 100644 --- a/src/anlBoard/DeviceManager.hpp +++ b/src/anlBoard/DeviceManager.hpp @@ -8,7 +8,7 @@ #ifndef SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_HPP_ #define SSPMODULES_SRC_ANLBOARD_DEVICEMANAGER_HPP_ -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" //#include "ftd2xx.h" //#include "USBDevice.h" @@ -39,7 +39,7 @@ class DeviceManager{ //unsigned int GetNUSBDevices(); //Open a device and return a pointer containing a handle to it - Device* OpenDevice(dunedaq::dataformats::ssp::Comm_t commType,unsigned int deviceId,bool slowControlOnly=false); + Device* OpenDevice(dunedaq::detdataformats::ssp::Comm_t commType,unsigned int deviceId,bool slowControlOnly=false); //Interrogate FTDI for list of devices. GetNUSBDevices and OpenDevice will call this //if it has not yet been run, so it should not normally be necessary to call this directly. diff --git a/src/anlBoard/EmulatedDevice.cxx b/src/anlBoard/EmulatedDevice.cxx index d0b4e62..4619774 100644 --- a/src/anlBoard/EmulatedDevice.cxx +++ b/src/anlBoard/EmulatedDevice.cxx @@ -8,7 +8,7 @@ #ifndef SSPMODULES_SRC_ANLBOARD_EMULATEDDEVICE_CXX_ #define SSPMODULES_SRC_ANLBOARD_EMULATEDDEVICE_CXX_ -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include "anlExceptions.hpp" #include "EmulatedDevice.hpp" @@ -151,7 +151,7 @@ void dunedaq::sspmodules::EmulatedDevice::Stop(){ void dunedaq::sspmodules::EmulatedDevice::EmulatorLoop(){ //dune::DAQLogger::LogDebug("SSP_EmulatedDevice")<<"Starting emulator loop..."<& da void dunedaq::sspmodules::EthernetDevice::DeviceRead(unsigned int address, unsigned int* value) { - dunedaq::dataformats::CtrlPacket tx; - dunedaq::dataformats::CtrlPacket rx; + dunedaq::detdataformats::CtrlPacket tx; + dunedaq::detdataformats::CtrlPacket rx; unsigned int txSize; unsigned int rxSizeExpected; - tx.header.length = sizeof(dunedaq::dataformats::CtrlHeader); + tx.header.length = sizeof(dunedaq::detdataformats::CtrlHeader); tx.header.address = address; - tx.header.command = dunedaq::dataformats::cmdRead; + tx.header.command = dunedaq::detdataformats::cmdRead; tx.header.size = 1; - tx.header.status = dunedaq::dataformats::statusNoError; - txSize = sizeof(dunedaq::dataformats::CtrlHeader); - rxSizeExpected = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(unsigned int); + tx.header.status = dunedaq::detdataformats::statusNoError; + txSize = sizeof(dunedaq::detdataformats::CtrlHeader); + rxSizeExpected = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(unsigned int); SendReceive(tx, rx, txSize, rxSizeExpected, 3); *value = rx.data[0]; @@ -122,19 +122,19 @@ dunedaq::sspmodules::EthernetDevice::DeviceRead(unsigned int address, unsigned i void dunedaq::sspmodules::EthernetDevice::DeviceReadMask(unsigned int address, unsigned int mask, unsigned int* value) { - dunedaq::dataformats::CtrlPacket tx; - dunedaq::dataformats::CtrlPacket rx; + dunedaq::detdataformats::CtrlPacket tx; + dunedaq::detdataformats::CtrlPacket rx; unsigned int txSize; unsigned int rxSizeExpected; - tx.header.length = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(uint); + tx.header.length = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(uint); tx.header.address = address; - tx.header.command = dunedaq::dataformats::cmdReadMask; + tx.header.command = dunedaq::detdataformats::cmdReadMask; tx.header.size = 1; - tx.header.status = dunedaq::dataformats::statusNoError; + tx.header.status = dunedaq::detdataformats::statusNoError; tx.data[0] = mask; - txSize = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(unsigned int); - rxSizeExpected = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(unsigned int); + txSize = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(unsigned int); + rxSizeExpected = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(unsigned int); SendReceive(tx, rx, txSize, rxSizeExpected, 3); *value = rx.data[0]; @@ -143,19 +143,19 @@ dunedaq::sspmodules::EthernetDevice::DeviceReadMask(unsigned int address, unsign void dunedaq::sspmodules::EthernetDevice::DeviceWrite(unsigned int address, unsigned int value) { - dunedaq::dataformats::CtrlPacket tx; - dunedaq::dataformats::CtrlPacket rx; + dunedaq::detdataformats::CtrlPacket tx; + dunedaq::detdataformats::CtrlPacket rx; unsigned int txSize; unsigned int rxSizeExpected; - tx.header.length = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(uint); + tx.header.length = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(uint); tx.header.address = address; - tx.header.command = dunedaq::dataformats::cmdWrite; + tx.header.command = dunedaq::detdataformats::cmdWrite; tx.header.size = 1; - tx.header.status = dunedaq::dataformats::statusNoError; + tx.header.status = dunedaq::detdataformats::statusNoError; tx.data[0] = value; - txSize = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(unsigned int); - rxSizeExpected = sizeof(dunedaq::dataformats::CtrlHeader); + txSize = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(unsigned int); + rxSizeExpected = sizeof(dunedaq::detdataformats::CtrlHeader); SendReceive(tx, rx, txSize, rxSizeExpected, 3); } @@ -163,20 +163,20 @@ dunedaq::sspmodules::EthernetDevice::DeviceWrite(unsigned int address, unsigned void dunedaq::sspmodules::EthernetDevice::DeviceWriteMask(unsigned int address, unsigned int mask, unsigned int value) { - dunedaq::dataformats::CtrlPacket tx; - dunedaq::dataformats::CtrlPacket rx; + dunedaq::detdataformats::CtrlPacket tx; + dunedaq::detdataformats::CtrlPacket rx; unsigned int txSize; unsigned int rxSizeExpected; - tx.header.length = sizeof(dunedaq::dataformats::CtrlHeader) + (sizeof(uint) * 2); + tx.header.length = sizeof(dunedaq::detdataformats::CtrlHeader) + (sizeof(uint) * 2); tx.header.address = address; - tx.header.command = dunedaq::dataformats::cmdWriteMask; + tx.header.command = dunedaq::detdataformats::cmdWriteMask; tx.header.size = 1; - tx.header.status = dunedaq::dataformats::statusNoError; + tx.header.status = dunedaq::detdataformats::statusNoError; tx.data[0] = mask; tx.data[1] = value; - txSize = sizeof(dunedaq::dataformats::CtrlHeader) + (sizeof(unsigned int) * 2); - rxSizeExpected = sizeof(dunedaq::dataformats::CtrlHeader) + sizeof(unsigned int); + txSize = sizeof(dunedaq::detdataformats::CtrlHeader) + (sizeof(unsigned int) * 2); + rxSizeExpected = sizeof(dunedaq::detdataformats::CtrlHeader) + sizeof(unsigned int); SendReceive(tx, rx, txSize, rxSizeExpected, 3); } @@ -197,18 +197,18 @@ void dunedaq::sspmodules::EthernetDevice::DeviceArrayRead(unsigned int address, unsigned int size, unsigned int* data) { unsigned int i = 0; - dunedaq::dataformats::CtrlPacket tx; - dunedaq::dataformats::CtrlPacket rx; + dunedaq::detdataformats::CtrlPacket tx; + dunedaq::detdataformats::CtrlPacket rx; unsigned int txSize; unsigned int rxSizeExpected; - tx.header.length = sizeof(dunedaq::dataformats::CtrlHeader); + tx.header.length = sizeof(dunedaq::detdataformats::CtrlHeader); tx.header.address = address; - tx.header.command = dunedaq::dataformats::cmdArrayRead; + tx.header.command = dunedaq::detdataformats::cmdArrayRead; tx.header.size = size; - tx.header.status = dunedaq::dataformats::statusNoError; - txSize = sizeof(dunedaq::dataformats::CtrlHeader); - rxSizeExpected = sizeof(dunedaq::dataformats::CtrlHeader) + (sizeof(unsigned int) * size); + tx.header.status = dunedaq::detdataformats::statusNoError; + txSize = sizeof(dunedaq::detdataformats::CtrlHeader); + rxSizeExpected = sizeof(dunedaq::detdataformats::CtrlHeader) + (sizeof(unsigned int) * size); SendReceive(tx, rx, txSize, rxSizeExpected, 3); for (i = 0; i < rx.header.size; i++) { @@ -220,18 +220,18 @@ void dunedaq::sspmodules::EthernetDevice::DeviceArrayWrite(unsigned int address, unsigned int size, unsigned int* data) { unsigned int i = 0; - dunedaq::dataformats::CtrlPacket tx; - dunedaq::dataformats::CtrlPacket rx; + dunedaq::detdataformats::CtrlPacket tx; + dunedaq::detdataformats::CtrlPacket rx; unsigned int txSize; unsigned int rxSizeExpected; - tx.header.length = sizeof(dunedaq::dataformats::CtrlHeader) + (sizeof(uint) * size); + tx.header.length = sizeof(dunedaq::detdataformats::CtrlHeader) + (sizeof(uint) * size); tx.header.address = address; - tx.header.command = dunedaq::dataformats::cmdArrayWrite; + tx.header.command = dunedaq::detdataformats::cmdArrayWrite; tx.header.size = size; - tx.header.status = dunedaq::dataformats::statusNoError; - txSize = sizeof(dunedaq::dataformats::CtrlHeader) + (sizeof(unsigned int) * size); - rxSizeExpected = sizeof(dunedaq::dataformats::CtrlHeader); + tx.header.status = dunedaq::detdataformats::statusNoError; + txSize = sizeof(dunedaq::detdataformats::CtrlHeader) + (sizeof(unsigned int) * size); + rxSizeExpected = sizeof(dunedaq::detdataformats::CtrlHeader); for (i = 0; i < size; i++) { tx.data[i] = data[i]; @@ -245,8 +245,8 @@ dunedaq::sspmodules::EthernetDevice::DeviceArrayWrite(unsigned int address, unsi //============================================================================== void -dunedaq::sspmodules::EthernetDevice::SendReceive(dunedaq::dataformats::CtrlPacket& tx, - dunedaq::dataformats::CtrlPacket& rx, +dunedaq::sspmodules::EthernetDevice::SendReceive(dunedaq::detdataformats::CtrlPacket& tx, + dunedaq::detdataformats::CtrlPacket& rx, unsigned int txSize, unsigned int rxSizeExpected, unsigned int retryCount) @@ -278,7 +278,7 @@ dunedaq::sspmodules::EthernetDevice::SendReceive(dunedaq::dataformats::CtrlPacke } void -dunedaq::sspmodules::EthernetDevice::SendEthernet(dunedaq::dataformats::CtrlPacket& tx, unsigned int txSize) +dunedaq::sspmodules::EthernetDevice::SendEthernet(dunedaq::detdataformats::CtrlPacket& tx, unsigned int txSize) { unsigned int txSizeWritten = fCommSocket.write_some(boost::asio::buffer(static_cast(&tx), txSize)); if (txSizeWritten != txSize) { @@ -287,7 +287,7 @@ dunedaq::sspmodules::EthernetDevice::SendEthernet(dunedaq::dataformats::CtrlPack } void -dunedaq::sspmodules::EthernetDevice::ReceiveEthernet(dunedaq::dataformats::CtrlPacket& rx, unsigned int rxSizeExpected) +dunedaq::sspmodules::EthernetDevice::ReceiveEthernet(dunedaq::detdataformats::CtrlPacket& rx, unsigned int rxSizeExpected) { unsigned int rxSizeReturned = fCommSocket.read_some(boost::asio::buffer(static_cast(&rx), rxSizeExpected)); if (rxSizeReturned != rxSizeExpected) { diff --git a/src/anlBoard/EthernetDevice.hpp b/src/anlBoard/EthernetDevice.hpp index c79cce9..58620b8 100644 --- a/src/anlBoard/EthernetDevice.hpp +++ b/src/anlBoard/EthernetDevice.hpp @@ -8,7 +8,7 @@ #ifndef SSPMODULES_SRC_ANLBOARD_ETHERNETDEVICE_HPP_ #define SSPMODULES_SRC_ANLBOARD_ETHERNETDEVICE_HPP_ -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include "Device.hpp" #include "boost/asio.hpp" @@ -66,11 +66,11 @@ class EthernetDevice : public Device{ //Internal functions - make public so debugging code can access them - void SendReceive(dunedaq::dataformats::CtrlPacket& tx, dunedaq::dataformats::CtrlPacket& rx, unsigned int txSize, unsigned int rxSizeExpected, unsigned int retryCount=0); + void SendReceive(dunedaq::detdataformats::CtrlPacket& tx, dunedaq::detdataformats::CtrlPacket& rx, unsigned int txSize, unsigned int rxSizeExpected, unsigned int retryCount=0); - void SendEthernet(dunedaq::dataformats::CtrlPacket& tx, unsigned int txSize); + void SendEthernet(dunedaq::detdataformats::CtrlPacket& tx, unsigned int txSize); - void ReceiveEthernet(dunedaq::dataformats::CtrlPacket& rx, unsigned int rxSizeExpected); + void ReceiveEthernet(dunedaq::detdataformats::CtrlPacket& rx, unsigned int rxSizeExpected); void DevicePurge(boost::asio::ip::tcp::socket& socket); diff --git a/src/anlBoard/EventPacket.hpp b/src/anlBoard/EventPacket.hpp index 2bb4754..f6ec65a 100644 --- a/src/anlBoard/EventPacket.hpp +++ b/src/anlBoard/EventPacket.hpp @@ -8,7 +8,7 @@ #ifndef SSPMODULES_SRC_ANLBOARD_EVENTPACKET_HPP_ #define SSPMODULES_SRC_ANLBOARD_EVENTPACKET_HPP_ -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include #include @@ -58,7 +58,7 @@ class EventPacket{ void DumpEvent(); - dunedaq::dataformats::EventHeader header; + dunedaq::detdataformats::EventHeader header; std::vector data; }; diff --git a/src/anlBoard/RegMap.hpp b/src/anlBoard/RegMap.hpp index 938aa0b..963d88e 100644 --- a/src/anlBoard/RegMap.hpp +++ b/src/anlBoard/RegMap.hpp @@ -8,7 +8,7 @@ #ifndef SSPMODULES_SRC_ANLBOARD_REGMAP_HPP_ #define SSPMODULES_SRC_ANLBOARD_REGMAP_HPP_ -#include "dataformats/ssp/SSPTypes.hpp" +#include "detdataformats/ssp/SSPTypes.hpp" #include "anlExceptions.hpp"