LAPTOP-SNT8I5JK\Boounion
2025-10-16 a351ed8a97a72bddfb281d2aa350a5c42a7f81a5
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
#pragma once
#include <string>
 
 
namespace SERVO {
    // ±äÁ¿¸ñʽ
    enum class SVFromat {
        U1 = 0,
        U2,
        I2,
        A20,
        A50,
        L
    };
 
    class CVariable
    {
    public:
        CVariable();
        CVariable(const char* pszId, const char* pszName, const char* pszFormat, const char* pszRemark);
        ~CVariable();
 
    public:
        static SVFromat toFormat(const char* pszFormat);
        static std::string formatToString(SVFromat format);
        unsigned int getVarialbleId();
        std::string& getName();
        SVFromat getFormat();
        std::string& getRemark();
        void setValue(__int64 value);
        void setValue(const char* pszValue);
        void setValue(std::vector<CVariable>& vars);
        std::string getValue();
        __int64 getIntValue();
        std::vector<CVariable>& getVarsValue();
 
    private:
        unsigned int m_nVarialbeId;
        std::string m_strName;
        SVFromat m_format;
        std::string m_strRemark;
        __int64 m_nValue;
        std::string m_strValue;
        std::vector<CVariable> m_varsValue;
    };
}