#ifndef CSCI_SIMULATION_SERVICE_H #define CSCI_SIMULATION_SERVICE_H #include #include #include #include "simulation_task.h" #include "../include/code/err_code.h" enum SimulationCommand { START, STOP , PAUSE, RESUME, EXPEDITE, RETARD }; class SimulationService : public QObject{ Q_OBJECT private: bool _run; // 运行开关 QTimer *_timer; // 定时器 int _landform; // 地形 int _weather; //天气 int _interval; // 步长 QDateTime _startTime; // 开始时间 QDateTime _endTime; // 结束时间 QList _tasks; private: SimulationService(); ~SimulationService() override; public: void set(int landform, int weather, int interval, const QDateTime& startTime,const QDateTime& endTime); void addTask(const SimulationTask& task); void start(); void pause(); void end(); void clear(); public: static SimulationService* ins(); public: signals: void boost(); public slots: void compute(); }; #endif //CSCI_SIMULATION_SERVICE_H