|
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. | |
| VECTOR2I | ToLtSpiceCoords (const VECTOR2I &aPos) |
| void | CreateItems (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, SCH_SCREEN *aScreen, const std::vector< wxString > &aUniqueAscNames, std::map< wxString, SCH_SCREEN * > &aMapOfScreens, VECTOR2I aOriginOffset) |
| Create KiCad items based on LTspice data. | |
| void | CreateSymLine (LIB_SYMBOL *aSymbol, const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aShape) |
| Create a library-symbol line from LTspice symbol data. | |
| void | CreateKicadSymbolsAndSubsheets (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, SCH_SCREEN *aScreen, const std::vector< wxString > &aUniqueAscNames, std::map< wxString, SCH_SCREEN * > &aMapOfScreens) |
| Create KiCad symbol objects and subsheets from ASC data. | |
| void | CreateSymbol (LTSPICE_SCHEMATIC::LT_SYMBOL &aLtSymbol, LIB_SYMBOL *aLibSymbol) |
| Create a library symbol from LTspice symbol data. | |
| void | RotateMirrorItem (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_ITEM *aItem) |
| Rotate and mirror an item according to LTspice symbol flags. | |
| VECTOR2I | RotateMirror (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, const VECTOR2I &aPoint) |
| Rotate and mirror a point according to LTspice symbol flags. | |
| void | AssignSymOrientation (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_SYMBOL *aSchSymbol) |
| Set KiCad symbol orientation based on LTspice symbol orientation. | |
| void | CreateKicadSCH_ITEMs (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, SCH_SCREEN *aScreen) |
| Create schematic items from ASC data. | |
| void | AddAscBusEntry (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen) |
| Create a schematic bus tap from ASC data. | |
| void | AddAscIopin (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen) |
| Create a schematic I/O pin from ASC data. | |
| void | AddAscLine (const LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen) |
| Create a schematic line from ASC data. | |
| void | AddAscCircle (const LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen) |
| Create a schematic circle from ASC data. | |
| void | AddAscArc (const LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen) |
| Create a schematic arc from ASC data. | |
| void | AddAscRect (const LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen) |
| Create a schematic rectangle from ASC data. | |
| SCH_SHEET * | AddAscSymAsSubsheet (LTSPICE_SCHEMATIC::LT_ASC &aAscfile, const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_SCREEN *aScreen) |
| SCH_TEXT * | CreateSCH_TEXT (const VECTOR2I &aOffset, const wxString &aText, int aFontSize, LTSPICE_SCHEMATIC::JUSTIFICATION aJustification) |
| Create schematic text. | |
| void | AddAscWire (const LTSPICE_SCHEMATIC::LT_ASC &aAscfile, int aIndex, SCH_SCREEN *aScreen, SCH_LAYER_ID aLayer) |
| Create a schematic wire from ASC data. | |
| SCH_SYMBOL * | CreatePowerSymbol (const VECTOR2I &aOffset, const wxString &aValue, int aFontSize, SCH_SCREEN *aScreen, std::vector< LTSPICE_SCHEMATIC::WIRE > &aWires) |
| Create a power symbol for the schematic. | |
| SCH_LABEL_BASE * | CreateSCH_LABEL (KICAD_T aType, const VECTOR2I &aOffset, const wxString &aValue, int aFontSize, SCH_SCREEN *aScreen) |
| Create a schematic label. | |
| void | AddSymFields (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, SCH_SYMBOL *aSymbol) |
| Create and configure symbol fields from LTspice symbol data. | |
| void | CreateSymRect (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aRectangle) |
| Create a symbol rectangle from LTspice symbol data. | |
| void | CreateSymPin (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_PIN *aPin) |
| Create a symbol pin from LTspice symbol data. | |
| void | CreateSymArc (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aArc) |
| Create a symbol arc from LTspice symbol data. | |
| void | CreateSymCircle (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_SHAPE *aCircle) |
| Create a symbol circle from LTspice symbol data. | |
| void | CreateSymText (const LTSPICE_SCHEMATIC::LT_SYMBOL &aLTSymbol, int aIndex, SCH_TEXT *aText) |
| Create a symbol text from LTspice symbol data. | |
Static Public Attributes | |
| static constexpr const wxChar * | LT_INSTNAME_FIELD = wxS( "LT_InstName" ) |
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 64 of file sch_io_ltspice_parser.h.
|
inlineexplicit |
Definition at line 70 of file sch_io_ltspice_parser.h.
References m_lt_schematic, and m_powerSymbolIndex.
|
inline |
Definition at line 75 of file sch_io_ltspice_parser.h.
| void SCH_IO_LTSPICE_PARSER::AddAscArc | ( | const LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic arc from ASC data.
Definition at line 928 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(), 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().
| void SCH_IO_LTSPICE_PARSER::AddAscBusEntry | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic bus tap from ASC data.
Definition at line 735 of file sch_io_ltspice_parser.cpp.
References AddAscWire(), SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LT_ASC::Bustap, 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::AddAscCircle | ( | const LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic circle from ASC data.
Definition at line 911 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::CIRCLE::BotRight, CIRCLE, circle(), LTSPICE_SCHEMATIC::LT_ASC::Circles, getStroke(), LTSPICE_SCHEMATIC::CIRCLE::LineStyle, LTSPICE_SCHEMATIC::CIRCLE::LineWidth, m_originOffset, ToKicadCoords(), LTSPICE_SCHEMATIC::CIRCLE::TopLeft, and VECTOR2< T >::x.
Referenced by CreateKicadSCH_ITEMs().
| void SCH_IO_LTSPICE_PARSER::AddAscIopin | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic I/O pin from ASC data.
Definition at line 872 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), autoLabelOrientation(), AUTOPLACE_AUTO, SCH_LABEL_BASE::AutoplaceFields(), LTSPICE_SCHEMATIC::LT_ASC::Flags, getLabelShape(), LTSPICE_SCHEMATIC::LT_ASC::Iopins, IS_NEW, LTSPICE_SCHEMATIC::IOPIN::Location, m_originOffset, LTSPICE_SCHEMATIC::IOPIN::Polarity, SPIN_STYLE::RIGHT, SCH_HIER_LABEL_T, EDA_ITEM::SetFlags(), SCH_LABEL_BASE::SetShape(), SCH_HIERLABEL::SetSpinStyle(), ToKicadCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CreateKicadSCH_ITEMs().
| void SCH_IO_LTSPICE_PARSER::AddAscLine | ( | const LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic line from ASC data.
Definition at line 898 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LINE::End, getStroke(), 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::AddAscRect | ( | const LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic rectangle from ASC data.
Definition at line 943 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::RECTANGLE::BotRight, getStroke(), 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().
| SCH_SHEET * SCH_IO_LTSPICE_PARSER::AddAscSymAsSubsheet | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, | ||
| SCH_SCREEN * | aScreen ) |
Definition at line 957 of file sch_io_ltspice_parser.cpp.
References SCH_SHEET::AddField(), SCH_SHEET::AddPin(), SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, LTSPICE_SCHEMATIC::LT_SYMBOL::AsyKey, LTSPICE_SCHEMATIC::ARC::BotRight, LTSPICE_SCHEMATIC::RECTANGLE::BotRight, circle(), LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, SCH_SHEET_PIN::ConstrainOnEdge(), LTSPICE_SCHEMATIC::LINE::End, LTSPICE_SCHEMATIC::WIRE::End, flag, LTSPICE_SCHEMATIC::LT_ASC::Flags, get_def(), SCH_SHEET::GetField(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetOrigin(), SCH_TEXT::GetPosition(), BOX2< Vec >::GetSize(), BOX2< Vec >::GetWidth(), BOX2< Vec >::Inflate(), LTSPICE_SCHEMATIC::LT_ASC::Iopins, LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, LTSPICE_SCHEMATIC::IOPIN::Location, LT_INSTNAME_FIELD, m_lt_schematic, m_originOffset, BOX2< Vec >::Merge(), LTSPICE_SCHEMATIC::LT_SYMBOL::Name, name, LTSPICE_SCHEMATIC::NONE, LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, pin, LTSPICE_SCHEMATIC::LT_SYMBOL::Pins, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, ReplaceIllegalFileNameChars(), RotateMirror(), SCH_SCREEN::Schematic(), schIUScale, SCH_SHEET::SetBorderWidth(), SCH_SHEET::SetPosition(), SCH_TEXT::SetSchTextSize(), SCH_SHEET::SetSize(), SCH_FIELD::SetText(), EDA_TEXT::SetVisible(), SHEET_FILENAME, SHEET_NAME, SHEET_USER, LTSPICE_SCHEMATIC::LINE::Start, LTSPICE_SCHEMATIC::WIRE::Start, LTSPICE_SCHEMATIC::LT_SYMBOL::SymAttributes, ToKicadCoords(), ToLtSpiceCoords(), LTSPICE_SCHEMATIC::ARC::TopLeft, LTSPICE_SCHEMATIC::RECTANGLE::TopLeft, and LTSPICE_SCHEMATIC::LT_ASC::Wires.
Referenced by CreateKicadSymbolsAndSubsheets().
| void SCH_IO_LTSPICE_PARSER::AddAscWire | ( | const LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| int | aIndex, | ||
| SCH_SCREEN * | aScreen, | ||
| SCH_LAYER_ID | aLayer ) |
Create a schematic wire from ASC data.
Definition at line 1207 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), getLineWidth(), 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 AddAscBusEntry(), and CreateKicadSCH_ITEMs().
| void SCH_IO_LTSPICE_PARSER::AddSymFields | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| SCH_SYMBOL * | aSymbol ) |
Create and configure symbol fields from LTspice symbol data.
Definition at line 1325 of file sch_io_ltspice_parser.cpp.
References SCH_SYMBOL::AddField(), convertPwlFileToNgspice(), LTSPICE_SCHEMATIC::LT_WINDOW::FontSize, get_def(), SCH_SYMBOL::GetField(), LTSPICE_SCHEMATIC::LT_WINDOW::Justification, LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::NONE, LTSPICE_SCHEMATIC::LT_WINDOW::Position, REFERENCE, SCH_FIELD::SetPosition(), 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 CreateKicadSymbolsAndSubsheets().
| void SCH_IO_LTSPICE_PARSER::AssignSymOrientation | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| SCH_SYMBOL * | aSchSymbol ) |
Set KiCad symbol orientation based on LTspice symbol orientation.
Definition at line 643 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 CreateKicadSymbolsAndSubsheets().
| void SCH_IO_LTSPICE_PARSER::CreateItems | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| SCH_SCREEN * | aScreen, | ||
| const std::vector< wxString > & | aUniqueAscNames, | ||
| std::map< wxString, SCH_SCREEN * > & | aMapOfScreens, | ||
| VECTOR2I | aOriginOffset ) |
Create KiCad items based on LTspice data.
| aAscfile | the LTspice ASC file data. |
| aScreen | the screen to add the items to. |
| aUniqueAscNames | the symbol names to import as subsheets instead of symbols. |
| aMapOfScreens | the map of screens to assign screens to new subsheets. |
| aOriginOffset | the offset to apply to the items (in KiCad units). |
Definition at line 246 of file sch_io_ltspice_parser.cpp.
References SCH_SCREEN::Append(), CreateKicadSCH_ITEMs(), CreateKicadSymbolsAndSubsheets(), PROJECT::GetProjectPath(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_BOTTOM, m_lt_schematic, m_originOffset, name, SCHEMATIC::Project(), SCHEMATIC::RootScreen(), SCH_SCREEN::Schematic(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetMultilineAllowed(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), and text.
Referenced by LTSPICE_SCHEMATIC::Load().
| void SCH_IO_LTSPICE_PARSER::CreateKicadSCH_ITEMs | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| SCH_SCREEN * | aScreen ) |
Create schematic items from ASC data.
Definition at line 683 of file sch_io_ltspice_parser.cpp.
References AddAscArc(), AddAscBusEntry(), AddAscCircle(), AddAscIopin(), AddAscLine(), AddAscRect(), AddAscWire(), SCH_SCREEN::Append(), LTSPICE_SCHEMATIC::LT_ASC::Arcs, LTSPICE_SCHEMATIC::LT_ASC::Bustap, LTSPICE_SCHEMATIC::LT_ASC::Circles, convertLtSpiceTextToNgspice(), CreatePowerSymbol(), CreateSCH_LABEL(), CreateSCH_TEXT(), LTSPICE_SCHEMATIC::LT_ASC::DataFlags, LTSPICE_SCHEMATIC::LT_ASC::Flags, LTSPICE_SCHEMATIC::FLAG::FontSize, LTSPICE_SCHEMATIC::TEXT::FontSize, LTSPICE_SCHEMATIC::LT_ASC::Iopins, LTSPICE_SCHEMATIC::TEXT::Justification, LAYER_WIRE, LTSPICE_SCHEMATIC::LT_ASC::Lines, LTSPICE_SCHEMATIC::FLAG::Offset, LTSPICE_SCHEMATIC::TEXT::Offset, LTSPICE_SCHEMATIC::LT_ASC::Rectangles, SCHEMATIC::RootScreen(), SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_LABEL_T, SCH_SCREEN::Schematic(), LTSPICE_SCHEMATIC::LT_ASC::Texts, LTSPICE_SCHEMATIC::FLAG::Value, LTSPICE_SCHEMATIC::TEXT::Value, and LTSPICE_SCHEMATIC::LT_ASC::Wires.
Referenced by CreateItems().
| void SCH_IO_LTSPICE_PARSER::CreateKicadSymbolsAndSubsheets | ( | LTSPICE_SCHEMATIC::LT_ASC & | aAscfile, |
| SCH_SCREEN * | aScreen, | ||
| const std::vector< wxString > & | aUniqueAscNames, | ||
| std::map< wxString, SCH_SCREEN * > & | aMapOfScreens ) |
Create KiCad symbol objects and subsheets from ASC data.
Definition at line 362 of file sch_io_ltspice_parser.cpp.
References AddAscSymAsSubsheet(), AddSymFields(), SCH_SCREEN::Append(), ARC, LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, AssignSymOrientation(), LTSPICE_SCHEMATIC::LT_SYMBOL::AsyKey, CIRCLE, LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, alg::contains(), CreateSymArc(), CreateSymbol(), CreateSymCircle(), CreateSymLine(), CreateSymRect(), CreateSymText(), LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, m_lt_schematic, m_originOffset, SCH_SHAPE::Move(), SCH_SYMBOL::Move(), LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::LT_SYMBOL::Offset, POLY, RECTANGLE, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, RotateMirrorItem(), SCH_SHEET::SetScreen(), LTSPICE_SCHEMATIC::LT_ASC::Symbols, text, LTSPICE_SCHEMATIC::LT_SYMBOL::Texts, and ToKicadCoords().
Referenced by CreateItems().
| SCH_SYMBOL * SCH_IO_LTSPICE_PARSER::CreatePowerSymbol | ( | const VECTOR2I & | aOffset, |
| const wxString & | aValue, | ||
| int | aFontSize, | ||
| SCH_SCREEN * | aScreen, | ||
| std::vector< LTSPICE_SCHEMATIC::WIRE > & | aWires ) |
Create a power symbol for the schematic.
Definition at line 1223 of file sch_io_ltspice_parser.cpp.
References LIB_SYMBOL::AddDrawItem(), SCH_SHAPE::AddPoint(), autoLabelOrientation(), SPIN_STYLE::BOTTOM, SCH_SYMBOL::GetField(), getLineWidth(), LAYER_DEVICE, SPIN_STYLE::LEFT, LINE, m_originOffset, m_powerSymbolIndex, SCH_SYMBOL::Move(), LTSPICE_SCHEMATIC::Normal, pin, POLY, PT_POWER_IN, REFERENCE, SPIN_STYLE::RIGHT, LIB_SYMBOL::SetGlobalPower(), SCH_SYMBOL::SetOrientation(), SCH_SHAPE::SetStroke(), SCH_FIELD::SetText(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), SOLID, SYM_ORIENT_0, SYM_ORIENT_180, SYM_ORIENT_270, SYM_ORIENT_90, ToKicadCoords(), ToKicadFontSize(), SPIN_STYLE::UP, and VALUE.
Referenced by CreateKicadSCH_ITEMs().
| SCH_LABEL_BASE * SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL | ( | KICAD_T | aType, |
| const VECTOR2I & | aOffset, | ||
| const wxString & | aValue, | ||
| int | aFontSize, | ||
| SCH_SCREEN * | aScreen ) |
Create a schematic label.
Definition at line 1275 of file sch_io_ltspice_parser.cpp.
References SCH_LABEL_BASE::AddField(), autoLabelOrientation(), AUTOPLACE_AUTO, SCH_LABEL_BASE::AutoplaceFields(), SCH_TEXT::GetPosition(), m_originOffset, SPIN_STYLE::RIGHT, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_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 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 1191 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::CreateSymArc | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| int | aIndex, | ||
| SCH_SHAPE * | aArc ) |
Create a symbol arc from LTspice symbol data.
Definition at line 1762 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.
Referenced by CreateKicadSymbolsAndSubsheets(), and CreateSymbol().
| void SCH_IO_LTSPICE_PARSER::CreateSymbol | ( | LTSPICE_SCHEMATIC::LT_SYMBOL & | aLtSymbol, |
| LIB_SYMBOL * | aLibSymbol ) |
Create a library symbol from LTspice symbol data.
Definition at line 465 of file sch_io_ltspice_parser.cpp.
References LIB_SYMBOL::AddDrawItem(), ARC, LTSPICE_SCHEMATIC::LT_SYMBOL::Arcs, CIRCLE, circle(), LTSPICE_SCHEMATIC::LT_SYMBOL::Circles, CreateSymArc(), CreateSymCircle(), CreateSymLine(), CreateSymPin(), CreateSymRect(), CreateSymText(), LAYER_DEVICE, LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, pin, LTSPICE_SCHEMATIC::LT_SYMBOL::Pins, POLY, RECTANGLE, LTSPICE_SCHEMATIC::LT_SYMBOL::Rectangles, SYMBOL::SetShowPinNumbers(), text, and LTSPICE_SCHEMATIC::LT_SYMBOL::Texts.
Referenced by CreateKicadSymbolsAndSubsheets().
| void SCH_IO_LTSPICE_PARSER::CreateSymCircle | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| int | aIndex, | ||
| SCH_SHAPE * | aCircle ) |
Create a symbol circle from LTspice symbol data.
Definition at line 1773 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.
Referenced by CreateKicadSymbolsAndSubsheets(), and CreateSymbol().
| void SCH_IO_LTSPICE_PARSER::CreateSymLine | ( | LIB_SYMBOL * | aSymbol, |
| const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, | ||
| int | aIndex, | ||
| SCH_SHAPE * | aShape ) |
Create a library-symbol line from LTspice symbol data.
Definition at line 351 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 CreateKicadSymbolsAndSubsheets(), and CreateSymbol().
| void SCH_IO_LTSPICE_PARSER::CreateSymPin | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| int | aIndex, | ||
| SCH_PIN * | aPin ) |
Create a symbol pin from LTspice symbol data.
Definition at line 1677 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::BOTTOM, LTSPICE_SCHEMATIC::LINE::End, get_def(), BOX2< Vec >::GetEnd(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetWidth(), LTSPICE_SCHEMATIC::LEFT, LINE, LTSPICE_SCHEMATIC::LT_SYMBOL::Lines, BOX2< Vec >::Merge(), LTSPICE_SCHEMATIC::LT_SYMBOL::Name, LTSPICE_SCHEMATIC::LT_PIN::NameOffSet, 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, schIUScale, SCH_PIN::SetLength(), SCH_PIN::SetName(), SCH_PIN::SetNameTextSize(), SCH_PIN::SetNumber(), SCH_PIN::SetOrientation(), SCH_PIN::SetPosition(), SCH_PIN::SetShape(), SCH_PIN::SetType(), LTSPICE_SCHEMATIC::LINE::Start, ToKicadCoords(), LTSPICE_SCHEMATIC::TOP, LTSPICE_SCHEMATIC::VBOTTOM, LTSPICE_SCHEMATIC::VLEFT, LTSPICE_SCHEMATIC::VRIGHT, and LTSPICE_SCHEMATIC::VTOP.
Referenced by CreateSymbol().
| void SCH_IO_LTSPICE_PARSER::CreateSymRect | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| int | aIndex, | ||
| SCH_SHAPE * | aRectangle ) |
Create a symbol rectangle from LTspice symbol data.
Definition at line 1663 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::RECTANGLE::BotRight, FILLED_WITH_BG_BODYCOLOR, get_def(), 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.
Referenced by CreateKicadSymbolsAndSubsheets(), and CreateSymbol().
| void SCH_IO_LTSPICE_PARSER::CreateSymText | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| int | aIndex, | ||
| SCH_TEXT * | aText ) |
Create a symbol text from LTspice symbol data.
Definition at line 1787 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::TEXT::FontSize, LTSPICE_SCHEMATIC::TEXT::Justification, LTSPICE_SCHEMATIC::TEXT::Offset, SCH_TEXT::SetPosition(), EDA_TEXT::SetText(), setTextJustification(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetVisible(), LTSPICE_SCHEMATIC::LT_SYMBOL::Texts, ToKicadCoords(), ToKicadFontSize(), and LTSPICE_SCHEMATIC::TEXT::Value.
Referenced by CreateKicadSymbolsAndSubsheets(), and CreateSymbol().
|
private |
Definition at line 1082 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 1071 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::Normal, schIUScale, and LTSPICE_SCHEMATIC::Wide.
Referenced by AddAscWire(), CreatePowerSymbol(), and getStroke().
|
private |
Definition at line 1096 of file sch_io_ltspice_parser.cpp.
References getLineStyle(), and getLineWidth().
Referenced by AddAscArc(), AddAscCircle(), AddAscLine(), AddAscRect(), CreateSymArc(), CreateSymCircle(), CreateSymLine(), and CreateSymRect().
| VECTOR2I SCH_IO_LTSPICE_PARSER::RotateMirror | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| const VECTOR2I & | aPoint ) |
Rotate and mirror a point according to LTspice symbol flags.
Definition at line 563 of file sch_io_ltspice_parser.cpp.
References ANGLE_180, ANGLE_270, ANGLE_90, LTSPICE_SCHEMATIC::M0, LTSPICE_SCHEMATIC::M180, LTSPICE_SCHEMATIC::M270, LTSPICE_SCHEMATIC::M90, LTSPICE_SCHEMATIC::R180, LTSPICE_SCHEMATIC::R270, LTSPICE_SCHEMATIC::R90, RotatePoint(), LTSPICE_SCHEMATIC::LT_SYMBOL::SymbolOrientation, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by AddAscSymAsSubsheet().
| void SCH_IO_LTSPICE_PARSER::RotateMirrorItem | ( | const LTSPICE_SCHEMATIC::LT_SYMBOL & | aLTSymbol, |
| SCH_ITEM * | aItem ) |
Rotate and mirror an item according to LTspice symbol flags.
Definition at line 607 of file sch_io_ltspice_parser.cpp.
References LTSPICE_SCHEMATIC::M0, LTSPICE_SCHEMATIC::M180, LTSPICE_SCHEMATIC::M270, LTSPICE_SCHEMATIC::M90, SCH_ITEM::MirrorHorizontally(), SCH_ITEM::MirrorVertically(), LTSPICE_SCHEMATIC::R180, LTSPICE_SCHEMATIC::R270, LTSPICE_SCHEMATIC::R90, SCH_ITEM::Rotate(), and LTSPICE_SCHEMATIC::LT_SYMBOL::SymbolOrientation.
Referenced by CreateKicadSymbolsAndSubsheets().
|
private |
Definition at line 1103 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 AddSymFields(), CreateSCH_TEXT(), and CreateSymText().
Definition at line 525 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 519 of file sch_io_ltspice_parser.cpp.
References rescale(), and schIUScale.
Referenced by AddAscArc(), AddAscBusEntry(), AddAscCircle(), AddAscIopin(), AddAscLine(), AddAscRect(), AddAscSymAsSubsheet(), AddAscWire(), AddSymFields(), CreateKicadSymbolsAndSubsheets(), CreatePowerSymbol(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateSymArc(), CreateSymCircle(), CreateSymLine(), CreateSymPin(), CreateSymRect(), CreateSymText(), LTSPICE_SCHEMATIC::Load(), and ToKicadCoords().
| VECTOR2I SCH_IO_LTSPICE_PARSER::ToKicadFontSize | ( | int | aLTFontSize | ) |
Definition at line 531 of file sch_io_ltspice_parser.cpp.
References schIUScale, and ToKicadFontSize().
Referenced by AddSymFields(), CreatePowerSymbol(), CreateSCH_LABEL(), CreateSCH_TEXT(), CreateSymText(), and ToKicadFontSize().
Definition at line 557 of file sch_io_ltspice_parser.cpp.
References ToLtSpiceCoords(), VECTOR2< T >::x, and VECTOR2< T >::y.
| 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 551 of file sch_io_ltspice_parser.cpp.
References rescale(), and schIUScale.
Referenced by AddAscSymAsSubsheet(), and ToLtSpiceCoords().
|
staticconstexpr |
Definition at line 68 of file sch_io_ltspice_parser.h.
Referenced by AddAscSymAsSubsheet().
|
private |
Definition at line 246 of file sch_io_ltspice_parser.h.
Referenced by AddAscSymAsSubsheet(), CreateItems(), CreateKicadSymbolsAndSubsheets(), and SCH_IO_LTSPICE_PARSER().
|
private |
Definition at line 247 of file sch_io_ltspice_parser.h.
Referenced by AddAscArc(), AddAscCircle(), AddAscIopin(), AddAscLine(), AddAscRect(), AddAscSymAsSubsheet(), AddAscWire(), CreateItems(), CreateKicadSymbolsAndSubsheets(), CreatePowerSymbol(), CreateSCH_LABEL(), and CreateSCH_TEXT().
|
private |
Definition at line 248 of file sch_io_ltspice_parser.h.
Referenced by CreatePowerSymbol(), and SCH_IO_LTSPICE_PARSER().