KiCad PCB EDA Suite
|
#include <algorithm>
#include <cstdio>
#include <memory>
#include <mutex>
#include <wx/log.h>
#include <board.h>
#include <board_design_settings.h>
#include <drc/drc_rtree.h>
#include <drc/drc_engine.h>
#include <lset.h>
#include <pcb_track.h>
#include <pcb_group.h>
#include <geometry/shape_segment.h>
#include <pcbexpr_evaluator.h>
#include <connectivity/connectivity_data.h>
#include <connectivity/connectivity_algo.h>
#include <connectivity/from_to_cache.h>
Go to the source code of this file.
Classes | |
class | SCOPED_LAYERSET |
Macros | |
#define | MISSING_LAYER_ARG(f) wxString::Format( _( "Missing layer name argument to %s." ), f ) |
#define | MISSING_FP_ARG(f) wxString::Format( _( "Missing footprint argument (A, B, or reference designator) to %s." ), f ) |
#define | MISSING_AREA_ARG(f) wxString::Format( _( "Missing rule-area argument (A, B, or rule-area name) to %s." ), f ) |
#define | MISSING_GROUP_ARG(f) wxString::Format( _( "Missing group name argument to %s." ), f ) |
#define | MISSING_SHEET_ARG(f) wxString::Format( _( "Missing sheet name argument to %s." ), f ) |
#define | MISSING_REF_ARG(f) wxString::Format( _( "Missing footprint argument (reference designator) to %s." ), f ) |
#define | MISSING_DP_ARG(f) wxString::Format( _( "Missing diff-pair name argument to %s." ), f ) |
Functions | |
bool | fromToFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | existsOnLayerFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | isPlatedFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
bool | collidesWithCourtyard (BOARD_ITEM *aItem, std::shared_ptr< SHAPE > &aItemShape, PCBEXPR_CONTEXT *aCtx, FOOTPRINT *aFootprint, PCB_LAYER_ID aSide) |
static bool | searchFootprints (BOARD *aBoard, const wxString &aArg, PCBEXPR_CONTEXT *aCtx, const std::function< bool(FOOTPRINT *)> &aFunc) |
static void | intersectsCourtyardFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | intersectsFrontCourtyardFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | intersectsBackCourtyardFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
bool | collidesWithArea (BOARD_ITEM *aItem, PCBEXPR_CONTEXT *aCtx, ZONE *aArea) |
bool | searchAreas (BOARD *aBoard, const wxString &aArg, PCBEXPR_CONTEXT *aCtx, const std::function< bool(ZONE *)> &aFunc) |
static void | intersectsAreaFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | enclosedByAreaFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | memberOfGroupFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | memberOfSheetFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | memberOfFootprintFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | isMicroVia (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | isBlindBuriedViaFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | isCoupledDiffPairFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | inDiffPairFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | getFieldFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | hasNetclassFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
static void | hasComponentClassFunc (LIBEVAL::CONTEXT *aCtx, void *self) |
#define MISSING_AREA_ARG | ( | f | ) | wxString::Format( _( "Missing rule-area argument (A, B, or rule-area name) to %s." ), f ) |
Definition at line 670 of file pcbexpr_functions.cpp.
#define MISSING_DP_ARG | ( | f | ) | wxString::Format( _( "Missing diff-pair name argument to %s." ), f ) |
Definition at line 1092 of file pcbexpr_functions.cpp.
#define MISSING_FP_ARG | ( | f | ) | wxString::Format( _( "Missing footprint argument (A, B, or reference designator) to %s." ), f ) |
Definition at line 263 of file pcbexpr_functions.cpp.
#define MISSING_GROUP_ARG | ( | f | ) | wxString::Format( _( "Missing group name argument to %s." ), f ) |
Definition at line 871 of file pcbexpr_functions.cpp.
#define MISSING_LAYER_ARG | ( | f | ) | wxString::Format( _( "Missing layer name argument to %s." ), f ) |
Definition at line 75 of file pcbexpr_functions.cpp.
#define MISSING_REF_ARG | ( | f | ) | wxString::Format( _( "Missing footprint argument (reference designator) to %s." ), f ) |
Definition at line 975 of file pcbexpr_functions.cpp.
#define MISSING_SHEET_ARG | ( | f | ) | wxString::Format( _( "Missing sheet name argument to %s." ), f ) |
Definition at line 917 of file pcbexpr_functions.cpp.
bool collidesWithArea | ( | BOARD_ITEM * | aItem, |
PCBEXPR_CONTEXT * | aCtx, | ||
ZONE * | aArea | ||
) |
Avoid buried vias that don't overlap the zone's layers
Definition at line 456 of file pcbexpr_functions.cpp.
References _, ALLOW_ACUTE_CORNERS, ARC_LOW_DEF, B_CrtYd, LSET::BackMask(), SHAPE_POLY_SET::ClearArcs(), SHAPE_POLY_SET::CloneDropTriangulation(), SHAPE_POLY_SET::Collide(), LSET::Contains(), SHAPE_POLY_SET::Deflate(), F_CrtYd, LSET::FrontMask(), BOARD_ITEM::GetBoard(), ZONE::GetBoundingBox(), FOOTPRINT::GetCourtyard(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetDRCEpsilon(), BOARD_ITEM::GetEffectiveHoleShape(), BOARD_ITEM::GetEffectiveShape(), EDA_ITEM::GetFlags(), PCBEXPR_CONTEXT::GetLayer(), BOARD_ITEM::GetLayerSet(), ZONE::GetLayerSet(), LIBEVAL::CONTEXT::HasErrorCallback(), HOLE_PROXY, ZONE::IsFilled(), BOARD::m_CopperZoneRTreeCache, MALFORMED_COURTYARDS, ZONE::Outline(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PCB_FOOTPRINT_T, PCB_PAD_T, PCB_VIA_T, PCB_ZONE_T, DRC_RTREE::QueryColliding(), LIBEVAL::CONTEXT::ReportError(), EDA_ITEM::Type(), and UNDEFINED_LAYER.
Referenced by intersectsAreaFunc().
bool collidesWithCourtyard | ( | BOARD_ITEM * | aItem, |
std::shared_ptr< SHAPE > & | aItemShape, | ||
PCBEXPR_CONTEXT * | aCtx, | ||
FOOTPRINT * | aFootprint, | ||
PCB_LAYER_ID | aSide | ||
) |
Definition at line 191 of file pcbexpr_functions.cpp.
References SHAPE_POLY_SET::Collide(), FOOTPRINT::GetCourtyard(), BOARD_ITEM::GetEffectiveShape(), and PCBEXPR_CONTEXT::GetLayer().
Referenced by intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), and intersectsFrontCourtyardFunc().
|
static |
Definition at line 773 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), BOARD_ITEM::GetBoard(), EDA_ITEM::GetBoundingBox(), BOARD::GetDesignSettings(), EDA_ITEM::GetFlags(), PCBEXPR_CONTEXT::GetLayer(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), BOARD_DESIGN_SETTINGS::m_MaxError, MISSING_AREA_ARG, PCB_ZONE_T, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), ROUTER_TRANSIENT, searchAreas(), LIBEVAL::VALUE::Set(), LIBEVAL::VALUE::SetDeferredEval(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 77 of file pcbexpr_functions.cpp.
References _, LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), BOARD_ITEM::GetBoard(), BOARD_ITEM::GetLayerSet(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), ENUM_MAP< T >::Instance(), BOARD_ITEM::IsOnLayer(), BOARD::m_CachesMutex, BOARD::m_LayerExpressionCache, MISSING_LAYER_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), BASE_SET::set(), LIBEVAL::VALUE::SetDeferredEval(), and ToLAYER_ID().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
bool fromToFunc | ( | LIBEVAL::CONTEXT * | aCtx, |
void * | self | ||
) |
Definition at line 43 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), BOARD_ITEM::GetBoard(), BOARD::GetConnectivity(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), and LIBEVAL::VALUE::Set().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1146 of file pcbexpr_functions.cpp.
References _, LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), BOARD_ITEM::GetBoard(), FOOTPRINT::GetFieldByName(), PCBEXPR_VAR_REF::GetObject(), EDA_TEXT::GetText(), LIBEVAL::CONTEXT::HasErrorCallback(), PCB_FOOTPRINT_T, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), LIBEVAL::VALUE::SetDeferredEval(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1226 of file pcbexpr_functions.cpp.
References _, LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), COMPONENT_CLASS::ContainsClassName(), FOOTPRINT::GetComponentClass(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1188 of file pcbexpr_functions.cpp.
References _, LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), NETCLASS::ContainsNetclassWithName(), BOARD_CONNECTED_ITEM::GetEffectiveNetClass(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), BOARD_ITEM::IsConnected(), LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1095 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), BOARD::FindNet(), BOARD_ITEM::GetBoard(), NETINFO_ITEM::GetNetname(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), BOARD_ITEM::IsConnected(), DRC_ENGINE::MatchDpSuffix(), MISSING_DP_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 673 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), collidesWithArea(), BOARD_ITEM::GetBoard(), EDA_ITEM::GetBoundingBox(), ZONE::GetBoundingBox(), EDA_ITEM::GetFlags(), PCBEXPR_CONTEXT::GetLayer(), BOARD_ITEM::GetLayerSet(), ZONE::GetLayerSet(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), BOX2< Vec >::Intersects(), MISSING_AREA_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), ROUTER_TRANSIENT, searchAreas(), LIBEVAL::VALUE::Set(), BASE_SET::set(), LIBEVAL::VALUE::SetDeferredEval(), and UNDEFINED_LAYER.
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 393 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), B_Cu, collidesWithCourtyard(), BOARD_ITEM::GetBoard(), EDA_ITEM::GetFlags(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), MISSING_FP_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), res, ROUTER_TRANSIENT, searchFootprints(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 266 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), B_Cu, collidesWithCourtyard(), F_Cu, BOARD_ITEM::GetBoard(), EDA_ITEM::GetFlags(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), MISSING_FP_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), res, ROUTER_TRANSIENT, searchFootprints(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 330 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), collidesWithCourtyard(), F_Cu, BOARD_ITEM::GetBoard(), EDA_ITEM::GetFlags(), PCBEXPR_VAR_REF::GetObject(), LIBEVAL::CONTEXT::HasErrorCallback(), MISSING_FP_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), res, ROUTER_TRANSIENT, searchFootprints(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1039 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), BLIND_BURIED, PCBEXPR_VAR_REF::GetObject(), PCB_VIA_T, LIBEVAL::CONTEXT::Push(), LIBEVAL::VALUE::Set(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1056 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), dummy, PCBEXPR_CONTEXT::GetConstraint(), PCBEXPR_CONTEXT::GetItem(), BOARD_CONNECTED_ITEM::GetNet(), BOARD_CONNECTED_ITEM::GetNetname(), NETINFO_ITEM::GetNetname(), LENGTH_CONSTRAINT, DRC_ENGINE::MatchDpSuffix(), LIBEVAL::CONTEXT::Push(), LIBEVAL::VALUE::Set(), LIBEVAL::VALUE::SetDeferredEval(), and SKEW_CONSTRAINT.
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 1022 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), PCBEXPR_VAR_REF::GetObject(), MICROVIA, PCB_VIA_T, LIBEVAL::CONTEXT::Push(), LIBEVAL::VALUE::Set(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 171 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), PCBEXPR_VAR_REF::GetObject(), PCB_PAD_T, PCB_VIA_T, PTH, LIBEVAL::CONTEXT::Push(), LIBEVAL::VALUE::Set(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 978 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), PCBEXPR_VAR_REF::GetObject(), BOARD_ITEM::GetParentFootprint(), LIBEVAL::CONTEXT::HasErrorCallback(), MISSING_REF_ARG, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), and LIBEVAL::VALUE::SetDeferredEval().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 874 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), PCBEXPR_VAR_REF::GetObject(), BOARD_ITEM::GetParent(), BOARD_ITEM::GetParentGroup(), group, LIBEVAL::CONTEXT::HasErrorCallback(), MISSING_GROUP_ARG, PCB_FOOTPRINT_T, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), LIBEVAL::VALUE::SetDeferredEval(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
|
static |
Definition at line 920 of file pcbexpr_functions.cpp.
References LIBEVAL::CONTEXT::AllocValue(), LIBEVAL::VALUE::AsString(), PCBEXPR_VAR_REF::GetObject(), BOARD_ITEM::GetParentFootprint(), FOOTPRINT::GetSheetname(), LIBEVAL::CONTEXT::HasErrorCallback(), MISSING_SHEET_ARG, PCB_FOOTPRINT_T, LIBEVAL::CONTEXT::Pop(), LIBEVAL::CONTEXT::Push(), LIBEVAL::CONTEXT::ReportError(), LIBEVAL::VALUE::Set(), LIBEVAL::VALUE::SetDeferredEval(), and EDA_ITEM::Type().
Referenced by PCBEXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions().
bool searchAreas | ( | BOARD * | aBoard, |
const wxString & | aArg, | ||
PCBEXPR_CONTEXT * | aCtx, | ||
const std::function< bool(ZONE *)> & | aFunc | ||
) |
Definition at line 579 of file pcbexpr_functions.cpp.
References BOARD::Footprints(), PCBEXPR_CONTEXT::GetItem(), KIID::SniffTest(), and BOARD::Zones().
Referenced by enclosedByAreaFunc(), and intersectsAreaFunc().
|
static |
Definition at line 212 of file pcbexpr_functions.cpp.
References BOARD::Footprints(), PCBEXPR_CONTEXT::GetItem(), and name.
Referenced by intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), and intersectsFrontCourtyardFunc().