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 {
60 wxString default_font;
72 };
73
75 {
76 int hierarchy_panel_docked_width; // width of hierarchy tree panel and pane when docked
77 int hierarchy_panel_float_width; // width of hierarchy tree panel when floating
78 int hierarchy_panel_float_height; // height of hierarchy tree panel when floating
79 bool schematic_hierarchy_float; // show hierarchy tree panel as floating
80 bool show_schematic_hierarchy; // show hierarchy tree pane
81 };
82
84 {
85 bool enable;
88 };
89
91 {
93
94 BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
95 name( aName ),
96 path( aPath )
97 {}
98
99 wxString name;
100 wxString path;
101 wxString command;
102 };
103
105 {
107
108 NETLIST_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
109 name( aName ),
110 path( aPath )
111 {}
112
113 wxString name;
114 wxString path;
115 wxString command;
116 };
117
118 struct DRAWING
119 {
131 wxString field_names;
140 std::vector<double> junction_size_mult_list;
141 // Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
143 };
144
145 struct INPUT
146 {
149 };
150
152 {
158 };
159
161 {
176 };
177
179 {
182 int scope;
187 };
188
190 {
192 std::vector<BOM_PLUGIN_SETTINGS> plugins;
193 };
194
196 {
197 std::map<std::string, bool> fields_show;
198 std::map<std::string, bool> fields_group_by;
199 std::map<std::string, int> column_widths;
200 };
201
203 {
209 };
210
212 {
213 std::vector<NETLIST_PLUGIN_SETTINGS> plugins;
214 };
215
217 {
219 bool color;
220 wxString color_theme;
227 };
228
230 {
233 int width;
237 };
238
240 {
248 };
249
251 {
256
258 };
259
261
263
264 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
265
266 static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
267
268
269protected:
270 virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
271
272private:
273 bool migrateBomSettings();
274
276
277 static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
278
280 static std::vector<NETLIST_PLUGIN_SETTINGS> netlistSettingsFromJson( const nlohmann::json& aObj );
281
282public:
284
286
288
290
292
294
296
298
300
302
304
306
308
310
312
314
316
318};
319
320
321#endif
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:110
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:102
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:92