KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_io_pads.cpp File Reference
#include <sch_io/pads/sch_io_pads.h>
#include <sch_io/pads/pads_sch_parser.h>
#include <sch_io/pads/pads_sch_symbol_builder.h>
#include <sch_io/pads/pads_sch_schematic_builder.h>
#include <lib_symbol.h>
#include <page_info.h>
#include <sch_junction.h>
#include <sch_label.h>
#include <sch_line.h>
#include <sch_pin.h>
#include <sch_screen.h>
#include <sch_shape.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <sch_symbol.h>
#include <sch_text.h>
#include <schematic.h>
#include <schematic_settings.h>
#include <wildcards_and_files_ext.h>
#include <math/util.h>
#include <stroke_params.h>
#include <advanced_config.h>
#include <io/pads/pads_common.h>
#include <locale_io.h>
#include <progress_reporter.h>
#include <reporter.h>
#include <fstream>
#include <map>
#include <set>
#include <wx/log.h>

Go to the source code of this file.

Functions

static std::string stripGateSuffix (const std::string &aRef)
 Strip any alphabetic gate suffix (e.g.
 
static SCH_TEXTcreateSchText (const PADS_SCH::TEXT_ITEM &aText, const VECTOR2I &aPos)
 
static int computePowerOrientation (const std::string &aOpcId, const std::vector< PADS_SCH::SCH_SIGNAL > &aSignals, const VECTOR2I &aOpcPos, bool aPinUp, int aPageHeightIU)
 Determine the orientation for a power symbol at an OPC position based on the wire direction at that point.
 

Function Documentation

◆ computePowerOrientation()

static int computePowerOrientation ( const std::string & aOpcId,
const std::vector< PADS_SCH::SCH_SIGNAL > & aSignals,
const VECTOR2I & aOpcPos,
bool aPinUp,
int aPageHeightIU )
static

Determine the orientation for a power symbol at an OPC position based on the wire direction at that point.

All power symbols are drawn with their pin at (0,0). Ground-style symbols have their body below the pin (pin_up=false), while VCC-style symbols have their body above the pin (pin_up=true). We orient the symbol so its body faces away from the wire.

Definition at line 147 of file sch_io_pads.cpp.

References std::abs(), KiROUND(), schIUScale, SYM_ORIENT_0, SYM_ORIENT_180, SYM_ORIENT_270, SYM_ORIENT_90, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_IO_PADS::LoadSchematicFile().

◆ createSchText()

◆ stripGateSuffix()

static std::string stripGateSuffix ( const std::string & aRef)
static

Strip any alphabetic gate suffix (e.g.

"-A", ".B") from a PADS reference designator, returning the base refdes that matches the PCB footprint naming convention.

Definition at line 60 of file sch_io_pads.cpp.

Referenced by SCH_IO_PADS::LoadSchematicFile().