26#ifndef CONFIG_PARAMS_H_
27#define CONFIG_PARAMS_H_
32#include <wx/confbase.h>
33#include <wx/fileconf.h>
34#include <boost/ptr_container/ptr_vector.hpp>
85 const wxString& legacy_ident = wxEmptyString );
93 virtual void ReadParam( wxConfigBase* aConfig )
const {};
100 virtual void SaveParam( wxConfigBase* aConfig )
const {};
119 PARAM_CFG_INT(
const wxString& ident,
int* ptparam,
int default_val = 0,
120 int min = std::numeric_limits<int>::min(),
121 int max = std::numeric_limits<int>::max(),
122 const wxChar*
group =
nullptr,
123 const wxString& legacy_ident = wxEmptyString );
124 PARAM_CFG_INT(
bool Insetup,
const wxString& ident,
int* ptparam,
int default_val = 0,
125 int min = std::numeric_limits<int>::min(),
126 int max = std::numeric_limits<int>::max(),
127 const wxChar*
group =
nullptr,
128 const wxString& legacy_ident = wxEmptyString );
130 virtual void ReadParam( wxConfigBase* aConfig )
const override;
131 virtual void SaveParam( wxConfigBase* aConfig )
const override;
148 int min = std::numeric_limits<int>::min(),
149 int max = std::numeric_limits<int>::max(),
150 const wxChar*
group =
nullptr,
double aBiu2cfgunit = 1.0,
151 const wxString& legacy_ident = wxEmptyString );
154 int min = std::numeric_limits<int>::min(),
155 int max = std::numeric_limits<int>::max(),
156 const wxChar*
group =
nullptr,
double aBiu2cfgunit = 1.0,
157 const wxString& legacy_ident = wxEmptyString );
159 virtual void ReadParam( wxConfigBase* aConfig )
const override;
160 virtual void SaveParam( wxConfigBase* aConfig )
const override;
174 double default_val = 0.0,
double min = 0.0,
double max = 10000.0,
175 const wxChar*
group =
nullptr );
177 double default_val = 0.0,
double min = 0.0,
double max = 10000.0,
178 const wxChar*
group =
nullptr );
180 virtual void ReadParam( wxConfigBase* aConfig )
const override;
181 virtual void SaveParam( wxConfigBase* aConfig )
const override;
196 int default_val =
false,
const wxChar*
group =
nullptr,
197 const wxString& legacy_ident = wxEmptyString );
198 PARAM_CFG_BOOL(
bool Insetup,
const wxString& ident,
bool* ptparam,
199 int default_val =
false,
const wxChar*
group =
nullptr,
200 const wxString& legacy_ident = wxEmptyString );
202 virtual void ReadParam( wxConfigBase* aConfig )
const override;
203 virtual void SaveParam( wxConfigBase* aConfig )
const override;
219 const wxString& ident,
221 const wxString& default_val = wxEmptyString,
222 const wxChar*
group =
nullptr );
224 virtual void ReadParam( wxConfigBase* aConfig )
const override;
225 virtual void SaveParam( wxConfigBase* aConfig )
const override;
240 const wxChar*
group =
nullptr );
243 const wxString& ident,
244 std::set<wxString>* ptparam,
245 const wxChar*
group =
nullptr );
247 virtual void ReadParam( wxConfigBase* aConfig )
const override;
248 virtual void SaveParam( wxConfigBase* aConfig )
const override;
263 const wxChar*
group =
nullptr );
264 virtual void ReadParam( wxConfigBase* aConfig )
const override;
265 virtual void SaveParam( wxConfigBase* aConfig )
const override;
278 const wxChar*
group =
nullptr );
280 virtual void ReadParam( wxConfigBase* aConfig )
const override;
281 virtual void SaveParam( wxConfigBase* aConfig )
const override;
306 const wxString& aGroup );
328 const wxString& aGroup );
A color representation with 4 components: red, green, blue, alpha.
Configuration object for booleans.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
bool * m_Pt_param
Pointer to the parameter value.
int m_Default
The default value of the parameter.
Configuration object for double precision floating point numbers.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
double m_Max
Minimum and maximum values of the param type.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
double * m_Pt_param
Pointer to the parameter value.
double m_Default
The default value of the parameter.
Configuration object for a file name object.
wxString * m_Pt_param
Pointer to the parameter value.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
Configuration for integers with unit conversion.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
double m_BIU_to_cfgunit
the factor to convert the saved value in internal value
Configuration object for integers.
int m_Max
Minimum and maximum values of the param type.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
int m_Default
The default value of the parameter.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
int * m_Pt_param
Pointer to the parameter value.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
wxArrayString * m_Pt_param
Pointer to the parameter value.
Configuration object for a set of wxString objects.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
std::set< wxString > * m_Pt_param
Pointer to the parameter value.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
Configuration object for wxString objects.
virtual void ReadParam(wxConfigBase *aConfig) const override
Read the value of the parameter stored in aConfig.
wxString * m_Pt_param
Pointer to the parameter value.
virtual void SaveParam(wxConfigBase *aConfig) const override
Save the value of the parameter stored in aConfig.
wxString m_default
The default value of the parameter.
A base class which establishes the interface functions ReadParam and SaveParam, which are implemented...
virtual void ReadParam(wxConfigBase *aConfig) const
Read the value of the parameter stored in aConfig.
paramcfg_id m_Type
Type of parameter.
wxString m_Ident
Keyword in config data.
wxString m_Group
Group name (this is like a path in the config data)
virtual void SaveParam(wxConfigBase *aConfig) const
Save the value of the parameter stored in aConfig.
bool m_Setup
Install or Project based parameter, true == install.
void wxConfigSaveSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Writes aList of PARAM_CFG objects to aCfg.
void wxConfigSaveParams(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
Write aList of PARAM_CFG objects aCfg.
void wxConfigLoadParams(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
Use aList of PARAM_CFG objects to load configuration values from aCfg.
void wxConfigLoadSetups(wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
Use aList of PARAM_CFG object to load configuration values from aCfg.
paramcfg_id
Type of parameter in the configuration file.
@ PARAM_DIFFPAIRDIMENSIONS
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
A helper function to write doubles in configuration file.