KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board_downgrade.cpp File Reference
#include <downgrade/board_downgrade.h>
#include <downgrade_scan.h>
#include <settings/settings_manager.h>
#include <wildcards_and_files_ext.h>
#include <algorithm>
#include <cctype>
#include <functional>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include <wx/ffile.h>
#include <wx/filefn.h>
#include <base_units.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <constraints/pcb_constraint.h>
#include <pad.h>
#include <pcb_barcode.h>
#include <pcb_shape.h>
#include <pcb_table.h>
#include <pcb_tablecell.h>
#include <pcb_textbox.h>
#include <pcb_track.h>
#include <pcb_point.h>
#include <pcb_reference_image.h>
#include <zone.h>
#include <zone_settings.h>
#include <netinfo.h>
#include <eda_group.h>
#include <eda_shape.h>
#include <pcb_group.h>
#include <pcb_dimension.h>
#include <pcb_generator.h>
#include <pcb_text.h>
#include <project.h>
#include <common.h>
#include <text_eval/text_eval_wrapper.h>
#include <board_stackup_manager/board_stackup.h>
#include <layer_ids.h>
#include <lset.h>
#include <io/kicad/legacy_tuning_pattern.h>
#include <geometry/shape_ellipse.h>
#include <geometry/shape_poly_set.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
#include <pcb_io/kicad_sexpr/writers/pcb_writer_v9.h>
#include <pcb_io/kicad_sexpr/writers/pcb_writer_v10.h>

Go to the source code of this file.

Classes

struct  TEXT_DOWNGRADE_PLAN
 
struct  BOARD_RULE
 

Functions

static bool isEllipse (const BOARD_ITEM *aItem)
 
static bool isHatchedShape (const BOARD_ITEM *aItem)
 
static bool isHatchedCopperShape (const BOARD_ITEM *aItem)
 
static bool isHatchedInkShape (const BOARD_ITEM *aItem)
 
static void detachFromGroup (BOARD_ITEM *aItem)
 
static void ellipseToPolygon (PCB_SHAPE *aShape, int aMaxError)
 
static int footprintMaxError (const FOOTPRINT *aFootprint)
 
static void forEachPadPrimitive (FOOTPRINT *aFootprint, const std::function< void(PCB_SHAPE *)> &aFunc)
 
static void lowerEllipsesFp (FOOTPRINT *aFootprint)
 
static void setHatchedFillsFp (FOOTPRINT *aFootprint, const std::function< bool(const BOARD_ITEM *)> &aMatches, FILL_T aFill)
 
static std::vector< PCB_SHAPE * > barcodeToShapes (PCB_BARCODE *aBarcode, BOARD_ITEM_CONTAINER *aParent)
 
static void lowerBarcodesFp (FOOTPRINT *aFootprint)
 
static void dropPcbPointsFp (FOOTPRINT *aFootprint)
 
static void dropExtrudedBodiesFp (FOOTPRINT *aFootprint)
 
static void dropPadSimTypesFp (FOOTPRINT *aFootprint)
 
static void dropUnitInfoFp (FOOTPRINT *aFootprint)
 
static void dropJumperPadsFp (FOOTPRINT *aFootprint)
 
static void dropPcbVariantsFp (FOOTPRINT *aFootprint)
 
static void dropPostMachiningFp (FOOTPRINT *aFootprint)
 
static void dropPressFitPadsFp (FOOTPRINT *aFootprint)
 
static void dropDieDelaysFp (FOOTPRINT *aFootprint)
 
static void dropGroupDesignBlocksFp (FOOTPRINT *aFootprint)
 
static int countNetChains (const BOARD *aBoard)
 
static void dropNetChains (BOARD *aBoard)
 
static int countEllipses (const BOARD *aBoard)
 
static void lowerEllipses (BOARD *aBoard)
 
static int countExtrudedBodies (const BOARD *aBoard)
 
static void dropExtrudedBodies (BOARD *aBoard)
 
static int countThievingZones (const BOARD *aBoard)
 
static int countPadSimTypes (const BOARD *aBoard)
 
static void dropPadSimTypes (BOARD *aBoard)
 
static int countUnitInfo (const BOARD *aBoard)
 
static void dropUnitInfo (BOARD *aBoard)
 
static int countBarcodes (const BOARD *aBoard)
 
static void lowerBarcodes (BOARD *aBoard)
 
static int countPcbVariants (const BOARD *aBoard)
 
static void dropPcbVariants (BOARD *aBoard)
 
static int countJumperPads (const BOARD *aBoard)
 
static void dropJumperPads (BOARD *aBoard)
 
static bool hasBackdrill (const PADSTACK &aPadstack)
 
static int countBackdrills (const BOARD *aBoard)
 
static bool hasPostMachining (const PADSTACK &aPadstack)
 
static int countPostMachining (const BOARD *aBoard)
 
static void dropPostMachining (BOARD *aBoard)
 
static int countPressFitPads (const BOARD *aBoard)
 
static void dropPressFitPads (BOARD *aBoard)
 
static int countBuriedVias (const BOARD *aBoard)
 
static void lowerBuriedVias (BOARD *aBoard)
 
static int countZoneDefaults (const BOARD *aBoard)
 
static void dropZoneDefaults (BOARD *aBoard)
 
static int countSkipVias (const BOARD *aBoard)
 
static void lowerSkipVias (BOARD *aBoard)
 
static int countDieDelays (const BOARD *aBoard)
 
static void dropDieDelays (BOARD *aBoard)
 
static int countHatchedFills (const BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches)
 
static void setHatchedFills (BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches, FILL_T aFill)
 
static int countPcbPoints (const BOARD *aBoard)
 
static void dropPcbPoints (BOARD *aBoard)
 
static int countHighUserLayers (const BOARD *aBoard)
 
static bool hasViaProtection (const PCB_VIA *aVia)
 
static int countViaProtection (const BOARD *aBoard)
 
static void dropViaProtection (BOARD *aBoard)
 
static int countDielectricModels (const BOARD *aBoard)
 
static void dropDielectricModels (BOARD *aBoard)
 
static int countGroupDesignBlocks (const BOARD *aBoard)
 
static void dropGroupDesignBlocks (BOARD *aBoard)
 
static int countScaledFootprints (const BOARD *aBoard)
 
static bool isRoundedRect (const BOARD_ITEM *aItem)
 
static void roundedRectToPolygon (PCB_SHAPE *aShape, int aMaxError)
 
static int countRoundedRectsFp (const FOOTPRINT *aFootprint)
 
static void lowerRoundedRectsFp (FOOTPRINT *aFootprint)
 
static int countRoundedRects (const BOARD *aBoard)
 
static void lowerRoundedRects (BOARD *aBoard)
 
static int countKnockoutTextBoxesFp (const FOOTPRINT *aFootprint)
 
static void dropKnockoutTextBoxesFp (FOOTPRINT *aFootprint)
 
static int countKnockoutTextBoxes (const BOARD *aBoard)
 
static void dropKnockoutTextBoxes (BOARD *aBoard)
 
static int countKnockoutCellsIn (const BOARD_ITEM *aItem)
 
static int countKnockoutTableCells (const BOARD *aBoard)
 
static void dropKnockoutCellsIn (BOARD_ITEM *aItem)
 
static void dropKnockoutTableCellsFp (FOOTPRINT *aFootprint)
 
static void dropKnockoutTableCells (BOARD *aBoard)
 
static int countZoneLayerProperties (const BOARD *aBoard)
 
static void dropZoneLayerPropertiesFp (FOOTPRINT *aFootprint)
 
static void dropZoneLayerProperties (BOARD *aBoard)
 
static bool hasGroupPlacementLinkage (const ZONE *aZone)
 
static int countGroupPlacementAreas (const BOARD *aBoard)
 
static void dropGroupPlacementLinkage (ZONE *aZone)
 
static void dropGroupPlacementAreasFp (FOOTPRINT *aFootprint)
 
static void dropGroupPlacementAreas (BOARD *aBoard)
 
static int countCustomFpStackups (const BOARD *aBoard)
 
static void omitGraphicsFp (FOOTPRINT *aFootprint, const std::function< bool(const BOARD_ITEM *)> &aMatches)
 
static void omitGraphics (BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches)
 
static void omitPadPrimitives (FOOTPRINT *aFootprint, const std::function< bool(const BOARD_ITEM *)> &aMatches)
 
static void omitEllipsesFp (FOOTPRINT *aFootprint)
 
static void omitEllipses (BOARD *aBoard)
 
static bool isBarcode (const BOARD_ITEM *aItem)
 
static void omitBarcodesFp (FOOTPRINT *aFootprint)
 
static void omitBarcodes (BOARD *aBoard)
 
static bool isKnockoutTextBox (const BOARD_ITEM *aItem)
 
static void omitKnockoutTextBoxesFp (FOOTPRINT *aFootprint)
 
static void omitKnockoutTextBoxes (BOARD *aBoard)
 
static void omitRoundedRectsFp (FOOTPRINT *aFootprint)
 
static void omitRoundedRects (BOARD *aBoard)
 
static void omitKnockoutCellContents (BOARD_ITEM *aItem)
 
static void omitKnockoutTableCellsFp (FOOTPRINT *aFootprint)
 
static void omitKnockoutTableCells (BOARD *aBoard)
 
static int countConstraints (const BOARD *aBoard)
 
static void dropConstraintsFp (FOOTPRINT *aFootprint)
 
static void dropConstraints (BOARD *aBoard)
 
static bool isGrid (const BOARD_ITEM *aItem)
 
static bool isDrillDrawing (const BOARD_ITEM *aItem)
 
static int countDrawings (const BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches)
 
static int countGrids (const BOARD *aBoard)
 
static void dropGrids (BOARD *aBoard)
 
static int countDrillDrawings (const BOARD *aBoard)
 
static void dropDrillDrawings (BOARD *aBoard)
 
static int countDrillSymbolConfiguration (const BOARD *aBoard)
 
static void dropDrillSymbolConfiguration (BOARD *aBoard)
 
static int countGenerators (const BOARD *aBoard, const wxString &aType)
 
static void dropGenerators (BOARD *aBoard, const std::function< bool(const PCB_GENERATOR *)> &aMatches)
 
static void dropGenerators (BOARD *aBoard, const wxString &aType)
 
static bool isTimeDomainTuning (const PCB_GENERATOR *aGenerator)
 
static int countTimeDomainTuning (const BOARD *aBoard)
 
static void dropTimeDomainTuning (BOARD *aBoard)
 
static int countUnreviewedTuningProperties (const BOARD *aBoard)
 
static int countUnknownGenerators (const BOARD *aBoard)
 
static bool isUnreviewedDrawing (const BOARD_ITEM *aItem)
 
static int countUnreviewedDrawings (const BOARD *aBoard)
 
static void visitFootprintItems (const FOOTPRINT *aFootprint, const std::function< void(BOARD_ITEM *)> &aVisit)
 
static void visitBoardItems (const BOARD *aBoard, const std::function< void(BOARD_ITEM *)> &aVisit)
 
static int countCustomProperties (const BOARD *aBoard)
 
static void dropCustomPropertiesFp (FOOTPRINT *aFootprint)
 
static void dropCustomProperties (BOARD *aBoard)
 
static int countSimulationExclusions (const BOARD *aBoard)
 
static void dropSimulationExclusionsFp (FOOTPRINT *aFootprint)
 
static void dropSimulationExclusions (BOARD *aBoard)
 
static bool hasLineEndings (const BOARD_ITEM *aItem)
 
static bool unsafeLineEndings (const PCB_SHAPE *aShape)
 
static int countLineEndings (const BOARD *aBoard, bool aUnsafeOnly=false)
 
static void clearLineEndings (PCB_SHAPE *aShape)
 
static void lowerLineEndingShape (PCB_SHAPE *aShape, int aMaxError)
 
static void transformLineEndingsFp (FOOTPRINT *aFootprint, bool aOmit)
 
static void transformLineEndings (BOARD *aBoard, bool aOmit)
 
static int titleFieldIndex (const wxString &aName)
 
static const wxString & titleFieldText (const TITLE_BLOCK &aTitle, int aIndex)
 
static bool postTargetText (const wxString &aText, const BOARD *aBoard, int aTargetVersion, std::set< wxString > &aDependencies, int aDepth=0)
 
static bool postTargetText (const wxString &aText, const BOARD *aBoard, int aTargetVersion)
 
static bool hasActiveExpression (const wxString &aText)
 
static void planTextItem (BOARD_ITEM *aItem, int aTargetVersion, TEXT_DOWNGRADE_PLAN &aPlan, const std::function< bool(wxString *)> *aResolver=nullptr)
 
static TEXT_DOWNGRADE_PLAN planBoardText (const BOARD *aBoard, int aTargetVersion)
 
static void applyTextPlan (const TEXT_DOWNGRADE_PLAN &aPlan)
 
static std::vector< BOARD_RULE > boardRules ()
 
COMPATIBILITY_REPORT ClassifyBoardForDowngrade (const BOARD *aBoard, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
 Report what a board would lose if exported to an older KiCad.
 
static void compensateImageScale (PCB_REFERENCE_IMAGE *aImage)
 
static void compensateReferenceImageScalesFp (FOOTPRINT *aFootprint)
 
static void compensateReferenceImageScales (BOARD *aBoard)
 
void DowngradeBoardInPlace (BOARD *aBoard, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
 Approximate or remove, in place, what the target cannot represent.
 
void DowngradeFootprintInPlace (FOOTPRINT *aFootprint, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
 Footprint-scoped downgrade for standalone .kicad_mod files the board pass never sees.
 
int BoardDowngradeCoveredVersion ()
 The format the denylist was generated against. A format bump forces a review.
 
void SaveBoardForTarget (BOARD *aBoard, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
 Save a board stamped for the target, using the writer for that version.
 
void SaveFootprintForTarget (FOOTPRINT *aFootprint, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
 Save a single .kicad_mod footprint file for the target.
 
static bool containsGroupPlacementSource (const std::string &aText)
 
wxString FindUnsupportedBoardToken (const wxString &aSerialized, const DOWNGRADE_TARGET &aTarget)
 Scan serialized board text for tokens the target cannot parse.
 
void FlattenBoardVariant (BOARD *aBoard, const wxString &aVariantName)
 Bake a variant's overrides into the base footprint attributes.
 
DOWNGRADE_FILE_RESULT DowngradeFootprintFileToTemp (const wxString &aSrcFile, const wxString &aTmpFile, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
 Load one .kicad_mod, classify it against the rule table, and write the downgraded copy to aTmpFile.
 
bool ExportBoardToOlderVersion (const wxString &aSrcFile, const wxString &aDestFile, const DOWNGRADE_TARGET &aTarget, COMPATIBILITY_REPORT &aReport, wxString *aUnsupportedToken, const wxString &aVariant, bool aDropInsteadOfApproximate)
 Load a board, downgrade the copy, and write it stamped for the target.
 

Variables

static constexpr int VER_USER_LAYERS = 20241229
 
static constexpr int VER_TEXTBOX_KNOCKOUT = 20250210
 
static constexpr int VER_SHAPE_HATCH = 20250222
 
static constexpr int VER_VIA_PROTECTION = 20250228
 
static constexpr int VER_ZONE_DEFAULTS = 20250302
 
static constexpr int VER_JUMPER_PADS = 20250324
 
static constexpr int VER_VIA_SPLIT = 20250926
 
static constexpr int VER_SKIP_VIA = 20250801
 
static constexpr int VER_PRESSFIT = 20250811
 
static constexpr int VER_POST_MACHINING = 20251101
 
static constexpr int VER_PCB_POINTS = 20250901
 
static constexpr int VER_ROUNDED_RECT = 20250829
 
static constexpr int VER_FP_UNITS = 20250909
 
static constexpr int VER_BARCODE = 20250914
 
static constexpr int VER_PAD_DIE_DELAY = 20250401
 
static constexpr int VER_TIME_DOMAIN_TUNING = 20250401
 
static constexpr int VER_GROUP_PLACEMENT = 20250401
 
static constexpr int VER_CELL_KNOCKOUT = 20260603
 
static constexpr int VER_BACKDRILL = 20251101
 
static constexpr int VER_EXTRUDED_BODY = 20260410
 
static constexpr int VER_ELLIPSE = 20260508
 
static constexpr int VER_THIEVING = 20260513
 
static constexpr int VER_NET_CHAINS = 20260512
 
static constexpr int VER_PAD_SIM = 20260521
 
static constexpr int VER_DIELECTRIC = 20260511
 
static constexpr int VER_GROUP_LIB_ID = 20250513
 
static constexpr int VER_IMAGE_PPI = 20260623
 
static constexpr int VER_CONSTRAINTS = 20260624
 
static constexpr int VER_GRIDS = 20260728
 
static constexpr int VER_VIA_STITCH = 20260816
 
static constexpr int VER_PROPERTY_VARIABLES = 20260817
 
static constexpr int VER_LINE_ENDINGS = 20260818
 
static constexpr int VER_SIM_EXCLUSION = 20260828
 
static constexpr int VER_VIA_STACK = 20260830
 
static constexpr int VER_CUSTOM_PROPERTIES = 20260831
 
static constexpr int VER_DRILL_DRAWINGS = 20260901
 
static constexpr int BOARD_DOWNGRADE_COVERED = 20260901
 
static constexpr DATED_TOKEN BOARD_TOKENS []
 
static constexpr DATED_TOKEN BOARD_VALUES []
 

Function Documentation

◆ applyTextPlan()

◆ barcodeToShapes()

◆ BoardDowngradeCoveredVersion()

int BoardDowngradeCoveredVersion ( )

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

Definition at line 2876 of file board_downgrade.cpp.

References BOARD_DOWNGRADE_COVERED.

Referenced by BOOST_AUTO_TEST_CASE().

◆ boardRules()

static std::vector< BOARD_RULE > boardRules ( )
static

Definition at line 2429 of file board_downgrade.cpp.

References _, BLOCK, countBackdrills(), countBarcodes(), countBuriedVias(), countConstraints(), countCustomFpStackups(), countCustomProperties(), countDieDelays(), countDielectricModels(), countDrillDrawings(), countDrillSymbolConfiguration(), countEllipses(), countExtrudedBodies(), countGenerators(), countGrids(), countGroupDesignBlocks(), countGroupPlacementAreas(), countHatchedFills(), countHighUserLayers(), countJumperPads(), countKnockoutTableCells(), countKnockoutTextBoxes(), countLineEndings(), countNetChains(), countPadSimTypes(), countPcbPoints(), countPcbVariants(), countPostMachining(), countPressFitPads(), countRoundedRects(), countScaledFootprints(), countSimulationExclusions(), countSkipVias(), countThievingZones(), countTimeDomainTuning(), countUnitInfo(), countUnknownGenerators(), countUnreviewedDrawings(), countUnreviewedTuningProperties(), countViaProtection(), countZoneDefaults(), countZoneLayerProperties(), DROP, dropConstraints(), dropConstraintsFp(), dropCustomProperties(), dropCustomPropertiesFp(), dropDieDelays(), dropDieDelaysFp(), dropDielectricModels(), dropDrillDrawings(), dropDrillSymbolConfiguration(), dropExtrudedBodies(), dropExtrudedBodiesFp(), dropGenerators(), dropGrids(), dropGroupDesignBlocks(), dropGroupDesignBlocksFp(), dropGroupPlacementAreas(), dropGroupPlacementAreasFp(), dropJumperPads(), dropJumperPadsFp(), dropKnockoutTableCells(), dropKnockoutTableCellsFp(), dropKnockoutTextBoxes(), dropKnockoutTextBoxesFp(), dropNetChains(), dropPadSimTypes(), dropPadSimTypesFp(), dropPcbPoints(), dropPcbPointsFp(), dropPcbVariants(), dropPcbVariantsFp(), dropPostMachining(), dropPostMachiningFp(), dropPressFitPads(), dropPressFitPadsFp(), dropSimulationExclusions(), dropSimulationExclusionsFp(), dropTimeDomainTuning(), dropUnitInfo(), dropUnitInfoFp(), dropViaProtection(), dropZoneDefaults(), dropZoneLayerProperties(), dropZoneLayerPropertiesFp(), FILLED_SHAPE, FIRST_FP_AFFINE_TRANSFORM, FIRST_FP_CUSTOM_STACKUP, FIRST_PCB_VARIANTS, isHatchedCopperShape(), isHatchedInkShape(), LOWER, lowerBarcodes(), lowerBarcodesFp(), lowerBuriedVias(), lowerEllipses(), lowerEllipsesFp(), lowerRoundedRects(), lowerRoundedRectsFp(), lowerSkipVias(), NO_FILL, omitBarcodes(), omitBarcodesFp(), omitEllipses(), omitEllipsesFp(), omitKnockoutTableCells(), omitKnockoutTableCellsFp(), omitKnockoutTextBoxes(), omitKnockoutTextBoxesFp(), omitRoundedRects(), omitRoundedRectsFp(), setHatchedFills(), setHatchedFillsFp(), transformLineEndings(), transformLineEndingsFp(), VER_BACKDRILL, VER_BARCODE, VER_CELL_KNOCKOUT, VER_CONSTRAINTS, VER_CUSTOM_PROPERTIES, VER_DIELECTRIC, VER_DRILL_DRAWINGS, VER_ELLIPSE, VER_EXTRUDED_BODY, VER_FP_UNITS, VER_GRIDS, VER_GROUP_LIB_ID, VER_GROUP_PLACEMENT, VER_JUMPER_PADS, VER_LINE_ENDINGS, VER_NET_CHAINS, VER_PAD_DIE_DELAY, VER_PAD_SIM, VER_PCB_POINTS, VER_POST_MACHINING, VER_PRESSFIT, VER_ROUNDED_RECT, VER_SHAPE_HATCH, VER_SIM_EXCLUSION, VER_SKIP_VIA, VER_TEXTBOX_KNOCKOUT, VER_THIEVING, VER_TIME_DOMAIN_TUNING, VER_USER_LAYERS, VER_VIA_PROTECTION, VER_VIA_SPLIT, VER_VIA_STACK, VER_VIA_STITCH, and VER_ZONE_DEFAULTS.

Referenced by ClassifyBoardForDowngrade(), DowngradeBoardInPlace(), and DowngradeFootprintInPlace().

◆ ClassifyBoardForDowngrade()

COMPATIBILITY_REPORT ClassifyBoardForDowngrade ( const BOARD * aBoard,
const DOWNGRADE_TARGET & aTarget,
bool aDropInsteadOfApproximate = false )

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

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

Definition at line 2641 of file board_downgrade.cpp.

References _, COMPATIBILITY_REPORT::Add(), BLOCK, BOARD_DOWNGRADE_COVERED, boardRules(), countLineEndings(), DROP, PCB_PLOT_PARAMS::GetFormat(), BOARD::GetPlotOptions(), LOWER, DOWNGRADE_TARGET::m_boardVersion, planBoardText(), PNG, SEXPR_BOARD_FILE_VERSION, text, VER_LINE_ENDINGS, and VER_PROPERTY_VARIABLES.

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(), 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(), checkTransformedBoardUsesOnlyKnownTokens(), classifyFootprintLibraries(), DowngradeFootprintFileToTemp(), ExportBoardToOlderVersion(), and PCBNEW_JOBS_HANDLER::JobDowngrade().

◆ clearLineEndings()

static void clearLineEndings ( PCB_SHAPE * aShape)
static

◆ compensateImageScale()

◆ compensateReferenceImageScales()

static void compensateReferenceImageScales ( BOARD * aBoard)
static

◆ compensateReferenceImageScalesFp()

static void compensateReferenceImageScalesFp ( FOOTPRINT * aFootprint)
static

◆ containsGroupPlacementSource()

static bool containsGroupPlacementSource ( const std::string & aText)
static

Definition at line 2906 of file board_downgrade.cpp.

References end, path, StripSexprStrings(), and text.

Referenced by FindUnsupportedBoardToken().

◆ countBackdrills()

static int countBackdrills ( const BOARD * aBoard)
static

Definition at line 656 of file board_downgrade.cpp.

References BOARD::GetPads(), hasBackdrill(), pad, PCB_VIA_T, and BOARD::Tracks().

Referenced by boardRules().

◆ countBarcodes()

static int countBarcodes ( const BOARD * aBoard)
static

Definition at line 551 of file board_downgrade.cpp.

References BOARD::Drawings(), BOARD::Footprints(), and PCB_BARCODE_T.

Referenced by boardRules().

◆ countBuriedVias()

static int countBuriedVias ( const BOARD * aBoard)
static

Definition at line 747 of file board_downgrade.cpp.

References BURIED, PCB_VIA::GetViaType(), PCB_VIA_T, and BOARD::Tracks().

Referenced by boardRules().

◆ countConstraints()

static int countConstraints ( const BOARD * aBoard)
static

Definition at line 1555 of file board_downgrade.cpp.

References BOARD::Constraints(), and BOARD::Footprints().

Referenced by boardRules().

◆ countCustomFpStackups()

static int countCustomFpStackups ( const BOARD * aBoard)
static

Definition at line 1388 of file board_downgrade.cpp.

References EXPAND_INNER_LAYERS, and BOARD::Footprints().

Referenced by boardRules().

◆ countCustomProperties()

static int countCustomProperties ( const BOARD * aBoard)
static

Definition at line 1818 of file board_downgrade.cpp.

References EDA_ITEM::HasCustomProperties(), and visitBoardItems().

◆ countDieDelays()

static int countDieDelays ( const BOARD * aBoard)
static

Definition at line 824 of file board_downgrade.cpp.

References BOARD::GetPads(), and pad.

Referenced by boardRules().

◆ countDielectricModels()

static int countDielectricModels ( const BOARD * aBoard)
static

◆ countDrawings()

static int countDrawings ( const BOARD * aBoard,
const std::function< bool(const BOARD_ITEM *)> & aMatches )
static

Definition at line 1606 of file board_downgrade.cpp.

References BOARD::Drawings().

Referenced by countDrillDrawings(), countGrids(), and countUnreviewedDrawings().

◆ countDrillDrawings()

static int countDrillDrawings ( const BOARD * aBoard)
static

Definition at line 1624 of file board_downgrade.cpp.

References countDrawings(), and isDrillDrawing().

Referenced by boardRules().

◆ countDrillSymbolConfiguration()

static int countDrillSymbolConfiguration ( const BOARD * aBoard)
static

◆ countEllipses()

static int countEllipses ( const BOARD * aBoard)
static

◆ countExtrudedBodies()

static int countExtrudedBodies ( const BOARD * aBoard)
static

Definition at line 463 of file board_downgrade.cpp.

References BOARD::Footprints().

Referenced by boardRules().

◆ countGenerators()

static int countGenerators ( const BOARD * aBoard,
const wxString & aType )
static

Definition at line 1648 of file board_downgrade.cpp.

References BOARD::Generators().

Referenced by boardRules().

◆ countGrids()

static int countGrids ( const BOARD * aBoard)
static

Definition at line 1612 of file board_downgrade.cpp.

References countDrawings(), and isGrid().

Referenced by boardRules().

◆ countGroupDesignBlocks()

static int countGroupDesignBlocks ( const BOARD * aBoard)
static

Definition at line 1022 of file board_downgrade.cpp.

References BOARD::Footprints(), group, and BOARD::Groups().

Referenced by boardRules().

◆ countGroupPlacementAreas()

static int countGroupPlacementAreas ( const BOARD * aBoard)
static

Definition at line 1349 of file board_downgrade.cpp.

References BOARD::Footprints(), hasGroupPlacementLinkage(), and BOARD::Zones().

Referenced by boardRules().

◆ countHatchedFills()

static int countHatchedFills ( const BOARD * aBoard,
const std::function< bool(const BOARD_ITEM *)> & aMatches )
static

Definition at line 845 of file board_downgrade.cpp.

References BOARD::Drawings(), and BOARD::Footprints().

Referenced by boardRules().

◆ countHighUserLayers()

static int countHighUserLayers ( const BOARD * aBoard)
static

Definition at line 907 of file board_downgrade.cpp.

References LSET::Contains(), BOARD::GetEnabledLayers(), User_10, and User_45.

Referenced by boardRules().

◆ countJumperPads()

static int countJumperPads ( const BOARD * aBoard)
static

Definition at line 629 of file board_downgrade.cpp.

References BOARD::Footprints().

Referenced by boardRules().

◆ countKnockoutCellsIn()

static int countKnockoutCellsIn ( const BOARD_ITEM * aItem)
static

Definition at line 1238 of file board_downgrade.cpp.

References PCB_TABLE_T, and EDA_ITEM::Type().

Referenced by countKnockoutTableCells().

◆ countKnockoutTableCells()

static int countKnockoutTableCells ( const BOARD * aBoard)
static

Definition at line 1255 of file board_downgrade.cpp.

References countKnockoutCellsIn(), BOARD::Drawings(), and BOARD::Footprints().

Referenced by boardRules().

◆ countKnockoutTextBoxes()

static int countKnockoutTextBoxes ( const BOARD * aBoard)
static

◆ countKnockoutTextBoxesFp()

static int countKnockoutTextBoxesFp ( const FOOTPRINT * aFootprint)
static

Definition at line 1184 of file board_downgrade.cpp.

References FOOTPRINT::GraphicalItems(), and PCB_TEXTBOX_T.

Referenced by countKnockoutTextBoxes().

◆ countLineEndings()

static int countLineEndings ( const BOARD * aBoard,
bool aUnsafeOnly = false )
static

◆ countNetChains()

static int countNetChains ( const BOARD * aBoard)
static

Definition at line 384 of file board_downgrade.cpp.

References BOARD::GetNetInfo().

Referenced by boardRules().

◆ countPadSimTypes()

static int countPadSimTypes ( const BOARD * aBoard)
static

Definition at line 507 of file board_downgrade.cpp.

References BOARD::GetPads(), NONE, and pad.

Referenced by boardRules().

◆ countPcbPoints()

static int countPcbPoints ( const BOARD * aBoard)
static

Definition at line 881 of file board_downgrade.cpp.

References BOARD::Footprints(), and BOARD::Points().

Referenced by boardRules().

◆ countPcbVariants()

static int countPcbVariants ( const BOARD * aBoard)
static

Definition at line 605 of file board_downgrade.cpp.

References BOARD::Footprints(), and BOARD::GetVariantNames().

Referenced by boardRules().

◆ countPostMachining()

static int countPostMachining ( const BOARD * aBoard)
static

Definition at line 687 of file board_downgrade.cpp.

References BOARD::GetPads(), hasPostMachining(), pad, PCB_VIA_T, and BOARD::Tracks().

Referenced by boardRules().

◆ countPressFitPads()

static int countPressFitPads ( const BOARD * aBoard)
static

Definition at line 726 of file board_downgrade.cpp.

References BOARD::GetPads(), pad, and PRESSFIT.

Referenced by boardRules().

◆ countRoundedRects()

static int countRoundedRects ( const BOARD * aBoard)
static

◆ countRoundedRectsFp()

static int countRoundedRectsFp ( const FOOTPRINT * aFootprint)
static

◆ countScaledFootprints()

static int countScaledFootprints ( const BOARD * aBoard)
static

Definition at line 1055 of file board_downgrade.cpp.

References BOARD::Footprints().

Referenced by boardRules().

◆ countSimulationExclusions()

static int countSimulationExclusions ( const BOARD * aBoard)
static

Definition at line 1853 of file board_downgrade.cpp.

References BOARD::Footprints(), and name.

Referenced by boardRules().

◆ countSkipVias()

static int countSkipVias ( const BOARD * aBoard)
static

◆ countThievingZones()

static int countThievingZones ( const BOARD * aBoard)
static

Definition at line 484 of file board_downgrade.cpp.

References BOARD::Footprints(), and BOARD::Zones().

Referenced by boardRules().

◆ countTimeDomainTuning()

static int countTimeDomainTuning ( const BOARD * aBoard)
static

Definition at line 1700 of file board_downgrade.cpp.

References BOARD::Generators(), and isTimeDomainTuning().

Referenced by boardRules().

◆ countUnitInfo()

static int countUnitInfo ( const BOARD * aBoard)
static

Definition at line 528 of file board_downgrade.cpp.

References BOARD::Footprints().

Referenced by boardRules().

◆ countUnknownGenerators()

static int countUnknownGenerators ( const BOARD * aBoard)
static

Definition at line 1727 of file board_downgrade.cpp.

References BOARD::Generators(), and BOARD::IsItemIndexedById().

Referenced by boardRules().

◆ countUnreviewedDrawings()

static int countUnreviewedDrawings ( const BOARD * aBoard)
static

Definition at line 1780 of file board_downgrade.cpp.

References countDrawings(), BOARD::Footprints(), and isUnreviewedDrawing().

Referenced by boardRules().

◆ countUnreviewedTuningProperties()

static int countUnreviewedTuningProperties ( const BOARD * aBoard)
static

Definition at line 1712 of file board_downgrade.cpp.

References BOARD::Generators().

Referenced by boardRules().

◆ countViaProtection()

◆ countZoneDefaults()

static int countZoneDefaults ( const BOARD * aBoard)
static

◆ countZoneLayerProperties()

static int countZoneLayerProperties ( const BOARD * aBoard)
static

Definition at line 1302 of file board_downgrade.cpp.

References BOARD::Footprints(), and BOARD::Zones().

Referenced by boardRules().

◆ detachFromGroup()

static void detachFromGroup ( BOARD_ITEM * aItem)
static

◆ DowngradeBoardInPlace()

void DowngradeBoardInPlace ( BOARD * aBoard,
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 2738 of file board_downgrade.cpp.

References applyTextPlan(), boardRules(), compensateReferenceImageScales(), GERBER, PCB_PLOT_PARAMS::GetFormat(), BOARD::GetPlotOptions(), LOWER, DOWNGRADE_TARGET::m_boardVersion, planBoardText(), PNG, PCB_PLOT_PARAMS::SetFormat(), BOARD::SetPlotOptions(), VER_IMAGE_PPI, and VER_PROPERTY_VARIABLES.

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(), 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(), and ExportBoardToOlderVersion().

◆ DowngradeFootprintFileToTemp()

DOWNGRADE_FILE_RESULT DowngradeFootprintFileToTemp ( const wxString & aSrcFile,
const wxString & aTmpFile,
const DOWNGRADE_TARGET & aTarget,
bool aDropInsteadOfApproximate = false )

Load one .kicad_mod, classify it against the rule table, and write the downgraded copy to aTmpFile.

Refuses when a block rule fires.

Definition at line 2978 of file board_downgrade.cpp.

References BOARD::Add(), ClassifyBoardForDowngrade(), CONVERTED, DowngradeFootprintInPlace(), PCB_IO_KICAD_SEXPR::ImportFootprint(), REFUSED, BOARD::Remove(), SaveFootprintForTarget(), EDA_ITEM::SetParent(), and SKIPPED.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), checkNativeFootprintGolden(), and downgradeFootprintLibraries().

◆ DowngradeFootprintInPlace()

◆ dropConstraints()

static void dropConstraints ( BOARD * aBoard)
static

◆ dropConstraintsFp()

static void dropConstraintsFp ( FOOTPRINT * aFootprint)
static

◆ dropCustomProperties()

static void dropCustomProperties ( BOARD * aBoard)
static

Definition at line 1842 of file board_downgrade.cpp.

References EDA_ITEM::ClearCustomProperties(), and visitBoardItems().

◆ dropCustomPropertiesFp()

static void dropCustomPropertiesFp ( FOOTPRINT * aFootprint)
static

Definition at line 1831 of file board_downgrade.cpp.

References EDA_ITEM::ClearCustomProperties(), and visitFootprintItems().

Referenced by boardRules().

◆ dropDieDelays()

static void dropDieDelays ( BOARD * aBoard)
static

Definition at line 838 of file board_downgrade.cpp.

References dropDieDelaysFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropDieDelaysFp()

static void dropDieDelaysFp ( FOOTPRINT * aFootprint)
static

Definition at line 370 of file board_downgrade.cpp.

References pad, and FOOTPRINT::Pads().

Referenced by boardRules(), and dropDieDelays().

◆ dropDielectricModels()

static void dropDielectricModels ( BOARD * aBoard)
static

◆ dropDrillDrawings()

static void dropDrillDrawings ( BOARD * aBoard)
static

Definition at line 1630 of file board_downgrade.cpp.

References isDrillDrawing(), and omitGraphics().

Referenced by boardRules().

◆ dropDrillSymbolConfiguration()

static void dropDrillSymbolConfiguration ( BOARD * aBoard)
static

◆ dropExtrudedBodies()

static void dropExtrudedBodies ( BOARD * aBoard)
static

Definition at line 477 of file board_downgrade.cpp.

References dropExtrudedBodiesFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropExtrudedBodiesFp()

static void dropExtrudedBodiesFp ( FOOTPRINT * aFootprint)
static

Definition at line 312 of file board_downgrade.cpp.

References FOOTPRINT::ClearExtrudedBody().

Referenced by boardRules(), and dropExtrudedBodies().

◆ dropGenerators() [1/2]

static void dropGenerators ( BOARD * aBoard,
const std::function< bool(const PCB_GENERATOR *)> & aMatches )
static

◆ dropGenerators() [2/2]

static void dropGenerators ( BOARD * aBoard,
const wxString & aType )
static

Definition at line 1683 of file board_downgrade.cpp.

References dropGenerators(), and PCB_GENERATOR::GetGeneratorType().

◆ dropGrids()

static void dropGrids ( BOARD * aBoard)
static

Definition at line 1618 of file board_downgrade.cpp.

References isGrid(), and omitGraphics().

Referenced by boardRules().

◆ dropGroupDesignBlocks()

static void dropGroupDesignBlocks ( BOARD * aBoard)
static

Definition at line 1045 of file board_downgrade.cpp.

References dropGroupDesignBlocksFp(), BOARD::Footprints(), group, and BOARD::Groups().

Referenced by boardRules().

◆ dropGroupDesignBlocksFp()

static void dropGroupDesignBlocksFp ( FOOTPRINT * aFootprint)
static

Definition at line 377 of file board_downgrade.cpp.

References group, and FOOTPRINT::Groups().

Referenced by boardRules(), and dropGroupDesignBlocks().

◆ dropGroupPlacementAreas()

static void dropGroupPlacementAreas ( BOARD * aBoard)
static

◆ dropGroupPlacementAreasFp()

static void dropGroupPlacementAreasFp ( FOOTPRINT * aFootprint)
static

Definition at line 1371 of file board_downgrade.cpp.

References dropGroupPlacementLinkage(), and FOOTPRINT::Zones().

Referenced by boardRules(), and dropGroupPlacementAreas().

◆ dropGroupPlacementLinkage()

◆ dropJumperPads()

static void dropJumperPads ( BOARD * aBoard)
static

Definition at line 643 of file board_downgrade.cpp.

References dropJumperPadsFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropJumperPadsFp()

static void dropJumperPadsFp ( FOOTPRINT * aFootprint)
static

◆ dropKnockoutCellsIn()

static void dropKnockoutCellsIn ( BOARD_ITEM * aItem)
static

Definition at line 1272 of file board_downgrade.cpp.

References PCB_TABLE_T, and EDA_ITEM::Type().

Referenced by dropKnockoutTableCells(), and dropKnockoutTableCellsFp().

◆ dropKnockoutTableCells()

static void dropKnockoutTableCells ( BOARD * aBoard)
static

◆ dropKnockoutTableCellsFp()

static void dropKnockoutTableCellsFp ( FOOTPRINT * aFootprint)
static

Definition at line 1285 of file board_downgrade.cpp.

References dropKnockoutCellsIn(), and FOOTPRINT::GraphicalItems().

Referenced by boardRules(), and dropKnockoutTableCells().

◆ dropKnockoutTextBoxes()

static void dropKnockoutTextBoxes ( BOARD * aBoard)
static

◆ dropKnockoutTextBoxesFp()

static void dropKnockoutTextBoxesFp ( FOOTPRINT * aFootprint)
static

Definition at line 1198 of file board_downgrade.cpp.

References FOOTPRINT::GraphicalItems(), and PCB_TEXTBOX_T.

Referenced by boardRules(), and dropKnockoutTextBoxes().

◆ dropNetChains()

static void dropNetChains ( BOARD * aBoard)
static

◆ dropPadSimTypes()

static void dropPadSimTypes ( BOARD * aBoard)
static

Definition at line 521 of file board_downgrade.cpp.

References dropPadSimTypesFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropPadSimTypesFp()

static void dropPadSimTypesFp ( FOOTPRINT * aFootprint)
static

Definition at line 318 of file board_downgrade.cpp.

References NONE, pad, and FOOTPRINT::Pads().

Referenced by boardRules(), and dropPadSimTypes().

◆ dropPcbPoints()

static void dropPcbPoints ( BOARD * aBoard)
static

Definition at line 892 of file board_downgrade.cpp.

References dropPcbPointsFp(), BOARD::Footprints(), BOARD::Points(), and BOARD::Remove().

Referenced by boardRules().

◆ dropPcbPointsFp()

static void dropPcbPointsFp ( FOOTPRINT * aFootprint)
static

Definition at line 300 of file board_downgrade.cpp.

References detachFromGroup(), and FOOTPRINT::Points().

Referenced by boardRules(), and dropPcbPoints().

◆ dropPcbVariants()

static void dropPcbVariants ( BOARD * aBoard)
static

◆ dropPcbVariantsFp()

static void dropPcbVariantsFp ( FOOTPRINT * aFootprint)
static

Definition at line 338 of file board_downgrade.cpp.

References FOOTPRINT::DeleteVariant(), FOOTPRINT::GetVariants(), and name.

Referenced by boardRules(), and dropPcbVariants().

◆ dropPostMachining()

static void dropPostMachining ( BOARD * aBoard)
static

Definition at line 707 of file board_downgrade.cpp.

References clear(), dropPostMachiningFp(), BOARD::Footprints(), PCB_VIA_T, and BOARD::Tracks().

Referenced by boardRules().

◆ dropPostMachiningFp()

static void dropPostMachiningFp ( FOOTPRINT * aFootprint)
static

Definition at line 350 of file board_downgrade.cpp.

References pad, and FOOTPRINT::Pads().

Referenced by boardRules(), and dropPostMachining().

◆ dropPressFitPads()

static void dropPressFitPads ( BOARD * aBoard)
static

Definition at line 740 of file board_downgrade.cpp.

References dropPressFitPadsFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropPressFitPadsFp()

static void dropPressFitPadsFp ( FOOTPRINT * aFootprint)
static

Definition at line 360 of file board_downgrade.cpp.

References NONE, pad, FOOTPRINT::Pads(), and PRESSFIT.

Referenced by boardRules(), and dropPressFitPads().

◆ dropSimulationExclusions()

static void dropSimulationExclusions ( BOARD * aBoard)
static

Definition at line 1881 of file board_downgrade.cpp.

References dropSimulationExclusionsFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropSimulationExclusionsFp()

static void dropSimulationExclusionsFp ( FOOTPRINT * aFootprint)
static

◆ dropTimeDomainTuning()

static void dropTimeDomainTuning ( BOARD * aBoard)
static

Definition at line 1706 of file board_downgrade.cpp.

References dropGenerators(), and isTimeDomainTuning().

Referenced by boardRules().

◆ dropUnitInfo()

static void dropUnitInfo ( BOARD * aBoard)
static

Definition at line 544 of file board_downgrade.cpp.

References dropUnitInfoFp(), and BOARD::Footprints().

Referenced by boardRules().

◆ dropUnitInfoFp()

static void dropUnitInfoFp ( FOOTPRINT * aFootprint)
static

Definition at line 325 of file board_downgrade.cpp.

References FOOTPRINT::SetUnitInfo().

Referenced by boardRules(), and dropUnitInfo().

◆ dropViaProtection()

◆ dropZoneDefaults()

static void dropZoneDefaults ( BOARD * aBoard)
static

◆ dropZoneLayerProperties()

static void dropZoneLayerProperties ( BOARD * aBoard)
static

Definition at line 1332 of file board_downgrade.cpp.

References dropZoneLayerPropertiesFp(), BOARD::Footprints(), and BOARD::Zones().

Referenced by boardRules().

◆ dropZoneLayerPropertiesFp()

static void dropZoneLayerPropertiesFp ( FOOTPRINT * aFootprint)
static

Definition at line 1325 of file board_downgrade.cpp.

References FOOTPRINT::Zones().

Referenced by boardRules(), and dropZoneLayerProperties().

◆ ellipseToPolygon()

◆ ExportBoardToOlderVersion()

bool ExportBoardToOlderVersion ( const wxString & aSrcFile,
const wxString & aDestFile,
const DOWNGRADE_TARGET & aTarget,
COMPATIBILITY_REPORT & aReport,
wxString * aUnsupportedToken = nullptr,
const wxString & aVariant = wxEmptyString,
bool aDropInsteadOfApproximate = false )

◆ FindUnsupportedBoardToken()

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

Scan serialized board 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 2944 of file board_downgrade.cpp.

References BOARD_TOKENS, BOARD_VALUES, containsGroupPlacementSource(), FindUnsupportedToken(), DOWNGRADE_TARGET::m_boardVersion, SEXPR_BOARD_FILE_VERSION, and VER_GROUP_PLACEMENT.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ FlattenBoardVariant()

void FlattenBoardVariant ( BOARD * aBoard,
const wxString & aVariantName )

Bake a variant's overrides into the base footprint attributes.

Run before the variant registry is dropped, so the exported board matches the chosen variant.

Definition at line 2957 of file board_downgrade.cpp.

References BOARD::Footprints(), and name.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ExportBoardToOlderVersion(), and PCBNEW_JOBS_HANDLER::JobDowngrade().

◆ footprintMaxError()

static int footprintMaxError ( const FOOTPRINT * aFootprint)
static

◆ forEachPadPrimitive()

static void forEachPadPrimitive ( FOOTPRINT * aFootprint,
const std::function< void(PCB_SHAPE *)> & aFunc )
static

◆ hasActiveExpression()

static bool hasActiveExpression ( const wxString & aText)
static

Definition at line 2160 of file board_downgrade.cpp.

Referenced by planTextItem().

◆ hasBackdrill()

◆ hasGroupPlacementLinkage()

static bool hasGroupPlacementLinkage ( const ZONE * aZone)
static

◆ hasLineEndings()

static bool hasLineEndings ( const BOARD_ITEM * aItem)
static

◆ hasPostMachining()

static bool hasPostMachining ( const PADSTACK & aPadstack)
static

◆ hasViaProtection()

◆ isBarcode()

static bool isBarcode ( const BOARD_ITEM * aItem)
static

Definition at line 1477 of file board_downgrade.cpp.

References PCB_BARCODE_T, and EDA_ITEM::Type().

Referenced by omitBarcodes(), and omitBarcodesFp().

◆ isDrillDrawing()

static bool isDrillDrawing ( const BOARD_ITEM * aItem)
static

Definition at line 1600 of file board_downgrade.cpp.

References PCB_DRILL_CHART_T, PCB_DRILL_MAP_T, and EDA_ITEM::Type().

Referenced by countDrillDrawings(), and dropDrillDrawings().

◆ isEllipse()

static bool isEllipse ( const BOARD_ITEM * aItem)
static

Definition at line 120 of file board_downgrade.cpp.

References ELLIPSE, ELLIPSE_ARC, PCB_SHAPE_T, and EDA_ITEM::Type().

Referenced by countEllipses(), lowerEllipses(), and lowerEllipsesFp().

◆ isGrid()

static bool isGrid ( const BOARD_ITEM * aItem)
static

Definition at line 1594 of file board_downgrade.cpp.

References PCB_GRID_ITEM_T, and EDA_ITEM::Type().

Referenced by countGrids(), and dropGrids().

◆ isHatchedCopperShape()

static bool isHatchedCopperShape ( const BOARD_ITEM * aItem)
static

Definition at line 138 of file board_downgrade.cpp.

References BOARD_ITEM::GetLayer(), IsCopperLayer(), and isHatchedShape().

Referenced by boardRules().

◆ isHatchedInkShape()

static bool isHatchedInkShape ( const BOARD_ITEM * aItem)
static

Definition at line 144 of file board_downgrade.cpp.

References BOARD_ITEM::GetLayer(), IsCopperLayer(), and isHatchedShape().

Referenced by boardRules().

◆ isHatchedShape()

static bool isHatchedShape ( const BOARD_ITEM * aItem)
static

Definition at line 130 of file board_downgrade.cpp.

References PCB_SHAPE_T, and EDA_ITEM::Type().

Referenced by isHatchedCopperShape(), and isHatchedInkShape().

◆ isKnockoutTextBox()

static bool isKnockoutTextBox ( const BOARD_ITEM * aItem)
static

◆ isRoundedRect()

static bool isRoundedRect ( const BOARD_ITEM * aItem)
static

◆ isTimeDomainTuning()

static bool isTimeDomainTuning ( const PCB_GENERATOR * aGenerator)
static

Definition at line 1693 of file board_downgrade.cpp.

References EDA_GROUP::GetItems().

Referenced by countTimeDomainTuning(), and dropTimeDomainTuning().

◆ isUnreviewedDrawing()

◆ lowerBarcodes()

static void lowerBarcodes ( BOARD * aBoard)
static

◆ lowerBarcodesFp()

static void lowerBarcodesFp ( FOOTPRINT * aFootprint)
static

◆ lowerBuriedVias()

static void lowerBuriedVias ( BOARD * aBoard)
static

Definition at line 762 of file board_downgrade.cpp.

References BLIND, BURIED, PCB_VIA_T, BOARD::Tracks(), and via.

Referenced by boardRules().

◆ lowerEllipses()

◆ lowerEllipsesFp()

static void lowerEllipsesFp ( FOOTPRINT * aFootprint)
static

◆ lowerLineEndingShape()

◆ lowerRoundedRects()

◆ lowerRoundedRectsFp()

static void lowerRoundedRectsFp ( FOOTPRINT * aFootprint)
static

◆ lowerSkipVias()

static void lowerSkipVias ( BOARD * aBoard)
static

◆ omitBarcodes()

static void omitBarcodes ( BOARD * aBoard)
static

Definition at line 1485 of file board_downgrade.cpp.

References isBarcode(), and omitGraphics().

Referenced by boardRules().

◆ omitBarcodesFp()

static void omitBarcodesFp ( FOOTPRINT * aFootprint)
static

Definition at line 1481 of file board_downgrade.cpp.

References isBarcode(), and omitGraphicsFp().

Referenced by boardRules().

◆ omitEllipses()

static void omitEllipses ( BOARD * aBoard)
static

◆ omitEllipsesFp()

static void omitEllipsesFp ( FOOTPRINT * aFootprint)
static

Definition at line 1464 of file board_downgrade.cpp.

References isEllipse(), omitGraphicsFp(), and omitPadPrimitives().

Referenced by boardRules().

◆ omitGraphics()

static void omitGraphics ( BOARD * aBoard,
const std::function< bool(const BOARD_ITEM *)> & aMatches )
static

◆ omitGraphicsFp()

static void omitGraphicsFp ( FOOTPRINT * aFootprint,
const std::function< bool(const BOARD_ITEM *)> & aMatches )
static

◆ omitKnockoutCellContents()

static void omitKnockoutCellContents ( BOARD_ITEM * aItem)
static

Definition at line 1521 of file board_downgrade.cpp.

References PCB_TABLE_T, and EDA_ITEM::Type().

Referenced by omitKnockoutTableCells(), and omitKnockoutTableCellsFp().

◆ omitKnockoutTableCells()

static void omitKnockoutTableCells ( BOARD * aBoard)
static

◆ omitKnockoutTableCellsFp()

static void omitKnockoutTableCellsFp ( FOOTPRINT * aFootprint)
static

◆ omitKnockoutTextBoxes()

static void omitKnockoutTextBoxes ( BOARD * aBoard)
static

Definition at line 1499 of file board_downgrade.cpp.

References isKnockoutTextBox(), and omitGraphics().

Referenced by boardRules().

◆ omitKnockoutTextBoxesFp()

static void omitKnockoutTextBoxesFp ( FOOTPRINT * aFootprint)
static

Definition at line 1495 of file board_downgrade.cpp.

References isKnockoutTextBox(), and omitGraphicsFp().

Referenced by boardRules().

◆ omitPadPrimitives()

static void omitPadPrimitives ( FOOTPRINT * aFootprint,
const std::function< bool(const BOARD_ITEM *)> & aMatches )
static

Definition at line 1444 of file board_downgrade.cpp.

References pad, and FOOTPRINT::Pads().

Referenced by omitEllipses(), omitEllipsesFp(), omitRoundedRects(), and omitRoundedRectsFp().

◆ omitRoundedRects()

static void omitRoundedRects ( BOARD * aBoard)
static

◆ omitRoundedRectsFp()

static void omitRoundedRectsFp ( FOOTPRINT * aFootprint)
static

Definition at line 1505 of file board_downgrade.cpp.

References isRoundedRect(), omitGraphicsFp(), and omitPadPrimitives().

Referenced by boardRules().

◆ planBoardText()

◆ planTextItem()

◆ postTargetText() [1/2]

static bool postTargetText ( const wxString & aText,
const BOARD * aBoard,
int aTargetVersion )
static

Definition at line 2144 of file board_downgrade.cpp.

References postTargetText().

◆ postTargetText() [2/2]

static bool postTargetText ( const wxString & aText,
const BOARD * aBoard,
int aTargetVersion,
std::set< wxString > & aDependencies,
int aDepth = 0 )
static

◆ roundedRectToPolygon()

◆ SaveBoardForTarget()

◆ SaveFootprintForTarget()

void SaveFootprintForTarget ( FOOTPRINT * aFootprint,
const wxString & aPath,
const DOWNGRADE_TARGET & aTarget )

◆ setHatchedFills()

static void setHatchedFills ( BOARD * aBoard,
const std::function< bool(const BOARD_ITEM *)> & aMatches,
FILL_T aFill )
static

Definition at line 868 of file board_downgrade.cpp.

References BOARD::Drawings(), BOARD::Footprints(), and setHatchedFillsFp().

Referenced by boardRules().

◆ setHatchedFillsFp()

static void setHatchedFillsFp ( FOOTPRINT * aFootprint,
const std::function< bool(const BOARD_ITEM *)> & aMatches,
FILL_T aFill )
static

Definition at line 227 of file board_downgrade.cpp.

References FOOTPRINT::GraphicalItems().

Referenced by boardRules(), and setHatchedFills().

◆ titleFieldIndex()

static int titleFieldIndex ( const wxString & aName)
static

Definition at line 2026 of file board_downgrade.cpp.

Referenced by postTargetText().

◆ titleFieldText()

static const wxString & titleFieldText ( const TITLE_BLOCK & aTitle,
int aIndex )
static

◆ transformLineEndings()

static void transformLineEndings ( BOARD * aBoard,
bool aOmit )
static

◆ transformLineEndingsFp()

static void transformLineEndingsFp ( FOOTPRINT * aFootprint,
bool aOmit )
static

◆ unsafeLineEndings()

◆ visitBoardItems()

static void visitBoardItems ( const BOARD * aBoard,
const std::function< void(BOARD_ITEM *)> & aVisit )
static

◆ visitFootprintItems()

static void visitFootprintItems ( const FOOTPRINT * aFootprint,
const std::function< void(BOARD_ITEM *)> & aVisit )
static

Variable Documentation

◆ BOARD_DOWNGRADE_COVERED

int BOARD_DOWNGRADE_COVERED = 20260901
staticconstexpr

Definition at line 117 of file board_downgrade.cpp.

Referenced by BoardDowngradeCoveredVersion(), and ClassifyBoardForDowngrade().

◆ BOARD_TOKENS

DATED_TOKEN BOARD_TOKENS[]
staticconstexpr

Definition at line 2806 of file board_downgrade.cpp.

Referenced by FindUnsupportedBoardToken().

◆ BOARD_VALUES

DATED_TOKEN BOARD_VALUES[]
staticconstexpr
Initial value:
= {
{ "exclude_from_sim", VER_SIM_EXCLUSION }, { "via_stitch", VER_VIA_STITCH }, { "via_stack", VER_VIA_STACK },
{ "pad_prop_pressfit", VER_PRESSFIT }, { "buried", VER_VIA_SPLIT },
}
static constexpr int VER_PRESSFIT
static constexpr int VER_SIM_EXCLUSION
static constexpr int VER_VIA_SPLIT
static constexpr int VER_VIA_STITCH
static constexpr int VER_VIA_STACK

Definition at line 2870 of file board_downgrade.cpp.

Referenced by FindUnsupportedBoardToken().

◆ VER_BACKDRILL

int VER_BACKDRILL = 20251101
staticconstexpr

Definition at line 94 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_BARCODE

int VER_BARCODE = 20250914
staticconstexpr

Definition at line 88 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_CELL_KNOCKOUT

int VER_CELL_KNOCKOUT = 20260603
staticconstexpr

Definition at line 93 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_CONSTRAINTS

int VER_CONSTRAINTS = 20260624
staticconstexpr

Definition at line 103 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_CUSTOM_PROPERTIES

int VER_CUSTOM_PROPERTIES = 20260831
staticconstexpr

Definition at line 110 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_DIELECTRIC

int VER_DIELECTRIC = 20260511
staticconstexpr

Definition at line 100 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_DRILL_DRAWINGS

int VER_DRILL_DRAWINGS = 20260901
staticconstexpr

Definition at line 111 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_ELLIPSE

int VER_ELLIPSE = 20260508
staticconstexpr

Definition at line 96 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_EXTRUDED_BODY

int VER_EXTRUDED_BODY = 20260410
staticconstexpr

Definition at line 95 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_FP_UNITS

int VER_FP_UNITS = 20250909
staticconstexpr

Definition at line 87 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_GRIDS

int VER_GRIDS = 20260728
staticconstexpr

Definition at line 104 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_GROUP_LIB_ID

int VER_GROUP_LIB_ID = 20250513
staticconstexpr

Definition at line 101 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_GROUP_PLACEMENT

int VER_GROUP_PLACEMENT = 20250401
staticconstexpr

Definition at line 92 of file board_downgrade.cpp.

Referenced by boardRules(), and FindUnsupportedBoardToken().

◆ VER_IMAGE_PPI

int VER_IMAGE_PPI = 20260623
staticconstexpr

Definition at line 102 of file board_downgrade.cpp.

Referenced by DowngradeBoardInPlace(), and DowngradeFootprintInPlace().

◆ VER_JUMPER_PADS

int VER_JUMPER_PADS = 20250324
staticconstexpr

Definition at line 80 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_LINE_ENDINGS

int VER_LINE_ENDINGS = 20260818
staticconstexpr

Definition at line 107 of file board_downgrade.cpp.

Referenced by boardRules(), and ClassifyBoardForDowngrade().

◆ VER_NET_CHAINS

int VER_NET_CHAINS = 20260512
staticconstexpr

Definition at line 98 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_PAD_DIE_DELAY

int VER_PAD_DIE_DELAY = 20250401
staticconstexpr

Definition at line 89 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_PAD_SIM

int VER_PAD_SIM = 20260521
staticconstexpr

Definition at line 99 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_PCB_POINTS

int VER_PCB_POINTS = 20250901
staticconstexpr

Definition at line 85 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_POST_MACHINING

int VER_POST_MACHINING = 20251101
staticconstexpr

Definition at line 84 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_PRESSFIT

int VER_PRESSFIT = 20250811
staticconstexpr

Definition at line 83 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_PROPERTY_VARIABLES

int VER_PROPERTY_VARIABLES = 20260817
staticconstexpr

◆ VER_ROUNDED_RECT

int VER_ROUNDED_RECT = 20250829
staticconstexpr

Definition at line 86 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_SHAPE_HATCH

int VER_SHAPE_HATCH = 20250222
staticconstexpr

Definition at line 77 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_SIM_EXCLUSION

int VER_SIM_EXCLUSION = 20260828
staticconstexpr

Definition at line 108 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_SKIP_VIA

int VER_SKIP_VIA = 20250801
staticconstexpr

Definition at line 82 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_TEXTBOX_KNOCKOUT

int VER_TEXTBOX_KNOCKOUT = 20250210
staticconstexpr

Definition at line 76 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_THIEVING

int VER_THIEVING = 20260513
staticconstexpr

Definition at line 97 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_TIME_DOMAIN_TUNING

int VER_TIME_DOMAIN_TUNING = 20250401
staticconstexpr

Definition at line 90 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_USER_LAYERS

int VER_USER_LAYERS = 20241229
staticconstexpr

Definition at line 75 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_VIA_PROTECTION

int VER_VIA_PROTECTION = 20250228
staticconstexpr

Definition at line 78 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_VIA_SPLIT

int VER_VIA_SPLIT = 20250926
staticconstexpr

Definition at line 81 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_VIA_STACK

int VER_VIA_STACK = 20260830
staticconstexpr

Definition at line 109 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_VIA_STITCH

int VER_VIA_STITCH = 20260816
staticconstexpr

Definition at line 105 of file board_downgrade.cpp.

Referenced by boardRules().

◆ VER_ZONE_DEFAULTS

int VER_ZONE_DEFAULTS = 20250302
staticconstexpr

Definition at line 79 of file board_downgrade.cpp.

Referenced by boardRules().