mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:50:05 +00:00
Connecting Radar Product Manager creation to Radar Product Model
This commit is contained in:
parent
98f8bab79a
commit
4c4c93cad1
6 changed files with 98 additions and 10 deletions
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue