Subversion Repositories tpanel

Rev

Rev 446 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 446 Rev 462
Line 23... Line 23...
23
#include <string>
23
#include <string>
24
#include <vector>
24
#include <vector>
25
#include "tvalidatefile.h"
25
#include "tvalidatefile.h"
26
#include "tprjresources.h"
26
#include "tprjresources.h"
27
 
27
 
-
 
28
typedef struct VERSION_INFO
-
 
29
{
-
 
30
    int formatVersion{0};
-
 
31
    int graphicsVersion{0};
-
 
32
    int g5appsVersion{0};           // Only in TP5
-
 
33
    std::string fileVersion;
-
 
34
    std::string designVersion;
-
 
35
}VERSION_INFO;
-
 
36
 
-
 
37
typedef struct SUPPORT_FILES
-
 
38
{
-
 
39
    std::string mapFile;
-
 
40
    std::string colorFile;
-
 
41
    std::string fontFile;
-
 
42
    std::string themeFile;
-
 
43
    std::string iconFile;               // Only on TP4
-
 
44
    std::string externalButtonFile;
-
 
45
    std::string appFile;                // Only on TP5
-
 
46
}SUPPORT_FILES;
-
 
47
 
28
typedef struct PALETTE_SETUP
48
typedef struct PALETTE_SETUP
29
{
49
{
30
    std::string name;
50
    std::string name;
31
    std::string file;
51
    std::string file;
32
    int paletteID{0};
52
    int paletteID{0};
Line 54... Line 74...
54
    int specifyChanCount{0};
74
    int specifyChanCount{0};
55
}PROJECT_INFO;
75
}PROJECT_INFO;
56
 
76
 
57
typedef struct PANEL_SETUP
77
typedef struct PANEL_SETUP
58
{
78
{
-
 
79
    VERSION_INFO versionInfo;           //!< The version information is used to tell between TP4 and TP5
59
    int portCount{0};                   //!< Number of total ports available
80
    int portCount{0};                   //!< Number of total ports available
60
    int setupPort{0};                   //!< The number of the setup port used for setup pages. Usualy 0
81
    int setupPort{0};                   //!< The number of the setup port used for setup pages. Usualy 0
61
    int addressCount{0};
82
    int addressCount{0};
62
    int channelCount{0};
83
    int channelCount{0};
63
    int levelCount{0};
84
    int levelCount{0};
Line 104... Line 125...
104
    std::string buildStatusMod;
125
    std::string buildStatusMod;
105
    int activePalette{0};
126
    int activePalette{0};
106
    int marqueeSpeed{0};
127
    int marqueeSpeed{0};
107
    int setupPagesProject{0};
128
    int setupPagesProject{0};
108
    int voipCommandPort{0};
129
    int voipCommandPort{0};
-
 
130
    SUPPORT_FILES supportFiles;
109
    std::vector<PALETTE_SETUP> palettes;
131
    std::vector<PALETTE_SETUP> palettes;
110
}PANEL_SETUP_T;
132
}PANEL_SETUP_T;
111
 
133
 
112
class TSettings : public TValidateFile
134
class TSettings : public TValidateFile
113
{
135
{
Line 115... Line 137...
115
        TSettings(const std::string& path);
137
        TSettings(const std::string& path);
116
 
138
 
117
        const std::string& getPath() { return mPath; }
139
        const std::string& getPath() { return mPath; }
118
        PANEL_SETUP_T& getSettings() { return mSetup; }
140
        PANEL_SETUP_T& getSettings() { return mSetup; }
119
        PROJECT_INFO& getProjectInfo() { return mProject; }
141
        PROJECT_INFO& getProjectInfo() { return mProject; }
-
 
142
        VERSION_INFO& getVersionInfo() { return mSetup.versionInfo; }
-
 
143
        SUPPORT_FILES& getSupportFiles() { return mSetup.supportFiles; }
-
 
144
        std::string& getMapFileName() { return mSetup.supportFiles.mapFile; }
-
 
145
        std::string& getColorFileName() { return mSetup.supportFiles.colorFile; }
-
 
146
        std::string& getFontFileName() { return mSetup.supportFiles.fontFile; }
-
 
147
        std::string& getThemeFileName() { return mSetup.supportFiles.themeFile; }
-
 
148
        std::string& getIconFileName() { return mSetup.supportFiles.iconFile; }
-
 
149
        std::string& getExtButtonFileName() { return mSetup.supportFiles.externalButtonFile; }
-
 
150
        std::string& getAppFileName() { return mSetup.supportFiles.appFile; }
-
 
151
 
120
        int getWidth() { return mSetup.screenWidth; }
152
        int getWidth() { return mSetup.screenWidth; }
121
        int getHeight() { return mSetup.screenHeight; }
153
        int getHeight() { return mSetup.screenHeight; }
122
        int getRotate() { return mSetup.screenRotate; }
154
        int getRotate() { return mSetup.screenRotate; }
123
        bool isPortrait();
155
        bool isPortrait();
124
        bool isLandscape();
156
        bool isLandscape();
125
        std::vector<RESOURCE_LIST_T>& getResourcesList() { return mResourceLists; }
157
        std::vector<RESOURCE_LIST_T>& getResourcesList() { return mResourceLists; }
126
        bool loadSettings(bool initial=false);
158
        bool loadSettings(bool initial=false);
127
        std::string& getPowerUpPage() { return mSetup.powerUpPage; }
159
        std::string& getPowerUpPage() { return mSetup.powerUpPage; }
128
        int getVoipCmdPort() { return mSetup.voipCommandPort; }
160
        int getVoipCmdPort() { return mSetup.voipCommandPort; }
129
        std::string& getPanelType() { return mProject.panelType; }
161
        std::string& getPanelType() { return mProject.panelType; }
-
 
162
        bool isTP5() { return mSetup.versionInfo.g5appsVersion > 0; }
130
 
163
 
131
    private:
164
    private:
132
        RESOURCE_LIST_T findResourceType(const std::string& type);
165
        RESOURCE_LIST_T findResourceType(const std::string& type);
133
 
166
 
134
        std::string mPath;                              // The path to the resources
167
        std::string mPath;                              // The path to the resources