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
+44
-44
@@ -77,25 +77,25 @@ void ExerciseParticipantHandler::registerParticipant(qint32 participantId,
|
||||
const dds::core::optional<QString> &info)
|
||||
{
|
||||
ParticipantManagement::RegisterParticipantRequest req;
|
||||
req.assignState(assignState);
|
||||
req.assignState = assignState;
|
||||
|
||||
if (equipNo.is_set())
|
||||
req.equipmentNumber(equipNo.get());
|
||||
req.equipmentNumber = equipNo.get();
|
||||
if (identification.is_set())
|
||||
req.identification(identification.get().toStdString());
|
||||
req.identification = identification.get().toStdString();
|
||||
if (info.is_set())
|
||||
req.info(info.get().toStdString());
|
||||
req.info = info.get().toStdString();
|
||||
if (!equipNo.is_set() || !info.is_set() || !identification.is_set())
|
||||
{
|
||||
const auto participant = m_ddsHandlerExercise->ppmDtc()->participant(participantId);
|
||||
if (!equipNo.is_set() && participant.equipmentNumber().is_set())
|
||||
req.equipmentNumber(participant.equipmentNumber().get());
|
||||
if (!equipNo.is_set() && participant.equipmentNumber.is_set())
|
||||
req.equipmentNumber = participant.equipmentNumber.get();
|
||||
if (!info.is_set())
|
||||
req.info(participant.info());
|
||||
req.info = participant.info;
|
||||
if (!identification.is_set())
|
||||
req.identification(participant.identification());
|
||||
req.identification = participant.identification;
|
||||
}
|
||||
req.participantId(participantId);
|
||||
req.participantId = participantId;
|
||||
|
||||
INFO_LOG(m_logger) << "IN ::registerParticipant, ParticipantId: " << participantId
|
||||
<< ", equipNo: " << equipNo << ", assignState: " << assignState;
|
||||
@@ -105,18 +105,18 @@ void ExerciseParticipantHandler::registerParticipant(qint32 participantId,
|
||||
|
||||
void ExerciseParticipantHandler::onRegisterParticipantReply(const ParticipantManagement::RegisterReply &reply)
|
||||
{
|
||||
INFO_LOG(m_logger) << "RegisterReply id " << reply.id()
|
||||
<< " - registerReturnValue: " << reply.registerReturnValue()
|
||||
<< " for exercise " << reply.exerciseId();
|
||||
INFO_LOG(m_logger) << "RegisterReply id " << reply.id
|
||||
<< " - registerReturnValue: " << reply.registerReturnValue
|
||||
<< " for exercise " << reply.exerciseId;
|
||||
|
||||
|
||||
|
||||
Core::FunctionReplyObject fro;
|
||||
fro.setStr(reply.errorString().c_str());
|
||||
for (const auto &arg : reply.errorParams())
|
||||
fro.setStr(reply.errorString.c_str());
|
||||
for (const auto &arg : reply.errorParams)
|
||||
fro = fro.arg(arg);
|
||||
|
||||
|
||||
emit registrationReturnValue(reply.exerciseId(), reply.id(), reply.registerReturnValue());
|
||||
|
||||
emit registrationReturnValue(reply.exerciseId, reply.id, reply.registerReturnValue);
|
||||
|
||||
if (fro.error())
|
||||
ERROR_LOG(m_logger) << "Error: " << fro();
|
||||
@@ -125,13 +125,13 @@ void ExerciseParticipantHandler::onRegisterParticipantReply(const ParticipantMan
|
||||
void ExerciseParticipantHandler::participantAdded(const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
|
||||
if (!participant.equipmentNumber().is_set() || participant.equipmentNumber().get() == 0)
|
||||
if (!participant.equipmentNumber.is_set() || participant.equipmentNumber.get() == 0)
|
||||
{
|
||||
|
||||
|
||||
INFO_LOG(m_logger) << "New participant but no equipment number - ignoring";
|
||||
return;
|
||||
}
|
||||
addParticipant(participant.id(), participant.equipmentNumber().get());
|
||||
addParticipant(participant.id, participant.equipmentNumber.get());
|
||||
}
|
||||
|
||||
void ExerciseParticipantHandler::participantModified(const ParticipantManagement::Participant &participant)
|
||||
@@ -145,50 +145,50 @@ void ExerciseParticipantHandler::participantModified(const ParticipantManagement
|
||||
|
||||
|
||||
|
||||
const auto itEquipNumber = m_participantId2EquipmentNumber.constFind(participant.id());
|
||||
const auto itEquipNumber = m_participantId2EquipmentNumber.constFind(participant.id);
|
||||
if (itEquipNumber == m_participantId2EquipmentNumber.constEnd())
|
||||
{
|
||||
|
||||
|
||||
if (!participant.equipmentNumber().is_set() || participant.equipmentNumber() == 0)
|
||||
|
||||
|
||||
if (!participant.equipmentNumber.is_set() || participant.equipmentNumber.get() == 0)
|
||||
{
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
addParticipant(participant.id(), participant.equipmentNumber().get());
|
||||
|
||||
addParticipant(participant.id, participant.equipmentNumber.get());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (itEquipNumber.value() == participant.equipmentNumber())
|
||||
|
||||
if (participant.equipmentNumber.is_set() && itEquipNumber.value() == participant.equipmentNumber.get())
|
||||
{
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
if (participant.equipmentNumber().is_set())
|
||||
if (participant.equipmentNumber.is_set())
|
||||
{
|
||||
INFO_LOG(m_logger) << "Participant with id " << participant.id() << " changed its equipment number from "
|
||||
<< itEquipNumber.value() << " to " << participant.equipmentNumber().get();
|
||||
INFO_LOG(m_logger) << "Participant with id " << participant.id << " changed its equipment number from "
|
||||
<< itEquipNumber.value() << " to " << participant.equipmentNumber.get();
|
||||
}
|
||||
|
||||
if (participant.equipmentNumber() == 0)
|
||||
if (participant.equipmentNumber.is_set() && participant.equipmentNumber.get() == 0)
|
||||
{
|
||||
|
||||
removeParticipant(participant.id(), participant.equipmentNumber().get());
|
||||
|
||||
removeParticipant(participant.id, participant.equipmentNumber.get());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
removeParticipant(itEquipNumber.key(), itEquipNumber.value());
|
||||
if (participant.equipmentNumber().is_set())
|
||||
addParticipant(participant.id(), participant.equipmentNumber().get());
|
||||
if (participant.equipmentNumber.is_set())
|
||||
addParticipant(participant.id, participant.equipmentNumber.get());
|
||||
}
|
||||
|
||||
void ExerciseParticipantHandler::participantRemoved(const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
|
||||
const auto itEquipNumber = m_participantId2EquipmentNumber.find(participant.id());
|
||||
const auto itEquipNumber = m_participantId2EquipmentNumber.find(participant.id);
|
||||
if (itEquipNumber == m_participantId2EquipmentNumber.end())
|
||||
{
|
||||
|
||||
@@ -200,10 +200,10 @@ void ExerciseParticipantHandler::participantRemoved(const ParticipantManagement:
|
||||
|
||||
void ExerciseParticipantHandler::emitChangedForInferiors(const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
for (const int inferior : participant.inferiorIds())
|
||||
for (const int inferior : participant.inferiorIds)
|
||||
{
|
||||
const auto inf = m_ddsHandlerExercise->ppmDtc()->participant(inferior);
|
||||
if (inf.id() != 0)
|
||||
if (inf.id != 0)
|
||||
emit participantChanged(inf, DataModification::eModified, m_exerciseId);
|
||||
emitChangedForInferiors(inf);
|
||||
}
|
||||
@@ -258,10 +258,10 @@ void ExerciseParticipantHandler::onPartyChanged(const ParticipantManagement::Par
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_partyMap[data.id()] = data;
|
||||
m_partyMap[data.id] = data;
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_partyMap.remove(data.id());
|
||||
m_partyMap.remove(data.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user