mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
This commit is contained in:
@@ -67,7 +67,7 @@ void HyperionIManager::toggleStateAllInstances(bool pause)
|
||||
}
|
||||
}
|
||||
|
||||
bool HyperionIManager::startInstance(quint8 inst, bool block)
|
||||
bool HyperionIManager::startInstance(quint8 inst, bool block, QObject* caller, int tan)
|
||||
{
|
||||
if(_instanceTable->instanceExist(inst))
|
||||
{
|
||||
@@ -104,6 +104,12 @@ bool HyperionIManager::startInstance(quint8 inst, bool block)
|
||||
while(!hyperionThread->isRunning()){};
|
||||
}
|
||||
|
||||
if (!_pendingRequests.contains(inst) && caller != nullptr)
|
||||
{
|
||||
PendingRequests newDef{caller, tan};
|
||||
_pendingRequests[inst] = newDef;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Debug(_log,"Can't start Hyperion instance index '%d' with name '%s' it's already running or queued for start", inst, QSTRING_CSTR(_instanceTable->getNamebyIndex(inst)));
|
||||
@@ -211,4 +217,11 @@ void HyperionIManager::handleStarted()
|
||||
_runningInstances.insert(instance, hyperion);
|
||||
emit instanceStateChanged(InstanceState::H_STARTED, instance);
|
||||
emit change();
|
||||
|
||||
if (_pendingRequests.contains(instance))
|
||||
{
|
||||
PendingRequests def = _pendingRequests.take(instance);
|
||||
emit startInstanceResponse(def.caller, def.tan);
|
||||
_pendingRequests.remove(instance);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user