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 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 
37  struct APPEARANCE
38  {
51  };
52 
54  {
55  bool enable;
58  };
59 
61  {
62  BOM_PLUGIN_SETTINGS() = default;
63 
64  BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
65  name( aName ),
66  path( aPath )
67  {}
68 
69  wxString name;
70  wxString path;
71  wxString command;
72  };
73 
74  struct DRAWING
75  {
87  wxString field_names;
95  std::vector<double> junction_size_mult_list;
96  // Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
98  double junction_size_mult; // User selected default multiplier for junction dot size
99  };
100 
101  struct INPUT
102  {
104  };
105 
106  struct SELECTION
107  {
113  };
114 
116  {
131  };
132 
134  {
135  int method;
138  };
139 
140  struct PANEL_BOM
141  {
142  wxString selected_plugin;
143  std::vector<BOM_PLUGIN_SETTINGS> plugins;
144  };
145 
147  {
148  std::map<std::string, bool> fields_show;
149  std::map<std::string, bool> fields_group_by;
150  std::map<std::string, int> column_widths;
151  };
152 
154  {
159  };
160 
162  {
163  std::vector<wxString> custom_command_titles;
164  std::vector<wxString> custom_command_paths;
165  };
166 
167  struct PANEL_PLOT
168  {
170  bool color;
171  wxString color_theme;
172  int format;
177  };
178 
180  {
183  int width;
184  int height;
187  };
188 
189  struct SIMULATOR
190  {
197  };
198 
200 
201  virtual ~EESCHEMA_SETTINGS() {}
202 
203  virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
204 
205  static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
206 
208 
210 
212 
214 
216 
218 
220 
222 
224 
226 
228 
230 
232 
234 
236 
238 
239 protected:
240 
241  virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
242 
243 private:
244 
245  bool migrateBomSettings();
246 
248 
249  static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
250 };
251 
252 
253 #endif
std::vector< BOM_PLUGIN_SETTINGS > plugins
PANEL_ANNOTATE m_AnnotatePanel
virtual ~EESCHEMA_SETTINGS()
nlohmann::json json
Definition: gerbview.cpp:40
PANEL_SYM_CHOOSER m_SymChooserPanel
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
std::vector< wxString > custom_command_titles
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:99
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< wxString > custom_command_paths
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()
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98