KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_downgrade.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The 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
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
23#include <downgrade_target.h>
24
25#include <vector>
26
27class SCH_SCREEN;
28class SCH_SHEET;
29class SCHEMATIC;
30class LIB_SYMBOL;
31
35 bool aDropInsteadOfApproximate = false );
36
39 const DOWNGRADE_TARGET& aTarget );
40
43void DowngradeScreenInPlace( SCH_SCREEN* aScreen, const DOWNGRADE_TARGET& aTarget,
44 bool aDropInsteadOfApproximate = false );
45
48 bool aDropInsteadOfApproximate = false );
49
51void DowngradeLibSymbolInPlace( LIB_SYMBOL* aSymbol, const DOWNGRADE_TARGET& aTarget,
52 bool aDropInsteadOfApproximate = false );
53
55void SaveSchematicForTarget( SCH_SHEET* aSheet, SCHEMATIC* aSchematic, const wxString& aPath,
56 const DOWNGRADE_TARGET& aTarget );
57
60void SaveSymbolLibraryForTarget( const std::vector<LIB_SYMBOL*>& aSymbols, const wxString& aPath,
61 const DOWNGRADE_TARGET& aTarget );
62
65wxString FindUnsupportedSchToken( const wxString& aSerialized, const DOWNGRADE_TARGET& aTarget );
66
70bool FlattenSchematicVariant( SCHEMATIC& aSchematic, const wxString& aVariantName, wxString* aConflict );
71
74
77
79constexpr int SCH_VER_VARIANTS = 20250922;
80constexpr int SCH_VER_NET_CHAINS = 20260512;
81constexpr int SCH_VER_FLAT_HIERARCHY = 20251012;
What an export to a given target will keep, approximate, drop, or block.
Define a library symbol object.
Definition lib_symbol.h:114
Holds all the data relating to one schematic.
Definition schematic.h:149
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48
COMPATIBILITY_REPORT ClassifySchematicStructureForDowngrade(const SCHEMATIC &aSchematic, const DOWNGRADE_TARGET &aTarget)
Schematic-wide structure the per-screen rules cannot see. Does not modify it.
bool FlattenSchematicVariant(SCHEMATIC &aSchematic, const wxString &aVariantName, wxString *aConflict)
Bake a variant into the base attributes of every symbol and sheet.
constexpr int SCH_VER_VARIANTS
Format dates for rules the jobs handler applies at schematic scope.
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 SaveSymbolLibraryForTarget(const std::vector< LIB_SYMBOL * > &aSymbols, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
Save a .kicad_sym library stamped for the target.
int SymbolLibDowngradeCoveredVersion()
The symbol library format the denylist was generated against.
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.
wxString FindUnsupportedSchToken(const wxString &aSerialized, const DOWNGRADE_TARGET &aTarget)
Scan serialized schematic text for tokens the target cannot parse.
constexpr int SCH_VER_FLAT_HIERARCHY
int SchDowngradeCoveredVersion()
The format the denylist was generated against. A format bump forces a review.
constexpr int SCH_VER_NET_CHAINS
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.
An older KiCad release we can export a project back to.