47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QNetworkRequest>
|
|
#include <QNetworkReply>
|
|
#include <QNetworkAccessManager>
|
|
|
|
#include "ui_TimedDataCollection_ui.h"
|
|
#include "TimedDataCollectionDataStructures.h"
|
|
|
|
class TwoMotorControl;
|
|
|
|
class TimedDataCollection : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TimedDataCollection(TwoMotorControl* motorControl, QWidget* parent = nullptr);
|
|
~TimedDataCollection();
|
|
|
|
void readTimedTaskFromFile(const QString& filePath);
|
|
|
|
// 设置马达控制器供调度器使用
|
|
void setMotorControl(TwoMotorControl* motorControl);
|
|
|
|
public Q_SLOTS:
|
|
void startScheduler();
|
|
void stopScheduler();
|
|
|
|
Q_SIGNALS:
|
|
void taskStarted(int taskId);
|
|
void taskFinished(int taskId, bool success);
|
|
void subTaskStarted(int taskId, int subTaskIndex);
|
|
void subTaskFinished(int taskId, int subTaskIndex);
|
|
void motorPositionUpdated(double x, double y);
|
|
void errorOccurred(const QString& error);
|
|
|
|
private:
|
|
Ui::TimedDataCollection_ui ui;
|
|
TwoMotorControl* m_motorControl;
|
|
|
|
void writeRead();
|
|
|
|
QVector<TimedTask> m_loadedTasks;
|
|
TaskScheduler* m_scheduler;
|
|
};
|