|
KiCad PCB EDA Suite
|
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 |
| 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.
Definition at line 2227 of file sch_downgrade.cpp.
References _, COMPATIBILITY_REPORT::Add(), BLOCK, canLowerLineEndings(), DROP, SCH_WRITER_V10::FORMAT_VERSION, LIB_SYMBOL::GetDrawItems(), hasLineEndings(), LOWER, DOWNGRADE_TARGET::m_schVersion, DOWNGRADE_TARGET::m_symLibVersion, reportTextPlan(), SCH_VER_CUSTOM_PROPERTIES, screenRules(), SEXPR_SYMBOL_LIB_FILE_VERSION, symbolTextPlan(), SYMLIB_DOWNGRADE_COVERED, and SYMLIB_VER_LINE_ENDINGS.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and classifySymbolLibraries().
| COMPATIBILITY_REPORT ClassifySchematicStructureForDowngrade | ( | const SCHEMATIC & | aSchematic, |
| const DOWNGRADE_TARGET & | aTarget ) |
Schematic-wide structure the per-screen rules cannot see. Does not modify it.
Definition at line 2146 of file sch_downgrade.cpp.
References _, COMPATIBILITY_REPORT::Add(), BLOCK, countAlternateSymbols(), SCH_WRITER_V10::FORMAT_VERSION, SCHEMATIC::GetAllBusAliases(), SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), SCHEMATIC::GetTopLevelSheets(), hasIncompatibleBusVector(), hasPaddedBusVector(), DOWNGRADE_TARGET::m_schVersion, reportIncompatibleBuses(), reportPaddedBuses(), SCHEMATIC::Root(), SCH_VER_ALTERNATE_SYMBOLS, SCH_VER_CUSTOM_PROPERTIES, SCH_VER_FLAT_HIERARCHY, and SCH_VER_VARIANTS.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and EESCHEMA_JOBS_HANDLER::JobDowngrade().
| 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().
| 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.
Definition at line 2270 of file sch_downgrade.cpp.
References applyTextPlan(), SCH_WRITER_V10::FORMAT_VERSION, LOWER, DOWNGRADE_TARGET::m_schVersion, DOWNGRADE_TARGET::m_symLibVersion, SCH_VER_CUSTOM_PROPERTIES, screenRules(), and symbolTextPlan().
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(), checkNativeSymbolLibraryGolden(), and downgradeSymbolLibraries().
| void DowngradeScreenInPlace | ( | SCH_SCREEN * | aScreen, |
| const DOWNGRADE_TARGET & | aTarget, | ||
| bool | aDropInsteadOfApproximate = false ) |
Approximate or remove, in place, what the target cannot represent.
When aDropInsteadOfApproximate is true, omit LOWER features without generating replacements.
Definition at line 2203 of file sch_downgrade.cpp.
References applyTextPlan(), compensateReferenceImageScales(), SCH_WRITER_V10::FORMAT_VERSION, LOWER, DOWNGRADE_TARGET::m_schVersion, SCH_VER_CUSTOM_PROPERTIES, SCH_VER_IMAGE_PPI, screenRules(), and screenTextPlan().
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(), checkExportUsesOnlyKnownTokens(), and EESCHEMA_JOBS_HANDLER::JobDowngrade().
| 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().
| bool FlattenSchematicVariant | ( | SCHEMATIC & | aSchematic, |
| const wxString & | aVariantName, | ||
| wxString * | aConflict ) |
Bake a variant into the base attributes of every symbol and sheet.
Returns false and names the reference in aConflict when a symbol shared between sheet instances resolves differently under the variant, which the base attributes cannot represent.
Definition at line 2477 of file sch_downgrade.cpp.
References _, SCH_SCREEN::AddLibSymbol(), SCH_SCREEN::Append(), SCHEMATIC::BuildUnorderedSheetList(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SCREEN::GetLibSymbols(), SCH_FIELD::GetText(), SCH_SYMBOL::IsMissingLibSymbol(), SCH_SCREEN::Items(), SYMBOL_VARIANT_SNAPSHOT::m_alternate, SYMBOL_VARIANT_SNAPSHOT::m_symbolOverride, name, EE_RTREE::OfType(), path, REFERENCE, SCH_SCREEN::Remove(), SCH_SYMBOL_T, SHEET_FILENAME, SHEET_NAME, snapshotSheet(), and snapshotSymbol().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and EESCHEMA_JOBS_HANDLER::JobDowngrade().
| 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.
Definition at line 2334 of file sch_downgrade.cpp.
References SCH_WRITER_V10::FORMAT_VERSION, SCH_WRITER_V9::FORMAT_VERSION, DOWNGRADE_TARGET::m_schVersion, SCH_WRITER_V10::SaveSchematicFile(), and SCH_WRITER_V9::SaveSchematicFile().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), checkExportUsesOnlyKnownTokens(), and EESCHEMA_JOBS_HANDLER::JobDowngrade().
| void SaveSymbolLibraryForTarget | ( | const std::vector< LIB_SYMBOL * > & | aSymbols, |
| const wxString & | aPath, | ||
| const DOWNGRADE_TARGET & | aTarget ) |
Save a .kicad_sym library stamped for the target.
Symbols must already be downgraded and ordered parents first.
Definition at line 2346 of file sch_downgrade.cpp.
References DOWNGRADE_TARGET::m_symLibVersion, SCH_WRITER_V10::SaveSymbolLibrary(), SCH_WRITER_V9::SaveSymbolLibrary(), SCH_WRITER_V10::SYMBOL_LIB_VERSION, and SCH_WRITER_V9::SYMBOL_LIB_VERSION.
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(), checkNativeSymbolLibraryGolden(), and downgradeSymbolLibraries().
| 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().
| 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().
|
constexpr |
Definition at line 81 of file sch_downgrade.h.
Referenced by ClassifySchematicStructureForDowngrade().
|
constexpr |
Definition at line 80 of file sch_downgrade.h.
Referenced by EESCHEMA_JOBS_HANDLER::JobDowngrade().
|
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().