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
@@ -7,6 +7,7 @@
|
||||
#include "helper.h"
|
||||
#include <AudioVideoManagement/avm_dtc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <LtsUtils/LtsUtilsCore/outdated_position.h>
|
||||
#include <QtGlobal>
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -22,13 +23,13 @@ QSet<int> participantIdsFromParty(const QMap<int32_t, ParticipantManagement::Par
|
||||
{
|
||||
ret.reserve(participants.size());
|
||||
for (const auto &p : participants)
|
||||
ret += p.id();
|
||||
ret += p.id;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const auto &participant : participants)
|
||||
if (participant.partyId() == partyId)
|
||||
ret += participant.id();
|
||||
if (participant.partyId == partyId)
|
||||
ret += participant.id;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -61,10 +62,10 @@ WebSocketInterface::Messages::PositionsCnrMessage::PositionsCnrMessageData Posit
|
||||
if (!plan)
|
||||
return positionsData;
|
||||
|
||||
for (const auto &entry : plan->data())
|
||||
for (const auto &entry : plan->data)
|
||||
{
|
||||
AudioVideoManagement::CnrConfig cnrConfig = m_avmDtc->cnrConfig(entry.cnrConfigId());
|
||||
AudioVideoManagement::CnrChannel cnrChannel = m_avmDtc->cnrChannel(cnrConfig.cnrChannelId());
|
||||
AudioVideoManagement::CnrConfig cnrConfig = m_avmDtc->cnrConfig(entry.cnrConfigId);
|
||||
AudioVideoManagement::CnrChannel cnrChannel = m_avmDtc->cnrChannel(cnrConfig.cnrChannelId);
|
||||
|
||||
positionsData.radioCircuit.push_back({toRcIdString(cnrChannel), positionsFor(cnrConfig)});
|
||||
}
|
||||
@@ -74,14 +75,14 @@ WebSocketInterface::Messages::PositionsCnrMessage::PositionsCnrMessageData Posit
|
||||
|
||||
QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::positionsForGlobal(const AudioVideoManagement::CnrConfig &config) const
|
||||
{
|
||||
bool isGlobal = !config.exerciseId().is_set();
|
||||
bool isGlobal = !config.exerciseId.is_set();
|
||||
Q_ASSERT(isGlobal);
|
||||
return positionsForLocal(config);
|
||||
}
|
||||
|
||||
QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::positionsFor(const AudioVideoManagement::CnrConfig &config) const
|
||||
{
|
||||
bool isLocal = config.exerciseId().is_set();
|
||||
bool isLocal = config.exerciseId.is_set();
|
||||
if (isLocal)
|
||||
return positionsForLocal(config);
|
||||
else
|
||||
@@ -95,12 +96,12 @@ QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::p
|
||||
auto allParticipants = m_ppmDtc->participants();
|
||||
|
||||
QSet<int> participantIdsInUnit;
|
||||
if (config.unitId().is_set())
|
||||
m_ppmDtc->participantIdsByUnit(config.unitId().get(), allParticipants, participantIdsInUnit);
|
||||
if (config.unitId.is_set())
|
||||
m_ppmDtc->participantIdsByUnit(config.unitId.get(), allParticipants, participantIdsInUnit);
|
||||
else
|
||||
{
|
||||
bool isGlobal = !config.exerciseId().is_set();
|
||||
participantIdsInUnit = participantIdsFromParty(allParticipants, config.partyId(), isGlobal);
|
||||
bool isGlobal = !config.exerciseId.is_set();
|
||||
participantIdsInUnit = participantIdsFromParty(allParticipants, config.partyId, isGlobal);
|
||||
}
|
||||
|
||||
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
||||
@@ -109,21 +110,24 @@ QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::p
|
||||
for (int participantId : std::as_const(participantIdsInUnit))
|
||||
{
|
||||
const ParticipantManagement::Participant &participant = allParticipants.value(participantId);
|
||||
if (!participant.equipmentNumber().is_set())
|
||||
if (!participant.equipmentNumber.is_set())
|
||||
continue;
|
||||
|
||||
const ParticipantManagement::Type &type = m_ppmDtc->type(participant.typeId());
|
||||
if (type.radioCount() < 1)
|
||||
continue;
|
||||
const ParticipantManagement::Type &type = m_ppmDtc->type(participant.typeId);
|
||||
if (type.radioCount < 1)
|
||||
continue;
|
||||
|
||||
const auto &pos = m_ppmDtc->participantPosition(participantId);
|
||||
if (pos.participantId() != participantId)
|
||||
continue;
|
||||
if (pos.participantId != participantId)
|
||||
continue;
|
||||
|
||||
if (LtsUtils::isPositionTimeOutdated(now, pos.sampleTime()))
|
||||
continue;
|
||||
if (LtsUtils::isPositionTimeOutdated(now, pos.sampleTime))
|
||||
continue;
|
||||
|
||||
positions.push_back({toDeg(pos.pos().lon()), toDeg(pos.pos().lat())});
|
||||
WebSocketInterface::Messages::ReplyMessage::LonLatPoint point;
|
||||
point.lon = toDeg(pos.pos.lon);
|
||||
point.lat = toDeg(pos.pos.lat);
|
||||
positions.push_back(point);
|
||||
}
|
||||
|
||||
return positions;
|
||||
@@ -132,9 +136,9 @@ QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::p
|
||||
boost::optional<AudioVideoManagement::FrequencyPlanning> PositionsCnr::activePlan() const
|
||||
{
|
||||
AudioVideoManagement::ActiveFrequencyPlanning activePlanning = m_avmDtc->activeFrequencyPlanning(m_exerciseId);
|
||||
if (activePlanning.exerciseId() != m_exerciseId)
|
||||
if (activePlanning.exerciseId != m_exerciseId)
|
||||
return boost::none;
|
||||
return m_avmDtc->frequencyPlanning(activePlanning.frequencyPlanningId());
|
||||
return m_avmDtc->frequencyPlanning(activePlanning.frequencyPlanningId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user