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 
73  struct DRAWING
74  {
86  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 scope;
136  int options;
137  int method;
140  };
141 
142  struct PANEL_BOM
143  {
144  wxString selected_plugin;
145  std::vector<BOM_PLUGIN_SETTINGS> plugins;
146  };
147 
149  {
150  std::map<std::string, bool> fields_show;
151  std::map<std::string, bool> fields_group_by;
152  std::map<std::string, int> column_widths;
153  };
154 
156  {
161  };
162 
164  {
165  std::vector<wxString> custom_command_titles;
166  std::vector<wxString> custom_command_paths;
167  };
168 
169  struct PANEL_PLOT
170  {
172  bool color;
173  wxString color_theme;
174  int format;
179  };
180 
182  {
185  int width;
186  int height;
189  };
190 
191  struct SIMULATOR
192  {
199  };
200 
202 
203  virtual ~EESCHEMA_SETTINGS() {}
204 
205  virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
206 
207  static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
208 
209 
210 protected:
211  virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
212 
213 private:
214  bool migrateBomSettings();
215 
217 
218  static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
219 
220 public:
222 
224 
226 
228 
230 
232 
234 
236 
238 
240 
242 
244 
246 
248 
250 
252 };
253 
254 
255 #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
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:103