Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
@@ -44,7 +44,7 @@ void ObjectBase::setEffectState(AesEffectState newState)
|
||||
Q_UNUSED(newState)
|
||||
m_publishDataTimer->start();
|
||||
AesEffectState es = checkEnterNewState(); // can create loop because checkEnterNewState is calling trySwitchFoo() but it's ok
|
||||
DEBUG_LOG() << id() << " New effect state is " << es;
|
||||
DEBUG_LOG(m_logger) << id() << " New effect state is " << es;
|
||||
emit effectStateChanged();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ bool ObjectBase::isObjectInTrainingArea() const
|
||||
|
||||
AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
DEBUG_LOG() << id() << " checkEnterNewState - cur effect state is " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " checkEnterNewState - cur effect state is " << effectState();
|
||||
bool bNeedToPublishNewData = false;
|
||||
switch (effectState().underlying())
|
||||
{
|
||||
@@ -147,13 +147,13 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
timeToTickMsec = activationTime().toMSecsSinceEpoch() - partitionTimeMSec() - flightDurationMsec();
|
||||
|
||||
DEBUG_LOG() << id() << " timeUntilFiredMSec: " << timeToTickMsec;
|
||||
DEBUG_LOG(m_logger) << id() << " timeUntilFiredMSec: " << timeToTickMsec;
|
||||
}
|
||||
else // setup EsAvtivated
|
||||
{
|
||||
timeToTickMsec = activationTime().toMSecsSinceEpoch() - partitionTimeMSec(); // time until activation
|
||||
|
||||
DEBUG_LOG() << id() << " timeUntilActivationMSec: " << timeToTickMsec
|
||||
DEBUG_LOG(m_logger) << id() << " timeUntilActivationMSec: " << timeToTickMsec
|
||||
<< " cur: " << partitionTimeMSec()
|
||||
<< " activation: " << activationTime().toMSecsSinceEpoch();
|
||||
}
|
||||
@@ -172,7 +172,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
if (!trySwitchToActivated())
|
||||
{
|
||||
WARNING_LOG() << id() << " Error switching to active ...";
|
||||
WARNING_LOG(m_logger) << id() << " Error switching to active ...";
|
||||
QTimer::singleShot(100, this, &ObjectBase::checkEnterNewState); // maybe some timing
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
// start timer for done
|
||||
m_aesTriggerTimer->stop(); // if it is called directly by someone
|
||||
qint64 timeUntilFinishedMSec = endTime().toMSecsSinceEpoch() - partitionTimeMSec();
|
||||
DEBUG_LOG() << id() << " timeUntilFinishedMSec: " << timeUntilFinishedMSec
|
||||
DEBUG_LOG(m_logger) << id() << " timeUntilFinishedMSec: " << timeUntilFinishedMSec
|
||||
<< " cur: " << partitionTimeMSec()
|
||||
<< " activation: " << activationTime().toMSecsSinceEpoch();
|
||||
if (timeUntilFinishedMSec > 0)
|
||||
@@ -208,7 +208,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
if (!trySwitchToExpired())
|
||||
{
|
||||
WARNING_LOG() << id() << " Error switching from active to expired ...";
|
||||
WARNING_LOG(m_logger) << id() << " Error switching from active to expired ...";
|
||||
QTimer::singleShot(100, this, &ObjectBase::checkEnterNewState); // maybe some timing
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
case AesEffectState::EsRemoved:
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG() << id() << " Unknown new state " << effectState();
|
||||
ERROR_LOG(m_logger) << id() << " Unknown new state " << effectState();
|
||||
break;
|
||||
}
|
||||
if (bNeedToPublishNewData)
|
||||
@@ -239,7 +239,7 @@ bool ObjectBase::trySwitchToReceived()
|
||||
if (!isUsingEffectStateReceived())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToReceived succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToReceived succeeded";
|
||||
setEffectState(AesEffectState::EsReceived);
|
||||
return true;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ bool ObjectBase::trySwitchToCreated()
|
||||
isUsingEffectStateReceived())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToCreated succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToCreated succeeded";
|
||||
setEffectState(AesEffectState::EsCreated);
|
||||
return true;
|
||||
}
|
||||
@@ -280,7 +280,7 @@ bool ObjectBase::trySwitchToPrepared()
|
||||
if (!isActivationTimeSet())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToPrepared succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToPrepared succeeded";
|
||||
setEffectState(AesEffectState::EsPrepared);
|
||||
return true;
|
||||
}
|
||||
@@ -290,29 +290,29 @@ bool ObjectBase::trySwitchToFired()
|
||||
{
|
||||
if (effectState() != AesEffectState::EsPrepared)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - not prepared: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - not prepared: " << effectState();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aesType() != AesType::AtExplosionArea && aesType() != AesType::AtEffectCluster)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - not AtExplosionArea: " << aesType();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - not AtExplosionArea: " << aesType();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isFiringTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - firing time is not reached";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - firing time is not reached";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isActivationTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - activation time already reached!";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - activation time already reached!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToFired succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired succeeded";
|
||||
setEffectState(AesEffectState::EsFired);
|
||||
return true;
|
||||
}
|
||||
@@ -324,17 +324,17 @@ bool ObjectBase::trySwitchToActivated()
|
||||
effectState() != AesEffectState::EsPaused &&
|
||||
effectState() != AesEffectState::EsFired)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToActivated failed - not prepared/fired/paused: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToActivated failed - not prepared/fired/paused: " << effectState();
|
||||
return false;
|
||||
}
|
||||
if (!isActivationTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToActivated failed - activation time not reached: "
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToActivated failed - activation time not reached: "
|
||||
<< isActivationTimeSet() << " - " << time(nullptr) << " - " << activationTime().toSecsSinceEpoch();
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToActivated succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToActivated succeeded";
|
||||
setEffectState(AesEffectState::EsActivated);
|
||||
return true;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ bool ObjectBase::trySwitchToPaused()
|
||||
if (!isPausingSupported())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToPaused succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToPaused succeeded";
|
||||
setEffectState(AesEffectState::EsPaused);
|
||||
return true;
|
||||
}
|
||||
@@ -358,24 +358,24 @@ bool ObjectBase::trySwitchToExpired()
|
||||
if (effectState() != AesEffectState::EsActivated &&
|
||||
effectState() != AesEffectState::EsPaused)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToExpired failed - not active or paused: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToExpired failed - not active or paused: " << effectState();
|
||||
return false;
|
||||
}
|
||||
if (!isEndTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToExpired failed - end time not reached: "
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToExpired failed - end time not reached: "
|
||||
<< isEndTimeSet() << " - " << time(nullptr) << " - " << endTime().toSecsSinceEpoch();
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToExpired succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToExpired succeeded";
|
||||
setEffectState(AesEffectState::EsExpired);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ObjectBase::trySwitchToRemoved()
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToRemoved: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToRemoved: " << effectState();
|
||||
switch (effectState().underlying())
|
||||
{
|
||||
case AesEffectState::EsReceived:
|
||||
|
||||
Reference in new issue
Block a user