Connecting Radar Product Manager creation to Radar Product Model

This commit is contained in:
Dan Paulat 2022-09-19 23:46:15 -05:00
parent 98f8bab79a
commit 4c4c93cad1
6 changed files with 98 additions and 10 deletions

View file

@ -1,4 +1,5 @@
#include <scwx/qt/manager/radar_product_manager.hpp>
#include <scwx/qt/manager/radar_product_manager_notifier.hpp>
#include <scwx/common/constants.hpp>
#include <scwx/provider/nexrad_data_provider_factory.hpp>
#include <scwx/util/logger.hpp>
@ -943,6 +944,8 @@ RadarProductManager::Instance(const std::string& radarSite)
{
instanceMap_[radarSite] =
std::make_shared<RadarProductManager>(radarSite);
emit RadarProductManagerNotifier::Instance().RadarProductManagerCreated(
radarSite);
}
return instanceMap_[radarSite];

View file

@ -0,0 +1,34 @@
#include <scwx/qt/manager/radar_product_manager_notifier.hpp>
namespace scwx
{
namespace qt
{
namespace manager
{
static const std::string logPrefix_ =
"scwx::qt::manager::radar_product_manager_notifier";
class RadarProductManagerNotifierImpl
{
public:
explicit RadarProductManagerNotifierImpl() {}
~RadarProductManagerNotifierImpl() {}
};
RadarProductManagerNotifier::RadarProductManagerNotifier() :
p(std::make_unique<RadarProductManagerNotifierImpl>())
{
}
RadarProductManagerNotifier::~RadarProductManagerNotifier() = default;
RadarProductManagerNotifier& RadarProductManagerNotifier::Instance()
{
static RadarProductManagerNotifier instance_ {};
return instance_;
}
} // namespace manager
} // namespace qt
} // namespace scwx

View file

@ -0,0 +1,35 @@
#pragma once
#include <memory>
#include <QObject>
namespace scwx
{
namespace qt
{
namespace manager
{
class RadarProductManagerNotifierImpl;
class RadarProductManagerNotifier : public QObject
{
Q_OBJECT
public:
explicit RadarProductManagerNotifier();
~RadarProductManagerNotifier();
static RadarProductManagerNotifier& Instance();
signals:
void RadarProductManagerCreated(const std::string& radarSite);
private:
std::unique_ptr<RadarProductManagerNotifierImpl> p;
};
} // namespace manager
} // namespace qt
} // namespace scwx