78 lines
2.1 KiB
C++
78 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QTreeView>
|
|
#include <QHeaderView>
|
|
#include <QLabel>
|
|
#include <QFileDialog>
|
|
#include "ui_TimedDataCollection_ui.h"
|
|
#include "TimedDataCollectionDataStructures.h"
|
|
#include "TaskTreeModel.h"
|
|
#include "PathLine.h"
|
|
|
|
class TimedDataCollection : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TimedDataCollection(QWidget* parent = nullptr);
|
|
~TimedDataCollection();
|
|
|
|
void readTimedTaskFromFile(const QString& filePath);
|
|
|
|
public Q_SLOTS:
|
|
void startScheduler();
|
|
void stopScheduler();
|
|
void subTaskCompleted(int status);
|
|
void onBack2Origin();
|
|
|
|
private Q_SLOTS:
|
|
// 任务状态更新槽
|
|
void onTaskStarted(int taskId);
|
|
void onTaskFinished(int taskId, bool success);
|
|
void onSubTaskStarted(int taskId, int subTaskIndex);
|
|
void onSubTaskFinished(int taskId, int subTaskIndex);
|
|
void onTaskDataChanged(const TimedTask& task);
|
|
void onErrorOccurred(const QString& error);
|
|
|
|
// 树视图交互
|
|
void onTreeItemClicked(const QModelIndex& index);
|
|
void onTreeItemDoubleClicked(const QModelIndex& index);
|
|
void onTreeSelectionChanged();
|
|
|
|
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 errorOccurred(const QString& error);
|
|
|
|
void hyperCamParm(int camType, double f, double e, QString filePath, QString fileName);
|
|
void camParm(int camType, int captureIntervalSeconds, QString folder);
|
|
void motorParm(QString pathLineFilePath);
|
|
void startRecordSignal(int camType);
|
|
|
|
void switchHalogenLampSignal(int state);
|
|
void switchD65LampSignal(int state);
|
|
void switchSlrSignal(int state);
|
|
|
|
void sequenceCompleteSignal(int status);
|
|
void Back2OriginSignal();
|
|
|
|
private:
|
|
void setupUI();
|
|
void setupConnections();
|
|
void updateStatusBar();
|
|
void expandRunningTask();
|
|
|
|
void onSelectTaskFile();
|
|
|
|
Ui::TimedDataCollection_ui ui;
|
|
|
|
TaskTreeModel* m_taskModel; // 任务树形模型
|
|
TaskScheduler* m_scheduler;
|
|
|
|
int m_currentTaskId = -1;
|
|
int m_currentSubTaskIndex = -1;
|
|
};
|