41 m_BoardLayersCount( 2 )
95 ret &= fromLegacy<bool>( aCfg,
96 "ShowBorderAndTitleBlock",
"appearance.show_border_and_titleblock" );
98 ret &= fromLegacy<bool>( aCfg,
"ShowDCodesOpt",
"appearance.show_dcodes" );
99 ret &= fromLegacy<bool>( aCfg,
"ShowNegativeObjectsOpt",
"appearance.show_negative_objects" );
102 auto migrate_files = [&] (
const std::string& aPath,
const std::string& aDest )
104 int max_history_size =
Pgm().GetCommonSettings()->m_System.file_history_size;
106 nlohmann::json js = nlohmann::json::array();
108 aCfg->SetPath( aPath );
110 for(
int i = 0; i < max_history_size; i++ )
112 key.Printf( wxT(
"file%d" ), i );
113 file = aCfg->Read( key, wxEmptyString );
115 if( !file.IsEmpty() )
116 js.emplace_back( file.ToStdString() );
119 aCfg->SetPath( wxT(
".." ) );
124 migrate_files(
"drl_files",
"system.drill_file_history" );
125 migrate_files(
"zip_files",
"system.zip_file_history" );
126 migrate_files(
"job_files",
"system.job_file_history" );
132 Set(
"gerber_to_pcb_layers", nlohmann::json::array() );
136 key.Printf( wxT(
"GbrLyr%dToPcb" ), i );
138 At(
"gerber_to_pcb_layers" ).emplace_back( value );
144 auto migrateLegacyColor = [&] (
const std::string& aKey,
int aLayerId ) {
147 if( aCfg->Read( aKey, &str ) )
163 key.Printf( wxT(
"ColorLayer%dEx" ), i );
164 migrateLegacyColor( key.ToStdString(),
id );
167 Pgm().GetSettingsManager().SaveColorSettings( cs,
"gerbview" );
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
std::vector< wxString > m_JobFileHistory
std::vector< wxString > m_DrillFileHistory
EXCELLON_DEFAULTS m_ExcellonDefaults
std::vector< int > m_GerberToPcbLayerMapping
A list of GERBER_DRAWLAYERS_COUNT length containing a mapping of gerber layers to PCB layers,...
std::vector< wxString > m_ZipFileHistory
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
bool fromLegacyString(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig string value to a given JSON pointer value.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
wxString GetFilename() const
A color representation with 4 components: red, green, blue, alpha.
#define FMT_MANTISSA_INCH
const int gerbviewSchemaVersion
! Update the schema version whenever a migration is required
@ LAYER_GERBVIEW_DRAWINGSHEET
@ GERBVIEW_LAYER_ID_START
@ LAYER_GERBVIEW_BACKGROUND
@ LAYER_GERBVIEW_PAGE_LIMITS
#define GERBER_DRAWLAYERS_COUNT
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
bool show_negative_objects
bool show_border_and_titleblock