Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1718 files changed
+126739
-18495
No files matched your search
+32
-32
@@ -69,14 +69,14 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
DEBUG_LOG(m_logger) << " remove Borderline- data.id()=" << data.id();
|
||||
m_borderlines.remove(data.id());
|
||||
DEBUG_LOG(m_logger) << " remove Borderline- data.id()=" << data.id;
|
||||
m_borderlines.remove(data.id);
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
{
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
switch (effectState.underlying())
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId;
|
||||
switch (effectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived:
|
||||
case AreaEffectSimulation::AesEffectState::EsFired:
|
||||
@@ -85,14 +85,14 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
case AreaEffectSimulation::AesEffectState::EsActivated:
|
||||
{
|
||||
BorderlineUtm borderline(data);
|
||||
DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id();
|
||||
m_borderlines.insert(data.id(), borderline);
|
||||
DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id;
|
||||
m_borderlines.insert(data.id, borderline);
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesEffectState::EsRemoved:
|
||||
case AreaEffectSimulation::AesEffectState::EsExpired:
|
||||
case AreaEffectSimulation::AesEffectState::EsPaused:
|
||||
m_borderlines.remove(data.id());
|
||||
m_borderlines.remove(data.id);
|
||||
break;
|
||||
case AreaEffectSimulation::AesEffectState::EsUnknown:
|
||||
case AreaEffectSimulation::AesEffectState::EsError:
|
||||
@@ -111,7 +111,7 @@ bool HandlerParticipantBorderline::intersect(const QPolygonF &polygonf, const QL
|
||||
{
|
||||
const QLineF segment(a, b);
|
||||
DEBUG_LOG(m_logger) << "segment:" << CentralEffectSimulation::debug(a) << " - " << CentralEffectSimulation::debug(b);
|
||||
if (QLineF::BoundedIntersection == linef.intersect(segment, nullptr))
|
||||
if (QLineF::BoundedIntersection == linef.intersects(segment, nullptr))
|
||||
return true;
|
||||
a = b;
|
||||
}
|
||||
@@ -123,8 +123,8 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
|
||||
{
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG(m_logger) << "ParicipantStep "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " participantId=" << partPos.participantId
|
||||
<< " participantTypeId=" << partPos.participantTypeId
|
||||
<< " Anzahl Borderlines=" << m_borderlines.size();
|
||||
|
||||
for (const BorderlineUtm &borderline : std::as_const(m_borderlines))
|
||||
@@ -132,7 +132,7 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
|
||||
DEBUG_LOG(m_logger) << "borderline id = " << borderline.id
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(borderline.boundingBox.bottomLeft())
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(borderline.boundingBox.topRight());
|
||||
const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId(), borderline.zone);
|
||||
const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId, borderline.zone);
|
||||
if (utmStepPoly.size() < 2)
|
||||
continue;
|
||||
|
||||
@@ -162,7 +162,7 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition,
|
||||
const ProjectDataManagement::PdmEventType eventType)
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId());
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId);
|
||||
|
||||
if (typeClass == ParticipantManagement::TypeClass::Unit ||
|
||||
typeClass == ParticipantManagement::TypeClass::SupportUnit ||
|
||||
@@ -170,40 +170,40 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
|
||||
typeClass == ParticipantManagement::TypeClass::Unknown)
|
||||
return;
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId);
|
||||
if (equipmentNumber <= 0)
|
||||
return;
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId
|
||||
<< " lat= " << participantPosition.pos.lat
|
||||
<< " lon= " << participantPosition.pos.lon
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
<< " eventType=" << eventType;
|
||||
pe.id(m_ddsHandler->getParticipantEventId());
|
||||
pe.eventTypeId(eventType);
|
||||
pe.participantId(participantPosition.participantId());
|
||||
pe.eventTime(participantPosition.sampleTime());
|
||||
pe.aesItemId(borderline.id);
|
||||
pe.partyId(participantPosition.partyId());
|
||||
pe.aesName(borderline.name.toStdString());
|
||||
pe.equipmentNumber(equipmentNumber);
|
||||
pe.position(participantPosition.pos());
|
||||
pe.id = m_ddsHandler->getParticipantEventId();
|
||||
pe.eventTypeId = eventType;
|
||||
pe.participantId = participantPosition.participantId;
|
||||
pe.eventTime = participantPosition.sampleTime;
|
||||
pe.aesItemId = borderline.id;
|
||||
pe.partyId = participantPosition.partyId;
|
||||
pe.aesName = borderline.name.toStdString();
|
||||
pe.equipmentNumber = equipmentNumber;
|
||||
pe.position = participantPosition.pos;
|
||||
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
qint64 id = pe.id();
|
||||
qint64 id = pe.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_ddsHandler->dtsCes()->removeParticipantEventByKey(id); });
|
||||
}
|
||||
|
||||
|
||||
HandlerParticipantBorderline::BorderlineUtm::BorderlineUtm(const AreaEffectSimulation::Borderline &bl)
|
||||
: id(bl.id())
|
||||
, operatorId(bl.operatorId())
|
||||
, partyId(bl.partyId.is_set() ? bl.partyId.get() : -1)
|
||||
, name(QString::fromStdString(bl.name()))
|
||||
: id(bl.id)
|
||||
, operatorId(bl.operatorId)
|
||||
, partyId(bl.partyId.has_value() ? bl.partyId.get() : -1)
|
||||
, name(QString::fromStdString(bl.name))
|
||||
{
|
||||
points.reserve(bl.segments().size());
|
||||
for (const Core::GeoPosition2D &pointGeo : bl.segments())
|
||||
points.reserve(bl.segments.size());
|
||||
for (const Core::GeoPosition2D &pointGeo : bl.segments)
|
||||
points.push_back(CentralEffectSimulation::geographic2Utm(pointGeo, &zone));
|
||||
|
||||
boundingBox = points.boundingRect();
|
||||
|
||||
+34
-34
@@ -69,12 +69,12 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovement &data : std::as_const(simMoveVec))
|
||||
{
|
||||
CentralEffectSimulation::SimulatedMovement request;
|
||||
request.id(data.id);
|
||||
request.name(data.name.toStdString());
|
||||
request.startTime(data.startTime);
|
||||
request.participantId(data.participantId);
|
||||
request.repeat(data.repeat);
|
||||
request.nextPoint(data.nextpoint);
|
||||
request.id = data.id;
|
||||
request.name = data.name.toStdString();
|
||||
request.startTime = data.startTime;
|
||||
request.participantId = data.participantId;
|
||||
request.repeat = data.repeat;
|
||||
request.nextPoint = data.nextpoint;
|
||||
DEBUG_LOG(m_logger) << "Loading SimulatedMovement: " << request;
|
||||
|
||||
QMap <int, CentralEffectSimulation::Database::CesSimulatedMovementSegment> segDbMap; // QMap to get it sorted
|
||||
@@ -83,16 +83,16 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
if (segData.simulatedMovementId == data.id)
|
||||
segDbMap.insert(segData.positionIndex, segData);
|
||||
}
|
||||
request.segments().reserve(segDbMap.size());
|
||||
request.segments.reserve(segDbMap.size());
|
||||
CentralEffectSimulation::SimulatedMovementSegment seg;
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segDb : std::as_const(segDbMap))
|
||||
{
|
||||
seg.delay(segDb.delay);
|
||||
seg.name(segDb.name.toStdString());
|
||||
seg.speed(segDb.speed);
|
||||
seg.position(Core::GeoPosition2D(segDb.position.x(),
|
||||
segDb.position.y()));
|
||||
request.segments().push_back(seg);
|
||||
seg.delay = segDb.delay;
|
||||
seg.name = segDb.name.toStdString();
|
||||
seg.speed = segDb.speed;
|
||||
seg.position = Core::GeoPosition2D(segDb.position.x(),
|
||||
segDb.position.y());
|
||||
request.segments.push_back(seg);
|
||||
}
|
||||
SimulationMovement *sm = new SimulationMovement(m_ddsHandler, m_db, m_handlerParticipant, request);
|
||||
m_simulationMovements.insert(sm->id(), sm);
|
||||
@@ -108,8 +108,8 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
if (m_simulationMovements.contains(request.id()))
|
||||
newSimulatedMovement.nextpoint = m_simulationMovements.value(request.id())->getNextPoint();
|
||||
if (m_simulationMovements.contains(request.id))
|
||||
newSimulatedMovement.nextpoint = m_simulationMovements.value(request.id)->getNextPoint();
|
||||
else // new Simulation
|
||||
newSimulatedMovement.nextpoint = 1;
|
||||
|
||||
@@ -119,13 +119,13 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
CentralEffectSimulation::Database::CesSimulatedMovementSegment newSegment;
|
||||
newSegment.simulatedMovementId = newSimulatedMovement.id;
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments())
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments)
|
||||
{
|
||||
newSegment.id = 0; // insert
|
||||
newSegment.delay = seg.delay();
|
||||
newSegment.speed = seg.speed();
|
||||
newSegment.name = QString::fromStdString(seg.name());
|
||||
newSegment.position = QPointF(seg.position().lon(), seg.position().lat());
|
||||
newSegment.delay = seg.delay;
|
||||
newSegment.speed = seg.speed;
|
||||
newSegment.name = QString::fromStdString(seg.name);
|
||||
newSegment.position = QPointF(seg.position.lon, seg.position.lat);
|
||||
if (!m_db->insert(newSegment))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error adding 'CesSimulatedMovementSegment' to database"));
|
||||
|
||||
@@ -134,7 +134,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
trans.commit();
|
||||
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id;
|
||||
return Core::FunctionReplyObject(newSimulatedMovement.id);
|
||||
} // end of insertInDb
|
||||
|
||||
@@ -152,19 +152,19 @@ Core::FunctionReplyObject HandlerSimulatedMovement::updateDb(const CentralEffect
|
||||
// Insert new segments:
|
||||
CentralEffectSimulation::Database::CesSimulatedMovementSegment newSegment;
|
||||
newSegment.simulatedMovementId = newSimulatedMovement.id;
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments())
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &seg : request.segments)
|
||||
{
|
||||
newSegment.id = 0; // insert
|
||||
newSegment.delay = seg.delay();
|
||||
newSegment.speed = seg.speed();
|
||||
newSegment.name = QString::fromStdString(seg.name());
|
||||
newSegment.position = QPointF(seg.position().lon(), seg.position().lat());
|
||||
newSegment.delay = seg.delay;
|
||||
newSegment.speed = seg.speed;
|
||||
newSegment.name = QString::fromStdString(seg.name);
|
||||
newSegment.position = QPointF(seg.position.lon, seg.position.lat);
|
||||
if (!m_db->insert(newSegment))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error adding 'CesSimulatedMovementSegment' to database"));
|
||||
++newSegment.positionIndex;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id;
|
||||
return Core::FunctionReplyObject(newSimulatedMovement.id);
|
||||
} // end of updateDb
|
||||
|
||||
@@ -208,23 +208,23 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core:
|
||||
const CentralEffectSimulation::SimulatedMovement &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSimulatedMovementModifyRequest: " << request;
|
||||
m_jumpToStart = request.jumpToStart();
|
||||
m_jumpToStart = request.jumpToStart;
|
||||
|
||||
// we allow a modify with requestId = 0 and participantId != 0
|
||||
SimulationMovement *sm = findSimulationMovement(request.id(), request.participantId());
|
||||
SimulationMovement *sm = findSimulationMovement(request.id, request.participantId);
|
||||
if (sm)
|
||||
sm->setSimulatedMovementRequest(request);
|
||||
else
|
||||
sm = new SimulationMovement(m_ddsHandler, m_db, m_handlerParticipant, request);
|
||||
|
||||
// New Route
|
||||
if (request.jumpToStart())
|
||||
if (request.jumpToStart)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "sm->setJump(true)";
|
||||
sm->setJump(true);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject reply = request.id() > 0
|
||||
Core::FunctionReplyObject reply = request.id > 0
|
||||
? updateDb(sm->simMovementData())
|
||||
: insertInDb(sm->simMovementData());
|
||||
|
||||
@@ -232,7 +232,7 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core:
|
||||
m_simulationMovements[sm->id()] = sm;
|
||||
publishSimulatedMovement(request);
|
||||
|
||||
setParticipantAsSimulated(request.participantId(), true);
|
||||
setParticipantAsSimulated(request.participantId, true);
|
||||
|
||||
DEBUG_LOG(m_logger) << "simulatedMovementModifyReply id=" << reply.id();
|
||||
|
||||
@@ -268,7 +268,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::removeSimulatedMovement(int3
|
||||
void HandlerSimulatedMovement::onSimulatedMovementRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject reply = removeSimulatedMovement(request.id());
|
||||
Core::FunctionReplyObject reply = removeSimulatedMovement(request.id);
|
||||
if (reply.error())
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
m_ddsHandler->ftsCes()->simulatedMovementRemoveReply(cookie, reply);
|
||||
@@ -283,7 +283,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(c
|
||||
int id = 0;
|
||||
for (const SimulationMovement *simMovement : std::as_const(m_simulationMovements))
|
||||
{
|
||||
if (simMovement->participantId() == request.participantId())
|
||||
if (simMovement->participantId() == request.participantId)
|
||||
{
|
||||
id = simMovement->id();
|
||||
break;
|
||||
|
||||
+75
-75
@@ -44,18 +44,18 @@ SimulationMovement::SimulationMovement(const std::shared_ptr<CentralEffectSimula
|
||||
SimulationMovement::~SimulationMovement()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Delete SimulatedMovement "
|
||||
<< " id=" << m_simMovement.id()
|
||||
<< " participantId= " << m_simMovement.participantId();
|
||||
m_ddsHandler->dtsCes()->removeSimulatedMovementByKey(m_simMovement.id());
|
||||
<< " id=" << m_simMovement.id
|
||||
<< " participantId= " << m_simMovement.participantId;
|
||||
m_ddsHandler->dtsCes()->removeSimulatedMovementByKey(m_simMovement.id);
|
||||
m_segTimer->stop();
|
||||
m_moveTimer->stop();
|
||||
}
|
||||
|
||||
void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulation::SimulatedMovement &sml)
|
||||
{
|
||||
int nextPoint = m_simMovement.nextPoint();
|
||||
int nextPoint = m_simMovement.nextPoint;
|
||||
m_simMovement = sml;
|
||||
m_simMovement.nextPoint(nextPoint);
|
||||
m_simMovement.nextPoint = nextPoint;
|
||||
|
||||
m_moveTime = 1;
|
||||
m_segTimer->stop();
|
||||
@@ -64,32 +64,32 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
m_points.clear();
|
||||
m_segSpeed.clear();
|
||||
m_segDelay.clear();
|
||||
m_points.reserve(sml.segments().size());
|
||||
m_segSpeed.reserve(sml.segments().size());
|
||||
m_segDelay.reserve(sml.segments().size());
|
||||
m_points.reserve(sml.segments.size());
|
||||
m_segSpeed.reserve(sml.segments.size());
|
||||
m_segDelay.reserve(sml.segments.size());
|
||||
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &point : sml.segments())
|
||||
for (const CentralEffectSimulation::SimulatedMovementSegment &point : sml.segments)
|
||||
{
|
||||
const Core::GeoPosition2D &pointGeo = point.position();
|
||||
const Core::GeoPosition2D &pointGeo = point.position;
|
||||
m_points.push_back(m_zone == -1 ? CentralEffectSimulation::geographic2Utm(pointGeo, &m_zone) : CentralEffectSimulation::geographic2Utm(pointGeo, m_zone));
|
||||
DEBUG_LOG(m_logger) << "pointGeo lat=" << pointGeo.lat() << " lon=" << pointGeo.lon()
|
||||
<< " point lat=" << point.position().lat() << " lon=" << point.position().lon()
|
||||
DEBUG_LOG(m_logger) << "pointGeo lat=" << pointGeo.lat << " lon=" << pointGeo.lon
|
||||
<< " point lat=" << point.position.lat << " lon=" << point.position.lon
|
||||
<< " utmPoint=" << CentralEffectSimulation::debug(m_points.last());
|
||||
m_segSpeed.append(point.speed());
|
||||
m_segDelay.append(point.delay());
|
||||
m_segSpeed.append(point.speed);
|
||||
m_segDelay.append(point.delay);
|
||||
}
|
||||
|
||||
// Only start simulation in future
|
||||
DEBUG_LOG(m_logger) << "m_startTime - QDateTime::currentMSecsSinceEpoch()=" << m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_startTime=" << m_simMovement.startTime()
|
||||
DEBUG_LOG(m_logger) << "m_startTime - QDateTime::currentMSecsSinceEpoch()=" << m_simMovement.startTime - QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_startTime=" << m_simMovement.startTime
|
||||
<< " currentTime=" << QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_nextPoint=" << m_simMovement.nextPoint();
|
||||
<< " m_nextPoint=" << m_simMovement.nextPoint;
|
||||
|
||||
if (m_simMovement.nextPoint() > 0 && m_points.size() > m_simMovement.nextPoint())
|
||||
m_newPos = m_points[m_simMovement.nextPoint()].toPoint();
|
||||
if (m_simMovement.nextPoint > 0 && m_points.size() > m_simMovement.nextPoint)
|
||||
m_newPos = m_points[m_simMovement.nextPoint].toPoint();
|
||||
|
||||
if (m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch() > 0)
|
||||
m_moveTimer->start(m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch());
|
||||
if (m_simMovement.startTime - QDateTime::currentMSecsSinceEpoch() > 0)
|
||||
m_moveTimer->start(m_simMovement.startTime - QDateTime::currentMSecsSinceEpoch());
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Service-Start";
|
||||
@@ -99,7 +99,7 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
|
||||
void SimulationMovement::updateNextPointInDb()
|
||||
{
|
||||
if (m_simMovement.id() <= 0)
|
||||
if (m_simMovement.id <= 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Internal error - id not set!";
|
||||
return;
|
||||
@@ -111,55 +111,55 @@ void SimulationMovement::updateNextPointInDb()
|
||||
|
||||
void SimulationMovement::startNewSegment()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "simulate participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint = " << m_simMovement.nextPoint();
|
||||
DEBUG_LOG(m_logger) << "simulate participantId = " << m_simMovement.participantId
|
||||
<< " m_nextPoint = " << m_simMovement.nextPoint;
|
||||
|
||||
m_moveTime = 1;
|
||||
if (m_simMovement.nextPoint() < m_points.size())
|
||||
if (m_simMovement.nextPoint < m_points.size())
|
||||
{
|
||||
QPointF p1;
|
||||
// Next segment
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData pos = m_handlerParticipant->position(m_simMovement.participantId());
|
||||
if (pos.participantId() == m_simMovement.participantId())
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData pos = m_handlerParticipant->position(m_simMovement.participantId);
|
||||
if (pos.participantId == m_simMovement.participantId)
|
||||
{
|
||||
p1 = CentralEffectSimulation::geographic2Utm(pos.pos(), m_zone);
|
||||
p1 = CentralEffectSimulation::geographic2Utm(pos.pos, m_zone);
|
||||
DEBUG_LOG(m_logger) << "Next segment ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_simStart) // Wait for participantPosition
|
||||
{
|
||||
INFO_LOG(m_logger) << "Wait for participant position participantId =" << m_simMovement.participantId();
|
||||
INFO_LOG(m_logger) << "Wait for participant position participantId =" << m_simMovement.participantId;
|
||||
m_segTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
if (m_simMovement.nextPoint() > 0)
|
||||
if (m_simMovement.nextPoint > 0)
|
||||
{
|
||||
p1 = m_points.at(m_simMovement.participantId() - 1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint>0 (" << m_simMovement.nextPoint() << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
p1 = m_points.at(m_simMovement.participantId - 1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint>0 (" << m_simMovement.nextPoint << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
p1 = m_points.at(m_points.size() - 1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint=" << m_simMovement.nextPoint() << " ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint=" << m_simMovement.nextPoint << " ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
}
|
||||
const QPointF &p2 = m_points.at(m_simMovement.nextPoint());
|
||||
const QPointF &p2 = m_points.at(m_simMovement.nextPoint);
|
||||
m_actSegment.setPoints(p1, p2);
|
||||
int curDelay = m_segDelay.at(m_simMovement.nextPoint());
|
||||
int curDelay = m_segDelay.at(m_simMovement.nextPoint);
|
||||
DEBUG_LOG(m_logger) << "New Segment: p1 = " << CentralEffectSimulation::debug(p1) << " p2=" << CentralEffectSimulation::debug(p2)
|
||||
<< " delay =" << curDelay;
|
||||
m_moveTimer->start(curDelay);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_simMovement.repeat())
|
||||
if (m_simMovement.repeat)
|
||||
{
|
||||
m_simMovement.nextPoint(0);
|
||||
m_moveTimer->start(m_segDelay.at(m_simMovement.nextPoint()));
|
||||
m_simMovement.nextPoint = 0;
|
||||
m_moveTimer->start(m_segDelay.at(m_simMovement.nextPoint));
|
||||
}
|
||||
else
|
||||
m_simMovement.nextPoint(-1); // Invalid value
|
||||
m_simMovement.nextPoint = -1; // Invalid value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,10 +168,10 @@ void SimulationMovement::setJump(bool jump)
|
||||
DEBUG_LOG(m_logger) << "Jump";
|
||||
if (jump)
|
||||
{
|
||||
m_simMovement.nextPoint(1);
|
||||
m_simMovement.nextPoint = 1;
|
||||
m_newPos = m_points.at(0);
|
||||
m_actSegment.setPoints(m_newPos,
|
||||
m_points.at(m_simMovement.nextPoint()));
|
||||
m_points.at(m_simMovement.nextPoint));
|
||||
m_moveTime = 1;
|
||||
m_simStart = false;
|
||||
publishNewPos();
|
||||
@@ -181,7 +181,7 @@ void SimulationMovement::setJump(bool jump)
|
||||
|
||||
void SimulationMovement::publishSimulatedMovement()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " m_nextPoint= " << m_simMovement.nextPoint();
|
||||
DEBUG_LOG(m_logger) << " m_nextPoint= " << m_simMovement.nextPoint;
|
||||
m_ddsHandler->dtsCes()->publish(m_simMovement);
|
||||
}
|
||||
|
||||
@@ -202,10 +202,10 @@ void SimulationMovement::publishNewPos()
|
||||
|
||||
const Core::GeoPosition pos(Core::GeoPosition(posGeo.x(), posGeo.y(), 0));
|
||||
|
||||
participantPos.equipmentNumber(-m_simMovement.participantId()); // negative - treat as participantId
|
||||
participantPos.sampleTime(m_ddsHandler->currentPartitionTime());
|
||||
participantPos.position().position(pos);
|
||||
participantPos.position().reportingSource(Core::PositionReportingSource::MovementSimulation);
|
||||
participantPos.equipmentNumber = -m_simMovement.participantId; // negative - treat as participantId
|
||||
participantPos.sampleTime = m_ddsHandler->currentPartitionTime();
|
||||
participantPos.position.position = pos;
|
||||
participantPos.position.reportingSource = Core::PositionReportingSource::MovementSimulation;
|
||||
|
||||
m_ddsHandler->dtsTab()->publish(participantPos);
|
||||
|
||||
@@ -214,23 +214,23 @@ void SimulationMovement::publishNewPos()
|
||||
void SimulationMovement::move()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move";
|
||||
if (m_simMovement.nextPoint() < 0)
|
||||
if (m_simMovement.nextPoint < 0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move next point < 0";
|
||||
return;
|
||||
}
|
||||
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(m_simMovement.participantId());
|
||||
const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(partPos.pos(), m_zone);
|
||||
if (partPos.participantId() != m_simMovement.participantId())
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(m_simMovement.participantId);
|
||||
const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(partPos.pos, m_zone);
|
||||
if (partPos.participantId != m_simMovement.participantId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId;
|
||||
m_moveTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
if (!partPos.positionValid)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId;
|
||||
m_moveTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void SimulationMovement::move()
|
||||
if (m_simStart)
|
||||
{
|
||||
m_actSegment.setPoints(participantPosUtm,
|
||||
m_points.at(m_simMovement.nextPoint()));
|
||||
m_points.at(m_simMovement.nextPoint));
|
||||
step = m_actSegment;
|
||||
DEBUG_LOG(m_logger) << "m_simStart set m_actSegment"
|
||||
<< " p1: " << CentralEffectSimulation::debug(m_actSegment.p1())
|
||||
@@ -248,14 +248,14 @@ void SimulationMovement::move()
|
||||
m_simStart = false;
|
||||
}
|
||||
|
||||
if (m_segSpeed[m_simMovement.nextPoint()] <= 0.0)
|
||||
if (m_segSpeed[m_simMovement.nextPoint] <= 0.0)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move next point < 0";
|
||||
return;
|
||||
}
|
||||
|
||||
m_newPos = m_points[m_simMovement.nextPoint()];
|
||||
step.setLength(m_segSpeed[m_simMovement.nextPoint()] * m_moveTime);
|
||||
m_newPos = m_points[m_simMovement.nextPoint];
|
||||
step.setLength(m_segSpeed[m_simMovement.nextPoint] * m_moveTime);
|
||||
m_moveTime++;
|
||||
// ready criterion
|
||||
if (step.length() >= m_actSegment.length() + 0.1 ||
|
||||
@@ -263,25 +263,25 @@ void SimulationMovement::move()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "move ready step.length()=" << step.length()
|
||||
<< " m_actSegment.length()=" << m_actSegment.length();
|
||||
m_simMovement.nextPoint(m_simMovement.nextPoint() + 1);
|
||||
if (m_simMovement.nextPoint() >= m_points.size())
|
||||
m_simMovement.nextPoint = m_simMovement.nextPoint + 1;
|
||||
if (m_simMovement.nextPoint >= m_points.size())
|
||||
{
|
||||
if (m_simMovement.repeat())
|
||||
m_simMovement.nextPoint(0);
|
||||
if (m_simMovement.repeat)
|
||||
m_simMovement.nextPoint = 0;
|
||||
else
|
||||
{
|
||||
m_simMovement.nextPoint(-1); // Invalid value
|
||||
m_simMovement.nextPoint = -1; // Invalid value
|
||||
return;
|
||||
}
|
||||
}
|
||||
updateNextPointInDb();
|
||||
DEBUG_LOG(m_logger) << "ready move participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint()
|
||||
DEBUG_LOG(m_logger) << "ready move participantId = " << m_simMovement.participantId
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint
|
||||
<< " newPos =" << m_newPos.x() << "/" << m_newPos.y()
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint()] * m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint] * m_moveTime
|
||||
<< " step.length=" << step.length()
|
||||
<< " m_segSpeed[m_nextPoint]=" << m_segSpeed[m_simMovement.nextPoint()]
|
||||
<< " m_segSpeed[m_nextPoint]=" << m_segSpeed[m_simMovement.nextPoint]
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " m_actSegment.length=" << m_actSegment.length()
|
||||
<< " m_zone=" << m_zone;
|
||||
@@ -291,13 +291,13 @@ void SimulationMovement::move()
|
||||
return;
|
||||
}
|
||||
m_newPos = step.p2();
|
||||
DEBUG_LOG(m_logger) << "move participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint()
|
||||
DEBUG_LOG(m_logger) << "move participantId = " << m_simMovement.participantId
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint
|
||||
<< " newPos =" << m_newPos.x() << "/" << m_newPos.y()
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint()] * m_moveTime
|
||||
<< " length=" << m_segSpeed[m_simMovement.nextPoint] * m_moveTime
|
||||
<< " step.length=" << step.length()
|
||||
<< " m_speed=" << m_segSpeed[m_simMovement.nextPoint()]
|
||||
<< " m_speed=" << m_segSpeed[m_simMovement.nextPoint]
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
<< " m_actSegment.length=" << m_actSegment.length()
|
||||
<< " m_zone=" << m_zone;
|
||||
@@ -308,12 +308,12 @@ void SimulationMovement::move()
|
||||
CentralEffectSimulation::Database::CesSimulatedMovement SimulationMovement::toDb(const CentralEffectSimulation::SimulatedMovement &ddsSimMovement)
|
||||
{
|
||||
CentralEffectSimulation::Database::CesSimulatedMovement ret;
|
||||
ret.id = ddsSimMovement.id();
|
||||
ret.name = QString::fromStdString(ddsSimMovement.name());
|
||||
ret.startTime = ddsSimMovement.startTime();
|
||||
ret.participantId = ddsSimMovement.participantId();
|
||||
ret.repeat = ddsSimMovement.repeat();
|
||||
ret.nextpoint = ddsSimMovement.nextPoint();
|
||||
ret.id = ddsSimMovement.id;
|
||||
ret.name = QString::fromStdString(ddsSimMovement.name);
|
||||
ret.startTime = ddsSimMovement.startTime;
|
||||
ret.participantId = ddsSimMovement.participantId;
|
||||
ret.repeat = ddsSimMovement.repeat;
|
||||
ret.nextpoint = ddsSimMovement.nextPoint;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -32,13 +32,13 @@ public:
|
||||
|
||||
~SimulationMovement();
|
||||
void setSimulatedMovementRequest(const CentralEffectSimulation::SimulatedMovement &sml);
|
||||
int id() const { return m_simMovement.id(); }
|
||||
void setId(int id) { m_simMovement.id(id); }
|
||||
int participantId() const { return m_simMovement.participantId(); }
|
||||
int id() const { return m_simMovement.id; }
|
||||
void setId(int id) { m_simMovement.id = id; }
|
||||
int participantId() const { return m_simMovement.participantId; }
|
||||
|
||||
void setJump(bool jump);
|
||||
void setnextPoint(int nextPoint) { m_simMovement.nextPoint(nextPoint); }
|
||||
int getNextPoint() const { return m_simMovement.nextPoint(); }
|
||||
void setnextPoint(int nextPoint) { m_simMovement.nextPoint = nextPoint; }
|
||||
int getNextPoint() const { return m_simMovement.nextPoint; }
|
||||
void publishSimulatedMovement();
|
||||
const CentralEffectSimulation::SimulatedMovement &simMovementData() const { return m_simMovement; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user