156 [&]() -> nlohmann::json
158 nlohmann::json ret = nlohmann::json::array();
163 ret.push_back( nlohmann::json( {
164 {
"name", field.m_Name },
165 {
"visible", field.m_Visible },
166 {
"url", field.m_URL }
172 [&](
const nlohmann::json& aJson )
174 if( !aJson.empty() && aJson.is_array() )
178 for(
const nlohmann::json& entry : aJson )
180 if( !entry.contains(
"name" ) || !entry.contains(
"url" )
181 || !entry.contains(
"visible" ) )
187 field.
m_URL = entry[
"url"].get<
bool>();
188 field.
m_Visible = entry[
"visible"].get<
bool>();
196 if( !curr_cfg->m_Drawing.field_names.IsEmpty() )
256 return std::string();
258 [&](
const std::string& aData )
267 [&]() -> nlohmann::json
269 nlohmann::json ret = nlohmann::json::array();
273 nlohmann::json entry;
274 entry[
"name"] =
name;
276 if( !description.IsEmpty() )
277 entry[
"description"] = description;
279 ret.push_back( entry );
284 [&](
const nlohmann::json& aJson )
288 if( aJson.is_array() )
290 for(
const auto& entry : aJson )
292 if( entry.contains(
"name" ) )
294 wxString
name = entry[
"name"].get<wxString>();
297 if( entry.contains(
"description" ) )
298 desc = entry[
"description"].get<wxString>();
304 }, nlohmann::json::array() ) );
309 std::optional<double> tor =
Get<double>(
"drawing.text_offset_ratio" );
312 Set(
"drawing.label_size_ratio", *tor );
326 m_parent->ReleaseNestedSettings(
this );
358 return std::max( dotSize, 1 );
BASE_SCREEN class implementation.
constexpr EDA_IU_SCALE schIUScale
constexpr double ARC_LOW_DEF_MM
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
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...
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 ReleaseNestedSettings(NESTED_SETTINGS *aSettings)
Saves and frees a nested settings object, if it exists within this one.
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
static wxString LetterSubReference(int aUnit, wxChar aInitialLetter)
JSON_SETTINGS * m_parent
A pointer to the parent object to load and store from.
NESTED_SETTINGS(const std::string &aName, int aSchemaVersion, JSON_SETTINGS *aParent, const std::string &aPath, bool aLoadFromFile=true)
std::shared_ptr< NETCLASS > GetDefaultNetclass()
Gets the default netclass for the project.
Like a normal param, but with custom getter and setter functions.
Represents a parameter that has a scaling factor between the value in the file and the value used int...
virtual SETTINGS_MANAGER & GetSettingsManager() const
The backing store for a PROJECT, in JSON format.
std::shared_ptr< NET_SETTINGS > & NetSettings()
virtual PROJECT_FILE & GetProjectFile() const
double GetHopOverScale()
Accessor that computes the current hop-over size.
wxString m_BomExportFileName
wxString m_SchDrawingSheetFileName
wxString m_IntersheetRefsPrefix
BOM_FMT_PRESET m_BomFmtSettings
List of stored BOM format presets.
wxString SubReference(int aUnit, bool aAddSeparator=true) const
SCHEMATIC_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)
std::shared_ptr< REFDES_TRACKER > m_refDesTracker
A list of previously used schematic reference designators.
TEMPLATES m_TemplateFieldNames
wxString m_IntersheetRefsSuffix
bool m_IntersheetRefsFormatShort
std::vector< BOM_PRESET > m_BomPresets
bool m_IntersheetRefsShow
double m_DashedLineGapRatio
bool m_IntersheetRefsListOwnPage
std::map< wxString, wxString > m_VariantDescriptions
A map of variant names to their descriptions.
std::vector< BOM_FMT_PRESET > m_BomFmtPresets
KIFONT::METRICS m_FontMetrics
double m_DashedLineDashRatio
int GetJunctionSize()
Accessor that computes the current junction size.
std::shared_ptr< NGSPICE_SETTINGS > m_NgspiceSettings
Ngspice simulator settings.
virtual ~SCHEMATIC_SETTINGS()
wxString m_PlotDirectoryName
BOM_PRESET m_BomSettings
List of stored BOM presets.
int m_MaxError
Max deviation allowable when approximating circles and curves (in IU).
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
#define DEFAULT_IREF_PREFIX
The intersheets references suffix string.
#define DEFAULT_LABEL_SIZE_RATIO
The offset of the pin name string from the end of the pin in mils.
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
#define DEFAULT_TEXT_OFFSET_RATIO
Ratio of the font height to space around global labels.
#define DEFAULT_IREF_SUFFIX
Radius of snap "gravity well".
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
This file contains miscellaneous commonly used macros and functions.
PGM_BASE & Pgm()
The global program "get" accessor.
const std::vector< double > junction_size_mult_list
const std::vector< double > hopover_size_mult_list
const int schSettingsSchemaVersion
#define MIN_CONNECTION_GRID_MILS
#define DEFAULT_CONNECTION_GRID_MILS
T * GetAppSettings(const char *aFilename)
static BOM_FMT_PRESET CSV()
static BOM_PRESET DefaultEditing()
bool intersheets_ref_show
wxString intersheets_ref_suffix
bool intersheets_ref_short
wxString intersheets_ref_prefix
int default_line_thickness
bool intersheets_ref_own_page
Hold a name of a symbol's field, field value, and default visibility.
static constexpr double IU_PER_MM
Mock up a conversion function.