huago-corrcet_tools/HuaGoCorrect/HuaGoCorrectDlg.h

121 lines
2.6 KiB
C++

// HuaGoCorrectDlg.h : 头文件
//
#pragma once
#include "afxcmn.h"
#include "HuaGoCorrect.h"
#include "DefHSCommon.h"
#include "IScanner.h"
#include "Config.h"
#include "twain.h"
#include "A3.h"
#include "A4.h"
//#include "ConfigParam.h"
#include "afxwin.h"
#include "CVISON.h"
#include "scn_usb.h"
#include "JsonConfig.h"
#define WM_MYMESSAGE (WM_USER+100)
union HG_ScanConfiguration
{
struct
{
unsigned int pageSize : 5;
unsigned int isColor : 1;
unsigned int dpi : 2;
unsigned int doubleFeeded : 1;
unsigned int enableUV : 1;
unsigned int enableLed : 1;
unsigned int reversed1 : 6;
unsigned int isCorrect : 1;
unsigned int dstHeight : 8;
unsigned int reversed2 : 6;
} params;
unsigned int value;
};
// CHuaGoCorrectDlg 对话框
class CHuaGoCorrectDlg : public CDialogEx
{
// 构造
public:
CHuaGoCorrectDlg(CWnd* pParent = NULL); // 标准构造函数
// 对话框数据
enum { IDD = IDD_HUAGOCORRECT_DIALOG };
bool m_bScanning;
bool ls_flat;
int papercount;
int m_iPicIndex;
int m_iflatIndex;
int m_iDpiIndex;
int m_iColorIndex;
int n_hour;
int n_minute;
int n_second;
BOOL b_review;
BOOL b_suspend;
CA4 m_A4Dlg;
CVISON m_VisonDlg;
CA3 m_A3dlg;
std::shared_ptr<IScanner> m_drv;
CRect tabRect; // 标签控件客户区的位置和大小
void Scan();
void RefreshTabChange();
void WriteLog(CString msg);
void InitButton();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
BOOL m_bExit;
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void EnableUIItem(bool enbale);
bool RefreshUSBList();
void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
CTabCtrl m_tab;
afx_msg void OnTcnSelChangeTab(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBnClickedCheckparamset();
afx_msg void OnBnClickedCheckparamread();
afx_msg void OnBnClickedBtnFlat();
CCriticalSection m_deviceLock;
virtual void OnCancel();
CComboBox m_ComboxDpi;
CComboBox m_ComboxColor;
CComboBox m_Usbs;
afx_msg void OnCbnSelChangeDpi();
afx_msg void OnCbnSelChangeColor();
CButton m_A4Scanner;
CString s_hour;
CString s_minute;
CString s_second;
afx_msg void OnBnClickedStopScan();
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnBnClickedBtnSelectfile();
afx_msg void OnBnClickedBtnUpdate();
afx_msg void OnBnClickedBtnRefresh();
afx_msg void OnCbnSelchangeCmbUsbs();
afx_msg void OnBnClickedBtnstart();
afx_msg void OnBnClickedBtnstop();
int GetSelectDPIIndex() {
return m_iDpiIndex;
}
private:
CString updateFilePath;
std::thread m_updateThread;
void updatefunc();
};