124 lines
2.5 KiB
C++
124 lines
2.5 KiB
C++
#ifndef WIDGET_H
|
|
#define WIDGET_H
|
|
#include <windows.h>
|
|
#include <QThread>
|
|
#include <QWidget>
|
|
#include <camera.h>
|
|
#include <QTcpServer>
|
|
#include <QPushButton>
|
|
#include "globals.h"
|
|
#include "storageworker.h"
|
|
#include "countdowndialog.h"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class Widget;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
class Widget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Widget(QWidget *parent = nullptr);
|
|
~Widget();
|
|
|
|
public slots:
|
|
void refreshImage(); // 刷新图片的槽函数
|
|
|
|
private slots:
|
|
|
|
void onCountdownFinished();
|
|
|
|
void onCountdownCancelled();
|
|
|
|
void refreshSingleImage(int camera_id, bool overlay_traditional_result = false, bool overlay_dl_result = false, bool mirror = false);
|
|
|
|
void on_pushButton_2_clicked();
|
|
|
|
void on_btn_stop_clicked();
|
|
|
|
void on_btn_start_clicked();
|
|
|
|
void on_btn_take_photos_pressed();
|
|
|
|
void on_btn_take_photos_released();
|
|
|
|
void on_btn_quit_clicked();
|
|
|
|
void on_btn_set_lower_clicked();
|
|
|
|
void on_btn_set_valve_clicked();
|
|
|
|
void on_btn_tab3_backtab2_clicked();
|
|
|
|
void on_btn_live_clicked();
|
|
|
|
void on_btn_tab3_backtab2_2_clicked();
|
|
|
|
void on_btn_settings_clicked();
|
|
|
|
void on_btn_setColor_clicked();
|
|
|
|
void update_colorlist();
|
|
|
|
void on_comboBox_colorlist_currentIndexChanged(int index);
|
|
|
|
bool loadConfig(const QString &filePath);
|
|
|
|
bool saveConfig(const QString &filePath, const std::map<std::string, int>& params_to_set,const std::vector<std::string>& color_vector_to_set);
|
|
|
|
void initDefaultConfig();
|
|
|
|
void on_btn_add_color_clicked();
|
|
|
|
void on_btn_del_color_clicked();
|
|
|
|
void on_btn_reset_color_clicked();
|
|
|
|
void on_btn_tab_color_clicked();
|
|
|
|
void on_btn_tab3_backtab2_3_clicked();
|
|
|
|
void on_btn_tab3_backtab2_5_clicked();
|
|
|
|
void on_btn_tab_color_2_clicked();
|
|
|
|
void on_btn_tab3_backtab2_6_clicked();
|
|
|
|
void on_btn_tab3_backtab2_7_clicked();
|
|
|
|
void on_btn_tab3_backtab2_8_clicked();
|
|
|
|
void on_btn_tab_color_3_clicked();
|
|
|
|
void on_btn_tab3_backtab2_9_clicked();
|
|
|
|
void on_btn_tab3_backtab2_4_clicked();
|
|
|
|
void on_btn_save_polar_clicked();
|
|
|
|
void on_btn_reset_polar_clicked();
|
|
|
|
void update_polar();
|
|
void update_machine_num();
|
|
|
|
|
|
void on_tabWidget_currentChanged(int index);
|
|
|
|
private:
|
|
Ui::Widget *ui;
|
|
|
|
bool isCamRunning;
|
|
|
|
QDateTime startTime; // 记录点“开始分选”的时间,用于计算总运行时长
|
|
|
|
QThread storageThread; // 存储线程
|
|
StorageWorker* storageWorker; // 存储工作者
|
|
|
|
void showStartupCountdown();
|
|
|
|
};
|
|
#endif // WIDGET_H
|