2020-01-13 01:44:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
|
2022-01-19 13:24:02 +00:00
|
|
|
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-01-13 01:44:19 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PCBNEW_SETTINGS_H_
|
|
|
|
#define PCBNEW_SETTINGS_H_
|
|
|
|
|
2022-01-19 13:24:02 +00:00
|
|
|
#include <geometry/eda_angle.h>
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <settings/app_settings.h>
|
|
|
|
#include <pcb_display_options.h>
|
|
|
|
|
|
|
|
namespace PNS
|
|
|
|
{
|
|
|
|
class ROUTING_SETTINGS;
|
|
|
|
}
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
|
2022-07-29 19:56:55 +00:00
|
|
|
// Settings for the CONVERT_TOOL.
|
2022-11-28 20:46:30 +00:00
|
|
|
enum CONVERT_STRATEGY
|
|
|
|
{
|
|
|
|
COPY_LINEWIDTH,
|
|
|
|
CENTERLINE,
|
|
|
|
BOUNDING_HULL
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2022-07-29 19:56:55 +00:00
|
|
|
struct CONVERT_SETTINGS
|
|
|
|
{
|
2022-11-28 20:46:30 +00:00
|
|
|
CONVERT_STRATEGY m_Strategy;
|
2022-12-01 13:27:59 +00:00
|
|
|
int m_LineWidth;
|
2022-11-28 20:46:30 +00:00
|
|
|
bool m_DeleteOriginals;
|
2022-07-29 19:56:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
enum class MAGNETIC_OPTIONS
|
|
|
|
{
|
2021-04-10 00:20:31 +00:00
|
|
|
NO_EFFECT = 0,
|
2020-01-13 01:44:19 +00:00
|
|
|
CAPTURE_CURSOR_IN_TRACK_TOOL,
|
|
|
|
CAPTURE_ALWAYS
|
|
|
|
};
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
|
2020-05-22 18:27:05 +00:00
|
|
|
struct MAGNETIC_SETTINGS
|
|
|
|
{
|
|
|
|
MAGNETIC_OPTIONS pads;
|
|
|
|
MAGNETIC_OPTIONS tracks;
|
|
|
|
bool graphics;
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
MAGNETIC_SETTINGS() :
|
|
|
|
pads( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
|
|
|
|
tracks( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ),
|
|
|
|
graphics( false )
|
|
|
|
{ }
|
2020-05-22 18:27:05 +00:00
|
|
|
};
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
|
2020-06-21 19:39:27 +00:00
|
|
|
enum class TRACK_DRAG_ACTION
|
|
|
|
{
|
|
|
|
MOVE,
|
|
|
|
DRAG,
|
|
|
|
DRAG_FREE_ANGLE
|
|
|
|
};
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
|
|
|
|
enum TRACK_CLEARANCE_MODE
|
|
|
|
{
|
|
|
|
DO_NOT_SHOW_CLEARANCE = 0,
|
2022-02-12 16:32:55 +00:00
|
|
|
SHOW_WHILE_ROUTING,
|
|
|
|
SHOW_WITH_VIA_WHILE_ROUTING,
|
|
|
|
SHOW_WITH_VIA_WHILE_ROUTING_OR_DRAGGING,
|
|
|
|
SHOW_WITH_VIA_ALWAYS
|
2021-12-26 00:36:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum PCB_DISPLAY_ORIGIN
|
|
|
|
{
|
|
|
|
PCB_ORIGIN_PAGE = 0,
|
|
|
|
PCB_ORIGIN_AUX,
|
|
|
|
PCB_ORIGIN_GRID,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-02-20 15:59:45 +00:00
|
|
|
typedef std::vector<std::pair<wxString, bool>> ACTION_PLUGIN_SETTINGS_LIST;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2022-07-23 08:34:31 +00:00
|
|
|
// base class to handle Pcbnew SETTINGS also used in Cvpcb
|
|
|
|
class PCB_VIEWERS_SETTINGS_BASE : public APP_SETTINGS_BASE
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct VIEWERS_DISPLAY_OPTIONS
|
|
|
|
{
|
|
|
|
bool m_DisplayGraphicsFill;
|
|
|
|
bool m_DisplayTextFill;
|
|
|
|
bool m_DisplayPadNumbers;
|
|
|
|
bool m_DisplayPadFill;
|
|
|
|
};
|
|
|
|
|
|
|
|
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay;
|
|
|
|
|
|
|
|
PCB_VIEWERS_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion ):
|
|
|
|
APP_SETTINGS_BASE( aFilename, aSchemaVersion )
|
|
|
|
{
|
|
|
|
m_ViewersDisplay.m_DisplayGraphicsFill = true;
|
|
|
|
m_ViewersDisplay.m_DisplayTextFill = true;
|
|
|
|
m_ViewersDisplay.m_DisplayPadNumbers = true;
|
|
|
|
m_ViewersDisplay.m_DisplayPadFill = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~PCB_VIEWERS_SETTINGS_BASE() {};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PCBNEW_SETTINGS : public PCB_VIEWERS_SETTINGS_BASE
|
2020-01-13 01:44:19 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct AUI_PANELS
|
|
|
|
{
|
2020-08-18 02:06:31 +00:00
|
|
|
int appearance_panel_tab;
|
2022-10-30 23:46:15 +00:00
|
|
|
bool appearance_expand_layer_display;
|
|
|
|
bool appearance_expand_net_display;
|
2020-08-16 18:33:40 +00:00
|
|
|
int right_panel_width;
|
2022-11-25 14:11:20 +00:00
|
|
|
int properties_panel_width;
|
|
|
|
int search_panel_height;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_layer_manager;
|
2020-02-04 08:40:25 +00:00
|
|
|
bool show_properties;
|
2022-09-25 15:56:41 +00:00
|
|
|
bool show_search;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_CLEANUP
|
|
|
|
{
|
|
|
|
bool cleanup_vias;
|
2020-07-31 04:21:25 +00:00
|
|
|
bool delete_dangling_vias;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool cleanup_tracks_in_pad;
|
|
|
|
bool cleanup_unconnected;
|
|
|
|
bool cleanup_short_circuits;
|
|
|
|
bool merge_segments;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_DRC
|
|
|
|
{
|
|
|
|
bool refill_zones;
|
2020-09-14 15:45:39 +00:00
|
|
|
bool test_all_track_errors;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool test_footprints;
|
2020-03-04 14:25:54 +00:00
|
|
|
int severities;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_EXPORT_IDF
|
|
|
|
{
|
|
|
|
bool auto_adjust;
|
|
|
|
int ref_units;
|
|
|
|
double ref_x;
|
|
|
|
double ref_y;
|
|
|
|
bool units_mils;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_EXPORT_STEP
|
|
|
|
{
|
|
|
|
int origin_mode;
|
|
|
|
int origin_units;
|
|
|
|
double origin_x;
|
|
|
|
double origin_y;
|
|
|
|
bool no_virtual;
|
2021-06-15 07:33:37 +00:00
|
|
|
bool replace_models;
|
|
|
|
bool overwrite_file;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_EXPORT_SVG
|
|
|
|
{
|
|
|
|
bool black_and_white;
|
|
|
|
bool mirror;
|
|
|
|
bool one_file;
|
|
|
|
bool plot_board_edges;
|
|
|
|
int page_size;
|
|
|
|
wxString output_dir;
|
|
|
|
std::vector<int> layers;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_EXPORT_VRML
|
|
|
|
{
|
|
|
|
int units;
|
|
|
|
bool copy_3d_models;
|
|
|
|
bool use_relative_paths;
|
|
|
|
int ref_units;
|
|
|
|
double ref_x;
|
|
|
|
double ref_y;
|
2021-03-17 13:26:26 +00:00
|
|
|
int origin_mode;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_FOOTPRINT_WIZARD_LIST
|
|
|
|
{
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_GENERATE_DRILL
|
|
|
|
{
|
|
|
|
bool merge_pth_npth;
|
|
|
|
bool minimal_header;
|
|
|
|
bool mirror;
|
|
|
|
bool unit_drill_is_inch;
|
|
|
|
bool use_route_for_oval_holes;
|
|
|
|
int drill_file_type;
|
|
|
|
int map_file_type;
|
|
|
|
int zeros_format;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_IMPORT_GRAPHICS
|
|
|
|
{
|
|
|
|
int layer;
|
|
|
|
bool interactive_placement;
|
|
|
|
wxString last_file;
|
2022-07-18 16:49:50 +00:00
|
|
|
double dxf_line_width;
|
|
|
|
int dxf_line_width_units;
|
2020-01-13 01:44:19 +00:00
|
|
|
int origin_units;
|
|
|
|
double origin_x;
|
|
|
|
double origin_y;
|
2020-11-22 03:11:24 +00:00
|
|
|
int dxf_units;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_NETLIST
|
|
|
|
{
|
|
|
|
int report_filter;
|
|
|
|
bool update_footprints;
|
|
|
|
bool delete_shorting_tracks;
|
|
|
|
bool delete_extra_footprints;
|
2020-05-05 13:20:02 +00:00
|
|
|
bool associate_by_ref_sch;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_PLACE_FILE
|
|
|
|
{
|
2022-10-24 21:21:50 +00:00
|
|
|
wxString output_directory;
|
|
|
|
int units;
|
|
|
|
int file_options;
|
|
|
|
int file_format;
|
|
|
|
bool include_board_edge;
|
|
|
|
bool exclude_TH;
|
|
|
|
bool only_SMD;
|
|
|
|
bool use_aux_origin;
|
|
|
|
bool negate_xcoord;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct DIALOG_PLOT
|
|
|
|
{
|
2020-10-21 20:23:28 +00:00
|
|
|
int all_layers_on_one_page;
|
2021-12-19 15:43:02 +00:00
|
|
|
bool edgecut_on_all_layers;
|
2020-01-13 01:44:19 +00:00
|
|
|
int pads_drill_mode;
|
|
|
|
double fine_scale_x;
|
|
|
|
double fine_scale_y;
|
|
|
|
double ps_fine_width_adjust;
|
|
|
|
bool check_zones_before_plotting;
|
2020-10-08 12:26:40 +00:00
|
|
|
bool mirror;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
2020-04-21 01:44:17 +00:00
|
|
|
struct DIALOG_REANNOTATE
|
|
|
|
{
|
2020-11-13 02:57:11 +00:00
|
|
|
bool sort_on_fp_location;
|
2020-04-21 01:44:17 +00:00
|
|
|
bool remove_front_prefix;
|
|
|
|
bool remove_back_prefix;
|
|
|
|
bool exclude_locked;
|
|
|
|
int grid_index;
|
|
|
|
int sort_code;
|
|
|
|
int annotation_choice;
|
|
|
|
int report_severity;
|
|
|
|
wxString front_refdes_start;
|
|
|
|
wxString back_refdes_start;
|
|
|
|
wxString front_prefix;
|
|
|
|
wxString back_prefix;
|
|
|
|
wxString exclude_list;
|
|
|
|
wxString report_file_name;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
struct FOOTPRINT_CHOOSER
|
|
|
|
{
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int sash_h;
|
|
|
|
int sash_v;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ZONES
|
|
|
|
{
|
|
|
|
int net_sort_mode;
|
|
|
|
};
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
struct DISPLAY_OPTIONS
|
|
|
|
{
|
2022-07-23 08:34:31 +00:00
|
|
|
// Note: Display options common to Cvpcb and Pcbnew are stored in
|
|
|
|
// VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay, because the section DISPLAY_OPTIONS
|
|
|
|
// exists only for Pcbnew
|
2021-12-26 00:36:12 +00:00
|
|
|
bool m_DisplayViaFill;
|
|
|
|
bool m_DisplayPcbTrackFill;
|
|
|
|
|
2022-02-12 16:32:55 +00:00
|
|
|
TRACK_CLEARANCE_MODE m_TrackClearance;
|
|
|
|
bool m_PadClearance;
|
2021-12-26 00:36:12 +00:00
|
|
|
|
2022-02-12 16:32:55 +00:00
|
|
|
int m_NetNames;
|
2021-12-26 00:36:12 +00:00
|
|
|
|
|
|
|
RATSNEST_MODE m_RatsnestMode;
|
|
|
|
|
|
|
|
int m_MaxLinksShowed;
|
|
|
|
bool m_ShowModuleRatsnest;
|
|
|
|
bool m_ShowGlobalRatsnest;
|
|
|
|
bool m_DisplayRatsnestLinesCurved;
|
|
|
|
|
|
|
|
PCB_DISPLAY_ORIGIN m_DisplayOrigin;
|
|
|
|
bool m_DisplayInvertXAxis;
|
|
|
|
bool m_DisplayInvertYAxis;
|
|
|
|
|
|
|
|
bool m_Live3DRefresh;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
PCBNEW_SETTINGS();
|
|
|
|
|
2020-02-28 03:53:00 +00:00
|
|
|
virtual ~PCBNEW_SETTINGS();
|
2020-01-13 01:44:19 +00:00
|
|
|
|
|
|
|
virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
|
|
|
|
|
|
|
|
AUI_PANELS m_AuiPanels;
|
|
|
|
|
|
|
|
DIALOG_CLEANUP m_Cleanup;
|
|
|
|
|
|
|
|
DIALOG_DRC m_DrcDialog;
|
|
|
|
|
|
|
|
DIALOG_EXPORT_IDF m_ExportIdf;
|
|
|
|
|
|
|
|
DIALOG_EXPORT_STEP m_ExportStep;
|
|
|
|
|
|
|
|
DIALOG_EXPORT_SVG m_ExportSvg;
|
|
|
|
|
|
|
|
DIALOG_EXPORT_VRML m_ExportVrml;
|
|
|
|
|
|
|
|
DIALOG_FOOTPRINT_WIZARD_LIST m_FootprintWizardList;
|
|
|
|
|
|
|
|
DIALOG_GENERATE_DRILL m_GenDrill;
|
|
|
|
|
|
|
|
DIALOG_IMPORT_GRAPHICS m_ImportGraphics;
|
|
|
|
|
|
|
|
DIALOG_NETLIST m_NetlistDialog;
|
|
|
|
|
|
|
|
DIALOG_PLACE_FILE m_PlaceFile;
|
|
|
|
|
|
|
|
DIALOG_PLOT m_Plot;
|
|
|
|
|
2020-04-21 01:44:17 +00:00
|
|
|
DIALOG_REANNOTATE m_Reannotate;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
FOOTPRINT_CHOOSER m_FootprintChooser;
|
|
|
|
|
|
|
|
ZONES m_Zones;
|
|
|
|
|
|
|
|
WINDOW_SETTINGS m_FootprintViewer;
|
|
|
|
|
|
|
|
WINDOW_SETTINGS m_FootprintWizard;
|
|
|
|
|
2021-12-26 00:36:12 +00:00
|
|
|
DISPLAY_OPTIONS m_Display;
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2020-05-22 18:27:05 +00:00
|
|
|
MAGNETIC_SETTINGS m_MagneticItems;
|
|
|
|
|
2020-06-21 19:39:27 +00:00
|
|
|
TRACK_DRAG_ACTION m_TrackDragAction;
|
|
|
|
|
2022-06-16 17:05:48 +00:00
|
|
|
bool m_CtrlClickHighlight;
|
|
|
|
|
2021-08-29 23:33:08 +00:00
|
|
|
bool m_Use45DegreeLimit; // True to constrain tool actions to horizontal,
|
|
|
|
// vertical and 45deg
|
2021-10-01 11:11:03 +00:00
|
|
|
bool m_FlipLeftRight; // True: Flip footprints across Y axis
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2022-08-09 07:45:29 +00:00
|
|
|
bool m_ESCClearsNetHighlight;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
bool m_PolarCoords;
|
|
|
|
|
2022-01-19 13:24:02 +00:00
|
|
|
EDA_ANGLE m_RotationAngle;
|
2020-01-13 01:44:19 +00:00
|
|
|
|
|
|
|
bool m_ShowPageLimits;
|
|
|
|
|
2022-10-19 10:32:16 +00:00
|
|
|
bool m_ShowCourtyardCollisions;
|
|
|
|
|
2021-03-17 18:57:07 +00:00
|
|
|
///<@todo Implement real auto zone filling (not just after zone properties are edited)
|
|
|
|
bool m_AutoRefillZones; // Fill zones after editing the zone using the Zone Properties dialog
|
|
|
|
|
2021-03-27 14:44:51 +00:00
|
|
|
bool m_AllowFreePads; // True: unlocked pads can be moved freely with respect to the footprint.
|
|
|
|
// False (default): all pads are treated as locked for the purposes of
|
|
|
|
// movement and any attempt to move them will move the footprint instead.
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
wxString m_FootprintTextShownColumns;
|
|
|
|
|
2020-02-28 03:53:00 +00:00
|
|
|
std::unique_ptr<PNS::ROUTING_SETTINGS> m_PnsSettings;
|
2020-01-13 01:44:19 +00:00
|
|
|
|
2022-04-18 08:32:36 +00:00
|
|
|
double m_FootprintViewerZoom; ///< The last zoom level used (0 for auto)
|
|
|
|
bool m_FootprintViewerAutoZoomOnSelect; ///< true to use automatic zoom on fp selection
|
2022-07-11 03:00:46 +00:00
|
|
|
int m_FootprintViewerLibListWidth;
|
|
|
|
int m_FootprintViewerFPListWidth;
|
2020-05-23 17:14:49 +00:00
|
|
|
|
2020-09-01 02:00:38 +00:00
|
|
|
wxString m_lastFootprintLibDir;
|
|
|
|
|
|
|
|
wxString m_lastFootprint3dDir;
|
|
|
|
|
2020-02-20 15:59:45 +00:00
|
|
|
ACTION_PLUGIN_SETTINGS_LIST m_VisibleActionPlugins;
|
2020-01-13 01:44:19 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual std::string getLegacyFrameName() const override { return "PcbFrame"; }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|