Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+31
-31
@@ -40,26 +40,26 @@ HandlerNasatAircraftParticipant::HandlerNasatAircraftParticipant(Initialization
|
||||
, m_fts(mainHandler->dds()->fts())
|
||||
, m_db(mainHandler->db())
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " END";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
HandlerNasatAircraftParticipant::~HandlerNasatAircraftParticipant()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
for (const auto &data : std::as_const(m_nasatAircraftParticipants))
|
||||
m_dts->removeNasatAircraftByKey(data.id());
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " END";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
bool HandlerNasatAircraftParticipant::init()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
auto cb = [this](const Database::NasatAircraftParticipant & data)
|
||||
{
|
||||
const auto dds(fromDb(data));
|
||||
DEBUG_LOG() << "m_nasatAircraftParticipants.insert(" << dds.id() << ")";
|
||||
DEBUG_LOG(m_logger) << "m_nasatAircraftParticipants.insert(" << dds.id() << ")";
|
||||
m_nasatAircraftParticipants.insert(dds.id(), dds);
|
||||
m_dts->publish(dds);
|
||||
m_mainHandler->handlerParticipant()->onNasatAircraftParticipantCreated(dds);
|
||||
@@ -85,16 +85,16 @@ bool HandlerNasatAircraftParticipant::init()
|
||||
dumpExercises();
|
||||
});
|
||||
|
||||
DEBUG_LOG() << "HandlerNasatAircraftParticipant init done";
|
||||
DEBUG_LOG(m_logger) << "HandlerNasatAircraftParticipant init done";
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandlerNasatAircraftParticipant::dumpNasatAircraftParticipants()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START, size=" << m_nasatAircraftParticipants.size();
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, size=" << m_nasatAircraftParticipants.size();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------";
|
||||
|
||||
auto it = m_nasatAircraftParticipants.begin();
|
||||
while (it != m_nasatAircraftParticipants.end())
|
||||
@@ -102,17 +102,17 @@ void HandlerNasatAircraftParticipant::dumpNasatAircraftParticipants()
|
||||
const auto &id = it.key();
|
||||
const auto &nap = it.value();
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " id=" << id << " - nap=" << nap;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id=" << id << " - nap=" << nap;
|
||||
++it;
|
||||
}
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " END, size=" << m_nasatAircraftParticipants.size();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, size=" << m_nasatAircraftParticipants.size();
|
||||
}
|
||||
|
||||
void HandlerNasatAircraftParticipant::dumpExercises()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START, size=" << m_exercises.size();
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, size=" << m_exercises.size();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------";
|
||||
|
||||
auto it = m_exercises.begin();
|
||||
while (it != m_exercises.end())
|
||||
@@ -120,11 +120,11 @@ void HandlerNasatAircraftParticipant::dumpExercises()
|
||||
const auto &id = it.key();
|
||||
const auto &nasatAircraftParticipant = it.value();
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " id=" << id << " - nasatAircraftParticipant=" << nasatAircraftParticipant;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id=" << id << " - nasatAircraftParticipant=" << nasatAircraftParticipant;
|
||||
++it;
|
||||
}
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------";
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " END, size=" << m_exercises.size();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, size=" << m_exercises.size();
|
||||
}
|
||||
|
||||
void HandlerNasatAircraftParticipant::aircraftRemoved(int nasatAircraftId)
|
||||
@@ -145,7 +145,7 @@ void HandlerNasatAircraftParticipant::aircraftRemoved(int nasatAircraftId)
|
||||
|
||||
void HandlerNasatAircraftParticipant::participantRemoved(int exerciseId, int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "participantRemoved: " << exerciseId << ", " << participantId;
|
||||
DEBUG_LOG(m_logger) << "participantRemoved: " << exerciseId << ", " << participantId;
|
||||
auto it = m_nasatAircraftParticipants.begin();
|
||||
while (it != m_nasatAircraftParticipants.end())
|
||||
{
|
||||
@@ -179,7 +179,7 @@ bool isExerciseStateValid(ExerciseManagement::ExerciseState_def::type state)
|
||||
|
||||
void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement::Exercise &exercise, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " START" << " , exercise" << exercise << " , modType" << modType;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " START" << " , exercise" << exercise << " , modType" << modType;
|
||||
|
||||
const int exId = exercise.id();
|
||||
switch (modType)
|
||||
@@ -190,10 +190,10 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement
|
||||
const bool valid = isExerciseStateValid(exercise.state().underlying());
|
||||
if (!valid)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " STATE of exId=" << exId
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE of exId=" << exId
|
||||
<< " , state=" << exercise.state();
|
||||
int cnt = removeNapsOfExercise(exId);
|
||||
INFO_LOG() << Q_FUNC_INFO << " STATE of exId=" << exId << " not valid : counter of removed naps=" << cnt;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE of exId=" << exId << " not valid : counter of removed naps=" << cnt;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -205,11 +205,11 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement
|
||||
const bool valid = isExerciseStateValid(exercise.state().underlying());
|
||||
if (!valid)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " STATE change of exId=" << exId
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of exId=" << exId
|
||||
<< " , old state=" << exerciseRef.state()
|
||||
<< " , new state=" << exercise.state();
|
||||
int cnt = removeNapsOfExercise(exId);
|
||||
INFO_LOG() << Q_FUNC_INFO << " STATE change of exId=" << exId << " : counter of removed naps=" << cnt;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of exId=" << exId << " : counter of removed naps=" << cnt;
|
||||
}
|
||||
}
|
||||
m_exercises[exId] = exercise;
|
||||
@@ -218,13 +218,13 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement
|
||||
case DataModification::eRemoved:
|
||||
{
|
||||
int cnt = removeNapsOfExercise(exId);
|
||||
INFO_LOG() << Q_FUNC_INFO << " STATE change of Exercise, counter of removed naps=" << cnt;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of Exercise, counter of removed naps=" << cnt;
|
||||
|
||||
m_exercises.remove(exId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
INFO_LOG() << Q_FUNC_INFO << " END" << " , exercise" << exercise << " , modType" << modType;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << " , exercise" << exercise << " , modType" << modType;
|
||||
}
|
||||
|
||||
void HandlerNasatAircraftParticipant::removeNasatAircraftParticipant(const NasatAircraftParticipant &val)
|
||||
@@ -238,10 +238,10 @@ void HandlerNasatAircraftParticipant::removeNasatAircraftParticipant(const Nasat
|
||||
void HandlerNasatAircraftParticipant::onModifyNasatAircraftParticipantRequest(const rti::core::SampleIdentity &cookie,
|
||||
const NasatAircraftParticipant &request)
|
||||
{
|
||||
DEBUG_LOG() << "onModifyNasatAircraftParticipantRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onModifyNasatAircraftParticipantRequest: " << request;
|
||||
auto ret = request.id() <= 0 ? createNasatAircraftParticipantRequest(request) : modifyNasatAircraftParticipantRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyNasatAircraftParticipantReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ Core::FunctionReplyObject HandlerNasatAircraftParticipant::modifyNasatAircraftPa
|
||||
|
||||
int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START, exerciseId=" << exerciseId
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, exerciseId=" << exerciseId
|
||||
<< ", m_nasatAircraftParticipants.size()" << m_nasatAircraftParticipants.size();
|
||||
int count = 0;
|
||||
QHash<int, NasatAircraftParticipant> napsCopy = m_nasatAircraftParticipants;
|
||||
@@ -308,7 +308,7 @@ int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId)
|
||||
{
|
||||
if (nap.exerciseId() == exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " nap has to be removed: nap=" << nap;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " nap has to be removed: nap=" << nap;
|
||||
|
||||
NasatAircraftParticipant napToTriggerRemoving;
|
||||
napToTriggerRemoving.id(nap.id());
|
||||
@@ -319,7 +319,7 @@ int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId)
|
||||
++count;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " END, exerciseId=" << exerciseId
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, exerciseId=" << exerciseId
|
||||
<< ", m_nasatAircraftParticipants.size()" << m_nasatAircraftParticipants.size()
|
||||
<< ", counter=" << count;
|
||||
return count;
|
||||
|
||||
Reference in new issue
Block a user