49#include <wx/filename.h>
61 std::map<wxString, std::unique_ptr<LIB_SYMBOL>>
byCompDef;
73constexpr double STROKE_HEIGHT_TO_SIZE = 0.656;
74constexpr double TRUETYPE_HEIGHT_TO_SIZE = 0.585;
76constexpr double BUS_ENTRY_SIZE_MILS = 100.0;
83int toIU(
double aMils )
89int schX(
double aPcadX )
91 return toIU( aPcadX );
95int schY(
double aPcadY,
double aPageHeightMils )
97 return toIU( aPageHeightMils - aPcadY );
101int symX(
double aPcadX )
103 return toIU( aPcadX );
107int symY(
double aPcadY )
109 return -toIU( aPcadY );
113int normalizeDeg(
double aRotDeg )
115 int rot =
static_cast<int>( std::round( aRotDeg ) ) % 360;
126bool isAutoNetName(
const wxString& aName )
128 if( aName.IsEmpty() )
131 static wxRegEx autoNet( wxT(
"^(NET)?[0-9]+$" ), wxRE_ICASE );
133 return autoNet.Matches( aName );
137bool isAutoBusName(
const wxString& aName )
139 if( aName.IsEmpty() )
142 static wxRegEx autoBus( wxT(
"^BUS[0-9]+$" ), wxRE_ICASE );
144 return autoBus.Matches( aName );
213 int size = toIU( font.
height * ratio );
215 return size > 0 ? size : aDefault;
226 double widthMils = 10.0;
228 bool isItalic =
false;
239 int size = textSizeFromStyle( style, toIU( 100.0 * STROKE_HEIGHT_TO_SIZE ) );
243 if( !isBold && widthMils > 0 )
250 int rot = normalizeDeg( aItem.
rotation );
254 if( rot == 90 || rot == 270 )
261 if( rot == 180 || rot == 270 )
277 switch( normalizeDeg( aRotDeg ) )
290 if( aPcadType == wxT(
"Passive" ) || aPcadType == wxT(
"Pasive" ) )
293 if( aPcadType == wxT(
"Input" ) )
296 if( aPcadType == wxT(
"Output" ) )
299 if( aPcadType == wxT(
"Bidirectional" ) )
302 if( aPcadType == wxT(
"Power" ) )
305 if( aPcadType == wxT(
"ThreeState" ) )
308 if( aPcadType == wxT(
"OpenH" ) )
311 if( aPcadType == wxT(
"OpenL" ) )
324 if( inverted && clock )
342const VECTOR2D IEEE_BREAK( -1e9, -1e9 );
344std::vector<VECTOR2D> ieeePoints(
const IEEE_SYMBOL& aSym )
346 const double h = aSym.
height;
347 const double half = h / 2.0;
348 const double quarter = h / 4.0;
349 const double third = h / 3.0;
354 return { { h, h - quarter }, { h, h }, { 0, h }, { half, half }, { 0, 0 }, { h, 0 },
358 return { { 0, 0 }, { h, half }, { 0, h }, { 0, 0 } };
361 return { { 0, 0 }, { half, 0 }, { half, h }, { h, h }, { h, 0 }, { h + half, 0 },
362 { h + half, h }, { 2 * h, h }, { 2 * h, 0 }, { 2 * h + half, 0 } };
365 return { { 0, 0 }, { h, 0 }, IEEE_BREAK, { half, 0 }, { half, h }, IEEE_BREAK,
366 { 0, h }, { h, h } };
369 return { { 0, 0 }, { half, 0 }, { half, h }, { h, h }, { h, 0 }, { h + half, 0 } };
372 return { { 0, 0 }, { half + h, 0 }, { half + h, h }, { half, h }, { half, 0 },
373 IEEE_BREAK, { half + h, h }, { 2 * h, h } };
376 return { { 0, h }, { h, h }, IEEE_BREAK, { third, 0 }, { third, h }, IEEE_BREAK,
377 { 2 * third, 0 }, { 2 * third, h } };
388 double x = aPoint.
x * std::cos( rad ) - aPoint.
y * std::sin( rad );
389 double y = aPoint.
x * std::sin( rad ) + aPoint.
y * std::cos( rad );
394 return { x + aSym.
x, y + aSym.
y };
400template <
typename XFORM>
404 std::vector<SCH_SHAPE*> shapes;
405 std::vector<VECTOR2D> points = ieeePoints( aSym );
414 if( pt == IEEE_BREAK )
420 VECTOR2D world = ieeeTransform( pt, aSym );
427 shapes.push_back( poly );
442 circle->SetCenter( aXform( c.
x, c.
y ) );
444 shapes.push_back(
circle );
453template <
typename XFORM>
464 shape->SetCenter(
center );
472 shape->SetCenter(
center );
473 shape->SetStart( start );
500 const wxString& aName )
509 const wxString& aSymPinNum )
526 bool* aShowPinDes,
bool* aShowPinName )
528 const int defaultWidth = toIU( 10.0 );
532 if( ln.
pts.size() < 2 )
537 for(
const auto& [x, y] : ln.
pts )
538 shape->AddPoint(
VECTOR2I( symX( x ), symY( y ) ) );
542 mapLineStyle( ln.
style ) ) );
543 shape->SetUnit( aUnit );
547 for(
const ARC& arc : aDef.
arcs )
551 [](
double x,
double y )
553 return VECTOR2I( symX( x ), symY( y ) );
561 if( poly.
pts.size() < 3 )
566 for(
const auto& [x, y] : poly.
pts )
579 if(
text.text.IsEmpty() )
584 applyTextStyle( schText,
text, aPcad );
585 schText->SetUnit( aUnit );
592 [](
double x,
double y )
594 return VECTOR2I( symX( x ), symY( y ) );
602 const int pinTextSize = toIU( 50.0 );
608 int rot = normalizeDeg(
pin.rotation );
614 case 0: extX +=
pin.pinLength;
break;
615 case 90: extY +=
pin.pinLength;
break;
616 case 180: extX -=
pin.pinLength;
break;
617 case 270: extY -=
pin.pinLength;
break;
619 extX +=
pin.pinLength * std::cos( rot *
M_PI / 180.0 );
620 extY +=
pin.pinLength * std::sin( rot *
M_PI / 180.0 );
624 auto* schPin =
new SCH_PIN( aSymbol );
626 const COMP_PIN* compPin = aCompDef ? findCompPin( *aCompDef, aUnit,
pin.pinNum )
638 if( number.IsEmpty() )
639 number = !
pin.defaultPinDes.IsEmpty() ?
pin.defaultPinDes :
pin.pinDesText.text;
641 if( number.IsEmpty() )
647 schPin->SetNumber( number );
648 schPin->SetName(
name );
649 schPin->SetPosition(
VECTOR2I( symX( extX ), symY( extY ) ) );
650 schPin->SetLength( toIU(
pin.pinLength ) );
651 schPin->SetOrientation( pinOrientation(
pin.rotation ) );
652 schPin->SetShape( mapPinShape(
pin ) );
653 schPin->SetUnit( aUnit );
655 if( aCompDef && aCompDef->
isPower )
658 schPin->SetVisible(
false );
662 schPin->SetType( compPin ? mapPinType( compPin->
pinType )
666 schPin->SetNumberTextSize(
669 schPin->SetNameTextSize(
674 *aShowPinDes |=
pin.showPinDes;
677 *aShowPinName |=
pin.showPinName;
686 for(
const ATTR& attr : aDef.
attrs )
690 if( attr.name == wxT(
"RefDes" ) )
692 else if( attr.name == wxT(
"Type" ) || attr.name == wxT(
"Value" ) )
698 symY( attr.placement.y ) ) );
699 applyTextStyle( field, attr.placement, aPcad );
700 field->
SetVisible( attr.placement.isVisible );
710 name.Replace( wxT(
" " ), wxT(
"_" ) );
717wxString uniqueSymbolName(
const wxString& aName, std::set<wxString>& aUsedNames )
719 wxString
name = aName;
722 while( !aUsedNames.insert(
name ).second )
723 name = wxString::Format( wxT(
"%s_%d" ), aName, suffix++ );
732 const wxString& aLibName,
733 const wxString& aSymbolName )
737 sym->SetLibId(
LIB_ID( aLibName, aSymbolName ) );
740 bool showPinDes =
false;
741 bool showPinName =
false;
743 for(
int unit = 1; unit <= aDef.
numParts; unit++ )
750 const SYMBOL_DEF* symDef = symName.IsEmpty() ? nullptr
751 : findSymbolDef( aPcad, symName );
754 addSymbolDefToLibSymbol( sym, *symDef, &aDef, unit, aPcad, &showPinDes,
758 sym->SetShowPinNumbers( showPinDes );
759 sym->SetShowPinNames( showPinName );
772 sym->SetGlobalPower();
773 sym->GetReferenceField().SetText( wxT(
"#PWR" ) );
774 sym->GetReferenceField().SetVisible(
false );
784 name.Replace( wxT(
" " ), wxT(
"_" ) );
792 const wxString& aLibName,
793 const wxString& aSymbolName )
796 sym->SetLibId(
LIB_ID( aLibName, aSymbolName ) );
798 bool showPinDes =
false;
799 bool showPinName =
false;
801 addSymbolDefToLibSymbol( sym, aDef,
nullptr, 1, aPcad, &showPinDes, &showPinName );
803 sym->SetShowPinNumbers( showPinDes );
804 sym->SetShowPinNames( showPinName );
818 switch( normalizeDeg( aRotDeg ) )
831 std::set<wxString> usedNames;
832 std::set<wxString> attachedNames;
838 if( !attached.IsEmpty() )
839 attachedNames.insert( attached );
845 wxString
name = uniqueSymbolName( libSymbolName( cd ), usedNames );
847 store.
byCompDef[cd.
name].reset( buildLibSymbolFromCompDef( cd, aPcad, aLibName,
name ) );
854 if( attachedNames.count( sd.
name ) || attachedNames.count( sd.
originalName ) )
860 wxString
name = uniqueSymbolName( symbolDefDisplayName( sd ), usedNames );
863 buildLibSymbolFromSymbolDef( sd, aPcad, aLibName,
name ) );
870SPIN_STYLE spinFromRotation(
double aRotDeg,
bool aFlipped,
bool aVertical )
872 int rot = normalizeDeg( aRotDeg );
874 if( rot == 0 && aVertical )
901 if( aPortType.Contains( wxT(
"Dbl" ) ) )
904 if( aPortType.StartsWith( wxT(
"LeftAngle" ) ) || aPortType.StartsWith( wxT(
"RightAngle" ) ) )
940 libName = aSchematic->Project().GetProjectName();
942 if( libName.IsEmpty() )
943 libName = wxFileName( aFileName ).GetName();
945 if( libName.IsEmpty() )
946 libName = wxT(
"noname" );
948 libName += wxT(
"-pcad-import" );
957 const wxString& aLibName )
960 [aPageH](
double x,
double y )
962 return VECTOR2I( schX( x ), schY( y, aPageH ) );
968 for(
size_t i = 0; i + 1 < w.
pts.size(); i++ )
971 line->SetEndPoint( xform( w.
pts[i + 1].first, w.
pts[i + 1].second ) );
978 for(
size_t i = 0; i + 1 < b.
pts.size(); i++ )
981 line->SetEndPoint( xform( b.
pts[i + 1].first, b.
pts[i + 1].second ) );
990 if( label.
x != 0 || label.
y != 0 )
991 pos = xform( label.
x, label.
y );
993 pos = xform( b.
pts[0].first, b.
pts[0].second );
996 applyTextStyle( schLabel, label, aPcad );
997 schLabel->SetSpinStyle( spinFromRotation( label.
rotation, label.
isFlipped,
false ) );
998 aScreen->
Append( schLabel );
1008 int step = toIU( BUS_ENTRY_SIZE_MILS );
1014 if( e.
orient == wxT(
"Left" ) )
1017 towardBusIsX =
true;
1019 else if( e.
orient == wxT(
"Right" ) )
1022 towardBusIsX =
true;
1024 else if( e.
orient == wxT(
"Up" ) )
1028 towardBusIsX =
false;
1033 towardBusIsX =
false;
1036 const BUS* bus =
nullptr;
1051 [&](
const VECTOR2I& aEnd ) ->
bool
1053 for(
size_t i = 0; i + 1 < bus->
pts.size(); i++ )
1056 VECTOR2I c = xform( bus->
pts[i + 1].first, bus->
pts[i + 1].second );
1058 if( a.
x == c.
x && aEnd.x == a.
x
1059 && aEnd.y >= std::min( a.
y, c.
y ) && aEnd.y <= std::max( a.
y, c.
y ) )
1062 if( a.
y == c.
y && aEnd.y == a.
y
1063 && aEnd.x >= std::min( a.
x, c.
x ) && aEnd.x <= std::max( a.
x, c.
x ) )
1073 if( !touchesBus( pos + size ) && touchesBus( pos + altSize ) )
1078 entry->SetSize( size );
1079 aScreen->
Append( entry );
1093 label->SetShape( mapPortShape( p.
portType ) );
1095 p.
portType.EndsWith( wxT(
"_Vert" ) ) ) );
1096 label->SetTextSize(
VECTOR2I( toIU( 50.0 ), toIU( 50.0 ) ) );
1097 aScreen->
Append( label );
1101 std::set<wxString> labelledNets;
1113 pos = xform( w.
pts[0].first, w.
pts[0].second );
1116 applyTextStyle( label, w.
label, aPcad );
1118 aScreen->
Append( label );
1120 labelledNets.insert( w.
netName );
1130 if( isAutoNetName( j.
netName ) )
1134 label->SetTextSize(
VECTOR2I( toIU( 50.0 ), toIU( 50.0 ) ) );
1135 aScreen->
Append( label );
1137 labelledNets.insert( j.
netName );
1155 if( t.
text.IsEmpty() )
1159 applyTextStyle(
text, t, aPcad );
1165 if( ln.
pts.size() < 2 )
1170 for(
const auto& [x, y] : ln.
pts )
1175 aScreen->
Append( shape );
1178 for(
const ARC& arc : aSheet.
arcs )
1180 aScreen->
Append( buildArcShape( arc,
1181 arc.
width > 0 ? toIU( arc.
width ) : toIU( 10.0 ),
1189 for(
const auto& [x, y] : poly.
pts )
1192 shape->
AddPoint( xform( poly.
pts[0].first, poly.
pts[0].second ) );
1195 aScreen->
Append( shape );
1201 aScreen->
Append( shape );
1213 compInst = ciIt->second;
1215 wxString compRef = compInst->
compRef;
1219 compRef = aliasIt->second;
1224 compDef = cdIt->second;
1233 if( libIt != aLibSymbols.
byCompDef.end() )
1234 libSym = libIt->second.get();
1245 libSym = libIt->second.get();
1254 _(
"Symbol definition '%s' for '%s' not found." ),
1262 symbol->SetLibId( libSym->
GetLibId() );
1263 symbol->SetUnit( inst.
partNum );
1264 symbol->SetLibSymbol(
new LIB_SYMBOL( *libSym ) );
1265 symbol->SetPosition( xform( inst.
x, inst.
y ) );
1266 symbol->SetOrientation( symOrientation( inst.
rotation ) );
1269 symbol->SetMirrorY(
true );
1272 symbol->UpdateFields(
nullptr,
1284 if( attr.
name == wxT(
"RefDes" ) )
1286 else if( attr.
name == wxT(
"Value" ) || attr.
name == wxT(
"Type" ) )
1292 applyTextStyle( field, attr.
placement, aPcad );
1301 wxString val = !compInst->
value.IsEmpty() ? compInst->
value
1304 if( !val.IsEmpty() )
1321 aScreen->
Append( symbol );
1328 const std::map<std::string, UTF8>* aProperties )
1330 wxASSERT( !aFileName.IsEmpty() && aSchematic !=
nullptr );
1340 wxFileName newFilename( aFileName );
1345 wxCHECK_MSG( aSchematic->IsValid(),
nullptr,
1346 wxT(
"Can't append to a schematic with no root!" ) );
1347 rootSheet = aAppendToMe;
1354 rootSheet =
new SCH_SHEET( aSchematic );
1355 rootSheet->
SetFileName( newFilename.GetFullPath() );
1361 aSchematic->SetTopLevelSheets( { rootSheet } );
1387 page.
SetType( wxT(
"User" ) );
1398 const wxString libName =
getLibName( aSchematic, aFileName );
1404 std::vector<SCH_SCREEN*> screens;
1406 if( pcad.
sheets.empty() )
1408 screens.push_back( rootSheet->
GetScreen() );
1413 screens.push_back( rootSheet->
GetScreen() );
1415 if( !pcad.
sheets[0].name.IsEmpty() )
1418 const int sheetSymbolStep = toIU( 1500.0 );
1421 std::set<wxString> usedFileNames;
1423 for(
size_t i = 1; i < pcad.
sheets.size(); i++ )
1427 auto* subSheet =
new SCH_SHEET( aSchematic );
1428 auto* subScreen =
new SCH_SCREEN( aSchematic );
1430 wxString sheetName = psheet.
name;
1432 if( sheetName.IsEmpty() )
1433 sheetName = wxString::Format( wxT(
"Sheet%d" ), psheet.
sheetNum );
1439 for( wxUniChar c : sheetName )
1440 fileBase += wxIsalnum( c ) ? c : wxUniChar(
'_' );
1442 fileBase = uniqueSymbolName( fileBase, usedFileNames );
1444 wxFileName subFilename( newFilename );
1445 subFilename.SetName( subFilename.GetName() + wxT(
"-" ) + fileBase );
1447 subScreen->SetFileName( subFilename.GetFullPath() );
1448 subSheet->SetScreen( subScreen );
1449 subSheet->SetName( sheetName );
1450 subSheet->SetFileName( subFilename.GetFullName() );
1452 subSheet->SetPosition(
VECTOR2I( toIU( 1000.0 ),
1453 toIU( 1000.0 ) + sheetIndex * sheetSymbolStep ) );
1454 subSheet->SetSize(
VECTOR2I( toIU( 1000.0 ), toIU( 500.0 ) ) );
1458 screens.push_back( subScreen );
1470 [&fields](
const wxString& aName ) -> wxString
1472 auto it = fields.find( aName );
1473 return it == fields.end() ? wxString() : it->second;
1476 titleBlock.
SetTitle( get( wxT(
"Title" ) ) );
1477 titleBlock.
SetDate( get( wxT(
"Date" ) ) );
1478 titleBlock.
SetRevision( get( wxT(
"Revision" ) ) );
1480 wxString company = get( wxT(
"Company Name" ) );
1482 if( company.IsEmpty() )
1483 company = get( wxT(
"Organization" ) );
1487 for(
const wxChar*
name : { wxT(
"Author" ), wxT(
"Drawn By" ), wxT(
"Checked By" ),
1488 wxT(
"Approved By" ), wxT(
"Engineer" ),
1489 wxT(
"Drawing Number" ) } )
1491 wxString value = get(
name );
1493 if( !value.IsEmpty() && commentIdx < 9 )
1494 titleBlock.
SetComment( commentIdx++, wxString(
name ) + wxT(
": " ) + value );
1498 for(
size_t i = 0; i < screens.size(); i++ )
1500 screens[i]->SetPageSettings( page );
1501 screens[i]->SetTitleBlock( titleBlock );
1503 if( i < pcad.
sheets.size() )
1509 aSchematic->RefreshHierarchy();
1513 wxString projectName = aSchematic->Project().GetProjectName();
1515 if( projectName.IsEmpty() )
1516 projectName = wxFileName( aFileName ).GetName();
1532 wxFileName fn( aLibraryPath );
1533 long long timestamp = fn.FileExists() ? fn.GetModificationTime().GetValue().GetValue() : 0;
1547 for(
auto& [key, sym] : store.
byCompDef )
1548 m_libCache[sym->GetName()] = std::move( sym );
1551 m_libCache[sym->GetName()] = std::move( sym );
1570 const wxString& aLibraryPath,
1571 const std::map<std::string, UTF8>* aProperties )
1576 aSymbolNameList.Add(
name );
1581 const wxString& aLibraryPath,
1582 const std::map<std::string, UTF8>* aProperties )
1587 aSymbolList.push_back( sym.get() );
1592 const std::map<std::string, UTF8>* aProperties )
1598 return it ==
m_libCache.end() ? nullptr : it->second.get();
constexpr EDA_IU_SCALE schIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
void SetFillMode(FILL_T aFill)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
virtual void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
virtual void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
REPORTER * m_reporter
Reporter to log errors/warnings to, may be nullptr.
A logical library item identifier and consists of various portions much like a URI.
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, bool aLib)
Replace illegal LIB_ID item name characters with underscores '_'.
Define a library symbol object.
const LIB_ID & GetLibId() const override
SCH_FIELD & GetValueField()
Return reference to the value field.
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
Describe the page size and margins of a paper page on which to eventually print or plot.
bool SetType(PAGE_SIZE_TYPE aPageSize, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
void SetHeightMils(double aHeightInMils)
double GetHeightMils() const
void SetWidthMils(double aWidthInMils)
void LoadFromFile(const wxString &aFilename, SCHEMATIC &aSchematic)
Class for a wire to bus entry.
void SetPosition(const VECTOR2I &aPosition) override
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aPartName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
static wxString getLibName(const ::SCHEMATIC *aSchematic, const wxString &aFileName)
long long m_cacheTimestamp
void ensureLoadedLibrary(const wxString &aLibraryPath)
Parse the library file once and serve cache-owned symbols, invalidated by path or file timestamp chan...
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load information from some input file format that this SCH_IO implementation knows about,...
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
void populateScreen(SCH_SCREEN *aScreen, const PCAD_SCH::SHEET &aSheet, const PCAD_SCH::SCHEMATIC &aPcad, double aPageH, const LIB_SYMBOL_STORE &aLibSymbols, const wxString &aLibName)
std::map< wxString, std::unique_ptr< LIB_SYMBOL > > m_libCache
SCH_IO(const wxString &aName)
virtual void SetUnit(int aUnit)
Segment description base class to describe items which have 2 end points (track, wire,...
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
void SetStroke(const STROKE_PARAMS &aStroke) override
void AddPoint(const VECTOR2I &aPosition)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void AddNewSymbolInstances(const SCH_SHEET_PATH &aPrefixSheetPath, const wxString &aProjectName)
Attempt to add new symbol instances for all symbols in this list of sheet paths prefixed with aPrefix...
void SetInitialPageNumbers()
Set initial sheet page numbers.
bool AllSheetPageNumbersEmpty() const
Check all of the sheet instance for empty page numbers.
void AddNewSheetInstances(const SCH_SHEET_PATH &aPrefixSheetPath, int aLastVirtualPageNumber)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetFileName(const wxString &aFilename)
void SetName(const wxString &aName)
SCH_SCREEN * GetScreen() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
Simple container to manage line stroke parameters.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
void SetRevision(const wxString &aRevision)
void SetComment(int aIdx, const wxString &aComment)
void SetTitle(const wxString &aTitle)
void SetCompany(const wxString &aCompany)
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
@ FILLED_SHAPE
Fill with object color.
static const std::string KiCadSchematicFileExtension
SCH_LAYER_ID
Eeschema drawing layers.
bool FileMatchesFormat(const wxString &aFileName, const std::string &aSection)
Check that a file is ACCEL_ASCII and, when aSection is not empty, that it contains the given section ...
const double TRUETYPE_HEIGHT_TO_SIZE
const double STROKE_HEIGHT_TO_SIZE
std::chrono::steady_clock clock
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
@ PT_INPUT
usual pin input: must be connected
@ PT_TRISTATE
tri state bus pin
@ PT_BIDI
input or output (like port for a microprocessor)
@ PT_OPENEMITTER
pin type open emitter
@ PT_OPENCOLLECTOR
pin type open collector
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
@ PT_UNSPECIFIED
unknown electrical properties: creates always a warning when connected
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
PIN_ORIENTATION
The symbol library pin object orientations.
@ PIN_UP
The pin extends upwards from the connection point: Probably on the bottom side of the symbol.
@ PIN_RIGHT
The pin extends rightwards from the connection point.
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
@ PIN_DOWN
The pin extends downwards from the connection: Probably on the top side of the symbol.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
LINE_STYLE
Dashed line types.
std::map< wxString, std::unique_ptr< LIB_SYMBOL > > bySymbolDef
std::map< wxString, std::unique_ptr< LIB_SYMBOL > > byCompDef
Center/radius/angles form; triplePointArc is converted at parse time.
std::vector< std::pair< double, double > > pts
std::vector< wxString > attachedSymbols
std::vector< COMP_PIN > compPins
A (compPin "padDes" ...) inside a compDef, mapping a symbol pin ordinal to the physical pad designato...
A placed title-block field whose name references the fieldDef holding the displayed text.
One font description inside a (textStyleDef ...).
std::vector< std::pair< double, double > > pts
wxString outsideEdgeStyle
std::vector< std::pair< double, double > > pts
std::map< wxString, const COMP_DEF * > compDefsByName
std::map< wxString, const COMP_INST * > compInstsByRef
std::vector< SHEET > sheets
std::vector< SYMBOL_DEF > symbolDefs
const TEXT_STYLE * FindTextStyle(const wxString &aName) const
std::map< wxString, wxString > compAliases
compAlias name -> compDef name
std::vector< COMP_DEF > compDefs
std::map< wxString, const SYMBOL_DEF * > symbolDefsByName
std::vector< PORT > ports
std::vector< BUS_ENTRY > busEntries
std::vector< WIRE > wires
std::vector< JUNCTION > junctions
std::vector< POLY > polys
std::vector< TEXT_ITEM > texts
std::vector< LINE > lines
std::vector< FIELD_PLACEMENT > fields
std::vector< IEEE_SYMBOL > ieeeSymbols
std::vector< SYMBOL_INST > symbols
std::vector< POLY > polys
std::vector< ATTR > attrs
std::vector< TEXT_ITEM > texts
std::vector< IEEE_SYMBOL > ieeeSymbols
std::vector< LINE > lines
std::vector< ATTR > attrs
const FONT & EffectiveFont() const
std::map< wxString, wxString > fields
std::vector< std::pair< double, double > > pts
SYMBOL_ORIENTATION_T
enum used in RotationMiroir()
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
constexpr GR_TEXT_H_ALIGN_T GetFlippedAlignment(GR_TEXT_H_ALIGN_T aAlign)
Get the reverse alignment: left-right are swapped, others are unchanged.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
Definition of file extensions used in Kicad.