mrDarker
2025-10-22 e8a27bb203fe2aff70390a5eca002d7438da9b0f
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
#pragma once
#include "Context.h"
#include "Common.h"
#include <vector>
#include "CParam.h"
 
#define ITOTAL        0
#define IMAX        1
#define IMIN        2
#define IAVE        3
 
#define PANEL_DATA_SIZE        5 * 60 * 15
#define PARAM_RAWDATA_SIZE    4096
 
#define STEP_READY                0
#define STEP_RECEIVED            20
#define STEP_BEGIN_SAMPLING        1
#define STEP_END_SAMPLING        2
#define STEP_REMOVED            30
 
class CPanel :
    public CContext
{
public:
    CPanel();
    CPanel(const char* pszQRCode, int nUnitId);
    virtual ~CPanel();
 
public:
    virtual std::string& getClassName();
    virtual std::string toString();
    std::string& getQRCode();
    void setQRCode(const char* pszQRCode);
    int getUnitId();
    void setUnitId(int id);
    void setStep(int step);
    int getStep();
    int addData(UNITDATA1& data);
    const std::vector<UNITDATA1>& getDatas();
    void Serialize(CArchive& ar);
    bool getReceivedTime(int& year, int& month, int& day);
    ULONG64 GetCurrentSampleTime();
    ULONGLONG getReceivedTime();
    void setReceivedTime(ULONGLONG time);
    ULONGLONG getBeginSamplingTime();
    void setBeginSamplingTime(ULONGLONG time);
    ULONGLONG getEndSamplingTime();
    void setEndSamplingTime(ULONGLONG time);
    ULONGLONG getRemovedTime();
    void setRemovedTime(ULONGLONG time);
    void getDatas(std::vector<UNITDATA1>& out);
    BOOL getNewestData(UNITDATA1& data);
    UNITDATA1& getMathData(int index);
    void setMathData(int index, UNITDATA1& data);
    int getBlodLen();
    int getBlod(char* pszBuffer, int nBufferSize);
    int setBlod(char* pszBlod, int len);
 
public:
    void setRecipeName(const char* pszName);
    std::string& getRecipeName();
    void setAir1(double air);
    double getAir1();
    void setAir2(double air);
    double getAir2();
    void setAir3(double air);
    double getAir3();
    void setPre1(int pre);
    int getPre1();
    void setTmp1(double tmp);
    double getTmp1();
    void setTmp2(double tmp);
    double getTmp2();
    void addIntParam(const char* pszName, const char* pszUnit, int value);
    void addDoubleParam(const char* pszName, const char* pszUnit, double value);
    std::vector<CParam*>& getParams();
    void SetParamsRawData(const char* pszData);
 
private:
    std::string m_strQRCode;
    int m_nUnitId;
    std::vector<UNITDATA1> m_datas;
    UNITDATA1 m_dataMath[4];            // 0£º»ã×Ü£»1£º×î´ó£»2£º×îС£»3£ºÆ½¾ù
    ULONG64 m_timeBeginSampling;
    ULONG64 m_timeEndSampling;
    ULONG64 m_timeReceived;
    ULONG64 m_timeRemoved;
 
private:
    int m_nStep;            // µ±Ç°²½Öè;
    std::string m_strRecipeName;
    double m_fAir1;            // ¸É±ÃÎüÕæ¿ÕÖµ
    double m_fAir2;            // ·Ö×Ó±ÃÎüÕæ¿ÕÖµ
    double m_fAir3;            // ÆøÄÒѹÁ¦Öµ
    int m_nPre1;            // ÌùºÏ×ÜѹÁ¦
    double m_fTmp1;            // ÉÏÇ»ÌåζÈ
    double m_fTmp2;            // ÏÂÇ»ÌåζÈ
    char* m_pszParamsRawData;
    std::vector<CParam*> m_params;            // ³öվʱ¼Ç¼²ÎÊý
};