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-2024 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#include <sim/sim_preferences.h>
31
32using KIGFX::COLOR4D;
33
34
35extern const wxAuiPaneInfo& defaultNetNavigatorPaneInfo();
36extern const wxAuiPaneInfo& defaultPropertiesPaneInfo( wxWindow* aWindow );
37extern const wxAuiPaneInfo& defaultSchSelectionFilterPaneInfo( wxWindow* aWindow );
38
39
40
42{
46
48};
49
50
52{
53public:
55 {
68 wxString default_font;
81 };
82
84 {
85 int hierarchy_panel_docked_width; // width of hierarchy tree panel and pane when docked
86 int hierarchy_panel_docked_height; // height of hierarchy tree panel and pane when docked
87 int hierarchy_panel_float_width; // width of hierarchy tree panel when floating
88 int hierarchy_panel_float_height; // height of hierarchy tree panel when floating
89 int search_panel_height; // height of the search panel
90 int search_panel_width; // width of the search panel
91 int search_panel_dock_direction; // docking direction of the search panel
92 bool schematic_hierarchy_float; // show hierarchy tree panel as floating
93 bool show_schematic_hierarchy; // show hierarchy tree pane
94 bool show_search; // show the search panel
103 };
104
106 {
107 bool enable;
110 };
111
113 {
115
116 BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
117 name( aName ),
118 path( aPath )
119 {}
120
121 wxString name;
122 wxString path;
123 wxString command;
124 };
125
127 {
129
130 NETLIST_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
131 name( aName ),
132 path( aPath )
133 {}
134
135 wxString name;
136 wxString path;
137 wxString command;
138 };
139
140 struct DRAWING
141 {
153 wxString field_names;
162 std::vector<double> junction_size_mult_list;
163
164 // Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
166 };
167
168 struct INPUT
169 {
172 };
173
175 {
180 };
181
183 {
198 };
199
201 {
204 int scope;
209 };
210
212 {
214 std::vector<BOM_PLUGIN_SETTINGS> plugins;
215 };
216
218 {
219 std::map<std::string, int> field_widths;
220 int width;
222 int page;
225 int scope;
226 };
227
229 {
235 };
236
238 {
239 std::vector<NETLIST_PLUGIN_SETTINGS> plugins;
240 };
241
243 {
245 bool color;
246 wxString color_theme;
255 };
256
258 {
261 int width;
266 };
267
269 {
271 wxString last_file;
275 double origin_x;
276 double origin_y;
278 };
279
281 {
282 struct VIEW
283 {
290 };
291
295 };
296
298 {
303
305 };
306
308
310
311 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
312
313 static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
314
315
316protected:
317 virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
318
319private:
320 bool migrateBomSettings();
321
322 nlohmann::json bomSettingsToJson() const;
323
324 static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
325
326 nlohmann::json netlistSettingsToJson() const;
327 static std::vector<NETLIST_PLUGIN_SETTINGS> netlistSettingsFromJson( const nlohmann::json& aObj );
328
329public:
331
333
335
337
339
341
343
345
347
349
351
353
355
357
359
361
363
365
367};
368
369
370#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
DIALOG_IMPORT_GRAPHICS m_ImportGraphics
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 & defaultSchSelectionFilterPaneInfo(wxWindow *aWindow)
LINE_MODE
@ LINE_MODE_90
@ LINE_MODE_45
@ LINE_MODE_FREE
@ LINE_MODE_COUNT
const wxAuiPaneInfo & defaultPropertiesPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultNetNavigatorPaneInfo()
Contains preferences pertaining to the simulator.
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
Contains preferences pertaining to the simulator.
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:74