KiCad PCB EDA Suite
Loading...
Searching...
No Matches
config_params.cpp File Reference
#include <config_params.h>
#include <locale_io.h>
#include <math/util.h>
#include <wx/config.h>
#include <wx/debug.h>

Go to the source code of this file.

Functions

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

Function Documentation

◆ ConfigBaseWriteDouble()

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()

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()

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()

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()

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.