KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew_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 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <core/mirror.h> // for FLIP_DIRECTION
24#include <geometry/eda_angle.h>
28#include <pcb_display_options.h>
29
30namespace PNS
31{
32 class ROUTING_SETTINGS;
33}
34
35
36// Settings for the CONVERT_TOOL.
43
44
52
53
60
61
70
71
78
79
80typedef std::vector<std::pair<wxString, bool>> ACTION_PLUGIN_SETTINGS_LIST;
81
82
83// base class to handle Pcbnew SETTINGS also used in Cvpcb
85{
86public:
95
98
100
101 PCB_VIEWERS_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion ):
102 APP_SETTINGS_BASE( aFilename, aSchemaVersion ),
105 {
106 m_ViewersDisplay.m_AngleSnapMode = LEADER_MODE::DIRECT;
107 m_ViewersDisplay.m_DisplayGraphicsFill = true;
108 m_ViewersDisplay.m_DisplayTextFill = true;
109 m_ViewersDisplay.m_DisplayPadNumbers = true;
110 m_ViewersDisplay.m_DisplayPadFill = true;
111 }
112
114};
115
116
118{
119public:
141
143 {
144 // Export D356 uses wxFileDialog, so there's no DIALOG_SHIM to save/restore control state
146 };
147
154
156 {
157 // Footprint chooser is a FRAME, so there's no DIALOG_SHIM to save/restore control state
158 int width;
165 };
166
168 {
169 // Note: Display options common to Cvpcb and Pcbnew are stored in
170 // VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay, because the section DISPLAY_OPTIONS
171 // exists only for Pcbnew
174
178
180
182
188
192
195
197 };
198
200 {
201 KIGFX::COLOR4D m_ZeroSkewColor{ 1.0, 1.0, 1.0, 1.0 };
202 KIGFX::COLOR4D m_PositiveSkewColor{ 0.0, 0.0, 1.0, 1.0 };
203 KIGFX::COLOR4D m_NegativeSkewColor{ 1.0, 0.0, 0.0, 1.0 };
204 KIGFX::COLOR4D m_UnknownSkewColor{ 0.5, 0.5, 0.5, 1.0 };
205 bool m_UseLogScale{ false };
206 };
207
210
211 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
212
213protected:
214 virtual std::string getLegacyFrameName() const override { return "PcbFrame"; }
215
216public:
218
222
225
227
232
234
235 LEADER_MODE m_AngleSnapMode; // Constrain tool actions to horizontal/vertical or 45°/90°
237
239
241
243
245
248
250 bool m_AutoRefillZones; // Fill zones after editing the zone using the Zone Properties dialog
251
252 bool m_AllowFreePads; // True: unlocked pads can be moved freely with respect to the footprint.
253 // False (default): all pads are treated as locked for the purposes of
254 // movement and any attempt to move them will move the footprint instead.
255
257
258 std::unique_ptr<PNS::ROUTING_SETTINGS> m_PnsSettings;
259
262
265
267};
ARC_EDIT_MODE
Settings for arc editing.
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
DIALOG_EXPORT_D356 m_ExportD356
DISPLAY_OPTIONS m_Display
wxString m_LastFootprintLibDir
EDA_ANGLE m_RotationAngle
DIALOG_DRC m_DRCDialog
ARC_EDIT_MODE m_ArcEditMode
FOOTPRINT_CHOOSER m_FootprintChooser
virtual ~PCBNEW_SETTINGS()
TRACK_DRAG_ACTION m_TrackDragAction
LEADER_MODE m_AngleSnapMode
virtual std::string getLegacyFrameName() const override
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
WINDOW_SETTINGS m_FootprintWizard
DIFF_PHASE_SKEW_SETTINGS m_DiffPhaseSkewSettings
AUI_PANELS m_AuiPanels
WINDOW_SETTINGS m_FootprintViewer
wxString m_LastFootprint3dDir
MAGNETIC_SETTINGS m_MagneticItems
FLIP_DIRECTION m_FlipDirection
SNAP_INFERENCE_SETTINGS m_SnapInference
std::unique_ptr< PNS::ROUTING_SETTINGS > m_PnsSettings
bool m_FootprintViewerAutoZoomOnSelect
true to use automatic zoom on fp selection
PCB_VIEWERS_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
double m_FootprintViewerZoom
The last zoom level used (0 for auto)
Contain all persistent settings of the router, such as the mode, optimization effort,...
a few functions useful in geometry calculations.
LEADER_MODE
The kind of the leader line.
@ DIRECT
Unconstrained point-to-point.
FLIP_DIRECTION
Definition mirror.h:23
Push and Shove diff pair dimensions (gap) settings dialog.
TRACK_CLEARANCE_MODE
@ SHOW_WITH_VIA_WHILE_ROUTING_OR_DRAGGING
@ DO_NOT_SHOW_CLEARANCE
@ SHOW_WHILE_ROUTING
@ SHOW_WITH_VIA_ALWAYS
@ SHOW_WITH_VIA_WHILE_ROUTING
PCB_DISPLAY_ORIGIN
@ PCB_ORIGIN_AUX
@ PCB_ORIGIN_GRID
@ PCB_ORIGIN_PAGE
CONVERT_STRATEGY
@ COPY_LINEWIDTH
@ CENTERLINE
@ BOUNDING_HULL
TRACK_DRAG_ACTION
std::vector< std::pair< wxString, bool > > ACTION_PLUGIN_SETTINGS_LIST
CONVERT_STRATEGY m_Strategy
TRACK_CLEARANCE_MODE m_TrackClearance
bool m_ShowConstraints
Keep the geometric-constraint overlay shown.
Store the common settings that are saved and loaded for each window / frame.