KiCad PCB EDA Suite
|
The class is been used for loading the asc and asy files in intermediate data structure. More...
#include <sch_io_ltspice_parser.h>
Public Member Functions | |
SCH_IO_LTSPICE_PARSER (LTSPICE_SCHEMATIC *aLTSchematic) | |
~SCH_IO_LTSPICE_PARSER () | |
int | ToKicadCoords (int aCoordinate) |
Method converts ltspice coordinate(i.e scale) to kicad coordinates. | |
VECTOR2I | ToKicadCoords (const VECTOR2I &aPos) |
VECTOR2I | ToInvertedKicadCoords (const VECTOR2I &aPos) |
VECTOR2I | ToKicadFontSize (int aLTFontSize) |
int | ToLtSpiceCoords (int aCoordinate) |
Method converts kicad coordinate(i.e scale) to ltspice coordinates. | |
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. | |
void | CreateLines (LIB_SYMBOL *aSymbol, LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aShape) |
Method for plotting Lines from Asy files. | |
void | CreateLines (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting Schematic Lines from Asy files. | |
void | CreateKicadSYMBOLs (SCH_SHEET_PATH *aSheet, std::vector< LTSPICE_SCHEMATIC::LT_ASC > &outLT_ASCs, const std::vector< wxString > &aAsyFiles) |
Main Method for loading indermediate data to kicacd object from asy files. | |
void | CreateSymbol (LTSPICE_SCHEMATIC::LT_SYMBOL &aLtSymbol, LIB_SYMBOL *aLibSymbol) |
void | RotateMirror (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_SYMBOL *aSchSymbol) |
Methods for rotating and mirroring objects. | |
void | RotateMirrorShape (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_SHAPE *aShape) |
void | CreateWires (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting wires. | |
void | CreateKicadSCH_ITEMs (SCH_SHEET_PATH *aSheet, std::vector< LTSPICE_SCHEMATIC::LT_ASC > &outLT_ASCs) |
Main method for loading intermediate data structure from Asc file to kicad. | |
void | CreateBusEntry (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting Bustap from Asc files. | |
void | CreatePin (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting Iopin from Asc files. | |
void | CreateLine (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting Line from Asc files. | |
void | CreateCircle (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting circle from Asc files. | |
void | CreateArc (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting Arc from Asc files. | |
void | CreateRect (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet) |
Method for plotting rectangle from Asc files. | |
SCH_TEXT * | CreateSCH_TEXT (VECTOR2I aOffset, const wxString &aText, int aFontSize, LTSPICE_SCHEMATIC::JUSTIFICATION aJustification) |
Create schematic text. | |
void | CreateWire (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SHEET_PATH *aSheet, SCH_LAYER_ID aLayer) |
Create a schematic wire. | |
SCH_SYMBOL * | CreatePowerSymbol (const VECTOR2I &aOffset, const wxString &aValue, int aFontSize, SCH_SHEET_PATH *aSheet, std::vector< LTSPICE_SCHEMATIC::WIRE > &aWires) |
Create a power symbol. | |
SCH_LABEL_BASE * | CreateSCH_LABEL (KICAD_T aType, const VECTOR2I &aOffset, const wxString &aValue, int aFontSize) |
Create a label. | |
void | CreateFields (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_SYMBOL *aSymbol, SCH_SHEET_PATH *aSheet) |
void | CreateRect (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aRectangle) |
Create a symbol rect. | |
void | CreateRect (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHEET_PATH *aSheet) |
Create a schematic rect. | |
void | CreatePin (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_PIN *aPin) |
Create a pin from an asy file. | |
void | CreateArc (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aArc) |
Create a symbol arc. | |
void | CreateArc (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHEET_PATH *aSheet) |
Create a schematic arc. | |
void | CreateCircle (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aCircle) |
Create a symbol circle. | |
void | CreateCircle (LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHEET_PATH *aSheet) |
Create a schematic circle. | |
Private Member Functions | |
int | getLineWidth (const LTSPICE_SCHEMATIC::LINEWIDTH &aLineWidth) |
LINE_STYLE | getLineStyle (const LTSPICE_SCHEMATIC::LINESTYLE &aLineStyle) |
STROKE_PARAMS | getStroke (const LTSPICE_SCHEMATIC::LINEWIDTH &aLineWidth, const LTSPICE_SCHEMATIC::LINESTYLE &aLineStyle) |
void | setTextJustification (EDA_TEXT *aText, LTSPICE_SCHEMATIC::JUSTIFICATION aJustification) |
void | readIncludes (std::vector< LTSPICE_SCHEMATIC::LT_ASC > &outLT_ASCs) |
Private Attributes | |
LTSPICE_SCHEMATIC * | m_lt_schematic |
VECTOR2I | m_originOffset |
std::map< wxString, wxString > | m_includes |
int | m_powerSymbolIndex |
The class is been used for loading the asc and asy files in intermediate data structure.
The intermediate data structure is a structure, from where the kicad objects will be initialised.
The intermediate datastructure is been defined below in the class, with comments for individual struct is in place.
parser() - This is the main function responsible for parsing the data into intermediate datastructure.
Data Processing Methods - The individual comments for function are given. In general. these methods are been used for manipulating the data.
Data Check Methods - The individual comments for functions under this section is given. In general these methods are been used for validating the data.
Enum Conversion Methods - The individual comments for functions under this section is given. In general these methods are used to convert the string into enum.
Definition at line 66 of file sch_io_ltspice_parser.h.
|
inlineexplicit |
Definition at line 69 of file sch_io_ltspice_parser.h.
|
inline |
Definition at line 74 of file sch_io_ltspice_parser.h.
void SCH_IO_LTSPICE_PARSER::CreateArc | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting Arc from Asc files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the Arc is represented. |
Definition at line 635 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::ARC::ArcEnd, LTSPICE_SCHEMATIC::LT_ASC::Arcs, LTSPICE_SCHEMATIC::ARC::ArcStart, LTSPICE_SCHEMATIC::ARC::BotRight, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::ARC::LineStyle, LTSPICE_SCHEMATIC::ARC::LineWidth, m_originOffset, SCH_SHAPE::Move(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), SCH_SHAPE::SetStroke(), ToKicadCoords(), and LTSPICE_SCHEMATIC::ARC::TopLeft.
Referenced by CreateKicadSCH_ITEMs(), CreateKicadSYMBOLs(), and CreateSymbol().
void SCH_IO_LTSPICE_PARSER::CreateArc | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHAPE * | aArc | ||
) |
Create a symbol arc.
Definition at line 1328 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::ARC::ArcEnd, LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, LTSPICE_SCHEMATIC::ARC::ArcStart, LTSPICE_SCHEMATIC::ARC::BotRight, getStroke(), LTSPICE_SCHEMATIC::ARC::LineStyle, LTSPICE_SCHEMATIC::ARC::LineWidth, EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), SCH_SHAPE::SetStroke(), ToInvertedKicadCoords(), and LTSPICE_SCHEMATIC::ARC::TopLeft.
void SCH_IO_LTSPICE_PARSER::CreateArc | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Create a schematic arc.
Definition at line 1340 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::ARC::ArcEnd, LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, LTSPICE_SCHEMATIC::ARC::ArcStart, LTSPICE_SCHEMATIC::ARC::BotRight, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::ARC::LineStyle, LTSPICE_SCHEMATIC::ARC::LineWidth, m_originOffset, SCH_SHAPE::Move(), LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, RotateMirrorShape(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), SCH_SHAPE::SetStroke(), ToInvertedKicadCoords(), ToKicadCoords(), and LTSPICE_SCHEMATIC::ARC::TopLeft.
void SCH_IO_LTSPICE_PARSER::CreateBusEntry | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting Bustap from Asc files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the circle is represented. |
Definition at line 542 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LT_ASC::Bustap, CreateWire(), SCH_SHEET_PATH::LastScreen(), SCH_BUS_ENTRY_BASE::SetSize(), LTSPICE_SCHEMATIC::BUSTAP::Start, ToKicadCoords(), LTSPICE_SCHEMATIC::LT_ASC::Wires, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CreateKicadSCH_ITEMs().
void SCH_IO_LTSPICE_PARSER::CreateCircle | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting circle from Asc files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the circle is represented. |
Definition at line 617 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::CIRCLE::BotRight, LTSPICE_SCHEMATIC::LT_ASC::Circles, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::CIRCLE::LineStyle, LTSPICE_SCHEMATIC::CIRCLE::LineWidth, m_originOffset, SCH_SHAPE::Move(), EDA_SHAPE::SetEnd(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), ToKicadCoords(), LTSPICE_SCHEMATIC::CIRCLE::TopLeft, and VECTOR2< T >::x.
Referenced by CreateKicadSCH_ITEMs(), CreateKicadSYMBOLs(), and CreateSymbol().
void SCH_IO_LTSPICE_PARSER::CreateCircle | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHAPE * | aCircle | ||
) |
Create a symbol circle.
Definition at line 1378 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::CIRCLE::BotRight, LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, getStroke(), LTSPICE_SCHEMATIC::CIRCLE::LineStyle, LTSPICE_SCHEMATIC::CIRCLE::LineWidth, EDA_SHAPE::SetEnd(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), ToInvertedKicadCoords(), ToKicadCoords(), LTSPICE_SCHEMATIC::CIRCLE::TopLeft, and VECTOR2< T >::x.
void SCH_IO_LTSPICE_PARSER::CreateCircle | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Create a schematic circle.
Definition at line 1358 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::CIRCLE::BotRight, LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::CIRCLE::LineStyle, LTSPICE_SCHEMATIC::CIRCLE::LineWidth, SCH_SHAPE::Move(), LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, RotateMirrorShape(), EDA_SHAPE::SetEnd(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), ToInvertedKicadCoords(), ToKicadCoords(), LTSPICE_SCHEMATIC::CIRCLE::TopLeft, and VECTOR2< T >::x.
void SCH_IO_LTSPICE_PARSER::CreateFields | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
SCH_SYMBOL * | aSymbol, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Definition at line 941 of file sch_io_ltspice_parser.cpp.
References SCH_SYMBOL::AddField(), SCH_SYMBOL::FindField(), LTSPICE_SCHEMATIC::LT_WINDOW::FontSize, SCH_SYMBOL::GetField(), LTSPICE_SCHEMATIC::GetLTspiceDataDir(), LTSPICE_SCHEMATIC::LT_WINDOW::Justification, m_includes, m_lt_schematic, LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::LT_WINDOW::Position, REFERENCE_FIELD, SCH_FIELD::SetPosition(), SCH_SYMBOL::SetRef(), SCH_FIELD::SetText(), setTextJustification(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), LTSPICE_SCHEMATIC::LT_SYMBOL::SymAttributes, ToKicadCoords(), ToKicadFontSize(), VALUE_FIELD, LTSPICE_SCHEMATIC::LT_WINDOW::WindowNumber, and LTSPICE_SCHEMATIC::LT_SYMBOL::Windows.
Referenced by CreateKicadSYMBOLs().
void SCH_IO_LTSPICE_PARSER::CreateKicadSCH_ITEMs | ( | SCH_SHEET_PATH * | aSheet, |
std::vector< LTSPICE_SCHEMATIC::LT_ASC > & | outLT_ASCs | ||
) |
Main method for loading intermediate data structure from Asc file to kicad.
outLT_ASCs | |
aSheet | a object on which the circle is represented. |
NOTE: This current code is used for plotting sch sheet pins on the sheet, we are working on finding how to place the pin on the intersection of line and sheet.
if( aSubSchematicStructure ) { SCH_HIERLABEL* sheetPin = new SCH_SHEET_PIN( aRootSheet, VECTOR2I(), lt_asc.Flags[index].Value );
sheetPin->SetText( "PIN" ); sheetPin->SetPosition( VECTOR2I( schIUScale.MilsToIU( rescale( 50, 592, 16 ) ), schIUScale.MilsToIU( rescale( 50, 133, 16 ) ) ) ); sheetPin->SetVisible( true ); aRootSheet->AddPin( (SCH_SHEET_PIN*) sheetPin ); }
Definition at line 457 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), CreateArc(), CreateBusEntry(), CreateCircle(), CreateLine(), CreatePin(), CreatePowerSymbol(), CreateRect(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateWire(), LTSPICE_SCHEMATIC::FLAG::FontSize, LTSPICE_SCHEMATIC::TEXT::FontSize, LTSPICE_SCHEMATIC::TEXT::Justification, SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::FLAG::Offset, LTSPICE_SCHEMATIC::TEXT::Offset, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, LTSPICE_SCHEMATIC::FLAG::Value, and LTSPICE_SCHEMATIC::TEXT::Value.
Referenced by Parse().
void SCH_IO_LTSPICE_PARSER::CreateKicadSYMBOLs | ( | SCH_SHEET_PATH * | aSheet, |
std::vector< LTSPICE_SCHEMATIC::LT_ASC > & | outLT_ASCs, | ||
const std::vector< wxString > & | aAsyFiles | ||
) |
Main Method for loading indermediate data to kicacd object from asy files.
aAscfiles | array object representing asc files. |
aSheet | a object on which the symbols are represented. |
Definition at line 135 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), alg::contains(), CreateArc(), CreateCircle(), CreateFields(), CreateLines(), CreateRect(), CreateSymbol(), CreateWires(), LTSPICE_SCHEMATIC::WIRE::End, LIB_SYMBOL::GetBoundingBox(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetSize(), SCH_SHEET_PATH::LastScreen(), m_lt_schematic, m_originOffset, SCH_SYMBOL::Move(), BOX2< Vec >::Offset(), pin, RotateMirror(), LTSPICE_SCHEMATIC::WIRE::Start, LTSPICE_SCHEMATIC::SymbolBuilder(), ToKicadCoords(), ToLtSpiceCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Parse().
void SCH_IO_LTSPICE_PARSER::CreateLine | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting Line from Asc files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the circle is represented. |
Definition at line 603 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LINE::End, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::LT_ASC::Lines, LTSPICE_SCHEMATIC::LINE::LineStyle, LTSPICE_SCHEMATIC::LINE::LineWidth, m_originOffset, SCH_LINE::Move(), SCH_LINE::SetEndPoint(), SCH_LINE::SetStroke(), LTSPICE_SCHEMATIC::LINE::Start, and ToKicadCoords().
Referenced by CreateKicadSCH_ITEMs().
void SCH_IO_LTSPICE_PARSER::CreateLines | ( | LIB_SYMBOL * | aSymbol, |
LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, | ||
int | aIndex, | ||
SCH_SHAPE * | aShape | ||
) |
Method for plotting Lines from Asy files.
aAscfile | object representing asc file. |
aIndex | index. |
Definition at line 106 of file sch_io_ltspice_parser.cpp.
References SCH_SHAPE::AddPoint(), LTSPICE_SCHEMATIC::LINE::End, getStroke(), LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, LTSPICE_SCHEMATIC::LINE::LineStyle, LTSPICE_SCHEMATIC::LINE::LineWidth, SCH_SHAPE::SetStroke(), LTSPICE_SCHEMATIC::LINE::Start, and ToInvertedKicadCoords().
Referenced by CreateKicadSYMBOLs(), and CreateSymbol().
void SCH_IO_LTSPICE_PARSER::CreateLines | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting Schematic Lines from Asy files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the circle is represented. |
Definition at line 118 of file sch_io_ltspice_parser.cpp.
References SCH_SHAPE::AddPoint(), SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LINE::End, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, LTSPICE_SCHEMATIC::LINE::LineStyle, LTSPICE_SCHEMATIC::LINE::LineWidth, m_originOffset, SCH_SHAPE::Move(), LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, RotateMirrorShape(), SCH_SHAPE::SetStroke(), LTSPICE_SCHEMATIC::LINE::Start, and ToKicadCoords().
void SCH_IO_LTSPICE_PARSER::CreatePin | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting Iopin from Asc files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the circle is represented. |
Definition at line 577 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LT_ASC::Flags, getLabelShape(), LTSPICE_SCHEMATIC::LT_ASC::Iopins, SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::IOPIN::Location, m_originOffset, SCH_LABEL_BASE::Move(), LTSPICE_SCHEMATIC::IOPIN::Polarity, SCH_HIER_LABEL_T, SCH_LABEL_BASE::SetShape(), ToKicadCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CreateKicadSCH_ITEMs(), and CreateSymbol().
void SCH_IO_LTSPICE_PARSER::CreatePin | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_PIN * | aPin | ||
) |
Create a pin from an asy file.
Definition at line 1274 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::BOTTOM, LTSPICE_SCHEMATIC::LEFT, LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::NONE, LTSPICE_SCHEMATIC::LT_PIN::PinAttribute, LTSPICE_SCHEMATIC::LT_PIN::PinJustification, LTSPICE_SCHEMATIC::LT_PIN::PinLocation, LTSPICE_SCHEMATIC::LT_SYMBOL::Pins, LTSPICE_SCHEMATIC::RIGHT, SCH_PIN::SetLength(), SCH_PIN::SetName(), SCH_PIN::SetNameTextSize(), SCH_PIN::SetNumber(), SCH_PIN::SetOrientation(), SCH_PIN::SetPosition(), SCH_PIN::SetShape(), SCH_PIN::SetType(), ToInvertedKicadCoords(), LTSPICE_SCHEMATIC::TOP, LTSPICE_SCHEMATIC::VBOTTOM, LTSPICE_SCHEMATIC::VLEFT, LTSPICE_SCHEMATIC::VRIGHT, and LTSPICE_SCHEMATIC::VTOP.
SCH_SYMBOL * SCH_IO_LTSPICE_PARSER::CreatePowerSymbol | ( | const VECTOR2I & | aOffset, |
const wxString & | aValue, | ||
int | aFontSize, | ||
SCH_SHEET_PATH * | aSheet, | ||
std::vector< LTSPICE_SCHEMATIC::WIRE > & | aWires | ||
) |
Create a power symbol.
aWires | Schematic wires. (Allows us to correctly orient the power symbol.) |
Definition at line 815 of file sch_io_ltspice_parser.cpp.
References LIB_SYMBOL::AddDrawItem(), SCH_SHAPE::AddPoint(), SCH_SYMBOL::GetField(), getLineWidth(), LAYER_DEVICE, m_originOffset, m_powerSymbolIndex, SCH_SYMBOL::Move(), LTSPICE_SCHEMATIC::Normal, pin, REFERENCE_FIELD, SCH_SYMBOL::SetOrientation(), LIB_SYMBOL::SetPower(), SCH_SYMBOL::SetRef(), SCH_SHAPE::SetStroke(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), SYM_ROTATE_CLOCKWISE, SYM_ROTATE_COUNTERCLOCKWISE, ToInvertedKicadCoords(), ToKicadCoords(), ToKicadFontSize(), and VALUE_FIELD.
Referenced by CreateKicadSCH_ITEMs().
void SCH_IO_LTSPICE_PARSER::CreateRect | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting rectangle from Asc files.
aAscfile | object representing asc file. |
aIndex | index. |
aSheet | a object on which the rectangle is represented. |
Definition at line 651 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::RECTANGLE::BotRight, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::RECTANGLE::LineStyle, LTSPICE_SCHEMATIC::RECTANGLE::LineWidth, m_originOffset, SCH_SHAPE::Move(), LTSPICE_SCHEMATIC::LT_ASC::Rectangles, EDA_SHAPE::SetEnd(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), ToKicadCoords(), and LTSPICE_SCHEMATIC::RECTANGLE::TopLeft.
Referenced by CreateKicadSCH_ITEMs(), CreateKicadSYMBOLs(), and CreateSymbol().
void SCH_IO_LTSPICE_PARSER::CreateRect | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHAPE * | aRectangle | ||
) |
Create a symbol rect.
Definition at line 1243 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::RECTANGLE::BotRight, getStroke(), LTSPICE_SCHEMATIC::RECTANGLE::LineStyle, LTSPICE_SCHEMATIC::RECTANGLE::LineWidth, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFillMode(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), LTSPICE_SCHEMATIC::LT_SYMBOL::SymAttributes, ToInvertedKicadCoords(), and LTSPICE_SCHEMATIC::RECTANGLE::TopLeft.
void SCH_IO_LTSPICE_PARSER::CreateRect | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Create a schematic rect.
Definition at line 1257 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::RECTANGLE::BotRight, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::RECTANGLE::LineStyle, LTSPICE_SCHEMATIC::RECTANGLE::LineWidth, SCH_SHAPE::Move(), LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, RotateMirrorShape(), EDA_SHAPE::SetEnd(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), ToInvertedKicadCoords(), and LTSPICE_SCHEMATIC::RECTANGLE::TopLeft.
SCH_LABEL_BASE * SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL | ( | KICAD_T | aType, |
const VECTOR2I & | aOffset, | ||
const wxString & | aValue, | ||
int | aFontSize | ||
) |
Create a label.
aType | Currently supported types: SCH_LABEL_T, SCH_DIRECTIVE_LABEL_T |
Definition at line 899 of file sch_io_ltspice_parser.cpp.
References SCH_LABEL_BASE::AddField(), SCH_LABEL_BASE::AutoplaceFields(), m_originOffset, SPIN_STYLE::RIGHT, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_LABEL_BASE::SetPosition(), SCH_LABEL_BASE::SetSpinStyle(), EDA_TEXT::SetText(), SCH_FIELD::SetText(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVisible(), ToKicadCoords(), ToKicadFontSize(), UNIMPLEMENTED_FOR, and SPIN_STYLE::UP.
Referenced by CreateKicadSCH_ITEMs().
SCH_TEXT * SCH_IO_LTSPICE_PARSER::CreateSCH_TEXT | ( | VECTOR2I | aOffset, |
const wxString & | aText, | ||
int | aFontSize, | ||
LTSPICE_SCHEMATIC::JUSTIFICATION | aJustification | ||
) |
Create schematic text.
Definition at line 782 of file sch_io_ltspice_parser.cpp.
References m_originOffset, EDA_TEXT::SetMultilineAllowed(), setTextJustification(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVisible(), ToKicadCoords(), and ToKicadFontSize().
Referenced by CreateKicadSCH_ITEMs().
void SCH_IO_LTSPICE_PARSER::CreateSymbol | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLtSymbol, |
LIB_SYMBOL * | aLibSymbol | ||
) |
Definition at line 274 of file sch_io_ltspice_parser.cpp.
References LIB_SYMBOL::AddDrawItem(), LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, CreateArc(), CreateCircle(), CreateLines(), CreatePin(), CreateRect(), LAYER_DEVICE, LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, pin, LTSPICE_SCHEMATIC::LT_SYMBOL::Pins, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, and SYMBOL::SetShowPinNumbers().
Referenced by CreateKicadSYMBOLs(), and LTSPICE_SCHEMATIC::Load().
void SCH_IO_LTSPICE_PARSER::CreateWire | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet, | ||
SCH_LAYER_ID | aLayer | ||
) |
Create a schematic wire.
Definition at line 799 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), getLineWidth(), SCH_SHEET_PATH::LastScreen(), m_originOffset, LTSPICE_SCHEMATIC::Normal, SCH_LINE::SetEndPoint(), SCH_ITEM::SetLayer(), SCH_LINE::SetLineStyle(), SCH_LINE::SetLineWidth(), SCH_LINE::SetStartPoint(), ToKicadCoords(), and LTSPICE_SCHEMATIC::LT_ASC::Wires.
Referenced by CreateBusEntry(), and CreateKicadSCH_ITEMs().
void SCH_IO_LTSPICE_PARSER::CreateWires | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
int | aIndex, | ||
SCH_SHEET_PATH * | aSheet | ||
) |
Method for plotting wires.
aLTSymbol | object representing asc file. |
aIndex | index. |
aSheet | a object on which the symbols is represented. |
Definition at line 442 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), getLineWidth(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::Normal, SCH_LINE::SetEndPoint(), SCH_LINE::SetLineStyle(), SCH_LINE::SetLineWidth(), SCH_LINE::SetStartPoint(), and LTSPICE_SCHEMATIC::LT_SYMBOL::Wires.
Referenced by CreateKicadSYMBOLs().
|
private |
Definition at line 677 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::DASH, LTSPICE_SCHEMATIC::DASHDOT, LTSPICE_SCHEMATIC::DASHDOTDOT, LTSPICE_SCHEMATIC::DOT, and LTSPICE_SCHEMATIC::SOLID.
Referenced by getStroke().
|
private |
Definition at line 666 of file sch_io_ltspice_parser.cpp.
References EDA_IU_SCALE::MilsToIU(), LTSPICE_SCHEMATIC::Normal, schIUScale, and LTSPICE_SCHEMATIC::Wide.
Referenced by CreatePowerSymbol(), CreateWire(), CreateWires(), and getStroke().
|
private |
Definition at line 691 of file sch_io_ltspice_parser.cpp.
References getLineStyle(), and getLineWidth().
Referenced by CreateArc(), CreateCircle(), CreateLine(), CreateLines(), and CreateRect().
void SCH_IO_LTSPICE_PARSER::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.
Parses the datastructure produced by the LTSPICE_SCHEMATIC into a KiCad schematic file.
aSheet | variable representing the current sheet. |
mapOfFiles | a string map containing all the data from .asc and .asy files. |
Definition at line 37 of file sch_io_ltspice_parser.cpp.
References CreateKicadSCH_ITEMs(), CreateKicadSYMBOLs(), BOX2< Vec >::GetCenter(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetOrigin(), SCH_SCREEN::GetPageSettings(), BOX2< Vec >::GetSize(), PAGE_INFO::GetSizeIU(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), grid, EDA_IU_SCALE::IU_PER_MILS, SCH_SHEET_PATH::LastScreen(), m_originOffset, BOX2< Vec >::Merge(), EDA_IU_SCALE::MilsToIU(), readIncludes(), schIUScale, BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), ToKicadCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LTSPICE_SCHEMATIC::Load().
|
private |
Definition at line 71 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::GetLTspiceDataDir(), m_includes, m_lt_schematic, path, and LTSPICE_SCHEMATIC::TEXT::Value.
Referenced by Parse().
void SCH_IO_LTSPICE_PARSER::RotateMirror | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
SCH_SYMBOL * | aSchSymbol | ||
) |
Methods for rotating and mirroring objects.
Definition at line 401 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::M0, LTSPICE_SCHEMATIC::M180, LTSPICE_SCHEMATIC::M270, LTSPICE_SCHEMATIC::M90, LTSPICE_SCHEMATIC::R0, LTSPICE_SCHEMATIC::R180, LTSPICE_SCHEMATIC::R270, LTSPICE_SCHEMATIC::R90, SCH_SYMBOL::SetOrientation(), SYM_MIRROR_X, SYM_MIRROR_Y, SYM_ORIENT_0, SYM_ORIENT_180, SYM_ROTATE_CLOCKWISE, SYM_ROTATE_COUNTERCLOCKWISE, and LTSPICE_SCHEMATIC::LT_SYMBOL::SymbolOrientation.
Referenced by CreateKicadSYMBOLs().
void SCH_IO_LTSPICE_PARSER::RotateMirrorShape | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
SCH_SHAPE * | aShape | ||
) |
Definition at line 364 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::M0, LTSPICE_SCHEMATIC::M180, LTSPICE_SCHEMATIC::M270, LTSPICE_SCHEMATIC::M90, SCH_SHAPE::MirrorHorizontally(), SCH_SHAPE::MirrorVertically(), LTSPICE_SCHEMATIC::R180, LTSPICE_SCHEMATIC::R270, LTSPICE_SCHEMATIC::R90, SCH_SHAPE::Rotate(), and LTSPICE_SCHEMATIC::LT_SYMBOL::SymbolOrientation.
Referenced by CreateArc(), CreateCircle(), CreateLines(), and CreateRect().
|
private |
Definition at line 698 of file sch_io_ltspice_parser.cpp.
References ANGLE_HORIZONTAL, ANGLE_VERTICAL, LTSPICE_SCHEMATIC::BOTTOM, LTSPICE_SCHEMATIC::CENTER, EDA_TEXT::GetText(), EDA_TEXT::GetTextHeight(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, LTSPICE_SCHEMATIC::LEFT, EDA_TEXT::Offset(), LTSPICE_SCHEMATIC::RIGHT, EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetVertJustify(), LTSPICE_SCHEMATIC::TOP, LTSPICE_SCHEMATIC::VBOTTOM, LTSPICE_SCHEMATIC::VCENTER, LTSPICE_SCHEMATIC::VLEFT, LTSPICE_SCHEMATIC::VRIGHT, and LTSPICE_SCHEMATIC::VTOP.
Referenced by CreateFields(), and CreateSCH_TEXT().
Definition at line 333 of file sch_io_ltspice_parser.cpp.
References ToKicadCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CreateArc(), CreateCircle(), CreateLines(), CreatePin(), CreatePowerSymbol(), and CreateRect().
Definition at line 327 of file sch_io_ltspice_parser.cpp.
References ToKicadCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
int SCH_IO_LTSPICE_PARSER::ToKicadCoords | ( | int | aCoordinate | ) |
Method converts ltspice coordinate(i.e scale) to kicad coordinates.
aCoordinate | coordinate(i.e scale) in ltspice. |
Definition at line 321 of file sch_io_ltspice_parser.cpp.
References EDA_IU_SCALE::MilsToIU(), rescale(), and schIUScale.
Referenced by CreateArc(), CreateBusEntry(), CreateCircle(), CreateFields(), CreateKicadSYMBOLs(), CreateLine(), CreateLines(), CreatePin(), CreatePowerSymbol(), CreateRect(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateWire(), LTSPICE_SCHEMATIC::Load(), Parse(), ToInvertedKicadCoords(), and ToKicadCoords().
VECTOR2I SCH_IO_LTSPICE_PARSER::ToKicadFontSize | ( | int | aLTFontSize | ) |
Definition at line 339 of file sch_io_ltspice_parser.cpp.
References EDA_IU_SCALE::MilsToIU(), schIUScale, and ToKicadFontSize().
Referenced by CreateFields(), CreatePowerSymbol(), CreateSCH_LABEL(), CreateSCH_TEXT(), and ToKicadFontSize().
int SCH_IO_LTSPICE_PARSER::ToLtSpiceCoords | ( | int | aCoordinate | ) |
Method converts kicad coordinate(i.e scale) to ltspice coordinates.
aCoordinate | coordinate(i.e scale) in ltspice. |
Definition at line 358 of file sch_io_ltspice_parser.cpp.
References EDA_IU_SCALE::IUToMils(), rescale(), and schIUScale.
Referenced by CreateKicadSYMBOLs().
|
private |
Definition at line 293 of file sch_io_ltspice_parser.h.
Referenced by CreateFields(), and readIncludes().
|
private |
Definition at line 291 of file sch_io_ltspice_parser.h.
Referenced by CreateFields(), CreateKicadSYMBOLs(), and readIncludes().
|
private |
Definition at line 292 of file sch_io_ltspice_parser.h.
Referenced by CreateArc(), CreateCircle(), CreateKicadSYMBOLs(), CreateLine(), CreateLines(), CreatePin(), CreatePowerSymbol(), CreateRect(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateWire(), and Parse().
|
private |
Definition at line 294 of file sch_io_ltspice_parser.h.
Referenced by CreatePowerSymbol().