You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.6 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
  5. *
  6. * This program is free software: you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation, either version 3 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef KICAD_SCHEMATIC_SETTINGS_H
  20. #define KICAD_SCHEMATIC_SETTINGS_H
  21. #include <default_values.h>
  22. #include <settings/nested_settings.h>
  23. #include <settings/bom_settings.h>
  24. #include <template_fieldnames.h>
  25. #include <font/font.h>
  26. class NGSPICE_SETTINGS;
  27. // The minimal grid size allowed to place a pin is 25 mils. Tthe best grid size is 50 mils,
  28. // but 25 mils is still usable.
  29. // This is because all symbols are using a 50 mils grid to place pins, and therefore the wires
  30. // must be on the 50 mils grid.
  31. #define MIN_CONNECTION_GRID_MILS 25
  32. #define DEFAULT_CONNECTION_GRID_MILS 50
  33. /**
  34. * These settings were stored in SCH_BASE_FRAME previously.
  35. * The backing store is currently the project file.
  36. * They should likely move to a project settings file (JSON) once that framework exists.
  37. *
  38. * These are loaded from Eeschema settings but then overwritten by the project settings.
  39. * All of the values are stored in IU, but the backing file stores in mils.
  40. */
  41. class SCHEMATIC_SETTINGS : public NESTED_SETTINGS
  42. {
  43. public:
  44. SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
  45. virtual ~SCHEMATIC_SETTINGS();
  46. wxString SubReference( int aUnit, bool aAddSeparator = true ) const;
  47. public:
  48. // Default sizes are all stored in IU here, and in mils in the JSON file
  49. int m_DefaultLineWidth;
  50. int m_DefaultTextSize;
  51. double m_LabelSizeRatio;
  52. double m_TextOffsetRatio;
  53. int m_PinSymbolSize;
  54. int m_JunctionSizeChoice; // none = 0, smallest = 1, small = 2, etc.
  55. int m_JunctionSize; // a runtime cache of the calculated size
  56. int m_ConnectionGridSize; // usually 50mils (IU internally; mils in the JSON file)
  57. int m_AnnotateStartNum; // Starting value for annotation
  58. int m_SubpartIdSeparator; // the separator char between the subpart id and the
  59. // reference like U1A, U1.A or U1-A
  60. int m_SubpartFirstId; // the ASCII char value to calculate the subpart symbol
  61. // id from the symbol number: only 'A', 'a' or '1' can
  62. // be used, other values have no sense.
  63. bool m_IntersheetRefsShow;
  64. bool m_IntersheetRefsListOwnPage;
  65. bool m_IntersheetRefsFormatShort;
  66. wxString m_IntersheetRefsPrefix;
  67. wxString m_IntersheetRefsSuffix;
  68. double m_DashedLineDashRatio; // Dash length as ratio of the lineWidth
  69. double m_DashedLineGapRatio; // Gap length as ratio of the lineWidth
  70. int m_OPO_VPrecision; // Operating-point overlay voltage significant digits
  71. wxString m_OPO_VRange; // Operating-point overlay voltage range
  72. int m_OPO_IPrecision; // Operating-point overlay current significant digits
  73. wxString m_OPO_IRange; // Operating-point overlay current range
  74. wxString m_SchDrawingSheetFileName;
  75. wxString m_PlotDirectoryName;
  76. wxString m_NetFormatName;
  77. ///< @todo These should probably be moved to the "schematic.simulator" path.
  78. bool m_SpiceCurSheetAsRoot;
  79. bool m_SpiceSaveAllVoltages;
  80. bool m_SpiceSaveAllCurrents;
  81. bool m_SpiceSaveAllDissipations;
  82. wxString m_SpiceCommandString; // A command string to run external spice
  83. bool m_SpiceModelCurSheetAsRoot;
  84. TEMPLATES m_TemplateFieldNames;
  85. /// List of stored BOM presets
  86. BOM_PRESET m_BomSettings;
  87. std::vector<BOM_PRESET> m_BomPresets;
  88. /// List of stored BOM format presets
  89. BOM_FMT_PRESET m_BomFmtSettings;
  90. std::vector<BOM_FMT_PRESET> m_BomFmtPresets;
  91. KIFONT::METRICS m_FontMetrics;
  92. /**
  93. * Ngspice simulator settings.
  94. */
  95. std::shared_ptr<NGSPICE_SETTINGS> m_NgspiceSettings;
  96. };
  97. #endif