#pragma once
#include <QDialog>
#include "ui_dialogsetup.h"
#include "basecamera.h"
#include  <common.h>
#include  <camera_glue.h>
#include  <output_statistic.h>
#include  <change_shift.h>

class DialogSetup : public QDialog {
	Q_OBJECT
signals :
	void system_exit();
	void sendMsgToShift(QTime timeA, QTime timeB, QTime timeC);
	void sendMsgToOutput();
	void sendMsgToConfig(int ptr[][3]);
#ifdef __DEBUG
	void _testimg();
	void _testimgs();
#endif
private slots :
	void on_toolButton_keyboard_released();
	void on_pushButton_exit_released();
	void on_pushButton_save_released();
	void on_pushButton_close_released();
	void on_toolButton_choose_path_released();
	void on_toolButton_choose_path_jpg_released();
	void on_pushButton_desktop_released();
	void on_pushButton_image_released();
	void on_pushButton_pswd_released();
	void on_pushButton_pswd_op_released();
	void on_pushButton_expo_released();
	void on_pushButton_filter_released();
	void on_pushButton_clear_pic_released();

	void on_pushButton_config_released();
	void on_pushButton_change_released();
	void on_pushButton_statistic_released();

	void on_checkBox_auto_open_clicked(bool checked);
	void on_checkBox_auto_work_clicked(bool checked);

	void recMsgFromDialogConfig(int ptr[][3]);
	void recMsgFromChangeShift(QTime timeA, QTime timeB, QTime timeC);
	void onComboBoxSelect(int index);
#ifdef __DEBUG
	void on_pushButton_testimg_released();
	void on_pushButton_testimgs_released();
#endif
public:
	DialogSetup(QWidget * parent = Q_NULLPTR);
	~DialogSetup();
	QLineEdit *lineEdit_expo_mat[NumberOfSupportedCameras];
	QLineEdit *lineEdit_gain_mat[NumberOfSupportedCameras];
	QLineEdit *lineEdit_filter_mat[NumberOfSupportedCameras];
	void InitPtrMat();
	static void write_pswd();
	static void write_pswd_op();
	static void write_config();

public:
	camera_glue *m_camera_glue=NULL;
	change_shift *m_change_shift=NULL;
	output_statistic *m_output_statistic=NULL;
private:
	Ui::DialogSetup ui;
};
