Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+31
-30
@@ -6,6 +6,7 @@
|
||||
#include "dds_handler.h"
|
||||
#include <ComponentMonitor/cmo.hpp>
|
||||
#include <ComponentMonitor/cmo_dts.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
@@ -75,7 +76,7 @@ std::vector<std::string> ComponentStatusHandler::getHostnames() const
|
||||
ret.reserve(m_statusMap.size());
|
||||
|
||||
for (CONST_ITERATOR_T it = m_statusMap.cbegin(); it != m_statusMap.cend(); ++it)
|
||||
ret.push_back(it->hostname());
|
||||
ret.push_back(it->hostname);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -83,28 +84,28 @@ std::vector<std::string> ComponentStatusHandler::getHostnames() const
|
||||
void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &iAsset,
|
||||
DataModification dataMod)
|
||||
{
|
||||
const InfrastructureManagement::MountingPointType_def::type mpType = iAsset.mountingPointTypeId().underlying();
|
||||
if ((mpType != InfrastructureManagement::MountingPointType_def::IndoorCamera) &&
|
||||
(mpType != InfrastructureManagement::MountingPointType_def::OutdoorCamera) &&
|
||||
(mpType != InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit) &&
|
||||
(mpType != InfrastructureManagement::MountingPointType_def::BuildingSensorModule)
|
||||
const InfrastructureManagement::MountingPointType mpType = static_cast<InfrastructureManagement::MountingPointType>(iAsset.mountingPointTypeId);
|
||||
if ((mpType != InfrastructureManagement::MountingPointType::IndoorCamera) &&
|
||||
(mpType != InfrastructureManagement::MountingPointType::OutdoorCamera) &&
|
||||
(mpType != InfrastructureManagement::MountingPointType::EffectGenerationControlUnit) &&
|
||||
(mpType != InfrastructureManagement::MountingPointType::BuildingSensorModule)
|
||||
)
|
||||
return;
|
||||
|
||||
static int assetChangedCounter = 0;
|
||||
|
||||
const int iAssetId = iAsset.id();
|
||||
const int iAssetId = iAsset.id;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< ", iAssetId=" << iAssetId
|
||||
<< " (assetChangedCounter=" << ++assetChangedCounter << ")";
|
||||
|
||||
|
||||
const bool bIsMounted = iAsset.assetStateId() == InfrastructureManagement::InstrumentationAssetState_def::Mounted;
|
||||
const bool bIsMounted = iAsset.assetStateId == InfrastructureManagement::InstrumentationAssetState::Mounted;
|
||||
if (!bIsMounted)
|
||||
dataMod = DataModification::eRemoved;
|
||||
|
||||
|
||||
const bool bNoHostname = iAsset.hostname().empty();
|
||||
const bool bNoHostname = iAsset.hostname.empty();
|
||||
if (bNoHostname)
|
||||
dataMod = DataModification::eRemoved;
|
||||
|
||||
@@ -116,9 +117,9 @@ void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureM
|
||||
case DataModification::eModified:
|
||||
{
|
||||
ComponentStatus cs;
|
||||
cs.id(iAssetId);
|
||||
cs.hostname(iAsset.hostname());
|
||||
cs.state(ComponentMonitor::ComponentState::Undefined);
|
||||
cs.id = iAssetId;
|
||||
cs.hostname = iAsset.hostname;
|
||||
cs.state = ComponentMonitor::ComponentState::Undefined;
|
||||
|
||||
addUpdateInstrumentationAsset(it, cs);
|
||||
}
|
||||
@@ -150,9 +151,9 @@ void ComponentStatusHandler::dump()
|
||||
DEBUG_LOG(m_logger) << " REACHABLE:";
|
||||
for (const ComponentStatus &status : std::as_const(m_statusMap))
|
||||
{
|
||||
if (status.state().underlying() == ComponentState_def::Reachable)
|
||||
if (status.state == ComponentState::Reachable)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Reachable";
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id << ", host '" << status.hostname.c_str() << " -> Reachable";
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
@@ -164,9 +165,9 @@ void ComponentStatusHandler::dump()
|
||||
DEBUG_LOG(m_logger) << " UNREACHABLE:";
|
||||
for (const ComponentStatus &status : std::as_const(m_statusMap))
|
||||
{
|
||||
if (status.state().underlying() == ComponentState_def::Unreachable)
|
||||
if (status.state == ComponentState::Unreachable)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Unreachable";
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id << ", host '" << status.hostname.c_str() << " -> Unreachable";
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
@@ -178,9 +179,9 @@ void ComponentStatusHandler::dump()
|
||||
DEBUG_LOG(m_logger) << " UNDEFINED:";
|
||||
for (const ComponentStatus &status : std::as_const(m_statusMap))
|
||||
{
|
||||
if (status.state().underlying() == ComponentState_def::Undefined)
|
||||
if (status.state == ComponentState::Undefined)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Undefined";
|
||||
DEBUG_LOG(m_logger) << " id=" << status.id << ", host '" << status.hostname.c_str() << " -> Undefined";
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
@@ -202,14 +203,14 @@ void ComponentStatusHandler::onNewState(const QString &hostname, bool reachable,
|
||||
|
||||
for (ITERATOR_T it = m_statusMap.begin(); it != m_statusMap.end(); ++it)
|
||||
{
|
||||
const QString hname = QString::fromStdString(it->hostname());
|
||||
const QString hname = QString::fromStdString(it->hostname);
|
||||
if (hname.compare(hostname, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
ComponentState_def::type newStateInner = reachable ? ComponentState_def::Reachable : ComponentState_def::Unreachable;
|
||||
ComponentState newStateInner = reachable ? ComponentState::Reachable : ComponentState::Unreachable;
|
||||
|
||||
ComponentStatus newCs = (*it);
|
||||
newCs.state(newStateInner);
|
||||
newCs.last_check(lastCheckSec);
|
||||
newCs.state = newStateInner;
|
||||
newCs.last_check = lastCheckSec;
|
||||
|
||||
addUpdateInstrumentationAsset(it, newCs);
|
||||
}
|
||||
@@ -223,23 +224,23 @@ void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &host
|
||||
for (ITERATOR_T it = m_statusMap.begin(); it != m_statusMap.end(); ++it)
|
||||
{
|
||||
ComponentStatus &cs = *it;
|
||||
const QString &curHostname = QString::fromStdString(cs.hostname());
|
||||
const QString &curHostname = QString::fromStdString(cs.hostname);
|
||||
if (!hostnamesForUpdateLastCheckTime.contains(curHostname, Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
|
||||
if (lastCheckSec <= cs.last_check())
|
||||
if (lastCheckSec <= cs.last_check)
|
||||
continue;
|
||||
|
||||
const ComponentState_def::type curState = cs.state().underlying();
|
||||
if ((curState == ComponentState_def::Reachable) ||
|
||||
(curState == ComponentState_def::Unreachable))
|
||||
const ComponentState curState = cs.state;
|
||||
if ((curState == ComponentState::Reachable) ||
|
||||
(curState == ComponentState::Unreachable))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updateLastCheckTimeDirect"
|
||||
<< " host: '" << curHostname << "'"
|
||||
<< " newLastCheck= " << lastCheckSec;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2a (*it) " << (*it);
|
||||
cs.last_check(lastCheckSec);
|
||||
cs.last_check = lastCheckSec;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2b (*it) " << (*it);
|
||||
m_ddsHandler->dts()->publish(cs);
|
||||
}
|
||||
@@ -251,7 +252,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START add/Update: cs=" << cs
|
||||
<< ", curSize=" << m_statusMap.size() << ")";
|
||||
const int id = cs.id();
|
||||
const int id = cs.id;
|
||||
|
||||
if (it != m_statusMap.end())
|
||||
{
|
||||
@@ -280,7 +281,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
|
||||
|
||||
bool ComponentStatusHandler::removeInstrumentationAsset(ComponentStatusHandler::ITERATOR_T it)
|
||||
{
|
||||
const int id = it.value().id();
|
||||
const int id = it.value().id;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " remove: id=" << id;
|
||||
m_statusMap.remove(id);
|
||||
m_ddsHandler->dts()->removeComponentStatusByKey(id);
|
||||
|
||||
Reference in new issue
Block a user