KiCad PCB EDA Suite
Loading...
Searching...
No Matches
config_params.h File Reference
#include <kicommon.h>
#include <set>
#include <limits>
#include <wx/confbase.h>
#include <wx/fileconf.h>
#include <boost/ptr_container/ptr_vector.hpp>

Go to the source code of this file.

Classes

class  PARAM_CFG
 A base class which establishes the interface functions ReadParam and SaveParam, which are implemented by a number of derived classes, and these function's doxygen comments are inherited also. More...
 
class  PARAM_CFG_INT
 Configuration object for integers. More...
 
class  PARAM_CFG_INT_WITH_SCALE
 Configuration for integers with unit conversion. More...
 
class  PARAM_CFG_DOUBLE
 Configuration object for double precision floating point numbers. More...
 
class  PARAM_CFG_BOOL
 Configuration object for booleans. More...
 
class  PARAM_CFG_WXSTRING
 Configuration object for wxString objects. More...
 
class  PARAM_CFG_WXSTRING_SET
 Configuration object for a set of wxString objects. More...
 
class  PARAM_CFG_FILENAME
 Configuration object for a file name object. More...
 
class  PARAM_CFG_LIBNAME_LIST
 

Enumerations

enum  paramcfg_id {
  PARAM_INT , PARAM_INT_WITH_SCALE , PARAM_DOUBLE , PARAM_BOOL ,
  PARAM_LIBNAME_LIST , PARAM_WXSTRING , PARAM_WXSTRING_SET , PARAM_FILENAME ,
  PARAM_COMMAND_ERASE , PARAM_LAYERS , PARAM_TRACKWIDTHS , PARAM_VIADIMENSIONS ,
  PARAM_DIFFPAIRDIMENSIONS , PARAM_NETCLASSES , PARAM_SEVERITIES
}
 Type of parameter in the configuration file. More...
 

Functions

KICOMMON_API void ConfigBaseWriteDouble (wxConfigBase *aConfig, const wxString &aKey, double aValue)
 A helper function to write doubles in configuration file. More...
 
KICOMMON_API void wxConfigSaveSetups (wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
 Writes aList of PARAM_CFG objects to aCfg. More...
 
KICOMMON_API void wxConfigSaveParams (wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList, const wxString &aGroup)
 Write aList of PARAM_CFG objects aCfg. More...
 
KICOMMON_API void wxConfigLoadSetups (wxConfigBase *aCfg, const std::vector< PARAM_CFG * > &aList)
 Use aList of PARAM_CFG object to load configuration values from aCfg. More...
 
KICOMMON_API 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. More...
 

Enumeration Type Documentation

◆ paramcfg_id

Type of parameter in the configuration file.

Enumerator
PARAM_INT 
PARAM_INT_WITH_SCALE 
PARAM_DOUBLE 
PARAM_BOOL 
PARAM_LIBNAME_LIST 
PARAM_WXSTRING 
PARAM_WXSTRING_SET 
PARAM_FILENAME 
PARAM_COMMAND_ERASE 
PARAM_LAYERS 
PARAM_TRACKWIDTHS 
PARAM_VIADIMENSIONS 
PARAM_DIFFPAIRDIMENSIONS 
PARAM_NETCLASSES 
PARAM_SEVERITIES 

Definition at line 52 of file config_params.h.

Function Documentation

◆ ConfigBaseWriteDouble()

KICOMMON_API void ConfigBaseWriteDouble ( wxConfigBase *  aConfig,
const wxString &  aKey,
double  aValue 
)

A helper function to write doubles in configuration file.

We cannot use wxConfigBase->Write for a double, because this function uses a format with very few digits in mantissa and truncation issues are frequent. We use here a better floating format.

Note
Everything in this file is deprecated, it only remains because advanced_config depends on it for the moment.

Definition at line 117 of file config_params.cpp.

Referenced by PARAM_CFG_INT_WITH_SCALE::SaveParam(), and PARAM_CFG_DOUBLE::SaveParam().

◆ wxConfigLoadParams()

KICOMMON_API 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.

Only elements whose m_Setup field is false will be loaded.

Parameters
aCfgwhere to load from.
aListholds some configuration parameters, not all of which will necessarily be loaded.
aGroupindicates in which group the value should be saved, unless the PARAM_CFG provides its own group, in which case it will take precedence. aGroup may be empty.

Definition at line 33 of file config_params.cpp.

◆ wxConfigLoadSetups()

KICOMMON_API void wxConfigLoadSetups ( wxConfigBase *  aCfg,
const std::vector< PARAM_CFG * > &  aList 
)

Use aList of PARAM_CFG object to load configuration values from aCfg.

Only elements whose m_Setup field is true will be loaded.

Parameters
aCfgwhere to load from.
aListholds some configuration parameters, not all of which will necessarily be loaded.

Definition at line 53 of file config_params.cpp.

Referenced by ADVANCED_CFG::loadSettings().

◆ wxConfigSaveParams()

KICOMMON_API void wxConfigSaveParams ( wxConfigBase *  aCfg,
const std::vector< PARAM_CFG * > &  aList,
const wxString &  aGroup 
)

Write aList of PARAM_CFG objects aCfg.

Only elements with m_Setup set false will be saved, hence the function name.

Parameters
aCfgwhere to save.
aListholds some configuration parameters, not all of which will necessarily be saved.
aGroupindicates in which group the value should be saved, unless the PARAM_CFG provides its own group, in which case it will take precedence. aGroup may be empty.

Definition at line 67 of file config_params.cpp.

References PARAM_COMMAND_ERASE.

◆ wxConfigSaveSetups()

KICOMMON_API void wxConfigSaveSetups ( wxConfigBase *  aCfg,
const std::vector< PARAM_CFG * > &  aList 
)

Writes aList of PARAM_CFG objects to aCfg.

Only elements with m_Setup set true will be saved, hence the function name.

Parameters
aCfgwhere to save.
aListholds some configuration parameters, not all of which will necessarily be saved.

Definition at line 95 of file config_params.cpp.

References PARAM_COMMAND_ERASE.