Commit ab1f9361 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Checking for timeout in both Ekos starting phase and when connecting INDI...

Checking for timeout in both Ekos starting phase and when connecting INDI devices. Better fail than wait forever
parent 08f53500
......@@ -1915,6 +1915,9 @@ bool Scheduler::checkEkosState()
{
ekosInterface->call(QDBus::AutoDetect,"start");
ekosState = EKOS_STARTING;
currentOperationTime = QTime::currentTime();
return false;
}
}
......@@ -1937,6 +1940,13 @@ bool Scheduler::checkEkosState()
stop();
return false;
}
// If a minute passed, give up
else if (currentOperationTime.elapsed() > 60)
{
appendLogText(i18n("Ekos timed out."));
stop();
return false;
}
}
break;
......@@ -1977,6 +1987,8 @@ bool Scheduler::checkINDIState()
ekosInterface->call(QDBus::AutoDetect,"connectDevices");
indiState = INDI_CONNECTING;
currentOperationTime = QTime::currentTime();
if (Options::verboseLogging())
qDebug() << "Scheduler: Connecting INDI Devices";
......@@ -2007,6 +2019,13 @@ bool Scheduler::checkINDIState()
stop();
return false;
}
// If a minute passed, we give up
else if (currentOperationTime.elapsed() > 60)
{
appendLogText(i18n("INDI devices connection timed out. Check INDI control panel for details."));
stop();
return false;
}
else
return false;
}
......
......@@ -552,6 +552,8 @@ private:
QTimer schedulerTimer; // To call checkStatus
QTimer jobTimer; // To call checkJobStage
QTime currentOperationTime; // Generic time to track timeout of current operation in progress
QUrl dirPath;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment