210 lines
4.5 KiB
C
210 lines
4.5 KiB
C
|
|
|||
|
// HuaGoCorrectDlg.h : ͷ<>ļ<EFBFBD>
|
|||
|
//
|
|||
|
|
|||
|
#pragma once
|
|||
|
#include "afxcmn.h"
|
|||
|
#include "HuaGoCorrect.h"
|
|||
|
#include "DefHSCommon.h"
|
|||
|
#include "gscn_drv.h"
|
|||
|
#include "Config.h"
|
|||
|
#include "twain.h"
|
|||
|
#include "A3.h"
|
|||
|
#include "A4.h"
|
|||
|
#include "CIS.h"
|
|||
|
#include "m_Dis.h"
|
|||
|
#include "ConfigParam.h"
|
|||
|
#include "afxwin.h"
|
|||
|
#include "CVISON.h"
|
|||
|
#include <memory>
|
|||
|
#include "ImageApply.h"
|
|||
|
#include "ImageApplyAdjustColors.h"
|
|||
|
#include "ImageApplyAutoCrop.h"
|
|||
|
#include "ImageApplyBWBinaray.h"
|
|||
|
#include "ImageApplyChannel.h"
|
|||
|
#include "ImageApplyCrop.h"
|
|||
|
#include "ImageApplyDiscardBlank.h"
|
|||
|
#include "ImageApplyResize.h"
|
|||
|
#include "ImageApplyRotation.h"
|
|||
|
#include "ImageApplySharpen.h"
|
|||
|
using namespace std;
|
|||
|
|
|||
|
#define WM_MYMESSAGE (WM_USER+100)
|
|||
|
|
|||
|
enum TwSS : ushort
|
|||
|
{
|
|||
|
A4 = 1,
|
|||
|
A3 = 11,
|
|||
|
USStatement = 52
|
|||
|
};
|
|||
|
|
|||
|
// CHuaGoCorrectDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
|
|||
|
class CHuaGoCorrectDlg : public CDialogEx
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
public:
|
|||
|
CHuaGoCorrectDlg(CWnd* pParent = NULL); // <20><><EFBFBD><D7BC><EFBFBD>캯<EFBFBD><ECBAAF>
|
|||
|
|
|||
|
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
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 iAMaxStep;
|
|||
|
int iAMiddleStep;
|
|||
|
int iAMinStep;
|
|||
|
int iBMaxStep;
|
|||
|
int iBMiddleStep;
|
|||
|
int iBMinStep;
|
|||
|
|
|||
|
int iAERMaxStep;
|
|||
|
int iAERMiddleStep;
|
|||
|
int iAERMinStep;
|
|||
|
int iAEGMaxStep;
|
|||
|
int iAEGMiddleStep;
|
|||
|
int iAEGMinStep;
|
|||
|
int iAEBMaxStep;
|
|||
|
int iAEBMiddleStep;
|
|||
|
int iAEBMinStep;
|
|||
|
int iBERMaxStep;
|
|||
|
int iBERMiddleStep;
|
|||
|
int iBERMinStep;
|
|||
|
int iBEGMaxStep;
|
|||
|
int iBEGMiddleStep;
|
|||
|
int iBEGMinStep;
|
|||
|
int iBEBMaxStep;
|
|||
|
int iBEBMiddleStep;
|
|||
|
int iBEBMinStep;
|
|||
|
int iGainStep;
|
|||
|
|
|||
|
int n_hour;
|
|||
|
int n_minute;
|
|||
|
int n_second;
|
|||
|
int usb_vid;
|
|||
|
int usb_pid;
|
|||
|
BOOL b_review;
|
|||
|
BOOL b_suspend;
|
|||
|
|
|||
|
CConfig m_Cfg;
|
|||
|
CA3 m_A3Dlg;
|
|||
|
CA4 m_A4Dlg;
|
|||
|
CIS m_CISDlg;
|
|||
|
m_Dis m_dis;
|
|||
|
CVISON m_VisonDlg;
|
|||
|
CConfigParam m_ConfigParam;
|
|||
|
shared_ptr<GScn_Drv> m_drv;
|
|||
|
CRect tabRect; // <20><>ǩ<EFBFBD>ؼ<EFBFBD><D8BC>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>úʹ<C3BA>С
|
|||
|
void Scan();
|
|||
|
void RefreshTabChange();
|
|||
|
int Mat2CImage(Mat *mat, CImage &img);
|
|||
|
|
|||
|
cv::Mat m_matFImage;
|
|||
|
cv::Mat m_matBImage;
|
|||
|
int Version_id[5][2] = { {0x064b,0x7823},{0x3072,0x0100},{0x3072 ,0x0200},{0x3072 ,0x0300},{0x3072 ,0x0400} };
|
|||
|
void ShowFrontImage(int index);
|
|||
|
void ShowBackImage(int index);
|
|||
|
void A3ParamSet();
|
|||
|
void A4ParamSet();
|
|||
|
void intToByte(UINT *src,byte *bytes,int iLength);
|
|||
|
void bytesToInt(byte* bytes,UINT *des, int iLength);
|
|||
|
|
|||
|
void CorrectBlackImage();
|
|||
|
void CorrectWhiteImage();
|
|||
|
void CorrectWhiteGain();
|
|||
|
void CorrectFinish();
|
|||
|
void WriteLog(CString msg);
|
|||
|
void CyclePro();
|
|||
|
|
|||
|
void CorrectCMDUpdate();
|
|||
|
void CorrectEndUpdate();
|
|||
|
void ConfigParamUpdate();
|
|||
|
void InitButton();
|
|||
|
void FSongleCorrect();
|
|||
|
|
|||
|
bool bABlackImage;
|
|||
|
bool bBBlackImage;
|
|||
|
|
|||
|
bool bAGrayWhiteImage;
|
|||
|
bool bBGrayWhiteImage;
|
|||
|
bool bAColorWhiteImage;
|
|||
|
bool bAcolr;
|
|||
|
bool bAcolg;
|
|||
|
bool bAcolb;
|
|||
|
bool bBColorWhiteImage;
|
|||
|
bool bBcolr;
|
|||
|
bool bBcolg;
|
|||
|
bool bBcolb;
|
|||
|
|
|||
|
bool bAGrayWhiteGain;
|
|||
|
bool bBGrayWhiteGain;
|
|||
|
bool bAColorWhiteGain;
|
|||
|
bool bBColorWhiteGain;
|
|||
|
std::vector<std::shared_ptr<CImageApply>> m_iaList;
|
|||
|
protected:
|
|||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>
|
|||
|
|
|||
|
|
|||
|
// ʵ<><CAB5>
|
|||
|
protected:
|
|||
|
HICON m_hIcon;
|
|||
|
|
|||
|
HANDLE m_hThread;
|
|||
|
BOOL m_bExit;
|
|||
|
void CorrectThreadFunc();
|
|||
|
static unsigned WINAPI CorrectThread(void* pCorrect);
|
|||
|
|
|||
|
// <20><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>Ϣӳ<CFA2>亯<EFBFBD><E4BAAF>
|
|||
|
virtual BOOL OnInitDialog();
|
|||
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
|||
|
afx_msg void OnPaint();
|
|||
|
afx_msg HCURSOR OnQueryDragIcon();
|
|||
|
DECLARE_MESSAGE_MAP()
|
|||
|
public:
|
|||
|
CTabCtrl m_tab;
|
|||
|
afx_msg BOOL PreCreateWindow(CREATESTRUCT& cs);
|
|||
|
afx_msg void OnTcnSelChangeTab(NMHDR *pNMHDR, LRESULT *pResult);
|
|||
|
afx_msg void OnBnClickedCheckparamset();
|
|||
|
afx_msg void OnBnClickedCheckparamread();
|
|||
|
void UpdateList(CONFIGPARAMS configParams, bool canUpdate);
|
|||
|
afx_msg void OnBnClickedBtnFlat();
|
|||
|
CButton m_pBlack;
|
|||
|
CButton m_pWExposure;
|
|||
|
CButton m_pWGain;
|
|||
|
afx_msg void OnBnClickedBtnFlatm();
|
|||
|
CCriticalSection m_deviceLock;
|
|||
|
virtual void OnCancel();
|
|||
|
BOOL m_bPause;
|
|||
|
BOOL m_bParamError;
|
|||
|
afx_msg void OnBnClickedBtnBlackflat();
|
|||
|
afx_msg void OnBnClickedBtnExflat();
|
|||
|
afx_msg void OnBnClickedBtnGainflat();
|
|||
|
afx_msg void OnBnClickedBtnContinue();
|
|||
|
afx_msg void OnBnClickedBtnPause();
|
|||
|
CComboBox m_ComboxDpi;
|
|||
|
CComboBox m_ComboxColor;
|
|||
|
afx_msg void OnCbnSelChangeDpi();
|
|||
|
afx_msg void OnCbnSelChangeColor();
|
|||
|
afx_msg void OnBnClickedConfirm();
|
|||
|
afx_msg void OnBnClickedBtnParamcfg();
|
|||
|
CButton m_check_FpgaFlat;
|
|||
|
CString s_hour;
|
|||
|
CString s_minute;
|
|||
|
CString s_second;
|
|||
|
afx_msg void OnBnClickedStopScan();
|
|||
|
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
|||
|
afx_msg LRESULT OnMyMessage(/*HWND hWnd, UINT Msg,*/ WPARAM w,LPARAM l);
|
|||
|
CButton close_butten;
|
|||
|
CComboBox twss;
|
|||
|
CComboBox duplex;
|
|||
|
CComboBox Version;
|
|||
|
afx_msg void OnCbnSelchangeCombo1();
|
|||
|
};
|