#pragma once #include #include #include #include #include // Shared by the UI RPC runner and the legacy worker; never opens a connection. class DemoSimulator { public: struct Reply {bool ok=false;QJsonObject response;int delayMs=30;}; static DemoSimulator& instance(); void reset(); Reply call(const QString& service,const QString& method,const QJsonObject& request); QJsonObject sample(const QString& id); void stop(const QString& id); private: struct Device {QJsonArray from,target;QJsonObject pose,poseFrom;QJsonObject settings;QJsonArray coordinates;QString activeCoordinate;qint64 started=0;int duration=0;}; QJsonObject sampleLocked(Device&); QMutex m_mutex; QHash m_devices; };