Migrates remaining services and plugins to generated rtiddsgen API

Converts accessor calls to plain member access across the residual service set.
This commit is contained in:
berrux-dev committed 2026-09-21 02:47:48 +02:00
1 parent 6a8c31b735
commit c3eda18234
104 files changed
+2424 -2430

No files matched your search

@@ -86,14 +86,14 @@ bool HandlerSounds::init()
<< " name=" << soundEntry.name
<< " displayName=" << soundEntry.displayName;
sound.id(soundEntry.index);
sound.category(soundEntry.category);
sound.soundId(soundEntry.soundId);
sound.name(soundEntry.name.toStdString());
sound.displayName(soundEntry.displayName.toStdString());
sound.duration(soundEntry.duration);
sound.isRepeatable(soundEntry.isRepeatable);
topicData.sounds().push_back(sound);
sound.id = soundEntry.index;
sound.category = soundEntry.category;
sound.soundId = soundEntry.soundId;
sound.name = soundEntry.name.toStdString();
sound.displayName = soundEntry.displayName.toStdString();
sound.duration = soundEntry.duration;
sound.isRepeatable = soundEntry.isRepeatable;
topicData.sounds.push_back(sound);
index++;
}
@@ -159,7 +159,7 @@ void HandlerSounds::onStopAllSoundsRequest(const rti::core::SampleIdentity &cook
DEBUG_LOG(m_logger) << "StopAllSounds: " << request;
int failedCount = 0;
if (request.egcuId() == -1) // stopp all sounds on each EGCU
if (request.egcuId == -1) // stopp all sounds on each EGCU
{
QHashIterator<int, QString> i(m_hostnames);
@@ -175,9 +175,9 @@ void HandlerSounds::onStopAllSoundsRequest(const rti::core::SampleIdentity &cook
}
else
{
QString hostname = m_hostnames.value(request.egcuId());
QString hostname = m_hostnames.value(request.egcuId);
DEBUG_LOG(m_logger) << "getActiveSound hostname=" << hostname;
if (!stopAllSounds(request.egcuId()).isEmpty()) // BLOCKING
if (!stopAllSounds(request.egcuId).isEmpty()) // BLOCKING
failedCount++;
}
@@ -198,7 +198,7 @@ void HandlerSounds::onGetSoundsRequest(const rti::core::SampleIdentity &cookie,
QString HandlerSounds::enumToString(const SoundCategory &category)
{
switch (category.underlying())
switch (category)
{
case SoundManagement::SoundCategory::Aircraft:
return QStringLiteral("Aircrafts");
@@ -280,17 +280,17 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
const ControlSoundRequest &request)
{
DEBUG_LOG(m_logger) << "ControlSound: " << request
<< " category=" << request.category();
<< " category=" << request.category;
const QString user = Settings::somUser();
const QString passwd = Settings::somPasswd();
const QString hostname = m_hostnames.value(request.egcuId());
const QString hostname = m_hostnames.value(request.egcuId);
switch (request.control().underlying())
switch (request.control)
{
case SoundManagement::PlayControl::StopSound:
{
onStopSingleSound(request.egcuId(), request.category(), request.soundId());
onStopSingleSound(request.egcuId, request.category, request.soundId);
Core::FunctionReplyObject reply = Core::FunctionReplyObject(0);
m_ddsHandler->ftsSom()->controlSoundReply(cookie, reply);
break;
@@ -298,19 +298,19 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
case SoundManagement::PlayControl::PlaySingle:
case SoundManagement::PlayControl::PlayLoop: // NOTE: falls through if PlaySingle !
{
const bool loop = (request.control().underlying() == SoundManagement::PlayControl::PlayLoop);
const int durationMs = getDuration(request.category(), request.soundId());
const bool loop = (request.control == SoundManagement::PlayControl::PlayLoop);
const int durationMs = getDuration(request.category, request.soundId);
// QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_mainHandler->dds()->dtsAlm()->removeNotificationByKey(id); });
const int soundId = request.soundId();
const int egcuId = request.egcuId();
const SoundManagement::SoundCategory category = request.category();
const int soundId = request.soundId;
const int egcuId = request.egcuId;
const SoundManagement::SoundCategory category = request.category;
DEBUG_LOG(m_logger) << "Play: durationMs=" << durationMs
<< " egcuId=" << egcuId
<< " soundId=" << soundId
<< " loop=" << loop;
const int control = static_cast<int>(request.control().underlying());
const int volumePercent = static_cast<int>(request.volumePercent());
const QString msg(playBackgroundSound(user, passwd, hostname, enumToString(request.category()), request.soundId(), volumePercent, control)); // => blocking !!
const int control = static_cast<int>(request.control);
const int volumePercent = static_cast<int>(request.volumePercent);
const QString msg(playBackgroundSound(user, passwd, hostname, enumToString(request.category), request.soundId, volumePercent, control)); // => blocking !!
if (!msg.isEmpty())
{
@@ -326,17 +326,17 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
// insert into m_soundStates
SoundManagement::SoundState soundState;
soundState.egcuId(egcuId);
soundState.soundId(soundId);
soundState.category(request.category());
soundState.id(m_indexActiveSound);
soundState.sampleTime(QDateTime::currentMSecsSinceEpoch());
soundState.inLoop(loop);
soundState.egcuId = egcuId;
soundState.soundId = soundId;
soundState.category = request.category;
soundState.id = m_indexActiveSound;
soundState.sampleTime = QDateTime::currentMSecsSinceEpoch();
soundState.inLoop = loop;
DEBUG_LOG(m_logger) << "id=" << m_indexActiveSound
<< " category=" << request.category()
<< " egcuId=" << request.egcuId()
<< " soundId=" << request.soundId()
<< " time=" << soundState.sampleTime();
<< " category=" << request.category
<< " egcuId=" << request.egcuId
<< " soundId=" << request.soundId
<< " time=" << soundState.sampleTime;
m_ddsHandler->dtsSom()->publish(soundState);
m_soundStates.append(soundState);
@@ -349,14 +349,14 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
}
case SoundManagement::PlayControl::StopAllSounds:
{
stopAllSounds(request.egcuId());
stopAllSounds(request.egcuId);
Core::FunctionReplyObject reply = Core::FunctionReplyObject(0);
m_ddsHandler->ftsSom()->controlSoundReply(cookie, reply);
break;
}
case SoundManagement::PlayControl::GetState:
{
getActiveSound(request.egcuId());
getActiveSound(request.egcuId);
Core::FunctionReplyObject reply = Core::FunctionReplyObject(0);
m_ddsHandler->ftsSom()->controlSoundReply(cookie, reply);
break;
@@ -379,10 +379,10 @@ void HandlerSounds::onStopSingleSound(const int egcuId, const SoundManagement::
while (it.hasNext())
{
const SoundState &item = it.next();
if ((item.soundId() == soundId) && (item.egcuId() == egcuId) && item.category() == soundCategory)
if ((item.soundId == soundId) && (item.egcuId == egcuId) && item.category == soundCategory)
{
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << item.id()
<< " egcuId=" << item.egcuId();
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << item.id
<< " egcuId=" << item.egcuId;
{
// start update request
@@ -403,7 +403,7 @@ void HandlerSounds::onStopSingleSound(const int egcuId, const SoundManagement::
startRequest(url);
}
m_ddsHandler->dtsSom()->removeSoundStateByKey(item.id());
m_ddsHandler->dtsSom()->removeSoundStateByKey(item.id);
it.remove();
// combination of soundId and egcuId may occur more than once, do not break the loop
}
@@ -439,13 +439,13 @@ QString HandlerSounds::stopAllSounds(const int egcuId)
{
const SoundState &ss(it.next());
DEBUG_LOG(m_logger) << "Sound EGCU=" << ss.egcuId() << " soundId=" << ss.soundId();
if (ss.egcuId() != egcuId)
DEBUG_LOG(m_logger) << "Sound EGCU=" << ss.egcuId << " soundId=" << ss.soundId;
if (ss.egcuId != egcuId)
continue;
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << ss.id()
<< " egcuId=" << ss.egcuId();
m_ddsHandler->dtsSom()->removeSoundStateByKey(ss.id());
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << ss.id
<< " egcuId=" << ss.egcuId;
m_ddsHandler->dtsSom()->removeSoundStateByKey(ss.id);
it.remove();
}
@@ -693,23 +693,23 @@ void HandlerSounds::handleSoundReport(const QString &json, const QString &host)
int soundId = getSoundIndex(category, name);
soundState.egcuId(egcuId);
soundState.soundId(soundId);
soundState.category(category);
soundState.id(m_indexActiveSound);
soundState.sampleTime(QDateTime::currentMSecsSinceEpoch());
soundState.egcuId = egcuId;
soundState.soundId = soundId;
soundState.category = category;
soundState.id = m_indexActiveSound;
soundState.sampleTime = QDateTime::currentMSecsSinceEpoch();
DEBUG_LOG(m_logger) << "id=" << m_indexActiveSound
<< " category=" << categoryStr
<< " name=" << name
<< " egcuId=" << egcuId
<< " soundId=" << soundId
<< " time=" << soundState.sampleTime();
<< " time=" << soundState.sampleTime;
for (const SoundManagement::SoundState& item : qAsConst(m_soundStates))
{
if ( (item.egcuId() == soundState.egcuId()) &&
(item.category() == soundState.category()) &&
(item.soundId() == soundState.soundId()) )
if ( (item.egcuId == soundState.egcuId) &&
(item.category == soundState.category) &&
(item.soundId == soundState.soundId) )
{
DEBUG_LOG(m_logger) << "Sound is already on DDS-Bus";
found = true;
@@ -750,24 +750,24 @@ void HandlerSounds::onInstrumentationAssetChanged(const InfrastructureManagement
modType != DataModification::eModified)
return;
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id()
<< " hostname=" << QString::fromStdString(data.hostname())
<< " mountingPointTypeId=" << data.mountingPointTypeId()
<< " assetStateId=" << data.assetStateId();
if ((data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
&& data.assetStateId() == InfrastructureManagement::InstrumentationAssetState::Mounted
&& data.hostname().size() > 0)
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id
<< " hostname=" << QString::fromStdString(data.hostname)
<< " mountingPointTypeId=" << data.mountingPointTypeId
<< " assetStateId=" << data.assetStateId;
if ((data.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
&& data.assetStateId == InfrastructureManagement::InstrumentationAssetState::Mounted
&& data.hostname.size() > 0)
{
QString hostname = QString::fromStdString(data.hostname());
DEBUG_LOG(m_logger) << "m_hostnames.insert id=" << data.id()
QString hostname = QString::fromStdString(data.hostname);
DEBUG_LOG(m_logger) << "m_hostnames.insert id=" << data.id
<< " hostname=" << hostname
<< " hostname.size=" << hostname.size()
<< " mountingPointTypeId=" << data.mountingPointTypeId()
<< " assetStateId=" << data.assetStateId();
<< " mountingPointTypeId=" << data.mountingPointTypeId
<< " assetStateId=" << data.assetStateId;
if (hostname.size() > 0 )
{
DEBUG_LOG(m_logger) << "insert EGCU in m_hostnames " << data.hostname();
m_hostnames.insert(data.id(), QString::fromStdString(data.hostname()));
DEBUG_LOG(m_logger) << "insert EGCU in m_hostnames " << data.hostname;
m_hostnames.insert(data.id, QString::fromStdString(data.hostname));
}
}
}
@@ -778,18 +778,18 @@ void HandlerSounds::onMountingPointAssetChanged(const InfrastructureManagement::
modType != DataModification::eModified)
return;
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged"
<< " id= " << data.id()
<< " assetId= " << data.assetId()
<< " structureElementId= " << data.structureElementId();
m_mountingPointAsset.insert(data.structureElementId(),data.assetId());
<< " id= " << data.id
<< " assetId= " << data.assetId
<< " structureElementId= " << data.structureElementId;
m_mountingPointAsset.insert(data.structureElementId,data.assetId);
}
void HandlerSounds::onSoundStateChanged(const SoundManagement::SoundState &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "onSoundStateChanged"
<< " id= " << data.id()
<< " egcuId= " << data.egcuId()
<< " soundId=" << data.soundId()
<< " id= " << data.id
<< " egcuId= " << data.egcuId
<< " soundId=" << data.soundId
<< " modType=" << modType;
if (modType != DataModification::eAdded &&