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-2021 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 <settings/app_settings.h>
28 
29 
30 using KIGFX::COLOR4D;
31 
32 
34 {
35 public:
36  struct APPEARANCE
37  {
50  };
51 
53  {
54  bool enable;
57  };
58 
60  {
61  BOM_PLUGIN_SETTINGS() = default;
62 
63  BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
64  name( aName ),
65  path( aPath )
66  {}
67 
68  wxString name;
69  wxString path;
70  wxString command;
71  };
72 
74  {
75  NETLIST_PLUGIN_SETTINGS() = default;
76 
77  NETLIST_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
78  name( aName ),
79  path( aPath )
80  {}
81 
82  wxString name;
83  wxString path;
84  wxString command;
85  };
86 
87  struct DRAWING
88  {
100  wxString field_names;
109  std::vector<double> junction_size_mult_list;
110  // Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
112  };
113 
114  struct INPUT
115  {
117  };
118 
119  struct SELECTION
120  {
126  };
127 
129  {
144  };
145 
147  {
148  int scope;
149  int options;
150  int method;
153  };
154 
155  struct PANEL_BOM
156  {
157  wxString selected_plugin;
158  std::vector<BOM_PLUGIN_SETTINGS> plugins;
159  };
160 
162  {
163  std::map<std::string, bool> fields_show;
164  std::map<std::string, bool> fields_group_by;
165  std::map<std::string, int> column_widths;
166  };
167 
169  {
174  };
175 
177  {
178  std::vector<NETLIST_PLUGIN_SETTINGS> plugins;
179  };
180 
181  struct PANEL_PLOT
182  {
184  bool color;
185  wxString color_theme;
186  int format;
191  };
192 
194  {
197  int width;
198  int height;
201  };
202 
203  struct SIMULATOR
204  {
211  };
212 
214 
215  virtual ~EESCHEMA_SETTINGS() {}
216 
217  virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
218 
219  static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
220 
221 
222 protected:
223  virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
224 
225 private:
226  bool migrateBomSettings();
227 
229 
230  static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
231 
233  static std::vector<NETLIST_PLUGIN_SETTINGS> netlistSettingsFromJson( const nlohmann::json& aObj );
234 
235 public:
237 
239 
241 
243 
245 
247 
249 
251 
253 
255 
257 
259 
261 
263 
265 
267 };
268 
269 
270 #endif
std::vector< BOM_PLUGIN_SETTINGS > plugins
PANEL_ANNOTATE m_AnnotatePanel
virtual ~EESCHEMA_SETTINGS()
nlohmann::json json
Definition: gerbview.cpp:41
PANEL_SYM_CHOOSER m_SymChooserPanel
std::vector< NETLIST_PLUGIN_SETTINGS > plugins
PANEL_FIELD_EDITOR m_FieldEditorPanel
PAGE_SETTINGS m_PageSettings
static std::vector< BOM_PLUGIN_SETTINGS > bomSettingsFromJson(const nlohmann::json &aObj)
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:81
AUTOPLACE_FIELDS m_AutoplaceFields
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
nlohmann::json netlistSettingsToJson() const
NETLIST_PLUGIN_SETTINGS(const wxString &aName, const wxString &aPath)
std::map< std::string, int > column_widths
nlohmann::json bomSettingsToJson() const
PANEL_LIB_VIEW m_LibViewPanel
BOM_PLUGIN_SETTINGS(const wxString &aName, const wxString &aPath)
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
virtual std::string getLegacyFrameName() const override
std::vector< double > junction_size_mult_list
std::map< std::string, bool > fields_group_by
std::map< std::string, bool > fields_show
PANEL_NETLIST m_NetlistPanel
static std::vector< BOM_PLUGIN_SETTINGS > DefaultBomPlugins()
static std::vector< NETLIST_PLUGIN_SETTINGS > netlistSettingsFromJson(const nlohmann::json &aObj)
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103