40 const wxFileName& aLibraryFileName,
REPORTER* aReporter )
42 std::map<wxString, wxString> mapOfAscFiles;
43 std::map<wxString, wxString> mapOfAsyFiles;
59 std::queue<wxString> ascFileQueue;
60 ascFileQueue.push( aLibraryFileName.GetName().Lower() );
62 LTSPICE_FILE rootAscFile( ascFileQueue.front(), { 0, 0 } );
64 rootAscFile.
Sheet = aRootSheet;
67 int parentSheetIndex = 0;
70 std::vector<LTSPICE_FILE> ascFiles;
72 ascFiles.push_back( rootAscFile );
74 while( !ascFileQueue.empty() )
79 wxString ascFilePath = mapOfAscFiles[ ascFileQueue.front() ];
90 for(
LTSPICE_FILE& newSubSchematicElement : newSubSchematicElements )
92 wxString asyName = newSubSchematicElement.ElementName;
93 auto it = mapOfAsyFiles.find( asyName );
95 if( it == mapOfAsyFiles.end() )
105 newSubSchematicElement.ParentIndex = parentSheetIndex;
106 newSubSchematicElement.Screen = screen;
107 newSubSchematicElement.Sheet =
new SCH_SHEET();
109 ascFileQueue.push( newSubSchematicElement.ElementName );
110 ascFiles.push_back( newSubSchematicElement );
119 for(
unsigned int i = 0; i < ascFiles.size(); i++ )
122 wxString buffer =
SafeReadFile( mapOfAscFiles[ascFiles[i].ElementName], wxS(
"r" ) );
129 m_fileCache[ wxS(
"ascFiles" ) ][ wxS(
"parentFile" ) ] = buffer;
132 wxASSERT( file.Sheet ==
nullptr && file.Screen ==
nullptr );
141 std::map tempAsyMap =
ReadAsyFile( ascFiles[i], mapOfAsyFiles );
142 wxString ascFileName = ascFiles[i].ElementName;
145 LIB_SYMBOL tempLibSymbol( ascFiles[i].ElementName );
153 curSheet->
SetParent( ascFiles[ascFiles[i].ParentIndex].Sheet );
157 wxString sheetName = wxString::Format( wxS(
"%s-subsheet-%d" ),
158 ascFiles[i].ElementName,
161 sheetNameField->
SetText( sheetName );
162 fileNameSheet->
SetText( sheetName +
".kicad_sch" );
164 curSheet->
SetScreen( ascFiles[i].Screen );
166 curSheetPath = ascFiles[ascFiles[i].ParentIndex].SheetPath;
169 ascFiles[i].SheetPath = curSheetPath;
171 ascFiles[ascFiles[i].ParentIndex].Sheet->GetScreen()->Append( curSheet );
180 ascFiles[i].SheetPath.push_back( curSheet );
181 curSheetPath = ascFiles[i].SheetPath;
184 std::vector<wxString> subSchematicAsyFiles;
187 subSchematicAsyFiles.
push_back( ascFile.ElementName );
192 parser.
Parse( &curSheetPath, lt_ascs, subSchematicAsyFiles );
203 std::map<wxString, wxString>& aMapOfAscFiles,
204 std::map<wxString, wxString>& aMapOfAsyFiles,
205 const std::vector<wxString>& aBaseDirs )
210 bool cont = aDir.GetFirst( &filename, wxEmptyString, wxDIR_FILES | wxDIR_HIDDEN );
214 wxFileName
path( aDir.GetName(), filename );
216 auto logToMap = [&]( std::map<wxString, wxString>& aMapToLogTo,
const wxString& aKey )
218 if( aMapToLogTo.count( aKey ) )
223 _(
"File at '%s' was ignored. Using previously found "
224 "file at '%s' instead." ),
225 path.GetFullPath(), aMapToLogTo.at( aKey ) ) );
230 aMapToLogTo.emplace( aKey,
path.GetFullPath() );
235 wxString extension =
path.GetExt().Lower();
237 for(
size_t i = 0; i < aBaseDirs.size() + 1; i++ )
241 for(
size_t j = i; j < aBaseDirs.size(); j++ )
242 alias << aBaseDirs[j].Lower() <<
'/';
244 alias <<
path.GetName().Lower();
246 if( extension == wxS(
"asc" ) )
247 logToMap( aMapOfAscFiles, alias );
248 else if( extension == wxS(
"asy" ) )
249 logToMap( aMapOfAsyFiles, alias );
252 cont = aDir.GetNext( &filename );
258 bool cont = aDir.GetFirst( &filename, wxEmptyString, wxDIR_DIRS | wxDIR_HIDDEN );
262 wxFileName
path( aDir.GetName(), filename );
263 wxDir subDir(
path.GetFullPath() );
265 std::vector<wxString> newBase = aBaseDirs;
266 newBase.push_back( filename );
270 cont = aDir.GetNext( &filename );
276std::map<wxString, wxString>
278 const std::map<wxString, wxString>& aAsyFileMap )
280 std::map<wxString, wxString> resultantMap;
284 if( aAsyFileMap.count( fileName ) )
285 resultantMap[fileName] =
SafeReadFile( aAsyFileMap.at( fileName ), wxS(
"r" ) );
291std::map<wxString, wxString>
293 const std::map<wxString, wxString>& aAsyFileMap )
295 std::map<wxString, wxString> resultantMap;
299 wxString fileName = source.ElementName;
301 if( aAsyFileMap.count( fileName ) )
302 resultantMap[fileName] =
SafeReadFile( aAsyFileMap.at( fileName ), wxS(
"r" ) );
311 std::vector<LTSPICE_FILE> resultantArray;
312 wxArrayString lines = wxSplit( aAscFile,
'\n' );
314 for(
const wxString& line : lines )
316 wxArrayString tokens = wxSplit( line,
' ' );
318 if( !tokens.IsEmpty() && tokens[0].Upper() == wxS(
"SYMBOL" ) )
320 wxString elementName( tokens[1] );
323 tokens[2].ToLong( &posX );
324 tokens[3].ToLong( &posY );
326 elementName.Replace(
'\\',
'/' );
330 resultantArray.push_back( asyFile );
334 return resultantArray;
340 wxStringTokenizer lines( aAsyFile,
"\n" );
342 while( lines.HasMoreTokens() )
344 wxStringTokenizer parts( lines.GetNextToken(),
" " );
346 if( parts.GetNextToken().IsSameAs( wxS(
"SYMATTR" ),
false )
347 && parts.GetNextToken().IsSameAs( wxS(
"Prefix" ),
false ) )
358 const wxString& aFileName )
362 if( !aToken.ToLong( &result ) )
364 THROW_IO_ERROR( wxString::Format(
_(
"Expecting integer at line %d in file %s" ),
374 int aLineNumber,
const wxString& aFileName )
382 int aExpectedMax,
int aLineNumber,
383 const wxString& aFileName )
385 if( (
int) aActualSize < aExpectedMin )
387 THROW_IO_ERROR( wxString::Format(
_(
"Expected data missing on line %d in file %s" ),
391 else if( (
int) aActualSize > aExpectedMax )
393 THROW_IO_ERROR( wxString::Format(
_(
"Extra data found on line %d in file %s" ),
403 for(
int i = aIndex + 1; i < (int) aTokens.GetCount(); i++ )
404 aTokens[ aIndex ] +=
" " + aTokens[i];
410 std::map<int, LINESTYLE> lineStyleMap;
418 if( lineStyleMap.find( aValue ) == lineStyleMap.end() )
421 return lineStyleMap[ aValue ];
427 std::map<wxString, LINEWIDTH> lineWidthMap;
432 if( lineWidthMap.find( aValue.Upper() ) == lineWidthMap.end() )
435 return lineWidthMap[ aValue.Upper() ];
441 std::map<wxString, POLARITY> polarityMap;
450 if( polarityMap.find( aValue.Upper() ) == polarityMap.end() )
453 return polarityMap[ aValue.Upper() ];
459 std::map<wxString, ORIENTATION> rotationMirrorMap;
471 if( rotationMirrorMap.find( aValue.Upper() ) == rotationMirrorMap.end() )
472 THROW_IO_ERROR(
_(
"Expecting R0, R90, R18, R270, M0, M90, M180 or M270" ) );
474 return rotationMirrorMap[ aValue.Upper() ];
480 std::map<wxString, JUSTIFICATION> justificationMap;
494 if( justificationMap.find( aValue.Upper() ) == justificationMap.end() )
495 THROW_IO_ERROR(
_(
"Expecting LEFT, CENTER, RIGHT, TOP, BOTTOM, VLEFT, VRIGHT, VCENTER, "
496 "VTOP, VBOTTOM or INVISIBLE" ) );
498 return justificationMap[ aValue.Upper() ];
504 std::map<wxString, JUSTIFICATION> pinJustificationMap;
517 if( pinJustificationMap.find( aValue.Upper() ) == pinJustificationMap.end() )
518 THROW_IO_ERROR(
_(
"Expecting NONE, BOTTOM, TOP, LEFT, RIGHT, VBOTTOM, VTOP, VCENTER, VLEFT or VRIGHT" ) );
520 return pinJustificationMap[ aValue.Upper() ];
526 std::map<wxString, SYMBOLTYPE> symbolTypeMap;
531 if( symbolTypeMap.find( aValue.Upper() ) == symbolTypeMap.end() )
534 return symbolTypeMap[ aValue.Upper() ];
540 if( elementFromLine.EndsWith(
'\r' ) )
541 elementFromLine = elementFromLine.BeforeLast(
'\r' );
548 const std::map<wxString, wxString>& asyFiles =
m_fileCache[ wxS(
"asyFiles" ) ];
550 if( !asyFiles.count( aAscFileName.Lower() ) )
551 THROW_IO_ERROR( wxString::Format(
_(
"Symbol '%s.asy' not found" ), aAscFileName ) );
553 return SymbolBuilder( aAscFileName, asyFiles.at( aAscFileName.Lower() ), aAscFile );
557 const wxString& aAsyFileContent,
563 lt_symbol.
Name = aAscFileName;
567 for( wxString line : wxSplit( aAsyFileContent,
'\n' ) )
571 wxArrayString tokens = wxSplit( line,
' ' );
573 if( tokens.IsEmpty() )
576 wxString element = tokens[0].Upper();
578 if( element ==
"LINE" )
582 wxString lineWidth = tokens[1];
583 wxString startPointX = tokens[2];
584 wxString startPointY = tokens[3];
585 wxString endPointX = tokens[4];
586 wxString endPointY = tokens[5];
590 lt_line.
Start =
pointCheck( startPointX, startPointY, lineNumber, aAscFileName );
591 lt_line.
End =
pointCheck( endPointX, endPointY, lineNumber, aAscFileName );
593 int lineStyleNumber = 0;
595 if( tokens.size() == 7 )
597 wxString lineStyle = tokens[6];
598 lineStyleNumber =
integerCheck( lineStyle, lineNumber, aAscFileName );
603 lt_symbol.
Lines.push_back( lt_line );
605 else if( element ==
"RECTANGLE" )
609 wxString lineWidth = tokens[1];
610 wxString botRightX = tokens[2];
611 wxString botRightY = tokens[3];
612 wxString topLeftX = tokens[4];
613 wxString topRightY = tokens[5];
620 int lineStyleNumber = 0;
622 if( tokens.size() == 7 )
624 wxString lineStyle = tokens[6];
625 lineStyleNumber =
integerCheck( lineStyle, lineNumber, aAscFileName );
632 else if( element ==
"CIRCLE" )
640 wxString lineWidth = tokens[1];
641 wxString botRightX = tokens[2];
642 wxString botRightY = tokens[3];
643 wxString topLeftX = tokens[4];
644 wxString topRightY = tokens[5];
648 circle.BotRight =
pointCheck( botRightX, botRightY, lineNumber, aAscFileName );
649 circle.TopLeft =
pointCheck( topLeftX, topRightY, lineNumber, aAscFileName );
651 int lineStyleNumber = 0;
653 if( tokens.size() == 7 )
655 wxString lineStyle = tokens[6];
656 lineStyleNumber =
integerCheck( lineStyle, lineNumber, aAscFileName );
663 else if( element ==
"ARC" )
672 wxString lineWidth = tokens[1];
673 wxString botRightX = tokens[2];
674 wxString botRightY = tokens[3];
675 wxString topLeftX = tokens[4];
676 wxString topRightY = tokens[5];
677 wxString arcStartPointX = tokens[6];
678 wxString arcStartPointY = tokens[7];
679 wxString arcEndPointX = tokens[8];
680 wxString arcEndPointY = tokens[9];
686 arc.
ArcStart =
pointCheck( arcStartPointX, arcStartPointY, lineNumber, aAscFileName );
687 arc.
ArcEnd =
pointCheck( arcEndPointX, arcEndPointY, lineNumber, aAscFileName );
689 int lineStyleNumber = 0;
691 if( tokens.size() == 11 )
693 wxString lineStyle = tokens[10];
694 lineStyleNumber =
integerCheck( lineStyle, lineNumber, aAscFileName );
699 lt_symbol.
Arcs.push_back( arc );
701 else if( element ==
"WINDOW" )
705 wxString number = tokens[1];
706 wxString windowPosX = tokens[2];
707 wxString windowPosY = tokens[3];
708 wxString justification = tokens[4];
709 wxString fontSize = tokens[5];
721 lt_symbol.
Windows.push_back( window );
723 else if( element ==
"SYMATTR" )
729 wxString key = tokens[1];
730 wxString value = tokens[2];
732 if( value == wxS(
"\"\"" ) )
733 value = wxEmptyString;
737 else if( element ==
"PIN" )
741 wxString pinLocationX = tokens[1];
742 wxString pinLocationY = tokens[2];
743 wxString Justification = tokens[3];
744 wxString nameOffSet = tokens[4];
747 pin.PinLocation =
pointCheck( pinLocationX, pinLocationY, lineNumber,aAscFileName );
751 lt_symbol.
Pins.push_back(
pin );
753 else if( element ==
"PINATTR" )
759 wxString
name = tokens[1];
760 wxString Value = tokens[2];
762 lt_symbol.
Pins.back().PinAttribute.insert( {
name, Value } );
764 else if( element ==
"SYMBOLTYPE" )
768 wxString symbolType = tokens[1];
784 lt_symbol.
Name = aAscFileName;
804 std::vector<LT_ASC> ascFiles;
806 for(
const auto& [ fileName, contents ] :
m_fileCache[ wxS(
"ascFiles" ) ] )
809 std::vector<LT_SYMBOL> symbolArray;
819 for( wxString line : wxSplit( contents,
'\n' ) )
823 wxArrayString tokens = wxSplit( line,
' ' );
825 if( tokens.IsEmpty() )
828 wxString element = tokens[0].Upper();
830 if( element ==
"SHEET" )
834 wxString sheetNumber = tokens[1];
835 wxString sheetWidth = tokens[2];
836 wxString sheetHeight = tokens[3];
841 else if( element ==
"SYMBOL" )
845 wxString symbolName = tokens[1];
846 wxString posX = tokens[2];
847 wxString posY = tokens[3];
848 wxString rotate_mirror_option = tokens[4];
850 symbolName.Replace(
'\\',
'/' );
858 ascFile.
Symbols.push_back( lt_symbol );
871 ascFile.
Symbols.push_back( lt_symbol );
875 else if( element ==
"WIRE" )
879 wxString startPointX = tokens[1];
880 wxString startPointY = tokens[2];
881 wxString endPointX = tokens[3];
882 wxString endPointY = tokens[4];
885 wire.
Start =
pointCheck( startPointX, startPointY, lineNumber, fileName );
886 wire.
End =
pointCheck( endPointX, endPointY, lineNumber, fileName );
888 ascFile.
Wires.push_back( wire );
892 else if( element ==
"FLAG" )
896 wxString posX = tokens[1];
897 wxString posY = tokens[2];
898 wxString
name = tokens[3];
908 else if( element ==
"DATAFLAG" )
912 wxString posX = tokens[1];
913 wxString posY = tokens[2];
914 wxString expression = tokens[3];
918 flag.Expression = expression;
924 else if( element ==
"WINDOW" )
928 wxString number = tokens[1];
929 wxString windowPosX = tokens[2];
930 wxString windowPosY = tokens[3];
931 wxString justification = tokens[4];
932 wxString fontSize = tokens[5];
934 int windowNumber =
integerCheck( number, lineNumber, fileName );
940 if( candidate.WindowNumber == windowNumber )
950 window = &ascFile.
Symbols.back().Windows.back();
960 else if( element ==
"SYMATTR" )
966 wxString
name = tokens[1];
967 wxString value = tokens[2];
969 if( value == wxS(
"\"\"" ) )
970 value = wxEmptyString;
972 ascFile.
Symbols.back().SymAttributes[
name.Upper() ] = value;
974 else if( element ==
"LINE" )
978 wxString lineWidth = tokens[1];
979 wxString startPointX = tokens[2];
980 wxString startPointY = tokens[3];
981 wxString endPointX = tokens[4];
982 wxString endPointY = tokens[5];
986 lt_line.
Start =
pointCheck( startPointX, startPointY, lineNumber, fileName );
987 lt_line.
End =
pointCheck( endPointX, endPointY, lineNumber, fileName );
989 int lineStyleNumber = 0;
991 if( tokens.size() == 7 )
993 wxString lineStyle = tokens[6];
994 lineStyleNumber =
integerCheck( lineStyle, lineNumber, fileName );
999 ascFile.
Lines.push_back( lt_line );
1003 else if( element ==
"RECTANGLE" )
1007 wxString lineWidth = tokens[1];
1008 wxString botRightX = tokens[2];
1009 wxString botRightY = tokens[3];
1010 wxString topLeftX = tokens[4];
1011 wxString topRightY = tokens[5];
1018 int lineStyleNumber = 0;
1020 if( tokens.size() == 7 )
1022 wxString lineStyle = tokens[6];
1023 lineStyleNumber =
integerCheck( lineStyle, lineNumber, fileName );
1032 else if( element ==
"CIRCLE" )
1036 wxString lineWidth = tokens[1];
1037 wxString botRightX = tokens[2];
1038 wxString botRightY = tokens[3];
1039 wxString topLeftX = tokens[4];
1040 wxString topRightY = tokens[5];
1044 circle.BotRight =
pointCheck( botRightX, botRightY, lineNumber, fileName );
1047 int lineStyleNumber = 0;
1049 if( tokens.size() == 7 )
1051 wxString lineStyle = tokens[6];
1052 lineStyleNumber =
integerCheck( lineStyle, lineNumber, fileName );
1061 else if( element ==
"ARC" )
1070 wxString lineWidth = tokens[1];
1071 wxString botRightX = tokens[2];
1072 wxString botRightY = tokens[3];
1073 wxString topLeftX = tokens[4];
1074 wxString topRightY = tokens[5];
1075 wxString arcStartPointX = tokens[6];
1076 wxString arcStartPointY = tokens[7];
1077 wxString arcEndPointX = tokens[8];
1078 wxString arcEndPointY = tokens[9];
1084 arc.
ArcEnd =
pointCheck( arcStartPointX, arcStartPointY, lineNumber, fileName );
1087 int lineStyleNumber = 0;
1089 if( tokens.size() == 11 )
1091 wxString lineStyle = tokens[10];
1092 lineStyleNumber =
integerCheck( lineStyle, lineNumber, fileName );
1097 ascFile.
Arcs.push_back( arc );
1101 else if( element ==
"IOPIN" )
1105 wxString pinLocationX = tokens[1];
1106 wxString pinLocationY = tokens[2];
1107 wxString pinPolarity = tokens[3];
1113 ascFile.
Iopins.push_back( iopin );
1116 else if( element ==
"TEXT" )
1122 wxString positionX = tokens[1];
1123 wxString positionY = tokens[2];
1124 wxString justification = tokens[3];
1125 wxString fontSize = tokens[4];
1126 wxString value = tokens[5];
1129 text.Offset =
pointCheck( positionX, positionY, lineNumber, fileName );
1133 if( value.StartsWith( wxS(
"!" ), &
text.Value ) )
1134 text.Value.Replace( wxS(
"! " ), wxS(
"\n" ) );
1135 else if( value.StartsWith( wxS(
";" ), &
text.Value ) )
1136 text.Value.Replace( wxS(
"; " ), wxS(
"\n" ) );
1140 text.Value.Replace( wxS(
"\\n" ), wxS(
"\n" ) );
1145 else if( element ==
"BUSTAP" )
1149 wxString startPointX = tokens[1];
1150 wxString startPointY = tokens[2];
1151 wxString endPointX = tokens[3];
1152 wxString endPointY = tokens[4];
1155 bustap.
Start =
pointCheck( startPointX, startPointY, lineNumber, fileName );
1156 bustap.
End =
pointCheck( endPointX, endPointY, lineNumber, fileName );
1158 ascFile.
Bustap.push_back( bustap );
1162 else if( element ==
"VERSION" )
1164 wxString versionNumber = tokens[1];
1165 if( versionNumber.Contains(
'.' ) )
1167 wxString majorStr = versionNumber.BeforeFirst(
'.' );
1168 wxString minorStr = versionNumber.AfterFirst(
'.' );
1181 ascFiles.push_back( ascFile );
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr const Vec & GetOrigin() const
constexpr const SizeVec & GetSize() const
virtual void SetParent(EDA_ITEM *aParent)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
Define a library symbol object.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
static VECTOR2I pointCheck(const wxString &aTokenX, const wxString &aTokenY, int aLineNumber, const wxString &aFileName)
LT_SYMBOL MakeDummySymbol(const wxString &aAscFileName)
static SYMBOLTYPE getSymbolType(const wxString &aValue)
std::vector< LT_ASC > StructureBuilder()
Build Intermediate data structure.
std::vector< LTSPICE_FILE > GetSchematicElements(const wxString &aAscFile)
Used to get symbols list present in asc file.
LT_SYMBOL SymbolBuilder(const wxString &aAscFileName, LT_ASC &aAscFile)
POLARITY
Polarity enum represents polarity of pin.
JUSTIFICATION
Defines in what ways the PIN or TEXT can be justified.
static ORIENTATION getSymbolRotationOrMirror(const wxString &aValue)
bool IsAsySubsheet(const wxString &aAsyFile)
Check if the asy file content indicates that we need to load subsheet.
static POLARITY getPolarity(const wxString &aValue)
static void tokensSizeRangeCheck(size_t aActualSize, int aExpectedMin, int aExpectedMax, int aLineNumber, const wxString &aFileName)
Used to check size of the token generated from split function.
static LINEWIDTH getLineWidth(const wxString &aValue)
ORIENTATION
Defines different types or rotation and mirror operation can be applied to a LT_SYMBOL.
static void aggregateAttributeValue(wxArrayString &aTokens, int aIndex)
Join value present across multiple tokens into one.
void GetAscAndAsyFilePaths(const wxDir &aDir, bool aRecursive, std::map< wxString, wxString > &aMapOfAscFiles, std::map< wxString, wxString > &aMapOfAsyFiles, const std::vector< wxString > &aBaseDirs={})
Used to get file path for Asc and Asy files.
void Load(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxFileName &aLibraryFileName, REPORTER *aReporter)
The main function responsible for loading the .asc and .asy files.
static int integerCheck(const wxString &aToken, int aLineNumber, const wxString &aFileName)
Used to check if the given token in integer or not.
wxFileName m_ltspiceDataDir
std::map< wxString, std::map< wxString, wxString > > m_fileCache
static JUSTIFICATION getTextJustification(const wxString &aValue)
static JUSTIFICATION getPinJustification(const wxString &aValue)
std::map< wxString, wxString > ReadAsyFile(const LTSPICE_FILE &aSourceFile, const std::map< wxString, wxString > &aAsyFileMap)
SYMBOLTYPE
Type of Symbol loaded from asc and asy file.
std::map< wxString, wxString > ReadAsyFiles(const std::vector< LTSPICE_FILE > &aSourceFiles, const std::map< wxString, wxString > &aAsyFileMap)
The function returns a map.
static void removeCarriageReturn(wxString &elementFromLine)
static LINESTYLE getLineStyle(int aValue)
virtual const wxString GetProjectPath() const
Return the full path of the project.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Holds all the data relating to one schematic.
PROJECT & Prj() const
Return a reference to the project this schematic is part of.
void SetText(const wxString &aText) override
The class is been used for loading the asc and asy files in intermediate data structure.
void Parse(SCH_SHEET_PATH *aSheet, std::vector< LTSPICE_SCHEMATIC::LT_ASC > &outLT_ASCs, const std::vector< wxString > &aAsyFileNames)
Function responsible for loading the .asc and .asy files in intermediate data structure.
int ToKicadCoords(int aCoordinate)
Method converts ltspice coordinate(i.e scale) to kicad coordinates.
void CreateSymbol(LTSPICE_SCHEMATIC::LT_SYMBOL &aLtSymbol, LIB_SYMBOL *aLibSymbol)
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetSize(const VECTOR2I &aSize)
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
void SetPosition(const VECTOR2I &aPosition) override
SCH_SCREEN * GetScreen() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
#define THROW_IO_ERROR(msg)
void delete_if(_Container &__c, _Function &&__f)
Deletes all values from __c for which __f returns true.
wxString SafeReadFile(const wxString &aFilePath, const wxString &aReadType)
Nominally opens a file and reads it into a string.
The ARC is represented inside a rectangle whose opposite site are given.
The CIRCLE is represented in Ltpsice inside a rectangle whose two opposite points and line style are ...
IOPIN is special contact on symbol used for IO operations.
A struct to hold .asc file definition.
std::vector< CIRCLE > Circles
std::vector< IOPIN > Iopins
std::vector< BUSTAP > Bustap
std::vector< LT_SYMBOL > Symbols
std::vector< TEXT > Texts
std::vector< DATAFLAG > DataFlags
std::vector< LINE > Lines
std::vector< WIRE > Wires
std::vector< RECTANGLE > Rectangles
std::vector< FLAG > Flags
A struct to hold SYMBOL definition.
std::map< wxString, wxString > SymAttributes
std::vector< RECTANGLE > Rectangles
std::vector< LT_WINDOW > Windows
std::vector< LT_PIN > Pins
ORIENTATION SymbolOrientation
std::vector< CIRCLE > Circles
std::vector< LINE > Lines
JUSTIFICATION Justification
A 4-sided polygon with opposite equal sides, used in representing shapes.
A metallic connection, used for transfer, between two points or pin.
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.