1 #include "mfextensions/Binaries/ReceiverManager.hh"
4 #include "fhiclcpp/ParameterSet.h"
5 #include "mfextensions/Receivers/makeMVReceiver.hh"
8 qRegisterMetaType<qt_mf_msg>(
"qt_mf_msg");
9 std::vector<std::string> names = pset.get_pset_names();
10 for (
auto name : names) {
11 std::string pluginType =
"unknown";
13 fhicl::ParameterSet plugin_pset = pset.get<fhicl::ParameterSet>(name);
14 pluginType = plugin_pset.get<std::string>(
"receiverType",
"unknown");
15 std::unique_ptr<mfviewer::MVReceiver> rcvr = makeMVReceiver(pluginType, plugin_pset);
16 connect(rcvr.get(), SIGNAL(NewMessage(
qt_mf_msg const&)),
this, SLOT(onNewMessage(
qt_mf_msg const&)));
17 receivers_.push_back(std::move(rcvr));
19 std::cerr <<
"ReceiverManager: Unable to load receiver plugin with name " << name <<
" and plugin type "
20 << pluginType << std::endl;
27 for (
auto& i : receivers_) i.reset(
nullptr);
31 for (
auto& receiver : receivers_) {
34 for (
auto& receiver : receivers_) {
40 for (
auto& receiver : receivers_) {
45 void mfviewer::ReceiverManager::onNewMessage(
qt_mf_msg const& mfmsg) { emit newMessage(mfmsg); }
ReceiverManager(fhicl::ParameterSet pset)
ReceiverManager Constructor
void start()
Start all receivers
Qt wrapper around MessageFacility message
virtual ~ReceiverManager()
ReceiverManager Destructor
void stop()
Stop all receivers