|
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 | 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 (const 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, std::vector< LTSPICE_SCHEMATIC::WIRE > &aWires) |
| 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) |
Private Attributes | |
| LTSPICE_SCHEMATIC * | m_lt_schematic |
| VECTOR2I | m_originOffset |
| 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.
References m_lt_schematic, and m_powerSymbolIndex.
|
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 879 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), ARC, 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 1666 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(), ToKicadCoords(), 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 1678 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), ARC, 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(), 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 786 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LT_ASC::Bustap, CreateWire(), SCH_SHEET_PATH::LastScreen(), LAYER_BUS, 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 861 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::CIRCLE::BotRight, CIRCLE, circle(), LTSPICE_SCHEMATIC::LT_ASC::Circles, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::CIRCLE::LineStyle, LTSPICE_SCHEMATIC::CIRCLE::LineWidth, m_originOffset, 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 1716 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(), 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 1696 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::CIRCLE::BotRight, CIRCLE, circle(), LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, getStroke(), SCH_SHEET_PATH::LastScreen(), LTSPICE_SCHEMATIC::CIRCLE::LineStyle, LTSPICE_SCHEMATIC::CIRCLE::LineWidth, LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, RotateMirrorShape(), 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 1234 of file sch_io_ltspice_parser.cpp.
References SCH_SYMBOL::AddField(), convertPwlFileToNgspice(), LTSPICE_SCHEMATIC::LT_WINDOW::FontSize, SCH_SYMBOL::GetField(), LTSPICE_SCHEMATIC::LT_WINDOW::Justification, LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::LT_WINDOW::Position, REFERENCE, SCH_FIELD::SetPosition(), SCH_SYMBOL::SetRef(), SCH_FIELD::SetText(), setTextJustification(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), LTSPICE_SCHEMATIC::LT_SYMBOL::SymAttributes, tokenizeQuoted(), ToKicadCoords(), ToKicadFontSize(), USER, VALUE, 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 710 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), convertLtSpiceTextToNgspice(), 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(), LAYER_WIRE, 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 394 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, 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 847 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LINE::End, getStroke(), SCH_SHEET_PATH::LastScreen(), LAYER_NOTES, 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 365 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 ToKicadCoords().
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 377 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, POLY, 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 821 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 1604 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::BOTTOM, LTSPICE_SCHEMATIC::LEFT, LINE, LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::NONE, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, LTSPICE_SCHEMATIC::LT_PIN::PinAttribute, LTSPICE_SCHEMATIC::LT_PIN::PinJustification, LTSPICE_SCHEMATIC::LT_PIN::PinLocation, LTSPICE_SCHEMATIC::LT_SYMBOL::Pins, PT_PASSIVE, 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(), ToKicadCoords(), 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 1063 of file sch_io_ltspice_parser.cpp.
References LIB_SYMBOL::AddDrawItem(), SCH_SHAPE::AddPoint(), SCH_SYMBOL::GetField(), getLineWidth(), LAYER_DEVICE, LINE, m_originOffset, m_powerSymbolIndex, SCH_SYMBOL::Move(), LTSPICE_SCHEMATIC::Normal, pin, POLY, PT_POWER_IN, REFERENCE, LIB_SYMBOL::SetGlobalPower(), SCH_SYMBOL::SetOrientation(), SCH_SYMBOL::SetRef(), SCH_SHAPE::SetStroke(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), SOLID, SYM_ROTATE_CLOCKWISE, SYM_ROTATE_COUNTERCLOCKWISE, ToKicadCoords(), ToKicadFontSize(), and VALUE.
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 895 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(), RECTANGLE, 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 1573 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::RECTANGLE::BotRight, FILLED_WITH_BG_BODYCOLOR, 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, ToKicadCoords(), 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 1587 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, RECTANGLE, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, RotateMirrorShape(), EDA_SHAPE::SetEnd(), SCH_SHAPE::SetPosition(), SCH_SHAPE::SetStroke(), ToKicadCoords(), 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, | ||
| std::vector< LTSPICE_SCHEMATIC::WIRE > & | aWires ) |
Create a label.
| aType | Currently supported types: SCH_LABEL_T, SCH_DIRECTIVE_LABEL_T |
Definition at line 1148 of file sch_io_ltspice_parser.cpp.
References SCH_LABEL_BASE::AddField(), AUTOPLACE_AUTO, SCH_LABEL_BASE::AutoplaceFields(), SPIN_STYLE::BOTTOM, SPIN_STYLE::LEFT, 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, SPIN_STYLE::UP, and USER.
Referenced by CreateKicadSCH_ITEMs().
| SCH_TEXT * SCH_IO_LTSPICE_PARSER::CreateSCH_TEXT | ( | const VECTOR2I & | aOffset, |
| const wxString & | aText, | ||
| int | aFontSize, | ||
| LTSPICE_SCHEMATIC::JUSTIFICATION | aJustification ) |
Create schematic text.
Definition at line 1030 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 533 of file sch_io_ltspice_parser.cpp.
References LIB_SYMBOL::AddDrawItem(), ARC, LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, CIRCLE, circle(), LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, CreateArc(), CreateCircle(), CreateLines(), CreatePin(), CreateRect(), LAYER_DEVICE, LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, pin, LTSPICE_SCHEMATIC::LT_SYMBOL::Pins, POLY, RECTANGLE, 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 1047 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(), SOLID, 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 695 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(), SOLID, and LTSPICE_SCHEMATIC::LT_SYMBOL::Wires.
Referenced by CreateKicadSYMBOLs().
|
private |
Definition at line 921 of file sch_io_ltspice_parser.cpp.
References DASH, LTSPICE_SCHEMATIC::DASH, DASHDOT, LTSPICE_SCHEMATIC::DASHDOT, DASHDOTDOT, LTSPICE_SCHEMATIC::DASHDOTDOT, DOT, LTSPICE_SCHEMATIC::DOT, SOLID, and LTSPICE_SCHEMATIC::SOLID.
Referenced by getStroke().
|
private |
Definition at line 910 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::Normal, schIUScale, and LTSPICE_SCHEMATIC::Wide.
Referenced by CreatePowerSymbol(), CreateWire(), CreateWires(), and getStroke().
|
private |
Definition at line 935 of file sch_io_ltspice_parser.cpp.
References getLineStyle(), and getLineWidth().
Referenced by CreateArc(), CreateArc(), CreateArc(), CreateCircle(), CreateCircle(), CreateCircle(), CreateLine(), CreateLines(), CreateLines(), CreateRect(), CreateRect(), 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.
| aSheet | variable representing the current sheet. |
| mapOfFiles | a string map containing all the data from .asc and .asy files. |
Definition at line 240 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), 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(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_BOTTOM, grid, SCH_SHEET_PATH::LastScreen(), m_lt_schematic, m_originOffset, BOX2< Vec >::Merge(), name, SCH_SCREEN::Schematic(), schIUScale, EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetMultilineAllowed(), BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), text, ToKicadCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by LTSPICE_SCHEMATIC::Load().
| void SCH_IO_LTSPICE_PARSER::RotateMirror | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| SCH_SYMBOL * | aSchSymbol ) |
Methods for rotating and mirroring objects.
Definition at line 654 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 617 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 942 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::INVISIBLE, LTSPICE_SCHEMATIC::LEFT, EDA_TEXT::Offset(), LTSPICE_SCHEMATIC::RIGHT, EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), 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 586 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 580 of file sch_io_ltspice_parser.cpp.
References rescale(), and schIUScale.
Referenced by CreateArc(), CreateArc(), CreateArc(), CreateBusEntry(), CreateCircle(), CreateCircle(), CreateCircle(), CreateFields(), CreateKicadSYMBOLs(), CreateLine(), CreateLines(), CreateLines(), CreatePin(), CreatePin(), CreatePowerSymbol(), CreateRect(), CreateRect(), CreateRect(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateWire(), LTSPICE_SCHEMATIC::Load(), Parse(), and ToKicadCoords().
| VECTOR2I SCH_IO_LTSPICE_PARSER::ToKicadFontSize | ( | int | aLTFontSize | ) |
Definition at line 592 of file sch_io_ltspice_parser.cpp.
References 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 611 of file sch_io_ltspice_parser.cpp.
References rescale(), and schIUScale.
Referenced by CreateKicadSYMBOLs().
|
private |
Definition at line 288 of file sch_io_ltspice_parser.h.
Referenced by CreateKicadSYMBOLs(), Parse(), and SCH_IO_LTSPICE_PARSER().
|
private |
Definition at line 289 of file sch_io_ltspice_parser.h.
Referenced by CreateArc(), CreateArc(), CreateCircle(), CreateKicadSYMBOLs(), CreateLine(), CreateLines(), CreatePin(), CreatePowerSymbol(), CreateRect(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateWire(), and Parse().
|
private |
Definition at line 290 of file sch_io_ltspice_parser.h.
Referenced by CreatePowerSymbol(), and SCH_IO_LTSPICE_PARSER().