admin
2025-04-08 5c9991be21f57781573f04961ec511ac2938ea3d
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
#pragma once
#include<string>
#include <libconfig.h++>
#include<map>
#include<list>
 
struct MyPoint {
    long x;
    long y;
};
 
// Í¼Ïñʶ±ð²ÎÊý
struct OCRWindowParams {
    int top; // Éϱ߾à
    int width; // ¿í¶È
    int height; // ¸ß¶È
    float scale; // Ëõ·Å±¶Êý
};
 
 
 
using namespace std;
class ConfigUtil
{
private:
 
    static string getConfigPath();
 
    static void readConfig(libconfig::Config& config);
    static void writeConfig(libconfig::Config& config);
    
    
 
 
 
public:
    static int readIntConfig(const char* key);
    static string readStringConfig(const char* key);
    static void setIntConfig(const char* key, int val);
    static void setStringConfig(const char* key, string val);
 
    static list<string> getKeys();
    static void delKey(string key);
    static bool isTradeRefresh();
    static bool isGroupRefresh();
    static bool isAutoFocus();
    static bool isTradeQuickKey();
    // »ñÈ¡Âô³ö¹æÔòµ¯¿òÏÔʾµÄλÖÃ
    static int* getSellRuleDialogShowPos();
 
 
    static void setTradeRefresh(bool enable);
    static void setGroupRefresh(bool enable);
    static void setAutoFocus(bool enable);
    static void setTradeQuickKey(bool enable);
    static void setSellRuleDialogShowPos(int x, int y);
 
 
    static void setWindowPos(int x,int y);
    //½»Ò×Ë¢ÐÂÆµÂÊ
    static int getThsAutoRefreshTimeSpace();
    static void setThsAutoRefreshTimeSpace(int ms);
    
    // Á¿ÉèÖÃ
    static list<int> getVolumesSetting();
    static void setVolumesSetting(list<int> volumes);
 
 
    // ´°¿ÚλÖÃ
    static MyPoint getWindowPos();
 
    // ±£´æ´úÂëÃû×ÖÓ³Éä
    static void setCodeNames(std::map<string, CString> codeNameMap);
 
    // »ñÈ¡´úÂëÃû×ÖÓ³Éä
    static map<string, CString> getCodeNames();
 
    // ÂòÈë½ð¶îÉèÖÃ
    static void setBuyMoney(int money);
    // ÂòÈë½ð¶î»ñÈ¡
    static int getBuyMoney();
 
 
    // Âô³ö½ð¶îÉèÖÃ
    static void setSellMoney(int money);
    // Âô³ö½ð¶î»ñÈ¡
    static int getSellMoney();
 
 
    static void setOCRWindowParams(OCRWindowParams params);
 
    static OCRWindowParams getOCRWindowParams();
 
    // ÉèÖÃÊÇ·ñ¿ÉÒÔʶ±ðͬ»¨Ë³´úÂë
    static void setEnableOCRCode(bool enable);
 
    static bool getEnableOCRCode();
};