SDC C-Project CF Review 프로그램
kojingeun
2023-11-24 c112cf54a238afa473e7eb0ea6298e06f4957658
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
132
133
134
#pragma once
 
#include "CHCommonClasses/MacroFile.h"
 
interface ILensChangeControl2Parent
{
    virtual void ILCC2P_DisplayMessage(int nIndex, const TCHAR* lpstrFormat, ...) = 0;
    virtual void ILCC2P_ChangePosition(int nIndex, int nPos) = 0;
};
 
class CLensChangeControlInfo
{
public:
    CLensChangeControlInfo(int nIndex=0) : m_nIndex(nIndex)            { Reset(); }
    ~CLensChangeControlInfo(void)                                    { Reset(); }
    void Reset()
    {
        m_strName            = _T("");
        m_nControllerType    = 0;
        m_strConnectionPort = _T("");
        m_nBaudRate            = CBR_9600;
        m_nDefaultLevel        = 0;
        m_nCurrentLevel        = 0;
        m_nMaxLevel            = 0;
        m_nMinLevel            = 0;
    }
 
    BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
    {
        if (pFile==NULL) return FALSE;
 
        CString strValue = _T("");
 
        strValue = strItemName + _T("_INDEX");
        pFile->GetItem(strValue, m_nIndex, 0);
 
        strValue = strItemName + _T("_NAME");
        pFile->GetItem(strValue, m_strName, _T(""));
 
        strValue = strItemName + _T("_CONTROL_TYPE");
        pFile->GetItem(strValue, m_nControllerType, 0);
 
        strValue = strItemName + _T("_CONNECT_PORT");
        pFile->GetItem(strValue, m_strConnectionPort, _T(""));
 
        strValue = strItemName + _T("_BAUD_RATE");
        pFile->GetItem(strValue, m_nBaudRate, CBR_9600);
 
        strValue = strItemName + _T("_DEFAULT_LEVEL");
        pFile->GetItem(strValue, m_nDefaultLevel, 0);
 
        strValue = strItemName + _T("_CURRENT_LEVEL");
        pFile->GetItem(strValue, m_nCurrentLevel, 0);
 
        strValue = strItemName + _T("_MAX_LEVEL");
        pFile->GetItem(strValue, m_nMaxLevel, 0);
 
        strValue = strItemName + _T("_MIN_LEVEL");
        pFile->GetItem(strValue, m_nMinLevel, 0);
 
        return TRUE;
    }
 
    BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName)
    {
        if (pFile==NULL) return FALSE;
 
        CString strValue = _T("");
 
        strValue = strItemName + _T("_INDEX");
        pFile->SetItem(strValue, m_nIndex);
 
        strValue = strItemName + _T("_NAME");
        pFile->SetItem(strValue, m_strName);
 
        strValue = strItemName + _T("_CONTROL_TYPE");
        pFile->SetItem(strValue, m_nControllerType);
 
        strValue = strItemName + _T("_CONNECT_PORT");
        pFile->SetItem(strValue, m_strConnectionPort);
 
        strValue = strItemName + _T("_BAUD_RATE");
        pFile->SetItem(strValue, m_nBaudRate);
 
        strValue = strItemName + _T("_DEFAULT_LEVEL");
        pFile->SetItem(strValue, m_nDefaultLevel);
 
        strValue = strItemName + _T("_CURRENT_LEVEL");
        pFile->SetItem(strValue, m_nCurrentLevel);
 
        strValue = strItemName + _T("_MAX_LEVEL");
        pFile->SetItem(strValue, m_nMaxLevel);
 
        strValue = strItemName + _T("_MIN_LEVEL");
        pFile->SetItem(strValue, m_nMinLevel);
 
        return TRUE;
    }
 
    int            GetIndex() const                                { return m_nIndex; }
    CString        GetName() const                                    { return m_strName; }
    int            GetControllerType() const                        { return m_nControllerType; }
    CString        GetConnectionPort() const                        { return m_strConnectionPort; }
    int            GetBaudRate() const                                { return m_nBaudRate; }
    int            GetDefaultLevel() const                            { return m_nDefaultLevel; }
    int            GetCurrentLevel() const                            { return m_nCurrentLevel; }
    int            GetMaxLevel() const                                { return m_nMaxLevel; }
    int            GetMinLevel() const                                { return m_nMinLevel; }
 
 
    void        SetIndex(int nIndex)                            { m_nIndex = nIndex; }
    void        SetName(const CString& strName)                    { m_strName = strName; }
    void        SetControllerType(int nType)                    { m_nControllerType = nType; }
    void        SetConnectionPort(const CString& strPort)        {  m_strConnectionPort = strPort; }
    void        SetBaudRate(int nValue)                            { m_nBaudRate = nValue; }
    void        SetDefaultLevel(int nValue)                        {  m_nDefaultLevel = nValue; }
    void        SetCurrentLevel(int nValue)                        { m_nCurrentLevel = nValue; }
    void        SetMaxLevel(int nValue)                            { m_nMaxLevel = nValue; }
    void        SetMinLevel(int nValue)                            { m_nMinLevel = nValue; }
 
 
protected:
    int            m_nIndex;
    CString        m_strName;
 
    int            m_nControllerType;
    CString        m_strConnectionPort;
    int            m_nBaudRate;            // ¿¬°á ¼Óµµ
 
    int            m_nDefaultLevel;
    int            m_nCurrentLevel;
    int            m_nMaxLevel;            //ÃÖ´ë Á¶¸í ¹à±â
    int            m_nMinLevel;            //ÃÖ¼Ò Á¶¸í ¹à±â
};