KiCad PCB EDA Suite
Loading...
Searching...
No Matches
altium_pcb.cpp File Reference
#include "altium_pcb.h"
#include "altium_parser_pcb.h"
#include <altium_pcb_compound_file.h>
#include <io/altium/altium_ascii_parser.h>
#include <io/altium/altium_binary_parser.h>
#include <io/altium/altium_parser_utils.h>
#include <io/altium/altium_props_utils.h>
#include <io/io_utils.h>
#include <io/altium/altium_project_variants.h>
#include <board.h>
#include <board_design_settings.h>
#include <project/net_settings.h>
#include <footprint.h>
#include <layer_range.h>
#include <pcb_dimension.h>
#include <pad.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <pcb_textbox.h>
#include <pcb_track.h>
#include <pcb_barcode.h>
#include <pcb_generator.h>
#include <generators_mgr.h>
#include <generators/pcb_tuning_pattern.h>
#include <router/pns_meander.h>
#include <geometry/shape_line_chain.h>
#include <core/profile.h>
#include <string_utils.h>
#include <tools/pad_tool.h>
#include <zone.h>
#include <board_stackup_manager/stackup_predefined_prms.h>
#include <cmath>
#include <set>
#include <advanced_config.h>
#include <compoundfilereader.h>
#include <convert_basic_shapes_to_polygon.h>
#include <font/outline_font.h>
#include <project.h>
#include <reporter.h>
#include <trigo.h>
#include <utf.h>
#include <wx/docview.h>
#include <wx/log.h>
#include <wx/mstream.h>
#include <wx/wfstream.h>
#include <wx/zstream.h>
#include <progress_reporter.h>
#include <magic_enum.hpp>
#include <thread_pool.h>

Go to the source code of this file.

Functions

bool IsAltiumLayerCopper (ALTIUM_LAYER aLayer)
 
bool IsAltiumLayerAPlane (ALTIUM_LAYER aLayer)
 
wxString AltiumUnnamedNetName (const BOARD &aBoard, int &aCounter)
 Invent a placeholder name for an Altium net that has none.
 
static bool IsAltiumScopeAll (const wxString &aExpr)
 
static bool GetAltiumNetclassScopeName (const ARULE6 &aRule, wxString *aNetclassName)
 
void ApplyAltiumNetclassRules (const std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > &aRulesByKind, NET_SETTINGS &aNetSettings, std::vector< const ARULE6 * > *aUnresolved)
 Copy the values of Altium rules scoped to a single netclass onto that netclass.
 
void HelperShapeLineChainFromAltiumVertices (SHAPE_LINE_CHAIN &aLine, const std::vector< ALTIUM_VERTICE > &aVertices)
 
static bool IsLayerNameCourtyard (const wxString &aName)
 
static bool IsLayerNameAssembly (const wxString &aName)
 
static bool IsLayerNameTopSide (const wxString &aName)
 
double normalizeAngleDegrees (double Angle, double aMin, double aMax)
 Normalize angle to be aMin < angle <= aMax angle is in degrees.
 
static void altiumCollectSchematicNetNames (const wxString &aFileName, std::map< wxString, wxString > &aNames, std::set< wxString > &aAmbiguous)
 

Variables

constexpr double BOLD_FACTOR = 1.75
 
constexpr int ALTIUM_TOP_PADSTACK_IDX = 0
 
constexpr int ALTIUM_MID1_PADSTACK_IDX = 1
 
constexpr int ALTIUM_MID2_PADSTACK_IDX = 2
 
constexpr int ALTIUM_BOTTOM_PADSTACK_IDX = 31
 
constexpr int ALTIUM_PADSTACK_IDX_COUNT = 32
 

Function Documentation

◆ altiumCollectSchematicNetNames()

static void altiumCollectSchematicNetNames ( const wxString & aFileName,
std::map< wxString, wxString > & aNames,
std::set< wxString > & aAmbiguous )
static

◆ AltiumUnnamedNetName()

wxString AltiumUnnamedNetName ( const BOARD & aBoard,
int & aCounter )

Invent a placeholder name for an Altium net that has none.

NETINFO_LIST keys nets by name and the unconnected net owns the empty string, so a nameless net has to be given one or it is merged into another net. aCounter is advanced past every candidate that is already taken on aBoard.

Definition at line 99 of file altium_pcb.cpp.

References BOARD::FindNet(), and name.

Referenced by BOOST_AUTO_TEST_CASE(), and ALTIUM_PCB::ParseNets6Data().

◆ ApplyAltiumNetclassRules()

void ApplyAltiumNetclassRules ( const std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > & aRulesByKind,
NET_SETTINGS & aNetSettings,
std::vector< const ARULE6 * > * aUnresolved = nullptr )

Copy the values of Altium rules scoped to a single netclass onto that netclass.

Only rules of the form InNetClass('<name>') against All are considered, and only for the clearance, width and routing-via kinds. Each vector in aRulesByKind must be sorted by ARULE6::priority ascending; the first enabled match for a netclass wins, because Altium priority 1 is the most specific. Disabled rules are skipped.

aUnresolved, when given, collects the rules that name a netclass the board does not define. Those constraints are lost, and the pointers alias aRulesByKind.

Definition at line 136 of file altium_pcb.cpp.

References CLEARANCE, GetAltiumNetclassScopeName(), NET_SETTINGS::GetNetclasses(), ROUTING_VIAS, and WIDTH.

Referenced by BOOST_AUTO_TEST_CASE(), and ALTIUM_PCB::ParseRules6Data().

◆ GetAltiumNetclassScopeName()

static bool GetAltiumNetclassScopeName ( const ARULE6 & aRule,
wxString * aNetclassName )
static

◆ HelperShapeLineChainFromAltiumVertices()

◆ IsAltiumLayerAPlane()

◆ IsAltiumLayerCopper()

◆ IsAltiumScopeAll()

static bool IsAltiumScopeAll ( const wxString & aExpr)
static

Definition at line 113 of file altium_pcb.cpp.

Referenced by GetAltiumNetclassScopeName(), and ALTIUM_PCB::GetRuleDefault().

◆ IsLayerNameAssembly()

static bool IsLayerNameAssembly ( const wxString & aName)
static

Definition at line 1361 of file altium_pcb.cpp.

Referenced by ALTIUM_PCB::remapUnsureLayers().

◆ IsLayerNameCourtyard()

static bool IsLayerNameCourtyard ( const wxString & aName)
static

Definition at line 1352 of file altium_pcb.cpp.

Referenced by ALTIUM_PCB::remapUnsureLayers().

◆ IsLayerNameTopSide()

static bool IsLayerNameTopSide ( const wxString & aName)
static

Definition at line 1369 of file altium_pcb.cpp.

Referenced by ALTIUM_PCB::remapUnsureLayers().

◆ normalizeAngleDegrees()

double normalizeAngleDegrees ( double Angle,
double aMin,
double aMax )

Normalize angle to be aMin < angle <= aMax angle is in degrees.

Definition at line 1806 of file altium_pcb.cpp.

Referenced by ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), and ALTIUM_PCB::ParseComponentsBodies6Data().

Variable Documentation

◆ ALTIUM_BOTTOM_PADSTACK_IDX

int ALTIUM_BOTTOM_PADSTACK_IDX = 31
constexpr

◆ ALTIUM_MID1_PADSTACK_IDX

int ALTIUM_MID1_PADSTACK_IDX = 1
constexpr

◆ ALTIUM_MID2_PADSTACK_IDX

int ALTIUM_MID2_PADSTACK_IDX = 2
constexpr

Definition at line 81 of file altium_pcb.cpp.

Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper().

◆ ALTIUM_PADSTACK_IDX_COUNT

int ALTIUM_PADSTACK_IDX_COUNT = 32
constexpr

Definition at line 83 of file altium_pcb.cpp.

Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper().

◆ ALTIUM_TOP_PADSTACK_IDX

int ALTIUM_TOP_PADSTACK_IDX = 0
constexpr

◆ BOLD_FACTOR

double BOLD_FACTOR = 1.75
constexpr