KiCad PCB EDA Suite
Loading...
Searching...
No Matches
project_local_settings.cpp
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 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include <lset.h>
23#include <project.h>
27#include <settings/parameters.h>
28
30
31
32PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxString& aFilename ) :
34 /* aCreateIfMissing = */ true, /* aCreateIfDefault = */ false,
35 /* aWriteFile = */ true ),
36 m_ActiveLayer( UNDEFINED_LAYER ),
37 m_ContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL ),
38 m_NetColorMode( NET_COLOR_MODE::RATSNEST ),
39 m_AutoTrackWidth( true ),
40 m_ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FILLED ),
41 m_TrackOpacity( 1.0 ),
42 m_ViaOpacity( 1.0 ),
43 m_PadOpacity( 1.0 ),
44 m_ZoneOpacity( 0.6 ),
45 m_ShapeOpacity( 1.0 ),
46 m_ImageOpacity( 0.6 ),
47 m_PcbSelectionFilter(),
48 m_project( aProject ),
49 m_wasMigrated( false )
50{
51 // Keep old files around
53
54 m_params.emplace_back( new PARAM_LAMBDA<std::string>( "board.visible_layers",
55 [&]() -> std::string
56 {
57 return m_VisibleLayers.FmtHex();
58 },
59 [&]( const std::string& aString )
60 {
61 m_VisibleLayers.ParseHex( aString );
62 },
64
65 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.visible_items",
66 [&]() -> nlohmann::json
67 {
68 nlohmann::json ret = nlohmann::json::array();
69
71 {
72 if( std::optional<VISIBILITY_LAYER> vl = VisibilityLayerFromRenderLayer( l ) )
73 ret.push_back( VisibilityLayerToString( *vl ) );
74 }
75
76 return ret;
77 },
78 [&]( const nlohmann::json& aVal )
79 {
80 if( !aVal.is_array() || aVal.empty() )
81 {
83 return;
84 }
85
86 m_VisibleItems &= ~UserVisbilityLayers();
87 GAL_SET visible;
88
89 for( const nlohmann::json& entry : aVal )
90 {
91 try
92 {
93 std::string vs = entry.get<std::string>();
94
95 if( std::optional<GAL_LAYER_ID> l = RenderLayerFromVisbilityString( vs ) )
96 visible.set( *l );
97 }
98 catch( ... )
99 {
100 // Non-integer or out of range entry in the array; ignore
101 }
102 }
103
104 m_VisibleItems |= UserVisbilityLayers() & visible;
105 },
106 {} ) );
107
108 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.selection_filter",
109 [&]() -> nlohmann::json
110 {
111 nlohmann::json ret;
112
113 ret["lockedItems"] = m_PcbSelectionFilter.lockedItems;
114 ret["footprints"] = m_PcbSelectionFilter.footprints;
115 ret["text"] = m_PcbSelectionFilter.text;
116 ret["tracks"] = m_PcbSelectionFilter.tracks;
117 ret["vias"] = m_PcbSelectionFilter.vias;
118 ret["pads"] = m_PcbSelectionFilter.pads;
119 ret["graphics"] = m_PcbSelectionFilter.graphics;
120 ret["zones"] = m_PcbSelectionFilter.zones;
121 ret["keepouts"] = m_PcbSelectionFilter.keepouts;
122 ret["dimensions"] = m_PcbSelectionFilter.dimensions;
123 ret["otherItems"] = m_PcbSelectionFilter.otherItems;
124
125 return ret;
126 },
127 [&]( const nlohmann::json& aVal )
128 {
129 if( aVal.empty() || !aVal.is_object() )
130 return;
131
132 SetIfPresent( aVal, "lockedItems", m_PcbSelectionFilter.lockedItems );
133 SetIfPresent( aVal, "footprints", m_PcbSelectionFilter.footprints );
134 SetIfPresent( aVal, "text", m_PcbSelectionFilter.text );
135 SetIfPresent( aVal, "tracks", m_PcbSelectionFilter.tracks );
136 SetIfPresent( aVal, "vias", m_PcbSelectionFilter.vias );
137 SetIfPresent( aVal, "pads", m_PcbSelectionFilter.pads );
138 SetIfPresent( aVal, "graphics", m_PcbSelectionFilter.graphics );
139 SetIfPresent( aVal, "zones", m_PcbSelectionFilter.zones );
140 SetIfPresent( aVal, "keepouts", m_PcbSelectionFilter.keepouts );
141 SetIfPresent( aVal, "dimensions", m_PcbSelectionFilter.dimensions );
142 SetIfPresent( aVal, "otherItems", m_PcbSelectionFilter.otherItems );
143 },
144 {
145 { "lockedItems", false },
146 { "footprints", true },
147 { "text", true },
148 { "tracks", true },
149 { "vias", true },
150 { "pads", true },
151 { "graphics", true },
152 { "zones", true },
153 { "keepouts", true },
154 { "dimensions", true },
155 { "otherItems", true }
156 } ) );
157
158 m_params.emplace_back( new PARAM_ENUM<PCB_LAYER_ID>( "board.active_layer",
160
161 m_params.emplace_back( new PARAM<wxString>( "board.active_layer_preset",
162 &m_ActiveLayerPreset, "" ) );
163
164 m_params.emplace_back( new PARAM_ENUM<HIGH_CONTRAST_MODE>( "board.high_contrast_mode",
165 &m_ContrastModeDisplay, HIGH_CONTRAST_MODE::NORMAL,
166 HIGH_CONTRAST_MODE::NORMAL, HIGH_CONTRAST_MODE::HIDDEN ) );
167
168 m_params.emplace_back( new PARAM<double>( "board.opacity.tracks", &m_TrackOpacity, 1.0 ) );
169 m_params.emplace_back( new PARAM<double>( "board.opacity.vias", &m_ViaOpacity, 1.0 ) );
170 m_params.emplace_back( new PARAM<double>( "board.opacity.pads", &m_PadOpacity, 1.0 ) );
171 m_params.emplace_back( new PARAM<double>( "board.opacity.zones", &m_ZoneOpacity, 0.6 ) );
172 m_params.emplace_back( new PARAM<double>( "board.opacity.images", &m_ImageOpacity, 0.6 ) );
173 m_params.emplace_back( new PARAM<double>( "board.opacity.shapes", &m_ShapeOpacity, 1.0 ) );
174
175 m_params.emplace_back( new PARAM_LIST<wxString>( "board.hidden_nets", &m_HiddenNets, {} ) );
176
177 m_params.emplace_back( new PARAM_SET<wxString>( "board.hidden_netclasses",
178 &m_HiddenNetclasses, {} ) );
179
180 m_params.emplace_back( new PARAM_ENUM<NET_COLOR_MODE>( "board.net_color_mode",
181 &m_NetColorMode, NET_COLOR_MODE::RATSNEST, NET_COLOR_MODE::OFF,
182 NET_COLOR_MODE::ALL ) );
183
184 m_params.emplace_back( new PARAM<bool>( "board.auto_track_width",
185 &m_AutoTrackWidth, true ) );
186
187 m_params.emplace_back( new PARAM_ENUM<ZONE_DISPLAY_MODE>( "board.zone_display_mode",
189 ZONE_DISPLAY_MODE::SHOW_FILLED, ZONE_DISPLAY_MODE::SHOW_FILLED,
190 ZONE_DISPLAY_MODE::SHOW_TRIANGULATION ) );
191
192 m_params.emplace_back( new PARAM<wxString>( "git.repo_username", &m_GitRepoUsername, "" ) );
193
194 m_params.emplace_back( new PARAM<wxString>( "git.repo_type", &m_GitRepoType, "" ) );
195
196 m_params.emplace_back( new PARAM<wxString>( "git.ssh_key", &m_GitSSHKey, "" ) );
197
198 m_params.emplace_back( new PARAM<wxString>( "net_inspector_panel.filter_text",
200 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.filter_by_net_name",
202 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.filter_by_netclass",
204 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_netclass",
206 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_constraint",
208 m_params.emplace_back( new PARAM_LIST<wxString>( "net_inspector_panel.custom_group_rules",
210 {} ) );
211 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_zero_pad_nets",
212 &m_NetInspectorPanel.show_zero_pad_nets, false ) );
213 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_unconnected_nets",
214 &m_NetInspectorPanel.show_unconnected_nets, false ) );
215 m_params.emplace_back( new PARAM<int>( "net_inspector_panel.sorting_column",
216 &m_NetInspectorPanel.sorting_column, -1 ) );
217 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.sort_ascending",
218 &m_NetInspectorPanel.sort_order_asc, true ) );
219 m_params.emplace_back( new PARAM_LIST<int>( "net_inspector_panel.col_order",
220 &m_NetInspectorPanel.col_order, {} ) );
221 m_params.emplace_back( new PARAM_LIST<int>( "net_inspector_panel.col_widths",
222 &m_NetInspectorPanel.col_widths, {} ) );
223 m_params.emplace_back( new PARAM_LIST<bool>( "net_inspector_panel.col_hidden",
224 &m_NetInspectorPanel.col_hidden, {} ) );
225 m_params.emplace_back( new PARAM_LIST<wxString>( "net_inspector_panel.expanded_rows",
226 &m_NetInspectorPanel.expanded_rows, {} ) );
227
228 m_params.emplace_back( new PARAM_LIST<wxString>( "open_jobsets", &m_OpenJobSets, {} ) );
229
230 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "project.files",
231 [&]() -> nlohmann::json
232 {
233 nlohmann::json ret = nlohmann::json::array();
234
235 for( PROJECT_FILE_STATE& fileState : m_files )
236 {
237 nlohmann::json file;
238 file["name"] = fileState.fileName;
239 file["open"] = fileState.open;
240
241 nlohmann::json window;
242 window["maximized"] = fileState.window.maximized;
243 window["size_x"] = fileState.window.size_x;
244 window["size_y"] = fileState.window.size_y;
245 window["pos_x"] = fileState.window.pos_x;
246 window["pos_y"] = fileState.window.pos_y;
247 window["display"] = fileState.window.display;
248
249 file["window"] = window;
250
251 ret.push_back( file );
252 }
253
254 return ret;
255 },
256 [&]( const nlohmann::json& aVal )
257 {
258 if( !aVal.is_array() || aVal.empty() )
259 return;
260
261 m_files.clear();
262
263 for( const nlohmann::json& file : aVal )
264 {
265 PROJECT_FILE_STATE fileState;
266
267 try
268 {
269 SetIfPresent( file, "name", fileState.fileName );
270 SetIfPresent( file, "open", fileState.open );
271 SetIfPresent( file, "window.size_x", fileState.window.size_x );
272 SetIfPresent( file, "window.size_y", fileState.window.size_y );
273 SetIfPresent( file, "window.pos_x", fileState.window.pos_x );
274 SetIfPresent( file, "window.pos_y", fileState.window.pos_y );
275 SetIfPresent( file, "window.maximized", fileState.window.maximized );
276 SetIfPresent( file, "window.display", fileState.window.display );
277
278 m_files.push_back( fileState );
279 }
280 catch( ... )
281 {
282 // Non-integer or out of range entry in the array; ignore
283 }
284 }
285
286 },
287 {
288 } ) );
289
290 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "schematic.selection_filter",
291 [&]() -> nlohmann::json
292 {
293 nlohmann::json ret;
294
295 ret["lockedItems"] = m_SchSelectionFilter.lockedItems;
296 ret["symbols"] = m_SchSelectionFilter.symbols;
297 ret["text"] = m_SchSelectionFilter.text;
298 ret["wires"] = m_SchSelectionFilter.wires;
299 ret["labels"] = m_SchSelectionFilter.labels;
300 ret["pins"] = m_SchSelectionFilter.pins;
301 ret["graphics"] = m_SchSelectionFilter.graphics;
302 ret["images"] = m_SchSelectionFilter.images;
303 ret["otherItems"] = m_SchSelectionFilter.otherItems;
304
305 return ret;
306 },
307 [&]( const nlohmann::json& aVal )
308 {
309 if( aVal.empty() || !aVal.is_object() )
310 return;
311
312 SetIfPresent( aVal, "lockedItems", m_SchSelectionFilter.lockedItems );
313 SetIfPresent( aVal, "symbols", m_SchSelectionFilter.symbols );
314 SetIfPresent( aVal, "text", m_SchSelectionFilter.text );
315 SetIfPresent( aVal, "wires", m_SchSelectionFilter.wires );
316 SetIfPresent( aVal, "labels", m_SchSelectionFilter.labels );
317 SetIfPresent( aVal, "pins", m_SchSelectionFilter.pins );
318 SetIfPresent( aVal, "graphics", m_SchSelectionFilter.graphics );
319 SetIfPresent( aVal, "images", m_SchSelectionFilter.images );
320 SetIfPresent( aVal, "otherItems", m_SchSelectionFilter.otherItems );
321 },
322 {
323 { "lockedItems", false },
324 { "symbols", true },
325 { "text", true },
326 { "wires", true },
327 { "labels", true },
328 { "pins", true },
329 { "graphics", true },
330 { "images", true },
331 { "otherItems", true }
332 } ) );
333
334 registerMigration( 1, 2,
335 [&]()
336 {
342 std::string ptr( "board.visible_items" );
343
344 if( Contains( ptr ) )
345 {
346 if( At( ptr ).is_array() )
347 {
348 At( ptr ).push_back( LAYER_PADS - GAL_LAYER_ID_START );
349 At( ptr ).push_back( LAYER_ZONES - GAL_LAYER_ID_START );
350 }
351 else
352 {
353 At( "board" ).erase( "visible_items" );
354 }
355
356 m_wasMigrated = true;
357 }
358
359 return true;
360 } );
361
362 registerMigration( 2, 3,
363 [&]()
364 {
372 const std::map<int, int> offsets = {
373 { 22, 34 }, // LAYER_PAD_HOLEWALLS
374 { 23, 22 }, // LAYER_VIA_HOLES
375 { 24, 35 }, // LAYER_VIA_HOLEWALLS
376 { 25, 23 }, // LAYER_DRC_ERROR
377 { 26, 36 }, // LAYER_DRC_WARNING
378 { 27, 37 }, // LAYER_DRC_EXCLUSION
379 { 28, 38 }, // LAYER_MARKER_SHADOWS
380 { 29, 24 }, // LAYER_DRAWINGSHEET
381 { 30, 25 }, // LAYER_GP_OVERLAY
382 { 31, 26 }, // LAYER_SELECT_OVERLAY
383 { 32, 27 }, // LAYER_PCB_BACKGROUND
384 { 33, 28 }, // LAYER_CURSOR
385 { 34, 29 }, // LAYER_AUX_ITEM
386 { 35, 30 }, // LAYER_DRAW_BITMAPS
387 { 39, 32 }, // LAYER_PADS
388 { 40, 33 }, // LAYER_ZONES
389 };
390
391 std::string ptr( "board.visible_items" );
392
393 if( Contains( ptr ) && At( ptr ).is_array() )
394 {
395 nlohmann::json visible = nlohmann::json::array();
396
397 for( const nlohmann::json& val : At( ptr ) )
398 {
399 try
400 {
401 int layer = val.get<int>();
402
403 if( offsets.count( layer ) )
404 visible.push_back( offsets.at( layer ) );
405 else
406 visible.push_back( layer );
407 }
408 catch( ... )
409 {
410 // skip invalid value
411 }
412 }
413
414 At( "board" )["visible_items"] = visible;
415 m_wasMigrated = true;
416 }
417
418 return true;
419 } );
420
421 registerMigration( 3, 4,
422 [&]()
423 {
424 // Schema version 3 to 4: LAYER_SHAPES added to visibility controls
425
426 std::string ptr( "board.visible_items" );
427
428 if( Contains( ptr ) )
429 {
430 if( At( ptr ).is_array() )
431 At( ptr ).push_back( LAYER_SHAPES - GAL_LAYER_ID_START );
432 else
433 At( "board" ).erase( "visible_items" );
434
435 m_wasMigrated = true;
436 }
437
438 return true;
439 } );
440
441 registerMigration( 4, 5,
442 [&]()
443 {
444 // Schema version 5: use named render layers
445
446 std::string ptr( "board.visible_items" );
447
448 if( Contains( ptr ) && At( ptr ).is_array() )
449 {
450 std::vector<std::string> newLayers;
451
452 for( nlohmann::json& entry : At( ptr ) )
453 {
454 if( !entry.is_number_integer() )
455 continue;
456
457 if( std::optional<VISIBILITY_LAYER> vl =
459 {
460 newLayers.emplace_back( VisibilityLayerToString( *vl ) );
461 }
462 }
463
464 At( ptr ) = newLayers;
465 m_wasMigrated = true;
466 }
467
468 return true;
469 } );
470}
471
472
473bool PROJECT_LOCAL_SETTINGS::MigrateFromLegacy( wxConfigBase* aLegacyConfig )
474{
480 return true;
481}
482
483
484bool PROJECT_LOCAL_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
485{
486 wxASSERT( m_project );
487
488 Set( "meta.filename",
490
491 // Even if parameters were not modified, we should resave after migration
492 bool force = aForce || m_wasMigrated;
493
494 // If we're actually going ahead and doing the save, the flag that keeps code from doing the
495 // save should be cleared at this point.
496 m_wasMigrated = false;
497
498 return JSON_SETTINGS::SaveToFile( aDirectory, force );
499}
500
501
502bool PROJECT_LOCAL_SETTINGS::SaveAs( const wxString& aDirectory, const wxString& aFile )
503{
504 Set( "meta.filename", aFile + "." + FILEEXT::ProjectLocalSettingsFileExtension );
505 SetFilename( aFile );
506
507 // If we're actually going ahead and doing the save, the flag that keeps code from doing the
508 // save should be cleared at this point.
509 m_wasMigrated = false;
510
511 return JSON_SETTINGS::SaveToFile( aDirectory, true );
512}
513
514
516{
517 auto it = std::find_if( m_files.begin(), m_files.end(),
518 [&aFileName]( const PROJECT_FILE_STATE &a )
519 {
520 return a.fileName == aFileName;
521 } );
522
523 if( it != m_files.end() )
524 {
525 return &( *it );
526 }
527
528 return nullptr;
529}
530
531
532void PROJECT_LOCAL_SETTINGS::SaveFileState( const wxString& aFileName,
533 const WINDOW_SETTINGS* aWindowCfg, bool aOpen )
534{
535 auto it = std::find_if( m_files.begin(), m_files.end(),
536 [&aFileName]( const PROJECT_FILE_STATE& a )
537 {
538 return a.fileName == aFileName;
539 } );
540
541 if( it == m_files.end() )
542 {
543 PROJECT_FILE_STATE fileState;
544 fileState.fileName = aFileName;
545 fileState.open = false;
546 fileState.window.maximized = false;
547 fileState.window.size_x = -1;
548 fileState.window.size_y = -1;
549 fileState.window.pos_x = -1;
550 fileState.window.pos_y = -1;
551 fileState.window.display = 0;
552
553 m_files.push_back( fileState );
554
555 it = m_files.end() - 1;
556 }
557
558 ( *it ).window = aWindowCfg->state;
559 ( *it ).open = aOpen;
560}
561
562
564{
565 m_files.clear();
566}
@ NORMAL
Use all material properties from model file.
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
@ RATSNEST
Net/netclass colors are shown on ratsnest lines only.
int ParseHex(const std::string &str)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
Definition: base_set.h:348
std::string FmtHex() const
Return a hex string showing contents of this set.
Definition: base_set.h:302
Helper for storing and iterating over GAL_LAYER_IDs.
Definition: layer_ids.h:391
GAL_SET & set()
Definition: layer_ids.h:407
static GAL_SET DefaultVisible()
Definition: lset.cpp:742
std::vector< GAL_LAYER_ID > Seq() const
Definition: lset.cpp:728
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
static bool SetIfPresent(const nlohmann::json &aObj, const std::string &aPath, wxString &aTarget)
Sets the given string if the given key/path is present.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
bool m_deleteLegacyAfterMigration
Whether or not to delete legacy file after migration.
void SetFilename(const wxString &aFilename)
Definition: json_settings.h:84
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
Calls Store() and then writes the contents of the JSON document to a file.
static LSET AllLayersMask()
Definition: lset.cpp:593
Stores an enum as an integer.
Definition: parameters.h:228
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:295
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
LSET m_VisibleLayers
Board settings.
double m_PadOpacity
Opacity override for SMD pads and PTH.
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Calls Store() and then writes the contents of the JSON document to a file.
std::vector< PROJECT_FILE_STATE > m_files
Project scope.
double m_ViaOpacity
Opacity override for all types of via.
PANEL_NET_INSPECTOR_SETTINGS m_NetInspectorPanel
The state of the net inspector panel.
PCB_SELECTION_FILTER_OPTIONS m_PcbSelectionFilter
State of the selection filter widgets.
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
double m_TrackOpacity
Opacity override for all tracks.
PROJECT * m_project
A link to the owning project.
double m_ZoneOpacity
Opacity override for filled zones.
bool m_AutoTrackWidth
The current setting for whether to automatically adjust track widths to match.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
How zones are drawn.
double m_ShapeOpacity
Opacity override for graphic shapes.
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
The current contrast mode.
NET_COLOR_MODE m_NetColorMode
The current net color mode.
bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
GAL_SET m_VisibleItems
The GAL layers (aka items) that are turned on for viewing (.
std::vector< wxString > m_HiddenNets
A list of netnames that have been manually hidden in the board editor.
PROJECT_LOCAL_SETTINGS(PROJECT *aProject, const wxString &aFilename)
std::set< wxString > m_HiddenNetclasses
void SaveFileState(const wxString &aFileName, const WINDOW_SETTINGS *aWindowCfg, bool aOpen)
double m_ImageOpacity
Opacity override for user images.
const PROJECT_FILE_STATE * GetFileState(const wxString &aFileName)
Container for project specific data.
Definition: project.h:64
virtual const wxString GetProjectName() const
Return the short name of the project.
Definition: project.cpp:158
static const std::string ProjectLocalSettingsFileExtension
SETTINGS_LOC
Definition: json_settings.h:54
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
Definition: layer_ids.h:174
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:227
@ GAL_LAYER_ID_START
Definition: layer_ids.h:228
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored).
Definition: layer_ids.h:293
@ LAYER_SHAPES
Copper graphic shape opacity/visibility (color ignored).
Definition: layer_ids.h:311
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored).
Definition: layer_ids.h:290
@ F_Fab
Definition: layer_ids.h:119
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
@ F_Cu
Definition: layer_ids.h:64
std::optional< VISIBILITY_LAYER > VisibilityLayerFromRenderLayer(GAL_LAYER_ID aLayerId)
GAL_SET UserVisbilityLayers()
The set of GAL_LAYER_IDs that correspond to VISIBILITY_LAYERS.
std::string VisibilityLayerToString(VISIBILITY_LAYER aLayerId)
std::optional< GAL_LAYER_ID > RenderLayerFromVisbilityString(const std::string &aLayer)
const int projectLocalSettingsVersion
std::vector< wxString > custom_group_rules
bool otherItems
Anything not fitting one of the above categories.
bool graphics
Graphic lines, shapes, polygons.
bool footprints
Allow selecting entire footprints.
bool text
Text (free or attached to a footprint)
bool lockedItems
Allow selecting locked items.
struct WINDOW_STATE window
Store the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:74
WINDOW_STATE state
Definition: app_settings.h:75
unsigned int display
Definition: app_settings.h:67