2020-05-19 23:34:55 -04:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2025-01-01 13:30:11 -08:00
|
|
|
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
2020-05-19 23:34:55 -04: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 KICAD_SCHEMATIC_SETTINGS_H
|
|
|
|
#define KICAD_SCHEMATIC_SETTINGS_H
|
|
|
|
|
|
|
|
#include <default_values.h>
|
2020-06-07 22:19:46 -04:00
|
|
|
#include <settings/nested_settings.h>
|
2023-03-27 16:48:37 -04:00
|
|
|
#include <settings/bom_settings.h>
|
2020-06-07 22:19:46 -04:00
|
|
|
#include <template_fieldnames.h>
|
2023-08-06 20:20:53 +01:00
|
|
|
#include <font/font.h>
|
2023-02-09 15:13:05 -05:00
|
|
|
|
2023-07-14 10:21:58 +01:00
|
|
|
class NGSPICE_SETTINGS;
|
2021-03-18 15:31:02 -04:00
|
|
|
|
2023-10-14 20:46:39 +01:00
|
|
|
|
|
|
|
// The minimal grid size allowed to place a pin is 25 mils. Tthe best grid size is 50 mils,
|
|
|
|
// but 25 mils is still usable.
|
|
|
|
// This is because all symbols are using a 50 mils grid to place pins, and therefore the wires
|
|
|
|
// must be on the 50 mils grid.
|
|
|
|
#define MIN_CONNECTION_GRID_MILS 25
|
|
|
|
#define DEFAULT_CONNECTION_GRID_MILS 50
|
|
|
|
|
|
|
|
|
2020-05-19 23:34:55 -04:00
|
|
|
/**
|
2021-03-18 15:31:02 -04:00
|
|
|
* These are loaded from Eeschema settings but then overwritten by the project settings.
|
2020-05-19 23:34:55 -04:00
|
|
|
* All of the values are stored in IU, but the backing file stores in mils.
|
|
|
|
*/
|
2020-06-20 10:36:16 -04:00
|
|
|
class SCHEMATIC_SETTINGS : public NESTED_SETTINGS
|
2020-05-19 23:34:55 -04:00
|
|
|
{
|
2020-06-20 10:36:16 -04:00
|
|
|
public:
|
2020-06-07 22:19:46 -04:00
|
|
|
SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
|
|
|
|
|
|
|
|
virtual ~SCHEMATIC_SETTINGS();
|
|
|
|
|
2023-11-12 23:42:36 +00:00
|
|
|
wxString SubReference( int aUnit, bool aAddSeparator = true ) const;
|
|
|
|
|
|
|
|
public:
|
2020-10-08 10:04:53 -07:00
|
|
|
// Default sizes are all stored in IU here, and in mils in the JSON file
|
2020-05-19 23:34:55 -04:00
|
|
|
|
2020-08-30 18:57:10 +01:00
|
|
|
int m_DefaultLineWidth;
|
|
|
|
int m_DefaultTextSize;
|
2021-07-25 13:42:19 +02:00
|
|
|
double m_LabelSizeRatio;
|
2020-08-30 18:57:10 +01:00
|
|
|
double m_TextOffsetRatio;
|
|
|
|
int m_PinSymbolSize;
|
2021-09-02 12:40:45 +01:00
|
|
|
|
|
|
|
int m_JunctionSizeChoice; // none = 0, smallest = 1, small = 2, etc.
|
|
|
|
int m_JunctionSize; // a runtime cache of the calculated size
|
|
|
|
|
2025-06-18 22:18:59 +01:00
|
|
|
int m_HopOverSizeChoice; // none = 0, smallest = 1, etc.
|
|
|
|
double m_HopOverScale; // a runtime cache of the calculated lineWidth multiplier
|
|
|
|
|
2023-10-14 20:46:39 +01:00
|
|
|
int m_ConnectionGridSize; // usually 50mils (IU internally; mils in the JSON file)
|
|
|
|
|
2021-09-02 12:40:45 +01:00
|
|
|
int m_AnnotateStartNum; // Starting value for annotation
|
2023-11-12 23:42:36 +00:00
|
|
|
int m_SubpartIdSeparator; // the separator char between the subpart id and the
|
|
|
|
// reference like U1A, U1.A or U1-A
|
|
|
|
int m_SubpartFirstId; // the ASCII char value to calculate the subpart symbol
|
|
|
|
// id from the symbol number: only 'A', 'a' or '1' can
|
|
|
|
// be used, other values have no sense.
|
2020-06-07 22:19:46 -04:00
|
|
|
|
2020-11-17 16:02:47 +00:00
|
|
|
bool m_IntersheetRefsShow;
|
2021-03-04 22:29:41 +01:00
|
|
|
bool m_IntersheetRefsListOwnPage;
|
2020-11-17 16:02:47 +00:00
|
|
|
bool m_IntersheetRefsFormatShort;
|
|
|
|
wxString m_IntersheetRefsPrefix;
|
|
|
|
wxString m_IntersheetRefsSuffix;
|
2020-08-31 16:11:54 +02:00
|
|
|
|
2021-07-23 00:05:01 +01:00
|
|
|
double m_DashedLineDashRatio; // Dash length as ratio of the lineWidth
|
|
|
|
double m_DashedLineGapRatio; // Gap length as ratio of the lineWidth
|
|
|
|
|
2023-02-09 17:18:56 +00:00
|
|
|
int m_OPO_VPrecision; // Operating-point overlay voltage significant digits
|
|
|
|
wxString m_OPO_VRange; // Operating-point overlay voltage range
|
|
|
|
int m_OPO_IPrecision; // Operating-point overlay current significant digits
|
|
|
|
wxString m_OPO_IRange; // Operating-point overlay current range
|
|
|
|
|
2022-08-31 10:35:27 +01:00
|
|
|
wxString m_SchDrawingSheetFileName;
|
2020-08-30 18:57:10 +01:00
|
|
|
wxString m_PlotDirectoryName;
|
2020-06-07 22:19:46 -04:00
|
|
|
|
2020-08-30 18:57:10 +01:00
|
|
|
wxString m_NetFormatName;
|
2020-06-07 22:19:46 -04:00
|
|
|
|
2021-03-18 15:31:02 -04:00
|
|
|
///< @todo These should probably be moved to the "schematic.simulator" path.
|
2022-09-09 15:34:56 +02:00
|
|
|
bool m_SpiceCurSheetAsRoot;
|
2022-04-12 16:37:06 +02:00
|
|
|
bool m_SpiceSaveAllVoltages;
|
|
|
|
bool m_SpiceSaveAllCurrents;
|
2023-02-10 20:52:52 +00:00
|
|
|
bool m_SpiceSaveAllDissipations;
|
2024-05-12 15:45:42 +01:00
|
|
|
bool m_SpiceSaveAllEvents;
|
2020-08-30 18:57:10 +01:00
|
|
|
wxString m_SpiceCommandString; // A command string to run external spice
|
2020-06-07 22:19:46 -04:00
|
|
|
|
2022-09-09 15:34:56 +02:00
|
|
|
bool m_SpiceModelCurSheetAsRoot;
|
|
|
|
|
2020-08-30 18:57:10 +01:00
|
|
|
TEMPLATES m_TemplateFieldNames;
|
2021-03-18 15:31:02 -04:00
|
|
|
|
2024-04-11 15:05:17 -04:00
|
|
|
wxString m_BomExportFileName;
|
|
|
|
|
2023-02-09 15:13:05 -05:00
|
|
|
/// List of stored BOM presets
|
2023-08-06 20:20:53 +01:00
|
|
|
BOM_PRESET m_BomSettings;
|
|
|
|
std::vector<BOM_PRESET> m_BomPresets;
|
2023-02-09 15:13:05 -05:00
|
|
|
|
2023-03-09 10:54:57 -05:00
|
|
|
/// List of stored BOM format presets
|
|
|
|
BOM_FMT_PRESET m_BomFmtSettings;
|
|
|
|
std::vector<BOM_FMT_PRESET> m_BomFmtPresets;
|
|
|
|
|
2023-08-06 20:20:53 +01:00
|
|
|
KIFONT::METRICS m_FontMetrics;
|
|
|
|
|
2025-05-26 17:30:37 +01:00
|
|
|
/// Max deviation allowable when approximating circles and curves (in IU).
|
|
|
|
int m_MaxError;
|
|
|
|
|
2021-03-18 15:31:02 -04:00
|
|
|
/**
|
|
|
|
* Ngspice simulator settings.
|
|
|
|
*/
|
2023-07-14 10:21:58 +01:00
|
|
|
std::shared_ptr<NGSPICE_SETTINGS> m_NgspiceSettings;
|
2020-05-19 23:34:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|