27 #define wxUSE_BASE64 1 28 #include <wx/base64.h> 29 #include <wx/mstream.h> 57 #include <schematic_lexer.h> 64 using namespace TSCHEMATIC_T;
67 #define SCH_PARSE_ERROR( text, reader, pos ) \ 68 THROW_PARSE_ERROR( text, reader.GetSource(), reader.Line(), \ 69 reader.LineNumber(), pos - reader.Line() ) 79 wxCHECK_RET( aItem && aItem->
IsFillable(),
"Invalid fill item." );
88 default: fillType =
"none";
91 aFormatter.
Print( aNestLevel,
"(fill (type %s))", fillType );
100 return SCHEMATIC_LEXER::TokenName( T_input );
103 return SCHEMATIC_LEXER::TokenName( T_output );
106 return SCHEMATIC_LEXER::TokenName( T_bidirectional );
109 return SCHEMATIC_LEXER::TokenName( T_tri_state );
112 return SCHEMATIC_LEXER::TokenName( T_passive );
115 return SCHEMATIC_LEXER::TokenName( T_free );
118 return SCHEMATIC_LEXER::TokenName( T_unspecified );
121 return SCHEMATIC_LEXER::TokenName( T_power_in );
124 return SCHEMATIC_LEXER::TokenName( T_power_out );
127 return SCHEMATIC_LEXER::TokenName( T_open_collector );
130 return SCHEMATIC_LEXER::TokenName( T_open_emitter );
133 return SCHEMATIC_LEXER::TokenName( T_no_connect );
136 wxFAIL_MSG(
"Missing symbol library pin connection type" );
148 return SCHEMATIC_LEXER::TokenName( T_line );
151 return SCHEMATIC_LEXER::TokenName( T_inverted );
154 return SCHEMATIC_LEXER::TokenName( T_clock );
157 return SCHEMATIC_LEXER::TokenName( T_inverted_clock );
160 return SCHEMATIC_LEXER::TokenName( T_input_low );
163 return SCHEMATIC_LEXER::TokenName( T_clock_low );
166 return SCHEMATIC_LEXER::TokenName( T_output_low );
169 return SCHEMATIC_LEXER::TokenName( T_edge_clock_high );
172 return SCHEMATIC_LEXER::TokenName( T_non_logic );
175 wxFAIL_MSG(
"Missing symbol library pin shape type" );
184 switch( aOrientation )
190 default: wxFAIL_MSG(
"Missing symbol library pin orientation type" );
return 0.0;
204 default: wxFAIL;
return SCHEMATIC_LEXER::TokenName( T_passive );
220 default: wxFAIL; retv = 0.0;
break;
237 default: token =
"solid";
break;
248 case SCH_TEXT_T:
return SCHEMATIC_LEXER::TokenName( T_text );
249 case SCH_LABEL_T:
return SCHEMATIC_LEXER::TokenName( T_label );
251 case SCH_HIER_LABEL_T:
return SCHEMATIC_LEXER::TokenName( T_hierarchical_label );
252 default: wxFAIL;
return SCHEMATIC_LEXER::TokenName( T_text );
272 wxASSERT( aFormatter !=
nullptr );
274 aFormatter->
Print( aNestLevel,
"(stroke (width %s) (type %s) (color %d %d %d %s))",
309 int aNestLevel = 0 );
311 int aNestLevel = 0 );
313 int aNestLevel = 0 );
316 int aNestLevel = 0 );
318 int aNestLevel = 0 );
341 void AddSymbol(
const LIB_PART* aPart );
343 void DeleteSymbol(
const wxString& aName );
346 wxFileName GetRealFile()
const;
348 wxDateTime GetLibModificationTime();
350 bool IsFile(
const wxString& aFullPathAndFileName )
const;
352 bool IsFileChanged()
const;
354 void SetModified(
bool aModified =
true ) { m_isModified = aModified; }
358 void SetFileName(
const wxString& aFileName ) { m_libFileName = aFileName; }
360 wxString
GetFileName()
const {
return m_libFileName.GetFullPath(); }
363 int aNestLevel = 0,
const wxString& aLibName = wxEmptyString );
382 m_rootSheet =
nullptr;
383 m_props = aProperties;
384 m_schematic = aSchematic;
393 wxASSERT( !aFileName || aSchematic !=
nullptr );
398 wxFileName fn = aFileName;
403 wxASSERT( fn.IsAbsolute() );
412 if( !normedFn.IsAbsolute() )
414 if( aFileName.Right( normedFn.GetFullPath().Length() ) == normedFn.GetFullPath() )
415 m_path = aFileName.Left( aFileName.Length() - normedFn.GetFullPath().Length() );
418 if( m_path.IsEmpty() )
428 m_currentPath.push( m_path );
429 init( aSchematic, aProperties );
431 if( aAppendToMe ==
NULL )
434 std::unique_ptr<SCH_SHEET> newSheet = std::make_unique<SCH_SHEET>( aSchematic );
436 wxFileName relPath( aFileName );
441 newSheet->SetFileName( relPath.GetFullPath() );
442 m_rootSheet = newSheet.get();
443 loadHierarchy( newSheet.get() );
446 sheet = newSheet.release();
447 m_rootSheet =
nullptr;
451 wxCHECK_MSG( aSchematic->
IsValid(),
nullptr,
"Can't append to a schematic with no root!" );
452 m_rootSheet = &aSchematic->
Root();
454 loadHierarchy( sheet );
457 wxASSERT( m_currentPath.size() == 1 );
476 if( !fileName.IsAbsolute() )
477 fileName.MakeAbsolute( m_currentPath.top() );
483 m_currentPath.push( fileName.GetPath() );
487 m_rootSheet->SearchHierarchy( fileName.GetFullPath(), &screen );
502 loadFile( fileName.GetFullPath(), aSheet );
507 if( aSheet == m_rootSheet )
511 if( !m_error.IsEmpty() )
514 m_error += ioe.
What();
522 auto sheet = static_cast<SCH_SHEET*>( aItem );
525 loadHierarchy( sheet );
559 wxCHECK_RET( aSheet !=
NULL,
"NULL SCH_SHEET object." );
560 wxCHECK_RET( !aFileName.IsEmpty(),
"No schematic file name defined." );
564 init( aSchematic, aProperties );
566 wxFileName fn = aFileName;
570 wxASSERT( fn.IsAbsolute() );
582 wxCHECK_RET( aSheet !=
NULL,
"NULL SCH_SHEET* object." );
583 wxCHECK_RET( m_schematic !=
NULL,
"NULL SCHEMATIC* object." );
589 m_out->Print( 0,
"(kicad_sch (version %d) (generator eeschema)\n\n",
593 m_out->Print( 0,
"\n" );
597 m_out->Print( 1,
"(lib_symbols\n" );
602 m_out->Print( 1,
")\n\n" );
606 saveBusAlias( alias, 1 );
615 std::multiset<
SCH_ITEM*, decltype( cmp )> save_map( cmp );
618 save_map.insert( item );
625 if( itemType != item->Type() )
627 itemType = item->Type();
632 m_out->Print( 0,
"\n" );
635 switch( item->Type() )
638 m_out->Print( 0,
"\n" );
639 saveSymbol( static_cast<SCH_COMPONENT*>( item ),
nullptr, 1 );
643 saveBitmap( static_cast<SCH_BITMAP*>( item ), 1 );
647 m_out->Print( 0,
"\n" );
648 saveSheet( static_cast<SCH_SHEET*>( item ), 1 );
652 saveJunction( static_cast<SCH_JUNCTION*>( item ), 1 );
656 saveNoConnect( static_cast<SCH_NO_CONNECT*>( item ), 1 );
661 saveBusEntry( static_cast<SCH_BUS_ENTRY_BASE*>( item ), 1 );
665 if( layer != item->GetLayer() )
669 layer = item->GetLayer();
673 layer = item->GetLayer();
674 m_out->Print( 0,
"\n" );
678 saveLine( static_cast<SCH_LINE*>( item ), 1 );
685 saveText( static_cast<SCH_TEXT*>( item ), 1 );
689 wxASSERT(
"Unexpected schematic object type in SCH_SEXPR_PLUGIN::Format()" );
698 m_out->Print( 0,
"\n" );
699 m_out->Print( 1,
"(sheet_instances\n" );
705 wxCHECK2( sheet,
continue );
707 m_out->Print( 2,
"(path %s (page %s))\n",
708 m_out->Quotew( sheetPath.PathAsString() ).c_str(),
709 m_out->Quotew( sheet->
GetPageNumber( sheetPath ) ).c_str() );
712 m_out->Print( 1,
")\n" );
713 m_out->Print( 0,
"\n" );
714 m_out->Print( 1,
"(symbol_instances\n" );
720 sheetPath.GetSymbols( instances,
true,
true );
723 for(
size_t i = 0; i < instances.
GetCount(); i++ )
725 m_out->Print( 2,
"(path %s\n",
726 m_out->Quotew( instances[i].GetPath() ).c_str() );
727 m_out->Print( 3,
"(reference %s) (unit %d) (value %s) (footprint %s)\n",
728 m_out->Quotew( instances[i].GetRef() ).c_str(),
729 instances[i].GetUnit(),
730 m_out->Quotew( instances[i].GetValue() ).c_str(),
731 m_out->Quotew( instances[i].GetFootprint() ).c_str() );
732 m_out->Print( 2,
")\n" );
736 m_out->Print( 1,
")\n" );
745 m_out->Print( 0,
"\n" );
746 m_out->Print( 1,
"(sheet_instances\n" );
750 m_out->Print( 2,
"(path %s (page %s))\n",
755 m_out->Print( 1,
")\n" );
760 m_out->Print( 0,
"\n" );
761 m_out->Print( 1,
"(symbol_instances\n" );
765 m_out->Print( 2,
"(path %s (reference %s) (unit %d))\n",
771 m_out->Print( 1,
")\n" );
775 m_out->Print( 0,
")\n" );
782 wxCHECK( aSelection && aFormatter, );
790 std::map<wxString, LIB_PART*> libSymbols;
793 for( i = 0; i < aSelection->
GetSize(); ++i )
795 item = dynamic_cast<SCH_ITEM*>( aSelection->
GetItem( i ) );
797 wxCHECK2( item,
continue );
802 SCH_COMPONENT* symbol = dynamic_cast<SCH_COMPONENT*>( item );
804 wxCHECK2( symbol,
continue );
814 libSymbols[ libSymbolLookup ] = it->second;
817 if( !libSymbols.empty() )
819 m_out->Print( 0,
"(lib_symbols\n" );
821 for(
auto libSymbol : libSymbols )
824 m_out->Print( 0,
")\n\n" );
827 for( i = 0; i < aSelection->
GetSize(); ++i )
831 switch( item->
Type() )
834 saveSymbol( static_cast<SCH_COMPONENT*>( item ), aSheetPath, 0 );
838 saveBitmap( static_cast< SCH_BITMAP* >( item ), 0 );
842 saveSheet( static_cast< SCH_SHEET* >( item ), 0 );
846 saveJunction( static_cast< SCH_JUNCTION* >( item ), 0 );
850 saveNoConnect( static_cast< SCH_NO_CONNECT* >( item ), 0 );
855 saveBusEntry( static_cast< SCH_BUS_ENTRY_BASE* >( item ), 0 );
859 saveLine( static_cast< SCH_LINE* >( item ), 0 );
866 saveText( static_cast< SCH_TEXT* >( item ), 0 );
870 wxASSERT(
"Unexpected schematic object type in SCH_SEXPR_PLUGIN::Format()" );
879 wxCHECK_RET( aSymbol !=
nullptr && m_out !=
nullptr,
"" );
882 wxArrayString reference_fields;
884 static wxString delimiters( wxT(
" " ) );
888 if( part_name.size() )
894 libName =
"_NONAME_";
909 m_out->Print( aNestLevel,
"(symbol" );
913 m_out->Print( 0,
" (lib_name %s)",
917 m_out->Print( 0,
" (lib_id %s) (at %s %s %s)",
926 if( mirrorX || mirrorY )
928 m_out->Print( 0,
" (mirror" );
931 m_out->Print( 0,
" x" );
934 m_out->Print( 0,
" y" );
936 m_out->Print( 0,
")" );
943 else if( aSheetPath !=
nullptr )
946 m_out->Print( 0,
" (unit %d)", unit );
948 if( aSymbol->
GetConvert() == LIB_ITEM::LIB_CONVERT::DEMORGAN )
949 m_out->Print( 0,
" (convert %d)", aSymbol->
GetConvert() );
951 m_out->Print( 0,
"\n" );
953 m_out->Print( aNestLevel + 1,
"(in_bom %s)", ( aSymbol->
GetIncludeInBom() ) ?
"yes" :
"no" );
954 m_out->Print( 0,
" (on_board %s)", ( aSymbol->
GetIncludeOnBoard() ) ?
"yes" :
"no" );
956 m_out->Print( 0,
"\n" );
964 saveField( &field, aNestLevel + 1 );
969 if( pin->GetAlt().IsEmpty() )
971 m_out->Print( aNestLevel + 1,
"(pin %s (uuid %s))\n",
972 m_out->Quotew( pin->GetNumber() ).c_str(),
973 TO_UTF8( pin->m_Uuid.AsString() ) );
977 m_out->Print( aNestLevel + 1,
"(pin %s (uuid %s) (alternate %s))\n",
978 m_out->Quotew( pin->GetNumber() ).c_str(),
979 TO_UTF8( pin->m_Uuid.AsString() ),
980 m_out->Quotew( pin->GetAlt() ).c_str() );
984 m_out->Print( aNestLevel,
")\n" );
990 wxCHECK_RET( aField !=
nullptr && m_out !=
nullptr,
"" );
992 wxString fieldName = aField->
GetName();
1007 if( aField->
GetId() == -1 )
1009 aField->
SetId( m_fieldId );
1013 m_out->Print( aNestLevel,
"(property %s %s (id %d) (at %s %s %s)",
1014 m_out->Quotew( fieldName ).c_str(),
1015 m_out->Quotew( aField->
GetText() ).c_str(),
1024 m_out->Print( 0,
"\n" );
1025 aField->
Format( m_out, aNestLevel, 0 );
1026 m_out->Print( aNestLevel,
")\n" );
1030 m_out->Print( 0,
")\n" );
1037 wxCHECK_RET( aBitmap !=
nullptr && m_out !=
nullptr,
"" );
1041 wxCHECK_RET( image !=
NULL,
"wxImage* is NULL" );
1043 m_out->Print( aNestLevel,
"(image (at %s %s)",
1050 m_out->Print( 0,
"\n" );
1054 m_out->Print( aNestLevel + 1,
"(data" );
1056 wxMemoryOutputStream stream;
1058 image->SaveFile( stream, wxBITMAP_TYPE_PNG );
1061 wxStreamBuffer* buffer = stream.GetOutputStreamBuffer();
1062 wxString out = wxBase64Encode( buffer->GetBufferStart(), buffer->GetBufferSize() );
1066 #define MIME_BASE64_LENGTH 76 1070 while( first < out.Length() )
1072 m_out->Print( 0,
"\n" );
1077 m_out->Print( 0,
"\n" );
1078 m_out->Print( aNestLevel + 1,
")\n" );
1079 m_out->Print( aNestLevel,
")\n" );
1085 wxCHECK_RET( aSheet !=
nullptr && m_out !=
nullptr,
"" );
1087 m_out->Print( aNestLevel,
"(sheet (at %s %s) (size %s %s)\n",
1099 m_out->Print( 0,
"\n" );
1101 m_out->Print( aNestLevel + 1,
"(fill (color %d %d %d %0.4f))\n",
1113 saveField( &field, aNestLevel + 1 );
1118 m_out->Print( aNestLevel + 1,
"(pin %s %s (at %s %s %s)\n",
1125 pin->Format( m_out, aNestLevel + 1, 0 );
1127 m_out->Print( aNestLevel + 2,
"(uuid %s)\n",
TO_UTF8( pin->m_Uuid.AsString() ) );
1129 m_out->Print( aNestLevel + 1,
")\n" );
1132 m_out->Print( aNestLevel,
")\n" );
1138 wxCHECK_RET( aJunction !=
nullptr && m_out !=
nullptr,
"" );
1140 m_out->Print( aNestLevel,
"(junction (at %s %s) (diameter %s) (color %d %d %d %s))\n",
1153 wxCHECK_RET( aNoConnect !=
nullptr && m_out !=
nullptr,
"" );
1155 m_out->Print( aNestLevel,
"(no_connect (at %s %s) (uuid %s))\n",
1164 wxCHECK_RET( aBusEntry !=
nullptr && m_out !=
nullptr,
"" );
1167 if( aBusEntry->
GetClass() ==
"SCH_BUS_BUS_ENTRY" )
1172 saveLine( &busEntryLine, aNestLevel );
1176 m_out->Print( aNestLevel,
"(bus_entry (at %s %s) (size %s %s)\n",
1184 m_out->Print( 0,
"\n" );
1188 m_out->Print( aNestLevel,
")\n" );
1195 wxCHECK_RET( aLine !=
nullptr && m_out !=
nullptr,
"" );
1211 case LAYER_BUS: lineType =
"bus";
break;
1214 default: lineType =
"polyline";
break;
1217 m_out->Print( aNestLevel,
"(%s (pts (xy %s %s) (xy %s %s))\n",
1225 m_out->Print( 0,
"\n" );
1229 m_out->Print( aNestLevel,
")\n" );
1235 wxCHECK_RET( aText !=
nullptr && m_out !=
nullptr,
"" );
1245 default: wxFAIL;
angle = 0.0;
break;
1248 m_out->Print( aNestLevel,
"(%s %s",
1250 m_out->Quotew( aText->
GetText() ).c_str() );
1255 if( aText->
GetText().Length() < 50 )
1257 m_out->Print( 0,
" (at %s %s %s)",
1264 m_out->Print( 0,
"\n" );
1265 m_out->Print( aNestLevel + 1,
"(at %s %s %s)",
1271 m_out->Print( 0,
"\n" );
1272 aText->
Format( m_out, aNestLevel, 0 );
1282 m_out->Print( aNestLevel,
")\n" );
1288 wxCHECK_RET( aAlias !=
NULL,
"BUS_ALIAS* is NULL" );
1292 for(
auto member : aAlias->Members() )
1294 if( members.IsEmpty() )
1295 members = m_out->Quotew( member );
1297 members +=
" " + m_out->Quotew( member );
1300 m_out->Print( aNestLevel,
"(bus_alias %s (members %s))\n",
1301 m_out->Quotew( aAlias->GetName() ).c_str(),
1310 m_fileName( aFullPathAndFileName ),
1311 m_libFileName( aFullPathAndFileName ),
1312 m_isWritable( true ),
1313 m_isModified( false )
1337 if( fn.Exists( wxFILE_EXISTS_SYMLINK ) )
1339 char buffer[ PATH_MAX + 1 ];
1340 ssize_t pathLen = readlink(
TO_UTF8( fn.GetFullPath() ), buffer, PATH_MAX );
1344 buffer[ pathLen ] =
'\0';
1345 fn.Assign( fn.GetPath() + wxT(
"/" ) + wxString::FromUTF8( buffer ) );
1363 return fn.GetModificationTime();
1377 if(
m_fileModTime.IsValid() && fn.IsOk() && fn.FileExists() )
1386 wxCHECK_MSG( aPart !=
NULL,
NULL,
"NULL pointer cannot be removed from library." );
1396 wxCHECK_MSG( *it->second == aPart,
NULL,
1397 "Pointer mismatch while attempting to remove alias entry <" + aPart->
GetName() +
1398 "> from library cache <" +
m_libFileName.GetName() +
">." );
1406 if( entry.second->IsAlias()
1407 && entry.second->GetParent().lock() == aPart->
SharedPtr() )
1409 firstChild = entry.second;
1420 LIB_FIELD& field = static_cast<LIB_FIELD&>( drawItem );
1434 if( entry.second->IsAlias()
1435 && entry.second->GetParent().lock() == aPart->
SharedPtr() )
1436 entry.second->SetParent( firstChild );
1479 wxCHECK2( wxLocale::GetInfo( wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER ) ==
".",
1509 auto formatter = std::make_unique<FILE_OUTPUTFORMATTER>( fn.GetFullPath() );
1511 formatter->Print( 0,
"(kicad_symbol_lib (version %d) (generator kicad_symbol_editor)\n",
1517 if( parent.second->IsRoot() )
1519 SaveSymbol( parent.second, *formatter.get(), 1 );
1524 if( !alias.second->IsAlias() )
1527 std::shared_ptr<LIB_PART> aliasParent = alias.second->GetParent().lock();
1529 if( aliasParent.get() != parent.second )
1532 SaveSymbol( alias.second, *formatter.get(), 1 );
1537 formatter->Print( 0,
")\n" );
1547 int aNestLevel,
const wxString& aLibName )
1549 wxCHECK_RET( aSymbol,
"Invalid LIB_PART pointer." );
1552 wxCHECK2( wxLocale::GetInfo( wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER ) ==
".",
1556 std::vector<LIB_FIELD*> fields;
1560 if( !aLibName.IsEmpty() )
1566 wxCHECK2( unitId.
Parse( aLibName ) < 0, );
1573 aFormatter.
Print( aNestLevel,
"(symbol %s",
name.c_str() );
1576 aFormatter.
Print( 0,
" (power)" );
1583 aFormatter.
Print( 0,
" (pin_numbers hide)" );
1588 aFormatter.
Print( 0,
" (pin_names" );
1591 aFormatter.
Print( 0,
" (offset %s)",
1595 aFormatter.
Print( 0,
" hide" );
1597 aFormatter.
Print( 0,
")" );
1607 aFormatter.
Print( 0,
"\n" );
1612 saveField( field, aFormatter, aNestLevel + 1 );
1614 lastFieldId = fields.back()->GetId() + 1;
1621 LIB_FIELD locked( lastFieldId,
"ki_locked" );
1622 saveField( &locked, aFormatter, aNestLevel + 1 );
1630 std::sort( units.begin(), units.end(),
1633 if( a.
m_unit == b.m_unit )
1636 return a.
m_unit < b.m_unit;
1639 for(
auto unit : units )
1645 aFormatter.
Print( aNestLevel + 1,
"(symbol %s_%d_%d\"\n",
1646 name.c_str(), unit.m_unit, unit.m_convert );
1648 for(
auto item : unit.m_items )
1651 aFormatter.
Print( aNestLevel + 1,
")\n" );
1656 std::shared_ptr<LIB_PART> parent = aSymbol->
GetParent().lock();
1660 aFormatter.
Print( aNestLevel,
"(symbol %s (extends %s)\n",
1662 aFormatter.
Quotew( parent->GetName() ).c_str() );
1667 saveField( field, aFormatter, aNestLevel + 1 );
1669 lastFieldId = fields.back()->GetId() + 1;
1674 aFormatter.
Print( aNestLevel,
")\n" );
1679 int aNestLevel,
int aFirstId )
1681 wxCHECK_RET( aSymbol,
"Invalid LIB_PART pointer." );
1687 LIB_FIELD keywords(
id, wxString(
"ki_keywords" ) );
1690 saveField( &keywords, aFormatter, aNestLevel + 1 );
1696 LIB_FIELD description(
id, wxString(
"ki_description" ) );
1699 saveField( &description, aFormatter, aNestLevel + 1 );
1705 if( !fpFilters.IsEmpty() )
1709 for(
auto filter : fpFilters )
1714 tmp +=
" " + filter;
1717 LIB_FIELD description(
id, wxString(
"ki_fp_filters" ) );
1720 saveField( &description, aFormatter, aNestLevel + 1 );
1729 wxCHECK_RET( aItem,
"Invalid LIB_ITEM pointer." );
1731 switch( aItem->
Type() )
1770 wxCHECK_RET( aArc && aArc->
Type() ==
LIB_ARC_T,
"Invalid LIB_ARC object." );
1782 aFormatter.
Print( aNestLevel,
1783 "(arc (start %s %s) (end %s %s) (radius (at %s %s) (length %s) " 1792 static_cast<double>( x1 ) / 10.0,
1793 static_cast<double>( x2 ) / 10.0 );
1795 aFormatter.
Print( 0,
"\n" );
1796 aFormatter.
Print( aNestLevel + 1,
"(stroke (width %s)) ",
1799 formatFill( static_cast< LIB_ITEM* >( aArc ), aFormatter, 0 );
1800 aFormatter.
Print( 0,
"\n" );
1801 aFormatter.
Print( aNestLevel,
")\n" );
1809 wxCHECK_RET( aBezier && aBezier->
Type() ==
LIB_BEZIER_T,
"Invalid LIB_BEZIER object." );
1813 aFormatter.
Print( aNestLevel,
"(bezier\n" );
1814 aFormatter.
Print( aNestLevel + 1,
"(pts " );
1816 for(
const auto& pt : aBezier->
GetPoints() )
1820 aFormatter.
Print( 0,
"\n" );
1821 aFormatter.
Print( aNestLevel + 3,
" (xy %s %s)",
1829 aFormatter.
Print( 0,
" (xy %s %s)",
1837 if( lineCount == 1 )
1839 aFormatter.
Print( 0,
")\n" );
1843 aFormatter.
Print( 0,
"\n" );
1844 aFormatter.
Print( aNestLevel + 1,
")\n" );
1847 aFormatter.
Print( aNestLevel + 1,
"(stroke (width %s)) ",
1850 formatFill( static_cast< LIB_ITEM* >( aBezier ), aFormatter, 0 );
1851 aFormatter.
Print( 0,
"\n" );
1852 aFormatter.
Print( aNestLevel,
")\n" );
1860 wxCHECK_RET( aCircle && aCircle->
Type() ==
LIB_CIRCLE_T,
"Invalid LIB_CIRCLE object." );
1862 aFormatter.
Print( aNestLevel,
"(circle (center %s %s) (radius %s) (stroke (width %s)) ",
1868 formatFill( static_cast< LIB_ITEM* >( aCircle ), aFormatter, 0 );
1869 aFormatter.
Print( 0,
")\n" );
1876 wxCHECK_RET( aField && aField->
Type() ==
LIB_FIELD_T,
"Invalid LIB_FIELD object." );
1878 wxString fieldName = aField->
GetName();
1883 aFormatter.
Print( aNestLevel,
"(property %s %s (id %d) (at %s %s %g)\n",
1884 aFormatter.
Quotew( fieldName ).c_str(),
1889 static_cast<double>( aField->
GetTextAngle() ) / 10.0 );
1891 aField->
Format( &aFormatter, aNestLevel, 0 );
1892 aFormatter.
Print( aNestLevel,
")\n" );
1900 wxCHECK_RET( aPin && aPin->
Type() ==
LIB_PIN_T,
"Invalid LIB_PIN object." );
1904 aFormatter.
Print( aNestLevel,
"(pin %s %s (at %s %s %s) (length %s)",
1913 aFormatter.
Print( 0,
" hide\n" );
1915 aFormatter.
Print( 0,
"\n" );
1918 aFormatter.
Print( aNestLevel + 1,
"(name %s (effects (font (size %s %s))))\n",
1923 aFormatter.
Print( aNestLevel + 1,
"(number %s (effects (font (size %s %s))))\n",
1929 for(
const std::pair<const wxString, LIB_PIN::ALT>& alt : aPin->
GetAlternates() )
1931 aFormatter.
Print( aNestLevel + 1,
"(alternate %s %s %s)\n",
1932 aFormatter.
Quotew( alt.second.m_Name ).c_str(),
1937 aFormatter.
Print( aNestLevel,
")\n" );
1945 wxCHECK_RET( aPolyLine && aPolyLine->
Type() ==
LIB_POLYLINE_T,
"Invalid LIB_POLYLINE object." );
1949 aFormatter.
Print( aNestLevel,
"(polyline\n" );
1950 aFormatter.
Print( aNestLevel + 1,
"(pts" );
1956 aFormatter.
Print( 0,
"\n" );
1957 aFormatter.
Print( aNestLevel + 2,
"(xy %s %s)",
1965 aFormatter.
Print( 0,
" (xy %s %s)",
1973 if( lineCount == 1 )
1975 aFormatter.
Print( 0,
")\n" );
1979 aFormatter.
Print( 0,
"\n" );
1980 aFormatter.
Print( aNestLevel + 1,
")\n" );
1983 aFormatter.
Print( aNestLevel + 1,
"(stroke (width %s)) ",
1985 formatFill( static_cast< LIB_ITEM* >( aPolyLine ), aFormatter, 0 );
1986 aFormatter.
Print( 0,
"\n" );
1987 aFormatter.
Print( aNestLevel,
")\n" );
1995 "Invalid LIB_RECTANGLE object." );
1997 aFormatter.
Print( aNestLevel,
"(rectangle (start %s %s) (end %s %s)\n",
2002 aFormatter.
Print( aNestLevel + 1,
"(stroke (width %s)) ",
2004 formatFill( static_cast< LIB_ITEM* >( aRectangle ), aFormatter, 0 );
2005 aFormatter.
Print( 0,
"\n" );
2006 aFormatter.
Print( aNestLevel,
")\n" );
2013 wxCHECK_RET( aText && aText->
Type() ==
LIB_TEXT_T,
"Invalid LIB_TEXT object." );
2015 aFormatter.
Print( aNestLevel,
"(text %s (at %s %s %g)\n",
2020 aText->
Format( &aFormatter, aNestLevel, 0 );
2021 aFormatter.
Print( aNestLevel,
")\n" );
2027 LIB_PART_MAP::iterator it =
m_symbols.find( aSymbolName );
2042 LIB_PART_MAP::iterator it1 =
m_symbols.begin();
2046 if( it1->second->IsAlias() && it1->second->GetParent().lock() == rootPart->
SharedPtr() )
2107 const wxString& aLibraryPath,
2114 bool powerSymbolsOnly = ( aProperties &&
2120 for( LIB_PART_MAP::const_iterator it = symbols.begin(); it != symbols.end(); ++it )
2122 if( !powerSymbolsOnly || it->second->IsPower() )
2123 aSymbolNameList.Add( it->first );
2129 const wxString& aLibraryPath,
2136 bool powerSymbolsOnly = ( aProperties &&
2142 for( LIB_PART_MAP::const_iterator it = symbols.begin(); it != symbols.end(); ++it )
2144 if( !powerSymbolsOnly || it->second->IsPower() )
2145 aSymbolList.push_back( it->second );
2201 if( wxFileExists( aLibraryPath ) )
2204 _(
"symbol library \"%s\" already exists, cannot create a new library" ),
2205 aLibraryPath.GetData() ) );
2223 wxFileName fn = aLibraryPath;
2225 if( !fn.FileExists() )
2230 if( wxRemove( aLibraryPath ) )
2233 aLibraryPath.GetData() ) );
2268 wxTextFile tempFile;
2270 tempFile.Open( aFileName );
2273 firstline = tempFile.GetFirstLine();
2276 return firstline.StartsWith(
"EESchema" );
2282 wxFileName fn( aLibraryPath );
2284 return ( fn.FileExists() && fn.IsFileWritable() ) || fn.IsDirWritable();
power input (GND, VCC for ICs). Must be connected to a power output.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
EE_TYPE OfType(KICAD_T aType) const
LIB_PART * ParseSymbol(LIB_PART_MAP &aSymbolLibMap, int aFileVersion=SEXPR_SYMBOL_LIB_FILE_VERSION)
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
#define IS_CHANGED
Item was edited, and modified.
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
SHEET_SIDE
Defines the edge of the sheet that the sheet pin is positioned SHEET_LEFT_SIDE = 0: pin on left side ...
void SetWidth(int aWidth)
const UTF8 & GetLibItemName() const
bool m_CompactSave
Save files in compact display mode When is is not specified, points are written one per line.
#define DEFAULT_SIZE_TEXT
This is the "default-of-the-default" hardcoded text size; individual application define their own def...
static void saveBezier(LIB_BEZIER *aBezier, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
void saveLine(SCH_LINE *aLine, int aNestLevel)
LIB_ID GetLibId() const override
void saveNoConnect(SCH_NO_CONNECT *aNoConnect, int aNestLevel)
Schematic and symbol library s-expression file format parser definitions.
int GetOrientation()
Get the display symbol orientation.
static const char * getTextTypeToken(KICAD_T aType)
void Format(SCH_SHEET *aSheet)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
SCH_SEXPR_PLUGIN_CACHE(const wxString &aLibraryPath)
wxPoint GetStartPoint() const
wxString GetName() const override
wxDateTime GetLibModificationTime()
std::vector< SYMBOL_INSTANCE_REFERENCE > m_symbolInstances
The list of symbol instances loaded from the schematic file.
void Save()
Save the entire library to file m_libFileName;.
static LIB_PART * ParsePart(LINE_READER &aReader, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
static int s_modify_generation
helper for GetModifyHash()
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
wxPoint GetPosition() const override
static void saveText(LIB_TEXT *aText, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
wxPoint GetPosition() const override
void saveJunction(SCH_JUNCTION *aJunction, int aNestLevel)
Define a symbol library graphical text item.
bool GetIncludeOnBoard() const
int GetOrientation() const
virtual STROKE_PARAMS GetStroke() const override
GRAPHIC_PINSHAPE GetShape() const
wxString GetFileName() const
void DeleteSymbol(const wxString &aLibraryPath, const wxString &aSymbolName, const PROPERTIES *aProperties=nullptr) override
Delete the entire LIB_PART associated with aAliasName from the library aLibraryPath.
wxPoint GetPosition() const override
wxPoint GetPosition() const override
SCH_SEXPR_PLUGIN_CACHE * m_cache
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
Field object used in symbol libraries.
static void saveCircle(LIB_CIRCLE *aCircle, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
wxString GetSchSymbolLibraryName() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
const wxChar *const traceSchLegacyPlugin
Flag to enable legacy schematic plugin debug output.
std::map< wxString, LIB_PART *, LibPartMapSort > LIB_PART_MAP
Part map used by part library object.
pin for passive components: must be connected, and can be connected to any pin
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
std::vector< struct PART_UNITS > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
void SetFileName(const wxString &aFileName)
void SetVisible(bool aVisible)
void Save(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const PROPERTIES *aProperties=nullptr) override
Write aSchematic to a storage file in a format that this SCH_PLUGIN implementation knows about,...
double GetTextAngle() const
wxPoint GetPosition() const override
unknown electrical properties: creates always a warning when connected
void saveText(SCH_TEXT *aText, int aNestLevel)
wxArrayString GetFPFilters() const
wxString AsString() const
const TITLE_BLOCK & GetTitleBlock() const
static const char * emptyString
KIGFX::COLOR4D GetBorderColor() const
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
std::string Double2Str(double aValue)
Helper function Double2Str to print a float number without using scientific notation and no trailing ...
void SetPlotStyle(PLOT_DASH_TYPE aPlotStyle)
void DeleteSymbol(const wxString &aName)
void saveField(SCH_FIELD *aField, int aNestLevel)
bool IsFileChanged() const
void AddSymbol(const LIB_PART *aPart)
static void FormatPart(LIB_PART *aPart, OUTPUTFORMATTER &aFormatter)
#define SEXPR_SYMBOL_LIB_FILE_VERSION
This file contains the file format version information for the s-expression schematic and symbol libr...
wxString GetKeyWords() const
static float getPinAngle(int aOrientation)
wxPoint GetPosition() const override
int m_unit
The unit number.
A logical library item identifier and consists of various portions much like a URI.
void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
Output the page class to aFormatter in s-expression form.
A name/value tuple with unique names and optional values.
int GetWidth() const override
std::string toUTFTildaText(const wxString &txt)
Convert a wxString to UTF8 and replace any control characters with a ~, where a control character is ...
SCH_SCREEN * GetScreen() const
const PAGE_INFO & GetPageSettings() const
virtual const wxString GetProjectPath() const
Return the full path of the project.
std::map< wxString, LIB_PART * > & GetLibSymbols()
Fetch a list of unique LIB_PART object pointers required to properly render each SCH_COMPONENT in thi...
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
virtual void SetParent(EDA_ITEM *aParent)
int GetWidth() const override
wxString GetName(bool aUseDefaultName=true) const
Returns the field name.
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
The base class for drawable items used by schematic library components.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populates a std::vector with SCH_FIELDs.
void SetEndPoint(const wxPoint &aPosition)
static void SaveSymbol(LIB_PART *aSymbol, OUTPUTFORMATTER &aFormatter, int aNestLevel=0, const wxString &aLibName=wxEmptyString)
int GetTextHeight() const
KIGFX::COLOR4D GetBackgroundColor() const
std::string EscapedUTF8(wxString aString)
Return an 8 bit UTF8 string given aString in Unicode form.
Base class for a bus or wire entry.
void AddDrawItem(LIB_ITEM *aItem)
Add a new draw aItem to the draw object list.
int GetWidth() const override
static const char * getPinShapeToken(GRAPHIC_PINSHAPE aShape)
const std::vector< wxPoint > & GetPolyPoints() const
std::vector< SCH_FIELD > & GetFields()
A cache assistant for the part library portion of the SCH_PLUGIN API, and only for the SCH_SEXPR_PLUG...
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
static void saveDcmInfoAsFields(LIB_PART *aSymbol, OUTPUTFORMATTER &aFormatter, int aNestLevel=0, int aFirstId=MANDATORY_FIELDS)
int GetSecondRadiusAngle() const
LIB_PART * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const PROPERTIES *aProperties=nullptr) override
Load a LIB_PART object having aPartName from the aLibraryPath containing a library format that this S...
bool UseLibIdLookup() const
not internally connected (may be connected to anything)
FILL_TYPE GetFillMode() const
void saveBusEntry(SCH_BUS_ENTRY_BASE *aBusEntry, int aNestLevel)
PLOT_DASH_TYPE GetDefaultStyle() const
void SetModified(bool aModified=true)
std::string FormatAngle(double aAngle)
Function FormatAngle converts aAngle from board units to a string appropriate for writing to file.
int GetBorderWidth() const
A LINE_READER that reads from an open file.
void saveBusAlias(std::shared_ptr< BUS_ALIAS > aAlias, int aNestLevel)
wxFileName GetRealFile() const
void CreateSymbolLib(const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override
Create a new empty symbol library at aLibraryPath.
bool IsFile(const wxString &aFullPathAndFileName) const
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this part matching aFieldName and returns it or NULL if not found.
virtual void SetText(const wxString &aText)
virtual const wxString What() const
A composite of Problem() and Where()
BITMAP_BASE * GetImage() const
wxString GetLogicalName() const
wxPoint GetPosition() const override
static void saveField(const LIB_FIELD *aField, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
const wxString & GetName() const
std::vector< SCH_SHEET_INSTANCE > m_sheetInstances
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
static const char * getPinElectricalTypeToken(ELECTRICAL_PINTYPE aType)
int GetWidth() const override
void SaveLibrary(const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override
static double getSheetPinAngle(SHEET_SIDE aSide)
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
static void savePolyLine(LIB_POLYLINE *aPolyLine, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
static void formatFill(const LIB_ITEM *aItem, OUTPUTFORMATTER &aFormatter, int aNestLevel)
Fill token formatting helper.
Define a library symbol object.
#define MIME_BASE64_LENGTH
void cacheLib(const wxString &aLibraryFileName)
static wxString getLineStyleToken(PLOT_DASH_TYPE aStyle)
A simple container for schematic symbol instance information.
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this part.
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override
Populate a list of LIB_PART alias names contained within the library aLibraryPath.
PLOT_DASH_TYPE GetPlotStyle() const
EDA_ITEM * GetParent() const
const std::vector< wxPoint > & GetPoints() const
static void savePin(LIB_PIN *aPin, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
wxLogTrace helper definitions.
bool isBuffering(const PROPERTIES *aProperties)
virtual void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
Output the object to aFormatter in s-expression form.
static const wxString GetDefaultFieldName(int aFieldNdx)
wxString GetDescription() override
LABEL_SPIN_STYLE GetLabelSpinStyle() const
virtual void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
Output the object to aFormatter in s-expression form.
SCH_LAYER_ID
Eeschema drawing layers.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
static void formatStroke(OUTPUTFORMATTER *aFormatter, int aNestLevel, const STROKE_PARAMS &aStroke)
Write stroke definition to aFormatter.
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslate=true)
Return a default symbol field name for field aFieldNdx for all components.
Object to parser s-expression symbol library and schematic file formats.
virtual ~SCH_SEXPR_PLUGIN()
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
int GetNameTextSize() const
bool GetIncludeInBom() const
#define DEFAULT_PIN_NAME_OFFSET
The intersheets references prefix string.
wxString GetFileName() const
Return the filename corresponding to this sheet.
bool IsDefaultFormatting() const
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
wxPoint GetPosition() const override
wxPoint GetPosition() const override
void loadFile(const wxString &aFileName, SCH_SHEET *aSheet)
Object to handle a bitmap image that can be inserted in a schematic.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieves a list of the SCH_PINs for the given sheet path.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
PLOT_DASH_TYPE
Dashed line types.
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
~SCH_SEXPR_PLUGIN_CACHE()
wxPoint GetPosition() const override
virtual unsigned int GetSize() const override
Return the number of stored items.
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
bool IsSymbolLibWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
std::vector< SCH_SHEET_PIN * > & GetPins()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
unsigned GetCount() const
SCH_SHEET * Load(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const PROPERTIES *aProperties=nullptr) override
Load information from some input file format that this SCH_PLUGIN implementation knows about,...
static void saveRectangle(LIB_RECTANGLE *aRectangle, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
int m_convert
The alternate body style of the unit.
SCH_FIELD * GetIntersheetRefs()
const wxString & GetNumber() const
ELECTRICAL_PINTYPE GetType() const
void LoadContent(LINE_READER &aReader, SCH_SHEET *aSheet, int aVersion=SEXPR_SCHEMATIC_FILE_VERSION)
int GetModifyHash() const
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
int GetWidth() const override
std::map< wxString, ALT > & GetAlternates()
double GetTextAngleDegrees() const
A simple container for sheet instance information.
int GetNumberTextSize() const
bool Exists(const std::string &aProperty) const
Segment description base class to describe items which have 2 end points (track, wire,...
bool CheckHeader(const wxString &aFileName) override
Return true if the first line in aFileName begins with the expected header.
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
void SortByReferenceOnly()
Sort the list of references by reference.
Simple container to manage line stroke parameters.
usual pin input: must be connected
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
wxString AsString() const
wxString GetName(bool aUseDefaultName=true) const
Function GetName returns the field name.
wxPoint GetPosition() const override
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
bool GetIncludeOnBoard() const
const PROPERTIES * m_props
Passed via Save() or Load(), no ownership, may be nullptr.
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
LIB_PART * removeSymbol(LIB_PART *aAlias)
void saveSheet(SCH_SHEET *aSheet, int aNestLevel)
virtual STROKE_PARAMS GetStroke() const override
virtual wxString GetClass() const override
Return the class name.
void ParseSchematic(SCH_SHEET *aSheet, bool aIsCopyablyOnly=false, int aFileVersion=SEXPR_SCHEMATIC_FILE_VERSION)
Parse the internal LINE_READER object into aSheet.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
void loadHierarchy(SCH_SHEET *aSheet)
int GetFirstRadiusAngle() const
KICAD_PLUGIN_EXPORT SCENEGRAPH * Load(char const *aFileName)
reads a model file and creates a generic display structure
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
input or output (like port for a microprocessor)
bool IsFillable() const
Check if draw object can be filled.
void SetFileName(const wxString &aFileName)
Definition for part library class.
void init(SCHEMATIC *aSchematic, const PROPERTIES *aProperties=nullptr)
initialize PLUGIN like a constructor would.
#define SEXPR_SCHEMATIC_FILE_VERSION
Symbol library file version.
static void saveArc(LIB_ARC *aArc, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
static void saveSymbolDrawItem(LIB_ITEM *aItem, OUTPUTFORMATTER &aFormatter, int aNestLevel)
not connected (must be left open)
const std::vector< SYMBOL_INSTANCE_REFERENCE > & GetInstanceReferences()
bool GetIncludeInBom() const
const LIB_ID & GetLibId() const
int GetModifyHash() const override
Return the modification hash from the library cache.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Base class for any item which can be embedded within the SCHEMATIC container class,...
#define THROW_IO_ERROR(msg)
output of a regulator: intended to be connected to power input pins
virtual const wxString & GetText() const
Return the string associated with the text object.
static const char * PropBuffering
The property used internally by the plugin to enable cache buffering which prevents the library file ...
static const char * PropPowerSymsOnly
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
bool UnitsLocked() const
Check whether part units are interchangeable.
wxPoint GetPosition() const override
wxString GetPageNumber(const SCH_SHEET_PATH &aInstance) const
Return the sheet page number for aInstance.
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
std::unordered_set< std::shared_ptr< BUS_ALIAS > > GetBusAliases()
Returns a list of bus aliases defined in this screen.
void saveBitmap(SCH_BITMAP *aBitmap, int aNestLevel)
void saveSymbol(SCH_COMPONENT *aComponent, SCH_SHEET_PATH *aSheetPath, int aNestLevel)
bool DeleteSymbolLib(const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override
Delete an existing symbol library and returns true if successful, or if library does not exist return...
static const char * getSheetPinShapeToken(PINSHEETLABEL_SHAPE aShape)
PINSHEETLABEL_SHAPE GetShape() const
KICAD_T Type() const
Returns the type of object.
Define a bezier curve graphic body item.
wxPoint GetPosition() const override
wxPoint GetPosition() const override
void SaveSymbol(const wxString &aLibraryPath, const LIB_PART *aSymbol, const PROPERTIES *aProperties=nullptr) override
Write aSymbol to an existing library located at aLibraryPath.
wxPoint GetEndPoint() const