KiCad PCB EDA Suite
eeschema_settings.h
Go to the documentation of this file.
1/*
2* This program source code file is part of KiCad, a free EDA CAD application.
3*
4* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
5*
6* This program is free software; you can redistribute it and/or
7* modify it under the terms of the GNU General Public License
8* as published by the Free Software Foundation; either version 2
9* of the License, or (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program; if not, you may find one here:
18* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19* or you may search the http://www.gnu.org website for the version 2 license,
20* or you may write to the Free Software Foundation, Inc.,
21* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22*/
23
24#ifndef _EESCHEMA_SETTINGS_H
25#define _EESCHEMA_SETTINGS_H
26
28
29
30using KIGFX::COLOR4D;
31
32
34{
38
40};
41
42
44{
45public:
47 {
54 wxString default_font;
64 };
65
67 {
68 int hierarchy_panel_docked_width; // width of hierarchy tree panel and pane when docked
69 int hierarchy_panel_float_width; // width of hierarchy tree panel when floating
70 int hierarchy_panel_float_height; // height of hierarchy tree panel when floating
71 bool schematic_hierarchy_float; // show hierarchy tree panel as floating
72 bool show_schematic_hierarchy; // show hierarchy tree pane
73 };
74
76 {
77 bool enable;
80 };
81
83 {
85
86 BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
87 name( aName ),
88 path( aPath )
89 {}
90
91 wxString name;
92 wxString path;
93 wxString command;
94 };
95
97 {
99
100 NETLIST_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
101 name( aName ),
102 path( aPath )
103 {}
104
105 wxString name;
106 wxString path;
107 wxString command;
108 };
109
110 struct DRAWING
111 {
123 wxString field_names;
132 std::vector<double> junction_size_mult_list;
133 // Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
135 };
136
137 struct INPUT
138 {
141 };
142
144 {
150 };
151
153 {
168 };
169
171 {
174 int scope;
179 };
180
182 {
184 std::vector<BOM_PLUGIN_SETTINGS> plugins;
185 };
186
188 {
189 std::map<std::string, bool> fields_show;
190 std::map<std::string, bool> fields_group_by;
191 std::map<std::string, int> column_widths;
192 };
193
195 {
201 };
202
204 {
205 std::vector<NETLIST_PLUGIN_SETTINGS> plugins;
206 };
207
209 {
211 bool color;
212 wxString color_theme;
219 };
220
222 {
225 int width;
229 };
230
232 {
239 };
240
242 {
246
248 };
249
251
253
254 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
255
256 static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
257
258
259protected:
260 virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
261
262private:
263 bool migrateBomSettings();
264
266
267 static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
268
270 static std::vector<NETLIST_PLUGIN_SETTINGS> netlistSettingsFromJson( const nlohmann::json& aObj );
271
272public:
274
276
278
280
282
284
286
288
290
292
294
296
298
300
302
304
306
308};
309
310
311#endif
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:101
PANEL_ANNOTATE m_AnnotatePanel
static std::vector< BOM_PLUGIN_SETTINGS > DefaultBomPlugins()
PANEL_NETLIST m_NetlistPanel
nlohmann::json bomSettingsToJson() const
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
nlohmann::json netlistSettingsToJson() const
virtual ~EESCHEMA_SETTINGS()
PANEL_SYM_CHOOSER m_SymChooserPanel
PAGE_SETTINGS m_PageSettings
static std::vector< BOM_PLUGIN_SETTINGS > bomSettingsFromJson(const nlohmann::json &aObj)
FIND_REPLACE_EXTRA m_FindReplaceExtra
PANEL_LIB_VIEW m_LibViewPanel
AUTOPLACE_FIELDS m_AutoplaceFields
static std::vector< NETLIST_PLUGIN_SETTINGS > netlistSettingsFromJson(const nlohmann::json &aObj)
PANEL_FIELD_EDITOR m_FieldEditorPanel
virtual std::string getLegacyFrameName() const override
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
LINE_MODE
@ LINE_MODE_90
@ LINE_MODE_45
@ LINE_MODE_FREE
@ LINE_MODE_COUNT
nlohmann::json json
Definition: gerbview.cpp:44
BOM_PLUGIN_SETTINGS(const wxString &aName, const wxString &aPath)
std::vector< double > junction_size_mult_list
NETLIST_PLUGIN_SETTINGS(const wxString &aName, const wxString &aPath)
std::vector< BOM_PLUGIN_SETTINGS > plugins
std::map< std::string, bool > fields_show
std::map< std::string, int > column_widths
std::map< std::string, bool > fields_group_by
std::vector< NETLIST_PLUGIN_SETTINGS > plugins
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:83