Skip to content

Commit

Permalink
Change ModuleConfiguration to ConfigurationManager
Browse files Browse the repository at this point in the history
  • Loading branch information
eflumerf committed Dec 18, 2024
1 parent bb098d7 commit ca24a62
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion include/hsilibs/HSIEventSender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class HSIEventSender : public dunedaq::appfwk::DAQModule
HSIEventSender(HSIEventSender&&) = delete; ///< HSIEventSender is not move-constructible
HSIEventSender& operator=(HSIEventSender&&) = delete; ///< HSIEventSender is not move-assignable

void init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg) override;
void init(std::shared_ptr<appfwk::ConfigurationManager> mcfg) override;

protected:
// Commands
Expand Down
6 changes: 3 additions & 3 deletions plugins/FakeHSIEventGeneratorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ FakeHSIEventGeneratorModule::FakeHSIEventGeneratorModule(const std::string& name
}

void
FakeHSIEventGeneratorModule::init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg)
FakeHSIEventGeneratorModule::init(std::shared_ptr<appfwk::ConfigurationManager> mcfg)
{
TLOG_DEBUG(TLVL_ENTER_EXIT_METHODS) << get_name() << ": Entering init() method";
HSIEventSender::init(mcfg);

m_clock_frequency = mcfg->configuration_manager()->session()->get_detector_configuration()->get_clock_speed_hz();
auto mdal = mcfg->module<appmodel::FakeHSIEventGeneratorModule>(get_name()); // Only need generic DaqModule for output
m_clock_frequency = mcfg->session()->get_detector_configuration()->get_clock_speed_hz();
auto mdal = mcfg->get_dal<appmodel::FakeHSIEventGeneratorModule>(get_name()); // Only need generic DaqModule for output

if (!mdal) {
throw appfwk::CommandFailed(ERS_HERE, "init", get_name(), "Unable to retrieve configuration object");
Expand Down
2 changes: 1 addition & 1 deletion plugins/FakeHSIEventGeneratorModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FakeHSIEventGeneratorModule : public hsilibs::HSIEventSender
FakeHSIEventGeneratorModule(FakeHSIEventGeneratorModule&&) = delete; ///< FakeHSIEventGeneratorModule is not move-constructible
FakeHSIEventGeneratorModule& operator=(FakeHSIEventGeneratorModule&&) = delete; ///< FakeHSIEventGeneratorModule is not move-assignable

void init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg) override;
void init(std::shared_ptr<appfwk::ConfigurationManager> mcfg) override;
//void get_info(opmonlib::InfoCollector& ci, int level) override;

private:
Expand Down
4 changes: 2 additions & 2 deletions plugins/HSIController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ HSIController::HSIController(const std::string& name)
}

void
HSIController::init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg)
HSIController::init(std::shared_ptr<appfwk::ConfigurationManager> mcfg)
{
TimingController::init(mcfg);
auto mod_config = mcfg->module<hsilibs::dal::HSIController>(get_name());
auto mod_config = mcfg->get_dal<hsilibs::dal::HSIController>(get_name());
m_hsi_configuration = mod_config->get_configuration()->cast<hsilibs::dal::HSIControllerConf>();
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/HSIController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class HSIController : public dunedaq::timinglibs::TimingEndpointControllerBase,
HSIController(HSIController&&) = delete; ///< HSIController is not move-constructible
HSIController& operator=(HSIController&&) = delete; ///< HSIController is not move-assignable

void init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg) override;
void init(std::shared_ptr<appfwk::ConfigurationManager> mcfg) override;
protected:
const hsilibs::dal::HSIControllerConf* m_hsi_configuration;

Expand Down
4 changes: 2 additions & 2 deletions plugins/HSIDataHandlerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ HSIDataHandlerModule::HSIDataHandlerModule(const std::string& name)
}

void
HSIDataHandlerModule::init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg)
HSIDataHandlerModule::init(std::shared_ptr<appfwk::ConfigurationManager> mcfg)
{

TLOG_DEBUG(TLVL_ENTER_EXIT_METHODS) << get_name() << ": Entering init() method";
Expand All @@ -57,7 +57,7 @@ HSIDataHandlerModule::init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg)
rol::DefaultRequestHandlerModel<hsilibs::HSI_FRAME_STRUCT, rol::BinarySearchQueueModel<hsilibs::HSI_FRAME_STRUCT>>,
rol::BinarySearchQueueModel<hsilibs::HSI_FRAME_STRUCT>,
hsilibs::HSIFrameProcessor>>(m_run_marker);
m_readout_impl->init(mcfg->module<appmodel::DataHandlerModule>(get_name()));
m_readout_impl->init(mcfg->get_dal<appmodel::DataHandlerModule>(get_name()));
if (m_readout_impl == nullptr)
{
TLOG() << get_name() << "Initialize HSIDataHandlerModule FAILED! ";
Expand Down
2 changes: 1 addition & 1 deletion plugins/HSIDataHandlerModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HSIDataHandlerModule : public dunedaq::appfwk::DAQModule
HSIDataHandlerModule(HSIDataHandlerModule&&) = delete; ///< HSIDataHandlerModule is not move-constructible
HSIDataHandlerModule& operator=(HSIDataHandlerModule&&) = delete; ///< HSIDataHandlerModule is not move-assignable

void init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg) override;
void init(std::shared_ptr<appfwk::ConfigurationManager> mcfg) override;
// void get_info(opmonlib::InfoCollector& ci, int level) override;

private:
Expand Down
4 changes: 2 additions & 2 deletions plugins/HSIReadout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ HSIReadout::HSIReadout(const std::string& name)
}

void
HSIReadout::init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg)
HSIReadout::init(std::shared_ptr<appfwk::ConfigurationManager> mcfg)
{
TLOG_DEBUG(TLVL_ENTER_EXIT_METHODS) << get_name() << ": Entering init() method";
HSIEventSender::init(mcfg);
auto mdal = mcfg->module<appmodel::HSIReadout>(get_name());
auto mdal = mcfg->get_dal<appmodel::HSIReadout>(get_name());

for (auto con : mdal->get_outputs()) {
if (con->get_data_type() == datatype_to_string<HSI_FRAME_STRUCT>()) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/HSIReadout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class HSIReadout : public hsilibs::HSIEventSender, dunedaq::timinglibs::TimingHa
HSIReadout(HSIReadout&&) = delete; ///< HSIReadout is not move-constructible
HSIReadout& operator=(HSIReadout&&) = delete; ///< HSIReadout is not move-assignable

void init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg) override;
void init(std::shared_ptr<appfwk::ConfigurationManager> mcfg) override;
// void get_info(opmonlib::InfoCollector& ci, int level) override;

private:
Expand Down
4 changes: 2 additions & 2 deletions src/HSIEventSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ HSIEventSender::HSIEventSender(const std::string& name)
}

void
HSIEventSender::init(std::shared_ptr<appfwk::ModuleConfiguration> mcfg)
HSIEventSender::init(std::shared_ptr<appfwk::ConfigurationManager> mcfg)
{
auto mdal = mcfg->module<confmodel::DaqModule>(get_name()); // Only need generic DaqModule for output
auto mdal = mcfg->get_dal<confmodel::DaqModule>(get_name()); // Only need generic DaqModule for output

if (!mdal) {
throw appfwk::CommandFailed(ERS_HERE, "init", get_name(), "Unable to retrieve configuration object");
Expand Down

0 comments on commit ca24a62

Please sign in to comment.