admin
2023-03-07 8b06b1cbf112d55307ea8a6efe711db4e7506d89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#pragma once
#include <string>
#include <list>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp> 
#include "CaptureUtil.h"
#include "RecognitionManager.h"
enum ImgType
{
    IMG_TYPE_GP,
    IMG_TYPE_ADD
};
 
enum MoneyUnit {
    MONEY_UNIT_Y,
    MONEY_UNIT_W,
    MONEY_UNIT_NO,
};
struct GPCodeArea
{
    ImgType type;
    int startx;
    int starty;
    int endx;
    int endy;
    std::string code;
 
    //L2Êý¾ÝÓÐЧ
    int cateIndex;
};
typedef list<OCRResult> (*MatOcrFun)(string key_regex,cv::Mat mat);
//ͬ»¨Ë³Ê¼þ
class THSActionUtil
{
private:
    
    //ÅúÁ¿Ìí¼Ó¹ÉƱ
    static void betchAddGP(HWND addDialog,list<string> codeList);
    
    //ɾ³ý°å¿éÄÚµÄËùÓдúÂë
    static void clearPlateCodes(HWND hwnd);
 
    //»ñÈ¡°å¿éÖдúÂëÌí¼Ó°´Å¥µÄλÖÃ
    static RECT getPlateAddCodeBtnPostion(HWND win);
 
public:
    static HWND getMainWin();
 
    static HWND getL2Win();
 
    static HWND getThirdWindow();
 
    static HWND getSecondWindow();
    //ÐÐÒµ
    static HWND getIndustryWindow();
 
    //½»Ò×¾ä±ú
    static HWND getTradeSuccessWindow();
 
    static HWND getTradeDelegateWindow();
 
    static HWND getTradeSimpleDelegateWindow();
 
    //»ñÈ¡¶ÌÏß¾«Áé´°¿Ú
    static HWND getDXJLWindow();
 
    static HWND getDXJLMainWindow();
 
 
    //¼ì²â»·¾³
    static bool checkEnv();
 
    //
    static GPCodeArea splitPlateMenuArea(cv::Mat img);
 
    //°å¿éÄÚÈÝ·Ö¸î
    static std::list<int*> splitPlateRowArea(cv::Mat img);
 
    static std::list<int*> splitPlateRowArea(cv::Mat img, int start_row, int start_col, int end_row, int end_col);
 
    //´ò¿ªÍ¬»¨Ë³µÄ¸±ÆÁÄ»
    static void openL2Screen();
    //½ÃÕýL2´úÂë°å¿é£¨Ñ¡ÖÐÊ×°æ´ýÑ¡£©
    static bool correctL2ScreenPlate(MatOcrFun matOcrFun);
    static void openSecondScreen();
    static void openThirdScreen();
    static void openTradeSuccessScreen();
    static void openDXJLScreen();
    static bool addGP(string code, MatOcrFun ocrFun);
 
    //ÉèÖÃ¹ÉÆ±
    static bool setGP(std::string quickCode, list<std::string> codeList,RecognitionManager* recognitionManager,MatOcrFun ocrFun);
    //ʶ±ð¹ÉƱ´úÂë
    static std::list<GPCodeArea>  recognitionGPArea(cv::Mat img);
 
    //ʶ±ðÊý×Ö
    static std::list<GPCodeArea>  recognitionGPCodeNum(cv::Mat img,std::list<GPCodeArea> areaList, RecognitionManager* recognitionManager);
 
    //ʶ±ð´úÂë
    static std::list<string> recognitionGPCode(cv::Mat img, RecognitionManager* recognitionManager);
 
 
    //ÉèÖûñÈ¡level2µÄ¹ÉƱÊý¾Ý
    static bool setListenL2GP(int p,string code, RecognitionManager* recognitionManager);
 
    //ÉèÖûñÈ¡level2µÄ¹ÉƱ´úÂë
    static std::map<int, string> getListenL2GPCodes(RecognitionManager* recognitionManager);
 
    //ʶ±ð°å¿éÄÚÈÝÇøÓò
    static GPCodeArea recognitionPlateContentArea(cv::Mat grayImg);
 
    //Ìí¼ÓÄ¿±ê±êµÄ
    static void addTargetCodes(list<std::string> codeList, RecognitionManager* recognitionManager);
 
    static std::list<GPCodeArea> getListenL2GPAreaAndCode(RecognitionManager* recognitionManager);
 
    static std::list<std::list<GPCodeArea>> getListenL2GPAreaActionBar();
 
    //ͬ»¨Ë³ÊÇ·ñ¿¨ËÀ
    static bool thsIsDead();
 
    //¸üÐÂÐÐÇéÖ÷Õ¾
    static void updateMainSite();
 
    //ɸѡL2ÐÐÇé½ð¶î
    static bool screenL2Money(HWND l2_hwnd,string money, MatOcrFun ocrFun);
 
};