Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -35,16 +35,15 @@ bool isActive(ExerciseManagement::ExerciseState state)
namespace AudioVideoManagement
{
ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId)
: QObject()
ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId) : QObject()
, m_exContext(exerciseId)
, m_curExerciseState(ExerciseManagement::ExerciseState::Unknown)
, m_curAVOperatingMode(AVControl::OperatingMode::Unknown)
, m_mainHandler(mainHandler)
, m_updateTimer(new QTimer(this))
, m_lastSeenTimer(new QTimer(this))
, m_bWarnedOnce(false)
{
, m_bWarnedOnce(false),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
m_updateTimer->setSingleShot(true);
connect(m_updateTimer, &QTimer::timeout, this, &ExerciseHandler::onUpdateTimerTimeout);
@@ -74,7 +73,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
m_recordSession.type = avTypeRecordSession();
if (!db()->insert(m_recordSession))
{
ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting";
ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting";
return;
}
emit avDbReloadNeeded();
@@ -88,7 +87,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
m_replaySession.type = avTypePlaybackSession();
if (!db()->insert(m_replaySession))
{
ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting";
ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting";
return;
}
emit avDbReloadNeeded();
@@ -98,7 +97,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newState)
{
Q_ASSERT(newState != ExerciseManagement::ExerciseState::Unknown);
INFO_LOG() << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState;
INFO_LOG(m_logger) << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState;
if (m_curExerciseState == newState)
return;
@@ -120,12 +119,12 @@ void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newS
{
if (newIsActive)
{
DEBUG_LOG() << m_exContext << " activated";
DEBUG_LOG(m_logger) << m_exContext << " activated";
emit contextActivated();
}
else
{
DEBUG_LOG() << m_exContext << " deactivated";
DEBUG_LOG(m_logger) << m_exContext << " deactivated";
emit contextDeactivated();
}
}
@@ -163,12 +162,12 @@ void ExerciseHandler::onUpdateTimerTimeout()
if (m_curAVOperatingMode == desiredOperatingMode)
return;
DEBUG_LOG() << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode;
DEBUG_LOG(m_logger) << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode;
if (!avControl()->setOperatingModeForContext(m_exContext, desiredOperatingMode))
{
if (!m_bWarnedOnce)
{
DEBUG_LOG() << "Context: " << m_exContext
DEBUG_LOG(m_logger) << "Context: " << m_exContext
<< " - could not change operating mode, maybe not yet connected to AVS - trying again in 5 seconds";
m_bWarnedOnce = true;
}
@@ -205,7 +204,7 @@ void ExerciseHandler::onLastSeenTimerTimeout()
m_lastSeen.lastSeen.isNull() ||
m_lastSeen.lastSeen.addDays(1) < QDateTime::currentDateTimeUtc())
{
INFO_LOG() << "Exercise with id " << m_exContext.id()
INFO_LOG(m_logger) << "Exercise with id " << m_exContext.id()
<< " not seen since more than 1 day -> removing";
// not seen at all or not since more than 1 day -> remove
setNewExerciseState(ExerciseManagement::ExerciseState::Terminated);
@@ -224,13 +223,13 @@ void ExerciseHandler::onOperatingModeChanged(const ExerciseContext &context,
if (desiredOperatingMode != om)
{
DEBUG_LOG() << "Context: " << context << " Got " << om
DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om
<< " for " << comp << " but expected " << desiredOperatingMode;
m_updateTimer->start(100);
}
else
{
DEBUG_LOG() << "Context: " << context << " Got " << om
DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om
<< " for " << comp << " which is the expected value";
m_updateTimer->stop();
}