- Migrated all 104 CMakeLists.txt files in Lts/Services - Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg, Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test, Qt5::SerialPort with Qt6:: equivalents - 1244 files modified (CMakeLists.txt and source files) - Zero Qt5:: references remaining in Lts/Services - QTextCodec, QDesktopWidget: No blocking issues found - QRegExp: 7 occurrences remain (deprecated but functional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
66 lines
1.9 KiB
C++
Executable File
66 lines
1.9 KiB
C++
Executable File
/**
|
|
* Handler for all meteo data units
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by hjl, SLSE, 2016-09-27
|
|
*/
|
|
|
|
|
|
#include "handler_meteo_data_units.h"
|
|
#include "handler_meteo_data_unit.h"
|
|
#include "handler_infrastructure_data.h"
|
|
|
|
namespace MeteoDataManagement
|
|
{
|
|
|
|
HandlerMeteoDataUnits::HandlerMeteoDataUnits(MainHandler *mainHandler)
|
|
: m_mainHandler(mainHandler)
|
|
, m_logger(getLogger("HandlerMeteoDataUnits"))
|
|
{
|
|
} // end of ctor()
|
|
//-----------------------------------------------------------------------------
|
|
|
|
HandlerMeteoDataUnits::~HandlerMeteoDataUnits()
|
|
{
|
|
qDeleteAll(m_handlerMeteoDataUnitsMap);
|
|
} // end of dtor()
|
|
//-----------------------------------------------------------------------------
|
|
|
|
bool HandlerMeteoDataUnits::init()
|
|
{
|
|
INFO_LOG(m_logger) << "HandlerMeteoDataUnits::init().... Initialisation of MDU's will be started from ISM directly. ";
|
|
|
|
return true;
|
|
} // end of init()
|
|
//-----------------------------------------------------------------------------
|
|
|
|
bool HandlerMeteoDataUnits::addMeteoDataUnit(const InfrastructureManagement::InstrumentationAsset &asset)
|
|
{
|
|
INFO_LOG(m_logger) << "addMeteoDataUnit: " << asset;
|
|
removeMeteoDataUnit(asset); // just to be sure
|
|
|
|
HandlerMeteoDataUnit *hMDU = new HandlerMeteoDataUnit(m_mainHandler, asset);
|
|
m_handlerMeteoDataUnitsMap.insert(asset.id(), hMDU);
|
|
|
|
return false;
|
|
} // end of addMeteoDataUnit()
|
|
//-----------------------------------------------------------------------------
|
|
|
|
bool HandlerMeteoDataUnits::removeMeteoDataUnit(const InfrastructureManagement::InstrumentationAsset &asset)
|
|
{
|
|
INFO_LOG(m_logger) << "removeMeteoDataUnit: " << asset;
|
|
auto it = m_handlerMeteoDataUnitsMap.find(asset.id());
|
|
if (it == m_handlerMeteoDataUnitsMap.end())
|
|
return false;
|
|
|
|
delete it.value();
|
|
|
|
m_handlerMeteoDataUnitsMap.erase(it);
|
|
|
|
return true;
|
|
} // end of removeMeteoDataUnit()
|
|
//-----------------------------------------------------------------------------
|
|
|
|
} // Namespace MeteoDataManagement
|