This commit is contained in:
Paulchen Panther
2020-10-18 17:05:07 +02:00
committed by GitHub
parent 9d2e442d42
commit aa465c018c
18 changed files with 207 additions and 90 deletions

View File

@@ -28,6 +28,12 @@ class HyperionIManager : public QObject
Q_OBJECT
public:
struct PendingRequests
{
QObject *caller;
int tan;
};
// global instance pointer
static HyperionIManager* getInstance() { return HIMinstance; }
static HyperionIManager* HIMinstance;
@@ -54,11 +60,11 @@ public slots:
///
/// @brief Start a Hyperion instance
/// @param instance Instance index
/// @param block If true return when thread has been started
/// @param instance Instance index
/// @param block If true return when thread has been started
/// @return Return true on success, false if not found in db
///
bool startInstance(quint8 inst, bool block = false);
bool startInstance(quint8 inst, bool block = false, QObject *caller = nullptr, int tan = 0);
///
/// @brief Stop a Hyperion instance
@@ -110,6 +116,13 @@ signals:
///
void change();
///
/// @brief Emits when the user has requested to start a instance
/// @param caller The origin caller instance who requested
/// @param tan The tan that was part of the request
///
void startInstanceResponse(QObject *caller, const int &tan);
signals:
///////////////////////////////////////
/// FROM HYPERIONDAEMON TO HYPERION ///
@@ -180,4 +193,6 @@ private:
const QString _rootPath;
QMap<quint8, Hyperion*> _runningInstances;
QList<quint8> _startQueue;
/// All pending requests
QMap<quint8, PendingRequests> _pendingRequests;
};