2020-01-13 01:44:19 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2023-05-20 17:47:12 +00:00
|
|
|
* Copyright (C) 2020-2023 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 2
|
|
|
|
* 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, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _EESCHEMA_SETTINGS_H
|
|
|
|
#define _EESCHEMA_SETTINGS_H
|
|
|
|
|
2023-05-20 17:47:12 +00:00
|
|
|
#include <wx/aui/framemanager.h>
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
#include <settings/app_settings.h>
|
|
|
|
|
|
|
|
|
2020-04-09 23:34:38 +00:00
|
|
|
using KIGFX::COLOR4D;
|
|
|
|
|
|
|
|
|
2023-05-20 17:47:12 +00:00
|
|
|
extern const wxAuiPaneInfo& defaultNetNavigatorPaneInfo();
|
2024-01-18 04:08:38 +00:00
|
|
|
extern const wxAuiPaneInfo& defaultPropertiesPaneInfo( wxWindow* aWindow );
|
2024-02-25 22:39:14 +00:00
|
|
|
extern const wxAuiPaneInfo& defaultSchSelectionFilterPaneInfo( wxWindow* aWindow );
|
2023-06-25 00:09:07 +00:00
|
|
|
|
2023-05-20 17:47:12 +00:00
|
|
|
|
|
|
|
|
2022-03-22 16:49:38 +00:00
|
|
|
enum LINE_MODE
|
|
|
|
{
|
|
|
|
LINE_MODE_FREE = 0,
|
|
|
|
LINE_MODE_90 = 1,
|
|
|
|
LINE_MODE_45 = 2,
|
|
|
|
|
|
|
|
LINE_MODE_COUNT,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
class EESCHEMA_SETTINGS : public APP_SETTINGS_BASE
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct APPEARANCE
|
|
|
|
{
|
2021-10-12 20:05:37 +00:00
|
|
|
wxString edit_symbol_visible_columns;
|
2022-12-24 22:18:05 +00:00
|
|
|
int edit_symbol_width;
|
|
|
|
int edit_symbol_height;
|
2020-03-06 20:02:58 +00:00
|
|
|
wxString edit_sheet_visible_columns;
|
2022-12-24 22:18:05 +00:00
|
|
|
int edit_sheet_width;
|
|
|
|
int edit_sheet_height;
|
2021-10-12 20:05:37 +00:00
|
|
|
wxString edit_label_visible_columns;
|
2022-12-24 22:18:05 +00:00
|
|
|
int edit_label_width;
|
|
|
|
int edit_label_height;
|
2020-03-16 11:05:01 +00:00
|
|
|
int erc_severities;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool footprint_preview;
|
|
|
|
bool print_sheet_reference;
|
2022-01-07 00:47:23 +00:00
|
|
|
wxString default_font;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_hidden_pins;
|
2020-04-18 15:36:29 +00:00
|
|
|
bool show_hidden_fields;
|
2023-04-27 16:59:53 +00:00
|
|
|
bool show_directive_labels;
|
2021-11-05 21:16:26 +00:00
|
|
|
bool show_erc_warnings;
|
|
|
|
bool show_erc_errors;
|
|
|
|
bool show_erc_exclusions;
|
2023-02-09 17:18:56 +00:00
|
|
|
bool show_op_voltages;
|
|
|
|
bool show_op_currents;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_illegal_symbol_lib_dialog;
|
|
|
|
bool show_page_limits;
|
2020-04-16 16:43:50 +00:00
|
|
|
bool show_sexpr_file_convert_warning;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool show_sheet_filename_case_sensitivity_dialog;
|
|
|
|
};
|
|
|
|
|
2022-06-02 21:56:17 +00:00
|
|
|
struct AUI_PANELS
|
|
|
|
{
|
2022-06-08 16:09:25 +00:00
|
|
|
int hierarchy_panel_docked_width; // width of hierarchy tree panel and pane when docked
|
2023-05-20 17:47:12 +00:00
|
|
|
int hierarchy_panel_docked_height; // height of hierarchy tree panel and pane when docked
|
2022-06-08 16:09:25 +00:00
|
|
|
int hierarchy_panel_float_width; // width of hierarchy tree panel when floating
|
|
|
|
int hierarchy_panel_float_height; // height of hierarchy tree panel when floating
|
2023-05-15 01:35:39 +00:00
|
|
|
int search_panel_height; // height of the search panel
|
2023-05-19 20:51:57 +00:00
|
|
|
int search_panel_width; // width of the search panel
|
|
|
|
int search_panel_dock_direction; // docking direction of the search panel
|
2022-06-08 16:09:25 +00:00
|
|
|
bool schematic_hierarchy_float; // show hierarchy tree panel as floating
|
|
|
|
bool show_schematic_hierarchy; // show hierarchy tree pane
|
2023-05-15 01:35:39 +00:00
|
|
|
bool show_search; // show the search panel
|
2023-05-20 17:47:12 +00:00
|
|
|
wxSize net_nav_panel_docked_size;
|
|
|
|
wxPoint net_nav_panel_float_pos;
|
|
|
|
wxSize net_nav_panel_float_size;
|
|
|
|
bool float_net_nav_panel;
|
|
|
|
bool show_net_nav_panel;
|
2023-06-21 01:57:20 +00:00
|
|
|
int properties_panel_width;
|
2023-09-25 11:35:31 +00:00
|
|
|
float properties_splitter;
|
2023-06-21 01:57:20 +00:00
|
|
|
bool show_properties;
|
2022-06-02 21:56:17 +00:00
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
struct AUTOPLACE_FIELDS
|
|
|
|
{
|
|
|
|
bool enable;
|
|
|
|
bool allow_rejustify;
|
|
|
|
bool align_to_grid;
|
|
|
|
};
|
|
|
|
|
2021-02-25 03:37:30 +00:00
|
|
|
struct BOM_PLUGIN_SETTINGS
|
|
|
|
{
|
|
|
|
BOM_PLUGIN_SETTINGS() = default;
|
|
|
|
|
|
|
|
BOM_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
|
|
|
|
name( aName ),
|
|
|
|
path( aPath )
|
|
|
|
{}
|
|
|
|
|
|
|
|
wxString name;
|
|
|
|
wxString path;
|
|
|
|
wxString command;
|
|
|
|
};
|
|
|
|
|
2021-09-05 14:13:52 +00:00
|
|
|
struct NETLIST_PLUGIN_SETTINGS
|
|
|
|
{
|
|
|
|
NETLIST_PLUGIN_SETTINGS() = default;
|
|
|
|
|
|
|
|
NETLIST_PLUGIN_SETTINGS( const wxString& aName, const wxString& aPath ) :
|
|
|
|
name( aName ),
|
|
|
|
path( aPath )
|
|
|
|
{}
|
|
|
|
|
|
|
|
wxString name;
|
|
|
|
wxString path;
|
|
|
|
wxString command;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
struct DRAWING
|
|
|
|
{
|
2020-05-20 03:34:55 +00:00
|
|
|
int default_bus_thickness;
|
|
|
|
int default_junction_size;
|
|
|
|
int default_line_thickness;
|
|
|
|
int default_repeat_offset_x;
|
|
|
|
int default_repeat_offset_y;
|
|
|
|
int default_wire_thickness;
|
|
|
|
int default_text_size;
|
|
|
|
int pin_symbol_size;
|
|
|
|
double text_offset_ratio;
|
|
|
|
COLOR4D default_sheet_border_color;
|
|
|
|
COLOR4D default_sheet_background_color;
|
2020-01-13 01:44:19 +00:00
|
|
|
wxString field_names;
|
2022-03-22 16:49:38 +00:00
|
|
|
int line_mode;
|
2020-05-20 03:34:55 +00:00
|
|
|
int repeat_label_increment;
|
2020-08-31 14:11:54 +00:00
|
|
|
bool intersheets_ref_show;
|
2021-03-04 21:29:41 +00:00
|
|
|
bool intersheets_ref_own_page;
|
2020-08-31 14:11:54 +00:00
|
|
|
bool intersheets_ref_short;
|
|
|
|
wxString intersheets_ref_prefix;
|
|
|
|
wxString intersheets_ref_suffix;
|
2020-10-01 23:53:47 +00:00
|
|
|
bool auto_start_wires;
|
2020-10-08 17:04:53 +00:00
|
|
|
std::vector<double> junction_size_mult_list;
|
2023-10-12 13:36:28 +00:00
|
|
|
|
2020-10-08 17:04:53 +00:00
|
|
|
// Pulldown index for user default junction dot size (e.g. smallest = 0, small = 1, etc)
|
|
|
|
int junction_size_choice;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct INPUT
|
|
|
|
{
|
|
|
|
bool drag_is_move;
|
2022-07-23 09:32:21 +00:00
|
|
|
bool esc_clears_net_highlight;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SELECTION
|
|
|
|
{
|
2021-09-15 20:03:07 +00:00
|
|
|
int selection_thickness;
|
|
|
|
int highlight_thickness;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool draw_selected_children;
|
|
|
|
bool fill_shapes;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PAGE_SETTINGS
|
|
|
|
{
|
2020-04-19 11:34:01 +00:00
|
|
|
bool export_paper;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool export_revision;
|
|
|
|
bool export_date;
|
|
|
|
bool export_title;
|
|
|
|
bool export_company;
|
|
|
|
bool export_comment1;
|
|
|
|
bool export_comment2;
|
|
|
|
bool export_comment3;
|
|
|
|
bool export_comment4;
|
|
|
|
bool export_comment5;
|
|
|
|
bool export_comment6;
|
|
|
|
bool export_comment7;
|
|
|
|
bool export_comment8;
|
|
|
|
bool export_comment9;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_ANNOTATE
|
|
|
|
{
|
2022-03-30 17:41:40 +00:00
|
|
|
bool automatic;
|
2022-04-22 11:55:00 +00:00
|
|
|
bool recursive;
|
2021-04-26 14:19:11 +00:00
|
|
|
int scope;
|
|
|
|
int options;
|
2020-01-13 01:44:19 +00:00
|
|
|
int method;
|
|
|
|
int messages_filter;
|
|
|
|
int sort_order;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_BOM
|
|
|
|
{
|
|
|
|
wxString selected_plugin;
|
2021-02-25 03:37:30 +00:00
|
|
|
std::vector<BOM_PLUGIN_SETTINGS> plugins;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_FIELD_EDITOR
|
|
|
|
{
|
2023-03-15 00:03:57 +00:00
|
|
|
std::map<std::string, int> field_widths;
|
2023-04-01 12:57:59 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int page;
|
2023-06-04 17:45:07 +00:00
|
|
|
wxString export_filename;
|
2023-08-07 17:49:27 +00:00
|
|
|
int selection_mode;
|
2023-08-07 19:04:46 +00:00
|
|
|
int scope;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_LIB_VIEW
|
|
|
|
{
|
|
|
|
int lib_list_width;
|
|
|
|
int cmp_list_width;
|
|
|
|
bool show_pin_electrical_type;
|
2022-09-06 16:28:44 +00:00
|
|
|
bool show_pin_numbers;
|
2020-01-13 01:44:19 +00:00
|
|
|
WINDOW_SETTINGS window;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_NETLIST
|
|
|
|
{
|
2021-09-05 14:13:52 +00:00
|
|
|
std::vector<NETLIST_PLUGIN_SETTINGS> plugins;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_PLOT
|
|
|
|
{
|
2020-03-06 03:00:30 +00:00
|
|
|
bool background_color;
|
|
|
|
bool color;
|
|
|
|
wxString color_theme;
|
|
|
|
int format;
|
|
|
|
bool frame_reference;
|
|
|
|
int hpgl_paper_size;
|
|
|
|
double hpgl_pen_size;
|
2020-12-21 23:27:31 +00:00
|
|
|
int hpgl_origin;
|
2023-10-21 20:52:51 +00:00
|
|
|
bool pdf_property_popups;
|
2022-08-21 15:21:09 +00:00
|
|
|
bool open_file_after_plot;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_SYM_CHOOSER
|
|
|
|
{
|
|
|
|
int sash_pos_h;
|
|
|
|
int sash_pos_v;
|
|
|
|
int width;
|
|
|
|
int height;
|
2023-05-01 20:26:29 +00:00
|
|
|
int sort_mode;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool keep_symbol;
|
|
|
|
bool place_all_units;
|
|
|
|
};
|
|
|
|
|
2023-10-09 00:54:34 +00:00
|
|
|
struct DIALOG_IMPORT_GRAPHICS
|
|
|
|
{
|
|
|
|
bool interactive_placement;
|
|
|
|
wxString last_file;
|
|
|
|
double dxf_line_width;
|
|
|
|
int dxf_line_width_units;
|
|
|
|
int origin_units;
|
|
|
|
double origin_x;
|
|
|
|
double origin_y;
|
|
|
|
int dxf_units;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
struct SIMULATOR
|
|
|
|
{
|
|
|
|
int plot_panel_width;
|
|
|
|
int plot_panel_height;
|
|
|
|
int signal_panel_height;
|
|
|
|
int cursors_panel_height;
|
2023-02-11 20:39:50 +00:00
|
|
|
int measurements_panel_height;
|
2020-01-13 01:44:19 +00:00
|
|
|
bool white_background;
|
|
|
|
WINDOW_SETTINGS window;
|
|
|
|
};
|
|
|
|
|
2022-08-05 02:40:38 +00:00
|
|
|
struct FIND_REPLACE_EXTRA
|
|
|
|
{
|
|
|
|
bool search_all_fields;
|
|
|
|
bool search_all_pins;
|
|
|
|
bool search_current_sheet_only;
|
2023-01-26 17:35:15 +00:00
|
|
|
bool search_selected_only;
|
2022-08-05 02:40:38 +00:00
|
|
|
|
|
|
|
bool replace_references;
|
|
|
|
};
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
EESCHEMA_SETTINGS();
|
|
|
|
|
|
|
|
virtual ~EESCHEMA_SETTINGS() {}
|
|
|
|
|
|
|
|
virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
|
|
|
|
|
2021-02-25 03:37:30 +00:00
|
|
|
static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
|
|
|
|
|
2021-03-25 14:07:16 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool migrateBomSettings();
|
|
|
|
|
|
|
|
nlohmann::json bomSettingsToJson() const;
|
|
|
|
|
|
|
|
static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
|
|
|
|
|
2021-09-05 14:13:52 +00:00
|
|
|
nlohmann::json netlistSettingsToJson() const;
|
|
|
|
static std::vector<NETLIST_PLUGIN_SETTINGS> netlistSettingsFromJson( const nlohmann::json& aObj );
|
|
|
|
|
2021-03-25 14:07:16 +00:00
|
|
|
public:
|
2020-01-13 01:44:19 +00:00
|
|
|
APPEARANCE m_Appearance;
|
|
|
|
|
|
|
|
AUTOPLACE_FIELDS m_AutoplaceFields;
|
|
|
|
|
2022-06-02 21:56:17 +00:00
|
|
|
AUI_PANELS m_AuiPanels;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
DRAWING m_Drawing;
|
|
|
|
|
2022-08-05 02:40:38 +00:00
|
|
|
FIND_REPLACE_EXTRA m_FindReplaceExtra;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
INPUT m_Input;
|
|
|
|
|
|
|
|
PAGE_SETTINGS m_PageSettings;
|
|
|
|
|
|
|
|
PANEL_ANNOTATE m_AnnotatePanel;
|
|
|
|
|
|
|
|
PANEL_BOM m_BomPanel;
|
|
|
|
|
|
|
|
PANEL_FIELD_EDITOR m_FieldEditorPanel;
|
|
|
|
|
|
|
|
PANEL_LIB_VIEW m_LibViewPanel;
|
|
|
|
|
|
|
|
PANEL_NETLIST m_NetlistPanel;
|
|
|
|
|
|
|
|
PANEL_PLOT m_PlotPanel;
|
|
|
|
|
|
|
|
PANEL_SYM_CHOOSER m_SymChooserPanel;
|
|
|
|
|
2023-10-09 00:54:34 +00:00
|
|
|
DIALOG_IMPORT_GRAPHICS m_ImportGraphics;
|
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
SELECTION m_Selection;
|
|
|
|
|
|
|
|
SIMULATOR m_Simulator;
|
|
|
|
|
|
|
|
bool m_RescueNeverShow;
|
|
|
|
|
2020-09-01 02:00:38 +00:00
|
|
|
wxString m_lastSymbolLibDir;
|
2020-01-13 01:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|