KiCad PCB EDA Suite
Loading...
Searching...
No Matches
easypc_sch_builder.cpp File Reference
#include <sch_io/easypc/easypc_sch_builder.h>
#include <sch_io/easypc/easypc_sch_items.h>
#include <algorithm>
#include <climits>
#include <cmath>
#include <numeric>
#include <utility>
#include <io/easypc/easypc_classes_connectivity.h>
#include <io/easypc/easypc_classes_geometry.h>
#include <io/easypc/easypc_classes_geometry_pad.h>
#include <io/easypc/easypc_classes_library.h>
#include <io/easypc/easypc_classes_root.h>
#include <io/easypc/easypc_classes_styles.h>
#include <io/easypc/easypc_design_settings.h>
#include <io/easypc/easypc_document.h>
#include <io/easypc/easypc_text_metrics.h>
#include <io/easypc/easypc_units.h>
#include <bus_alias.h>
#include <geometry/seg.h>
#include <lib_id.h>
#include <lib_symbol.h>
#include <page_info.h>
#include <reporter.h>
#include <sch_bus_entry.h>
#include <sch_junction.h>
#include <sch_label.h>
#include <sch_line.h>
#include <sch_no_connect.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 <string_utils.h>
#include <transform.h>
#include <wx/regex.h>

Go to the source code of this file.

Classes

struct  EASYPC::VALUE_LINE
 One line of the text a value position shows. More...
 

Namespaces

namespace  EASYPC
 

Functions

bool EASYPC::IsNamedNet (const wxString &aName)
 True unless aName is an automatic net name (N or n and digits, an optional !sheet! suffix)
 
static POINT32 EASYPC::placePoint (const SOURCE_SYMBOL_INSTANCE &aInst, const SOURCE_SYMBOL &aSym, const POINT32 &aLocal)
 Symbol point to design point: subtract the symbol origin, mirror in X, rotate anticlockwise, add the position.
 
static bool EASYPC::isDrawn (const SOURCE_SYMBOL_INSTANCE &aInst)
 Gates the import draws: placed ones, and unplaced ones whose pins are still on nets.
 
static const SOURCE_NET * EASYPC::netOf (const OBJECT *aNode)
 
static const SOURCE_TEXT_STYLE * EASYPC::defaultTextStyle (const SOURCE_DESIGN &aDesign)
 
static std::vector< const SOURCE_ATTRIBUTE * > EASYPC::partAttributes (const SOURCE_COMPONENT_INSTANCE &aComp, const SOURCE_COMPONENT &aPart)
 Package attributes then the instance's own, an instance attribute overriding the package's of the same name.
 
static wxString EASYPC::attributeValue (const SOURCE_COMPONENT_INSTANCE &aComp, const SOURCE_COMPONENT &aPart, const wxString &aName)
 The value of the part's first attribute named aName, or empty.
 
static std::vector< VALUE_LINE > EASYPC::valueLines (const SOURCE_VALUE_POSITION &aVp, const SOURCE_COMPONENT_INSTANCE &aComp, const SOURCE_COMPONENT &aPart, const SOURCE_SYMBOL_INSTANCE &aInst)
 
static wxString EASYPC::joinLines (const std::vector< VALUE_LINE > &aLines)
 
static int32_t EASYPC::floorTo (int64_t aValue, int32_t aGrid)
 
static TRANSFORM EASYPC::placementTransform (int32_t aAngle, bool aMirrored)
 KiCad transform for a stored placement: mirror in X, then rotate anticlockwise (Y up)
 
static bool EASYPC::isScmOnly (const SOURCE_COMPONENT &aPart)
 Schematic-only part: no package, an empty package name, or no gate pin mapped to a pad.
 
static SOURCE_TEXT_POSITION EASYPC::placedText (const SOURCE_SYMBOL_INSTANCE &aInst, const SOURCE_SYMBOL &aSym, const SOURCE_TEXT_POSITION &aLocal)
 A symbol-local text position placed on the sheet with the instance transform.
 
static bool EASYPC::collinearOverlap (const SEG &aA, const SEG &aB)
 Two segments on one line sharing more than a point.
 
static SPIN_STYLE EASYPC::labelSpin (const SOURCE_NET_NAME &aName, const SOURCE_NODE &aNode, const wxString &aText)
 Label orientation from the stored text rotation and alignment, judged by the middle of the text.
 

Variables

static constexpr int32_t EASYPC::SHEET_ORIGIN_GRID = 25400
 The sheet origin snaps to 0.1 inch, keeping items on Easy-PC grids on KiCad's 50 mil grid.
 
static constexpr int32_t EASYPC::PAGE_MARGIN = static_cast<int32_t>( PAGE_MARGIN_MM * 10000 )
 
static constexpr int32_t EASYPC::DETOUR = 10
 Offset that keeps a wire off another net's connection point, far below drawing resolution.