KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_downgrade.h File Reference
#include <compatibility_report.h>
#include <downgrade_target.h>
#include <vector>

Go to the source code of this file.

Functions

COMPATIBILITY_REPORT ClassifyScreenForDowngrade (const SCH_SCREEN *aScreen, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate=false)
 Report what a schematic screen would lose if exported to an older KiCad.
 
COMPATIBILITY_REPORT ClassifySchematicStructureForDowngrade (const SCHEMATIC &aSchematic, const DOWNGRADE_TARGET &aTarget)
 Schematic-wide structure the per-screen rules cannot see. Does not modify it.
 
void DowngradeScreenInPlace (SCH_SCREEN *aScreen, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate=false)
 Approximate or remove, in place, what the target cannot represent.
 
COMPATIBILITY_REPORT ClassifyLibSymbolForDowngrade (const LIB_SYMBOL *aSymbol, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate=false)
 Report what a library symbol would lose if exported to an older KiCad. Does not modify it.
 
void DowngradeLibSymbolInPlace (LIB_SYMBOL *aSymbol, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate=false)
 Symbol-scoped downgrade for standalone .kicad_sym files the screen pass never sees.
 
void SaveSchematicForTarget (SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
 Save a schematic sheet file stamped for the target, using the writer for that version.
 
void SaveSymbolLibraryForTarget (const std::vector< LIB_SYMBOL * > &aSymbols, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
 Save a .kicad_sym library stamped for the target.
 
wxString FindUnsupportedSchToken (const wxString &aSerialized, const DOWNGRADE_TARGET &aTarget)
 Scan serialized schematic text for tokens the target cannot parse.
 
bool FlattenSchematicVariant (SCHEMATIC &aSchematic, const wxString &aVariantName, wxString *aConflict)
 Bake a variant into the base attributes of every symbol and sheet.
 
int SchDowngradeCoveredVersion ()
 The format the denylist was generated against. A format bump forces a review.
 
int SymbolLibDowngradeCoveredVersion ()
 The symbol library format the denylist was generated against.
 

Variables

constexpr int SCH_VER_VARIANTS = 20250922
 Format dates for rules the jobs handler applies at schematic scope.
 
constexpr int SCH_VER_NET_CHAINS = 20260512
 
constexpr int SCH_VER_FLAT_HIERARCHY = 20251012
 

Function Documentation

◆ ClassifyLibSymbolForDowngrade()

◆ ClassifySchematicStructureForDowngrade()

◆ ClassifyScreenForDowngrade()

COMPATIBILITY_REPORT ClassifyScreenForDowngrade ( const SCH_SCREEN * aScreen,
const DOWNGRADE_TARGET & aTarget,
bool aDropInsteadOfApproximate = false )

Report what a schematic screen would lose if exported to an older KiCad.

Does not modify it. aDropInsteadOfApproximate reports LOWER features as DROP and selects their omission transforms.

Definition at line 2077 of file sch_downgrade.cpp.

References _, COMPATIBILITY_REPORT::Add(), BLOCK, canLowerLineEndings(), countIncompatibleBusLabels(), countPaddedBusLabels(), DROP, SCH_WRITER_V10::FORMAT_VERSION, hasLineEndings(), LOWER, DOWNGRADE_TARGET::m_schVersion, reportIncompatibleBuses(), reportPaddedBuses(), reportTextPlan(), SCH_DOWNGRADE_COVERED, SCH_VER_CUSTOM_PROPERTIES, SCH_VER_LINE_ENDINGS, screenRules(), screenTextPlan(), SEXPR_SCHEMATIC_FILE_VERSION, and visitScreenItems().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), checkTransformedSchematicUsesOnlyKnownTokens(), and EESCHEMA_JOBS_HANDLER::JobDowngrade().

◆ DowngradeLibSymbolInPlace()

◆ DowngradeScreenInPlace()

◆ FindUnsupportedSchToken()

wxString FindUnsupportedSchToken ( const wxString & aSerialized,
const DOWNGRADE_TARGET & aTarget )

Scan serialized schematic text for tokens the target cannot parse.

Returns the first such token, or empty if the output is safe. Non-empty means refuse the export.

Definition at line 2370 of file sch_downgrade.cpp.

References FindUnsupportedToken(), DOWNGRADE_TARGET::m_schVersion, SCH_TOKENS, SCH_VALUES, and SEXPR_SCHEMATIC_FILE_VERSION.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ FlattenSchematicVariant()

bool FlattenSchematicVariant ( SCHEMATIC & aSchematic,
const wxString & aVariantName,
wxString * aConflict )

◆ SaveSchematicForTarget()

void SaveSchematicForTarget ( SCH_SHEET * aSheet,
SCHEMATIC * aSchematic,
const wxString & aPath,
const DOWNGRADE_TARGET & aTarget )

◆ SaveSymbolLibraryForTarget()

void SaveSymbolLibraryForTarget ( const std::vector< LIB_SYMBOL * > & aSymbols,
const wxString & aPath,
const DOWNGRADE_TARGET & aTarget )

◆ SchDowngradeCoveredVersion()

int SchDowngradeCoveredVersion ( )

The format the denylist was generated against. A format bump forces a review.

Definition at line 2364 of file sch_downgrade.cpp.

References SCH_DOWNGRADE_COVERED.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SymbolLibDowngradeCoveredVersion()

int SymbolLibDowngradeCoveredVersion ( )

The symbol library format the denylist was generated against.

Definition at line 2358 of file sch_downgrade.cpp.

References SYMLIB_DOWNGRADE_COVERED.

Referenced by BOOST_AUTO_TEST_CASE().

Variable Documentation

◆ SCH_VER_FLAT_HIERARCHY

int SCH_VER_FLAT_HIERARCHY = 20251012
constexpr

Definition at line 81 of file sch_downgrade.h.

Referenced by ClassifySchematicStructureForDowngrade().

◆ SCH_VER_NET_CHAINS

int SCH_VER_NET_CHAINS = 20260512
constexpr

Definition at line 80 of file sch_downgrade.h.

Referenced by EESCHEMA_JOBS_HANDLER::JobDowngrade().

◆ SCH_VER_VARIANTS

int SCH_VER_VARIANTS = 20250922
constexpr

Format dates for rules the jobs handler applies at schematic scope.

Definition at line 79 of file sch_downgrade.h.

Referenced by ClassifySchematicStructureForDowngrade(), and EESCHEMA_JOBS_HANDLER::JobDowngrade().