115 &
m_PinTable.crossprobe_on_selection,
true ) );
118 [&]() -> nlohmann::json
134 [&](
const nlohmann::json& aVal )
136 if( aVal.empty() || !aVal.is_object() )
150 {
"lockedItems",
false },
156 {
"graphics",
true },
158 {
"otherItems",
true }
162 [&]() -> nlohmann::json
164 nlohmann::json ret = nlohmann::json::array();
168 nlohmann::json entry;
170 entry[
"lib"] = tab.lib.ToUTF8();
171 entry[
"name"] = tab.name.ToUTF8();
172 entry[
"unit"] = tab.unit;
173 entry[
"body_style"] = tab.bodyStyle;
174 entry[
"preview"] = tab.preview;
176 ret.push_back( entry );
181 [&](
const nlohmann::json& aVal )
185 if( !aVal.is_array() )
188 for(
const nlohmann::json& entry : aVal )
190 if( !entry.is_object() || !entry.contains(
"lib" ) || !entry.contains(
"name" ) )
195 tab.
lib = wxString::FromUTF8( entry[
"lib"].get<std::string>() );
196 tab.
name = wxString::FromUTF8( entry[
"name"].get<std::string>() );
198 if( entry.contains(
"unit" ) )
199 tab.
unit = entry[
"unit"].get<
int>();
201 if( entry.contains(
"body_style" ) )
202 tab.
bodyStyle = entry[
"body_style"].get<
int>();
204 if( entry.contains(
"preview" ) )
205 tab.
preview = entry[
"preview"].get<
bool>();
210 nlohmann::json::array() ) );
230 std::string gridSizePtr =
"window.grid.last_size";
232 if( std::optional<int> currentSize =
Get<int>( gridSizePtr ) )
234 Set( gridSizePtr, *currentSize - 4 );
239 Set( gridSizePtr, 1 );
242 ret &=
fromLegacy<int>( aCfg,
"DefaultWireWidth",
"defaults.line_width" );
243 ret &=
fromLegacy<int>( aCfg,
"DefaultPinLength",
"defaults.pin_length" );
244 ret &=
fromLegacy<int>( aCfg,
"LibeditPinNameSize",
"defaults.pin_name_size" );
245 ret &=
fromLegacy<int>( aCfg,
"LibeditPinNumSize",
"defaults.pin_num_size" );
247 ret &=
fromLegacy<int>( aCfg,
"LibeditRepeatLabelInc",
"repeat.label_delta" );
248 ret &=
fromLegacy<int>( aCfg,
"LibeditPinRepeatStep",
"repeat.pin_step" );
253 ret &=
fromLegacy<bool>( aCfg,
"LibeditShowPinElectricalType",
"show_pin_electrical_type" );
ARC_EDIT_MODE
Settings for arc editing.
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
When editing endpoints, the angle and radius are adjusted.
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
bool migrateLibTreeWidth()
Migrate the library tree width setting from a single column (Item) to multi-column.
bool fromLegacy(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig value to a given JSON pointer value.
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...
static bool SetIfPresent(const nlohmann::json &aObj, const std::string &aPath, wxString &aTarget)
Sets the given string if the given key/path is present.
std::optional< ValueType > Get(const std::string &aPath) const
Fetches a value from within the JSON document.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
void SetLegacyFilename(const wxString &aFilename)
Like a normal param, but with custom getter and setter functions.
Represents a map of <std::string, Value>.
ARC_EDIT_MODE m_ArcEditMode
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
bool m_UseEeschemaColorSettings
PANEL_LIB_FIELDS_TABLE m_LibFieldEditor
bool m_ShowPinElectricalType
std::vector< OPEN_TAB > m_OpenTabs
SCH_SELECTION_FILTER_OPTIONS m_SelectionFilter
bool m_ShowPinAltIcons
When true, dragging an outline edge will drag pins rooted on it.
bool m_dragPinsAlongWithEdges
#define DEFAULT_PINNUM_SIZE
The default pin name size when creating pins(can be changed in preference menu)
#define DEFAULT_PINNAME_SIZE
The default selection highlight thickness (can be changed in preference menu)
#define DEFAULT_PIN_LENGTH
The default pin number size when creating pins(can be changed in preference menu)
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
One persisted open editor tab, restored on the next session.
const int libeditSchemaVersion
! Update the schema version whenever a migration is required