Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+15
-15
@@ -65,7 +65,7 @@ bool CesMissionPlanHandler::init()
|
||||
this, &CesMissionPlanHandler::onMissionPlanChanged);
|
||||
|
||||
|
||||
DEBUG_LOG() << " -- MissionPlanHandler::init() finished.";
|
||||
DEBUG_LOG(m_logger) << " -- MissionPlanHandler::init() finished.";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
}
|
||||
|
||||
// check if mission start is in the future before proceeding..
|
||||
DEBUG_LOG()<<" -- [updateMissionPlanList] new missionPlan : "<<data.name()<< " planId: "<<data.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [updateMissionPlanList] new missionPlan : "<<data.name()<< " planId: "<<data.id();
|
||||
|
||||
if (data.missionStart() < m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
WARNING_LOG() << " -- updateMissionPlanList mission startTime ("<<data.missionStart()<<") in the past ignore mission plan id: "<<data.id()
|
||||
WARNING_LOG(m_logger) << " -- updateMissionPlanList mission startTime ("<<data.missionStart()<<") in the past ignore mission plan id: "<<data.id()
|
||||
<< " name: " << data.name() << " - now: " << m_ddsHandler->currentPartitionTime();
|
||||
return;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
const int planId = obj->planId();
|
||||
std::function<void(void)> onDeleteObj = [this, planId]()
|
||||
{
|
||||
DEBUG_LOG()<<" -- remove ces mission object from container planId: "<<planId;
|
||||
DEBUG_LOG(m_logger)<<" -- remove ces mission object from container planId: "<<planId;
|
||||
m_missionPlanObjects.remove(planId);
|
||||
};
|
||||
connect(obj, &CesMissionPlanObject::destroyed, this, onDeleteObj);
|
||||
@@ -107,7 +107,7 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
DEBUG_LOG()<<" -- onUasChanged : uas.id = "<<data.id() <<" participantId = "<<data.participantId();
|
||||
DEBUG_LOG(m_logger)<<" -- onUasChanged : uas.id = "<<data.id() <<" participantId = "<<data.participantId();
|
||||
// get mission object of corresponding uas participant
|
||||
// if drone status is manual mode then cancel mission.
|
||||
if (data.uasState() != ProjectDataManagement::UasState_def::Manual && modType != DataModification::eRemoved)
|
||||
@@ -127,7 +127,7 @@ void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data,
|
||||
|
||||
void CesMissionPlanHandler::onMissionPlanChanged(const ParticipantManagement::MissionPlan &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG()<<" -- onMissionPlanChanged : missionPlanName: "<<data.name() << ", modType: " << (int)modType;
|
||||
DEBUG_LOG(m_logger)<<" -- onMissionPlanChanged : missionPlanName: "<<data.name() << ", modType: " << (int)modType;
|
||||
if (data.id() <= 0)
|
||||
return;
|
||||
switch (modType)
|
||||
@@ -159,11 +159,11 @@ bool CesMissionPlanHandler::isUasInAutoMode(int participantId)
|
||||
|
||||
if (uas.id() < 1)
|
||||
{
|
||||
ERROR_LOG() << "no uas for pid " << participantId;
|
||||
ERROR_LOG(m_logger) << "no uas for pid " << participantId;
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "uas with pid " << participantId << " is in mode: " << (int)uas.uasState().underlying();
|
||||
DEBUG_LOG(m_logger) << "uas with pid " << participantId << " is in mode: " << (int)uas.uasState().underlying();
|
||||
|
||||
return (uas.uasState() == ProjectDataManagement::UasState::Auto);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ bool CesMissionPlanHandler::isUasCombatReady(int participantId)
|
||||
}
|
||||
|
||||
//Current State
|
||||
DEBUG_LOG() << "stateHistory count" << data.stateHistory().size();
|
||||
DEBUG_LOG(m_logger) << "stateHistory count" << data.stateHistory().size();
|
||||
if (data.stateHistory().empty())
|
||||
{
|
||||
return false;
|
||||
@@ -196,7 +196,7 @@ bool CesMissionPlanHandler::isUasCombatReady(int participantId)
|
||||
youngestState.stateTime(0);
|
||||
for (const auto &si : history)
|
||||
{
|
||||
DEBUG_LOG() << "StateInformation "
|
||||
DEBUG_LOG(m_logger) << "StateInformation "
|
||||
<< " time=" << si.stateTime()
|
||||
<< " vulnerabilityBits=" << si.vulnerabilityBits()
|
||||
<< " vulnerabilityKindId=" << si.vulnerabilityKindId();
|
||||
@@ -212,7 +212,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
auto missionPlan = m_missionPlanObjects.value(msa.planId(), nullptr);
|
||||
if (!missionPlan)
|
||||
{
|
||||
DEBUG_LOG()<<" -- [SEND NEXT MISSION] Object not found. PlanId: "<<msa.planId();
|
||||
DEBUG_LOG(m_logger)<<" -- [SEND NEXT MISSION] Object not found. PlanId: "<<msa.planId();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
|
||||
if (!participant.equipmentNumber())
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav without equipment number";
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav without equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
|
||||
if (!isUasInAutoMode(participantId))
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav that is not in auto mode";
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav that is not in auto mode";
|
||||
//TODO: fulfill all other missions or mark as incomplete
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
|
||||
if (!isUasCombatReady(participantId))
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav that is not combat ready";
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav that is not combat ready";
|
||||
//TODO: fulfill all other missions or mark as incomplete
|
||||
return;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav: " << ex.what();
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav: " << ex.what();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -43,6 +43,7 @@ public:
|
||||
bool init();
|
||||
void updateMissionPlanList(const ParticipantManagement::MissionPlan &data);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendNextMissionAction();
|
||||
private Q_SLOTS:
|
||||
|
||||
|
||||
+17
-17
@@ -32,7 +32,7 @@ CesMissionPlanObject::CesMissionPlanObject(const ParticipantManagement::MissionP
|
||||
if (missionPlan.missionStart() > m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
const int time = m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime();
|
||||
// DEBUG_LOG()<<" -- [CesMissionPlanObject] start mission after << "<<time/1000<<" sec.";
|
||||
// DEBUG_LOG(m_logger)<<" -- [CesMissionPlanObject] start mission after << "<<time/1000<<" sec.";
|
||||
m_missionStartimer->start(time);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
///4- if no actions left send misson plan completed signal
|
||||
///5- else send next mission action to TAB
|
||||
|
||||
//DEBUG_LOG()<<" -- [setMissionActionFullfiled] -> msa.number: "<<msa.actionNumber()<<" planId: "<<msa.planId();
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionActionFullfiled] -> msa.number: "<<msa.actionNumber()<<" planId: "<<msa.planId();
|
||||
// actionNumb=-1 && itemNumb=-1 |-> mission will be aborted
|
||||
if (msa.itemNumber() < 0 && msa.actionNumber() < 0)
|
||||
{
|
||||
@@ -60,21 +60,21 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
-1,
|
||||
-1);
|
||||
if ( !m_ddsHandler->ftcPpm()->setMissionActionFulfilledRequest(abortReq))
|
||||
WARNING_LOG() << " -- unable to abort mission with planId:"<<abortReq.missionId();
|
||||
WARNING_LOG(m_logger) << " -- unable to abort mission with planId:"<<abortReq.missionId();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (msa.itemNumber() >= static_cast<int>(m_missionPlan.items().size()) )
|
||||
{
|
||||
//WARNING_LOG()<<" -- [setMissionActionFulfilled] item size invalid !!";
|
||||
//WARNING_LOG(m_logger)<<" -- [setMissionActionFulfilled] item size invalid !!";
|
||||
return;
|
||||
}
|
||||
|
||||
const int actionCount = m_missionPlan.items()[msa.itemNumber()].actions().size();
|
||||
if (msa.actionNumber() >= actionCount)
|
||||
{
|
||||
//WARNING_LOG()<<" -- [setMissionActionFulfilled] actions size invalid !!";
|
||||
//WARNING_LOG(m_logger)<<" -- [setMissionActionFulfilled] actions size invalid !!";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
req.missionId(m_missionPlan.id());
|
||||
|
||||
if (!m_ddsHandler->ftcPpm()->setMissionActionFulfilledRequest(req))
|
||||
WARNING_LOG() << " -- unable to setMissionActionFulfilledRequest: planId:"<<req.missionId();
|
||||
WARNING_LOG(m_logger) << " -- unable to setMissionActionFulfilledRequest: planId:"<<req.missionId();
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ bool CesMissionPlanObject::isMissionFulfilled(const ParticipantManagement::Missi
|
||||
actionCount = 0;
|
||||
for (const auto &a : item.actions())
|
||||
{
|
||||
//DEBUG_LOG()<<" -- [setMissionPlan] action.Num : "<<a.actionNumber()<<" itemNum: "<<a.itemNumber()<<" fulfilled: "<<a.fulfilled();
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionPlan] action.Num : "<<a.actionNumber()<<" itemNum: "<<a.itemNumber()<<" fulfilled: "<<a.fulfilled();
|
||||
if (a.fulfilled() > 0)
|
||||
actionCount++;
|
||||
else
|
||||
@@ -130,7 +130,7 @@ void CesMissionPlanObject::sendActionAttact()
|
||||
//3- setActionFulfilled
|
||||
int ret = m_ddsHandler->ftcAes()->explosionClusterSingleEffectOnlyModifyRequest(getExplosionCluster());
|
||||
if (!ret)
|
||||
WARNING_LOG()<<" -- sendActionAttact ret error for planId: "<<m_missionPlan.id();
|
||||
WARNING_LOG(m_logger)<<" -- sendActionAttact ret error for planId: "<<m_missionPlan.id();
|
||||
|
||||
setMissionActionFulfilled(getNextAction());
|
||||
}
|
||||
@@ -177,12 +177,12 @@ void CesMissionPlanObject::sendNextMissionAction()
|
||||
|
||||
ParticipantManagement::MissionAction action = getNextAction();
|
||||
|
||||
//DEBUG_LOG()<<" -- ########## ###### SEND NEXT ACTION ###### #############";
|
||||
//DEBUG_LOG(m_logger)<<" -- ########## ###### SEND NEXT ACTION ###### #############";
|
||||
|
||||
// set mission plan completed! or aborted
|
||||
if (isMissionFulfilled(m_missionPlan) || m_missionPlan.aborted())
|
||||
{
|
||||
DEBUG_LOG()<<" -- [sendNextMissionAction] No action mission Completed for plan id: "<<m_missionPlan.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [sendNextMissionAction] No action mission Completed for plan id: "<<m_missionPlan.id();
|
||||
deleteMissionPlanObject();
|
||||
return;
|
||||
}
|
||||
@@ -217,14 +217,14 @@ void CesMissionPlanObject::setMissionPlan(const ParticipantManagement::MissionPl
|
||||
m_missionPlan = plan;
|
||||
if (plan.missionStart() > m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
//DEBUG_LOG()<<" -- [setMissionPlan] restart Timer for plan.id: "<<plan.id();
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionPlan] restart Timer for plan.id: "<<plan.id();
|
||||
m_missionStartimer->start(m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime());
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMissionFulfilled(plan) || plan.aborted())
|
||||
{
|
||||
DEBUG_LOG() << "setMissionPlan deleteMissionPlanObject";
|
||||
DEBUG_LOG(m_logger) << "setMissionPlan deleteMissionPlanObject";
|
||||
deleteMissionPlanObject();
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ ParticipantManagement::MissionPlan &CesMissionPlanObject::missionPlan()
|
||||
const ParticipantManagement::MissionAction CesMissionPlanObject::getNextAction()
|
||||
{
|
||||
|
||||
DEBUG_LOG()<<" -- [getNextAction]: planId: "<<m_missionPlan.id()<<" itemSize: "<<m_missionPlan.items().size();
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextAction]: planId: "<<m_missionPlan.id()<<" itemSize: "<<m_missionPlan.items().size();
|
||||
std::vector<ParticipantManagement::MissionItem> items = m_missionPlan.items();
|
||||
|
||||
// std::sort(items.begin(), items.end(), [](const ParticipantManagement::MissionItem &itemA, const ParticipantManagement::MissionItem &itemB){ return (itemA.itemNumber() < itemB.itemNumber()); });
|
||||
@@ -253,7 +253,7 @@ const ParticipantManagement::MissionAction CesMissionPlanObject::getNextAction()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG()<<" -- [getNextActopm]mission with planId: " << m_missionPlan.id() << " // action_number " << msa.actionNumber()
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextActopm]mission with planId: " << m_missionPlan.id() << " // action_number " << msa.actionNumber()
|
||||
<< " // action_type " << msa.actionType();
|
||||
|
||||
return msa;
|
||||
@@ -277,7 +277,7 @@ void CesMissionPlanObject::setMissionCompleted()
|
||||
req.repeat(msp.repeat());
|
||||
|
||||
if (!m_ddsHandler->ftcPpm()->modifyMissionPlanRequest(req))
|
||||
ERROR_LOG()<<" -- couldn't modify mission plan ";
|
||||
ERROR_LOG(m_logger)<<" -- couldn't modify mission plan ";
|
||||
|
||||
// delete object object is connected with handler
|
||||
// it will be automatically removed from object list in handler
|
||||
@@ -292,7 +292,7 @@ void CesMissionPlanObject::setMissionCompleted()
|
||||
*/
|
||||
void CesMissionPlanObject::abortMission()
|
||||
{
|
||||
DEBUG_LOG()<<" -- [abortMission] abord mission with planId: "<<m_missionPlan.id()<<" // uas id: "<<m_missionPlan.participantId();
|
||||
DEBUG_LOG(m_logger)<<" -- [abortMission] abord mission with planId: "<<m_missionPlan.id()<<" // uas id: "<<m_missionPlan.participantId();
|
||||
ParticipantManagement::MissionAction msa = getNextAction();
|
||||
msa.actionNumber(-1);
|
||||
msa.itemNumber(-1);
|
||||
@@ -301,7 +301,7 @@ void CesMissionPlanObject::abortMission()
|
||||
|
||||
void CesMissionPlanObject::deleteMissionPlanObject()
|
||||
{
|
||||
DEBUG_LOG()<<" -- [DELETE OBJECT] plan fullfiled: delete Object planId: "<<m_missionPlan.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [DELETE OBJECT] plan fullfiled: delete Object planId: "<<m_missionPlan.id();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ public:
|
||||
int participantId() const; /// uas participantId
|
||||
bool isMissionFulfilled(const ParticipantManagement::MissionPlan &mission);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendActionAttact();
|
||||
AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest getExplosionCluster();
|
||||
ParticipantManagement::MissionPlan &missionPlan();
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ CES_MissionPlanInterfaceImpl::CES_MissionPlanInterfaceImpl(CentralEffectSimulati
|
||||
{
|
||||
Q_UNUSED(settings)
|
||||
|
||||
ERROR_LOG() << " >>> constructor CES_MissionPlanInterfaceImpl";
|
||||
ERROR_LOG(m_logger) << " >>> constructor CES_MissionPlanInterfaceImpl";
|
||||
}
|
||||
|
||||
CES_MissionPlanInterfaceImpl::~CES_MissionPlanInterfaceImpl()
|
||||
@@ -49,7 +49,7 @@ bool CES_MissionPlanInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
ERROR_LOG() << "CES_MissionPlanInterfaceImpl::init()"
|
||||
ERROR_LOG(m_logger) << "CES_MissionPlanInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,11 +62,11 @@ bool CES_MissionPlanInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_missionPlanHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CES_MissionPlanInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CES_MissionPlanInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ QString CES_MissionPlanInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_MissionPlanInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user