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 along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22
23#include <core/mirror.h> // for FLIP_DIRECTION
24#include <geometry/eda_angle.h>
27#include <pcb_display_options.h>
28
29namespace PNS
30{
31 class ROUTING_SETTINGS;
32}
33
34
35// Settings for the CONVERT_TOOL.
42
43
51
52
59
60
75
76
83
84
93
94
101
102
103typedef std::vector<std::pair<wxString, bool>> ACTION_PLUGIN_SETTINGS_LIST;
104
105
106// base class to handle Pcbnew SETTINGS also used in Cvpcb
108{
109public:
118
121
123
124 PCB_VIEWERS_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion ):
125 APP_SETTINGS_BASE( aFilename, aSchemaVersion ),
128 {
129 m_ViewersDisplay.m_AngleSnapMode = LEADER_MODE::DIRECT;
130 m_ViewersDisplay.m_DisplayGraphicsFill = true;
131 m_ViewersDisplay.m_DisplayTextFill = true;
132 m_ViewersDisplay.m_DisplayPadNumbers = true;
133 m_ViewersDisplay.m_DisplayPadFill = true;
134 }
135
137};
138
139
141{
142public:
164
166 {
167 // Export D356 uses wxFileDialog, so there's no DIALOG_SHIM to save/restore control state
169 };
170
177
179 {
180 // Footprint chooser is a FRAME, so there's no DIALOG_SHIM to save/restore control state
181 int width;
188 };
189
191 {
192 // Note: Display options common to Cvpcb and Pcbnew are stored in
193 // VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay, because the section DISPLAY_OPTIONS
194 // exists only for Pcbnew
197
201
203
205
211
215
218 };
219
221 {
222 KIGFX::COLOR4D m_ZeroSkewColor{ 1.0, 1.0, 1.0, 1.0 };
223 KIGFX::COLOR4D m_PositiveSkewColor{ 0.0, 0.0, 1.0, 1.0 };
224 KIGFX::COLOR4D m_NegativeSkewColor{ 1.0, 0.0, 0.0, 1.0 };
225 KIGFX::COLOR4D m_UnknownSkewColor{ 0.5, 0.5, 0.5, 1.0 };
226 bool m_UseLogScale{ false };
227 };
228
231
232 virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
233
234protected:
235 virtual std::string getLegacyFrameName() const override { return "PcbFrame"; }
236
237public:
239
243
246
248
252
254
255 LEADER_MODE m_AngleSnapMode; // Constrain tool actions to horizontal/vertical or 45°/90°
257
259
261
263
266
268 bool m_AutoRefillZones; // Fill zones after editing the zone using the Zone Properties dialog
269
270 bool m_AllowFreePads; // True: unlocked pads can be moved freely with respect to the footprint.
271 // False (default): all pads are treated as locked for the purposes of
272 // movement and any attempt to move them will move the footprint instead.
273
275
276 std::unique_ptr<PNS::ROUTING_SETTINGS> m_PnsSettings;
277
280
283
285};
286
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:105
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
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:27
Push and Shove diff pair dimensions (gap) settings dialog.
MAGNETIC_OPTIONS
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
MAGNETIC_OPTIONS tracks
MAGNETIC_OPTIONS pads
TRACK_CLEARANCE_MODE m_TrackClearance
Store the common settings that are saved and loaded for each window / frame.