KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_symbol.cpp File Reference
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <sch_collectors.h>
#include <sch_commit.h>
#include <sch_edit_frame.h>
#include <widgets/msgpanel.h>
#include <bitmaps.h>
#include <common.h>
#include <core/mirror.h>
#include "lib_symbol.h"
#include <pin_map.h>
#include <sch_shape.h>
#include <pgm_base.h>
#include <sim/sim_model.h>
#include <sim/spice_generator.h>
#include <sim/sim_lib_mgr.h>
#include <trace_helpers.h>
#include <trigo.h>
#include <refdes_utils.h>
#include <wx/log.h>
#include <settings/settings_manager.h>
#include <sch_plotter.h>
#include <string_utils.h>
#include <geometry/geometry_utils.h>
#include <sch_rule_area.h>
#include <api/api_sch_utils.h>
#include <api/schematic/schematic_types.pb.h>
#include <project_sch.h>
#include <project/project_file.h>
#include <libraries/symbol_library_adapter.h>
#include <variant_symbol_utils.h>
#include <diff_merge/property_value_converter.h>
#include <utility>
#include <validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>

Go to the source code of this file.

Classes

class  SCH_SYMBOL_INSTANCE_PROPERTY
 
class  SCH_SYMBOL_FIELD_PROPERTY
 
class  SCH_SYMBOL_PIN_MAP_FOOTPRINT_PROPERTY
 Read-only property showing the footprint a symbol's pin map resolves against. More...
 
class  SCH_SYMBOL_PIN_MAP_MODE_PROPERTY
 Override-mode selector for a symbol's per-instance pin map. More...
 
class  SCH_SYMBOL_PIN_MAP_NAME_PROPERTY
 
class  SCH_SYMBOL_PIN_MAP_ENTRY_PROPERTY
 Read-only per-pin row of the effective pin->pad table. More...
 
struct  SCH_SYMBOL_DESC
 

Functions

static const ASSOCIATED_FOOTPRINTactiveAssociatedFootprint (const SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH *aPath=nullptr, const wxString &aVariant=wxEmptyString)
 
std::string toUTFTildaText (const wxString &txt)
 Convert a wxString to UTF8 and replace any control characters with a ~, where a control character is one of the first ASCII values up to ' ' 32d.
 
static void plotLocalPowerIcon (PLOTTER *aPlotter, const VECTOR2D &aPos, double aSize, bool aRotate)
 plot a local power pin indicator icon.
 

Variables

static const wxString PIN_MAP_GROUP = _HKI( "Pin Map" )
 
static const wxString PIN_MAP_FOOTPRINT_PROP = wxS( "Pin Map Footprint" )
 
static const wxString PIN_MAP_MODE_PROP = wxS( "Pin Map Mode" )
 
static const wxString PIN_MAP_NAME_PROP = wxS( "Pin Map Name" )
 
static const wxString PIN_MAP_TABLE_GROUP = _HKI( "Effective Pin Map" )
 
static const wxString PIN_MAP_ENTRY_PREFIX = wxS( "Pin " )
 
static struct SCH_SYMBOL_DESC _SCH_SYMBOL_DESC
 

Function Documentation

◆ activeAssociatedFootprint()

static const ASSOCIATED_FOOTPRINT * activeAssociatedFootprint ( const SCH_SYMBOL * aSymbol,
const SCH_SHEET_PATH * aPath = nullptr,
const wxString & aVariant = wxEmptyString )
static
Returns
the associated footprint the symbol's current footprint resolves to, or the first associated footprint when the footprint field matches none of them; nullptr when the symbol has none.

Definition at line 74 of file sch_symbol.cpp.

References FOOTPRINT, SCH_SYMBOL::GetField(), SCH_SYMBOL::GetLibSymbolRef(), and LIB_ID::Parse().

Referenced by SCH_SYMBOL_PIN_MAP_MODE_PROPERTY::setter(), SCH_SYMBOL_PIN_MAP_FOOTPRINT_PROPERTY::ValueForInstance(), and SCH_SYMBOL_PIN_MAP_NAME_PROPERTY::ValueForInstance().

◆ plotLocalPowerIcon()

static void plotLocalPowerIcon ( PLOTTER * aPlotter,
const VECTOR2D & aPos,
double aSize,
bool aRotate )
static

plot a local power pin indicator icon.

Definition at line 4426 of file sch_symbol.cpp.

References BEZIER, PLOTTER::BezierCurve(), SCH_SYMBOL::BuildLocalPowerIconShape(), CIRCLE, PLOTTER::Circle(), FILLED_SHAPE, and NO_FILL.

Referenced by SCH_SYMBOL::PlotLocalPowerIconShape().

◆ toUTFTildaText()

std::string toUTFTildaText ( const wxString & txt)

Convert a wxString to UTF8 and replace any control characters with a ~, where a control character is one of the first ASCII values up to ' ' 32d.

Definition at line 481 of file sch_symbol.cpp.

References TO_UTF8.

Referenced by SCH_IO_KICAD_LEGACY::saveSymbol(), and SCH_IO_KICAD_SEXPR::saveSymbol().

Variable Documentation

◆ _SCH_SYMBOL_DESC

struct SCH_SYMBOL_DESC _SCH_SYMBOL_DESC
static

◆ PIN_MAP_ENTRY_PREFIX

const wxString PIN_MAP_ENTRY_PREFIX = wxS( "Pin " )
static

Definition at line 66 of file sch_symbol.cpp.

Referenced by SCH_SYMBOL::GetDynamicProperties().

◆ PIN_MAP_FOOTPRINT_PROP

const wxString PIN_MAP_FOOTPRINT_PROP = wxS( "Pin Map Footprint" )
static

◆ PIN_MAP_GROUP

◆ PIN_MAP_MODE_PROP

const wxString PIN_MAP_MODE_PROP = wxS( "Pin Map Mode" )
static

◆ PIN_MAP_NAME_PROP

const wxString PIN_MAP_NAME_PROP = wxS( "Pin Map Name" )
static

◆ PIN_MAP_TABLE_GROUP

const wxString PIN_MAP_TABLE_GROUP = _HKI( "Effective Pin Map" )
static