KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2023 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
27#include <wx/aui/framemanager.h>
28
30
31
32using KIGFX::COLOR4D;
33
34
35extern const wxAuiPaneInfo& defaultNetNavigatorPaneInfo();
36extern const wxAuiPaneInfo& defaultPropertiesPaneInfo();
37
38
39
41{
45
47};
48
49
51{
52public:
54 {
67 wxString default_font;
80 };
81
83 {
84 int hierarchy_panel_docked_width; // width of hierarchy tree panel and pane when docked
85 int hierarchy_panel_docked_height; // height of hierarchy tree panel and pane when docked
86 int hierarchy_panel_float_width; // width of hierarchy tree panel when floating
87 int hierarchy_panel_float_height; // height of hierarchy tree panel when floating
88 int search_panel_height; // height of the search panel
89 int search_panel_width; // width of the search panel
90 int search_panel_dock_direction; // docking direction of the search panel
91 bool schematic_hierarchy_float; // show hierarchy tree panel as floating
92 bool show_schematic_hierarchy; // show hierarchy tree pane
93 bool show_search; // show the search panel
102 };
103
105 {
106 bool enable;
109 };
110
112 {
114
115 BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
116 name( aName ),
117 path( aPath )
118 {}
119
120 wxString name;
121 wxString path;
122 wxString command;
123 };
124
126 {
128
129 NETLIST_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
130 name( aName ),
131 path( aPath )
132 {}
133
134 wxString name;
135 wxString path;
136 wxString command;
137 };
138
139 struct DRAWING
140 {
152 wxString field_names;
161 std::vector<double> junction_size_mult_list;
162 // Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
164 };
165
166 struct INPUT
167 {
170 };
171
173 {
179 };
180
182 {
197 };
198
200 {
203 int scope;
208 };
209
211 {
213 std::vector<BOM_PLUGIN_SETTINGS> plugins;
214 };
215
217 {
218 std::map<std::string, int> field_widths;
219 int width;
221 int page;
224 int scope;
225 };
226
228 {
234 };
235
237 {
238 std::vector<NETLIST_PLUGIN_SETTINGS> plugins;
239 };
240
242 {
244 bool color;
245 wxString color_theme;
252 };
253
255 {
258 int width;
263 };
264
266 {
274 };
275
277 {
282
284 };
285
287
289
290 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
291
292 static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
293
294
295protected:
296 virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
297
298private:
299 bool migrateBomSettings();
300
301 nlohmann::json bomSettingsToJson() const;
302
303 static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
304
305 nlohmann::json netlistSettingsToJson() const;
306 static std::vector<NETLIST_PLUGIN_SETTINGS> netlistSettingsFromJson( const nlohmann::json& aObj );
307
308public:
310
312
314
316
318
320
322
324
326
328
330
332
334
336
338
340
342
344};
345
346
347#endif
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
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
const wxAuiPaneInfo & defaultPropertiesPaneInfo()
LINE_MODE
@ LINE_MODE_90
@ LINE_MODE_45
@ LINE_MODE_FREE
@ LINE_MODE_COUNT
const wxAuiPaneInfo & defaultNetNavigatorPaneInfo()
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, int > field_widths
std::vector< NETLIST_PLUGIN_SETTINGS > plugins
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:74