Subversion Repositories tpanel

Rev

Rev 446 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 446 Rev 462
Line 26... Line 26...
26
 
26
 
27
// Pages with buttons
27
// Pages with buttons
28
class TMap : public TValidateFile
28
class TMap : public TValidateFile
29
{
29
{
30
    public:
30
    public:
31
        TMap(const std::string &file);
31
        TMap(const std::string &file, bool tp=false);
32
 
32
 
33
        typedef enum MAP_TYPE
33
        typedef enum MAP_TYPE
34
        {
34
        {
35
            TYPE_CM = 1,    // ON / OFF
35
            TYPE_CM = 1,    // ON / OFF
36
            TYPE_AM,        // TXT, ...
36
            TYPE_AM,        // TXT, ...
37
            TYPE_LM        // Bargraphs
37
            TYPE_LM         // Bargraphs
38
        }MAP_TYPE;
38
        }MAP_TYPE;
39
 
39
 
40
        typedef struct MAP_T
40
        typedef struct MAP_T
41
        {
41
        {
42
            int p{0};           // port number
42
            int p{0};           // port number
Line 58... Line 58...
58
            int bt{0};          // button number
58
            int bt{0};          // button number
59
            int st{0};          // button instance
59
            int st{0};          // button instance
60
            int sl{0};
60
            int sl{0};
61
            std::string pn;     // page name
61
            std::string pn;     // page name
62
            std::string bn;     // button name
62
            std::string bn;     // button name
-
 
63
            int rc{0};          // Only TP5
63
        }MAP_BM_T;
64
        }MAP_BM_T;
64
 
65
 
65
        typedef struct MAP_PM_T
66
        typedef struct MAP_PM_T     // Only TP4
66
        {
67
        {
67
            int a{0};
68
            int a{0};
68
            std::string t;      // Group name
69
            std::string t;      // Group name
69
            int pg{0};          // page number
70
            int pg{0};          // page number
70
            int bt{0};          // button number
71
            int bt{0};          // button number
71
            std::string pn;     // page name
72
            std::string pn;     // page name
72
            std::string bn;     // button name
73
            std::string bn;     // button name
73
        }MAP_PM_T;
74
        }MAP_PM_T;
74
 
75
 
-
 
76
        typedef struct MAP_EVPF_T   // Only TP5
-
 
77
        {
-
 
78
            int a{0};
-
 
79
            std::string t;      // Group name
-
 
80
            int pg{0};          // page number
-
 
81
            int bt{0};          // button number
-
 
82
            std::string ev;
-
 
83
            int ai{0};
-
 
84
        }MAP_EVPF_T;
-
 
85
 
75
        typedef struct MAPS_T
86
        typedef struct MAPS_T
76
        {
87
        {
77
            std::vector<MAP_T> map_cm;
88
            std::vector<MAP_T> map_cm;
78
            std::vector<MAP_T> map_am;
89
            std::vector<MAP_T> map_am;
79
            std::vector<MAP_T> map_lm;
90
            std::vector<MAP_T> map_lm;
80
            std::vector<MAP_BM_T> map_bm;       // Images
91
            std::vector<MAP_BM_T> map_bm;       // Images
81
            std::vector<std::string> map_sm;    // sound file names
92
            std::vector<std::string> map_sm;    // sound file names
82
            std::vector<MAP_T> map_strm;        // System resources
93
            std::vector<MAP_T> map_strm;        // System resources
83
            std::vector<MAP_PM_T> map_pm;       // Button -> text
94
            std::vector<MAP_PM_T> map_pm;       // Button -> text
-
 
95
            std::vector<MAP_EVPF_T> map_evpf;   // Only TP5
84
        }MAPS_T;
96
        }MAPS_T;
85
 
97
 
86
        std::vector<MAP_T> findButtons(int port, std::vector<int>& channels, MAP_TYPE mt = TYPE_AM);
98
        std::vector<MAP_T> findButtons(int port, std::vector<int>& channels, MAP_TYPE mt = TYPE_AM);
87
        std::vector<MAP_T> findButtonByName(const std::string& name);
99
        std::vector<MAP_T> findButtonByName(const std::string& name);
88
        std::string findImage(int bt, int page, int instance=0);
100
        std::string findImage(int bt, int page, int instance=0);
Line 98... Line 110...
98
 
110
 
99
    private:
111
    private:
100
        std::string mFile;
112
        std::string mFile;
101
        MAPS_T mMap;
113
        MAPS_T mMap;
102
        bool mError{false};
114
        bool mError{false};
-
 
115
        bool mIsTP5{false};
103
};
116
};
104
 
117
 
105
#endif
118
#endif