KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_EASYEDAPRO_PARSER Class Reference

#include <sch_easyedapro_parser.h>

Public Member Functions

 SCH_EASYEDAPRO_PARSER (SCHEMATIC *aSchematic, PROGRESS_REPORTER *aProgressReporter)
 
 ~SCH_EASYEDAPRO_PARSER ()
 
double SizeToKi (wxString units)
 
EASYEDAPRO::SYM_INFO ParseSymbol (const std::vector< nlohmann::json > &aLines)
 
void ParseSchematic (SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const nlohmann::json &aProject, std::map< wxString, EASYEDAPRO::SYM_INFO > &aSymbolMap, const std::map< wxString, EASYEDAPRO::BLOB > &aBlobMap, const std::vector< nlohmann::json > &aLines, const wxString &aLibName)
 

Static Public Member Functions

static double Convert (wxString aValue)
 
template<typename T >
static T ScaleSize (T aValue)
 
template<typename T >
static VECTOR2< T > ScaleSize (VECTOR2< T > aValue)
 
template<typename T >
static VECTOR2< T > ScalePos (VECTOR2< T > aValue)
 
template<typename T >
static VECTOR2< T > ScalePosSym (VECTOR2< T > aValue)
 

Protected Member Functions

wxString ResolveFieldVariables (const wxString aInput, const std::map< wxString, wxString > &aDeviceAttributes)
 
template<typename T >
void ApplyFontStyle (const std::map< wxString, nlohmann::json > &fontStyles, T &text, const wxString &styleStr)
 
template<typename T >
void ApplyLineStyle (const std::map< wxString, nlohmann::json > &lineStyles, T &shape, const wxString &styleStr)
 
template<typename T >
void ApplyAttrToField (const std::map< wxString, nlohmann::json > &fontStyles, T *text, const EASYEDAPRO::SCH_ATTR &aAttr, bool aIsSym, bool aToSym, const std::map< wxString, wxString > &aDeviceAttributes={}, SCH_SYMBOL *aParent=nullptr)
 

Protected Attributes

SCHEMATICm_schematic
 

Detailed Description

Definition at line 66 of file sch_easyedapro_parser.h.

Constructor & Destructor Documentation

◆ SCH_EASYEDAPRO_PARSER()

SCH_EASYEDAPRO_PARSER::SCH_EASYEDAPRO_PARSER ( SCHEMATIC aSchematic,
PROGRESS_REPORTER aProgressReporter 
)
explicit

Definition at line 55 of file sch_easyedapro_parser.cpp.

References m_schematic.

◆ ~SCH_EASYEDAPRO_PARSER()

SCH_EASYEDAPRO_PARSER::~SCH_EASYEDAPRO_PARSER ( )

Definition at line 62 of file sch_easyedapro_parser.cpp.

Member Function Documentation

◆ ApplyAttrToField()

template<typename T >
void SCH_EASYEDAPRO_PARSER::ApplyAttrToField ( const std::map< wxString, nlohmann::json > &  fontStyles,
T *  text,
const EASYEDAPRO::SCH_ATTR aAttr,
bool  aIsSym,
bool  aToSym,
const std::map< wxString, wxString > &  aDeviceAttributes = {},
SCH_SYMBOL aParent = nullptr 
)
protected

◆ ApplyFontStyle()

template<typename T >
void SCH_EASYEDAPRO_PARSER::ApplyFontStyle ( const std::map< wxString, nlohmann::json > &  fontStyles,
T &  text,
const wxString &  styleStr 
)
protected

◆ ApplyLineStyle()

template<typename T >
void SCH_EASYEDAPRO_PARSER::ApplyLineStyle ( const std::map< wxString, nlohmann::json > &  lineStyles,
T &  shape,
const wxString &  styleStr 
)
protected

◆ Convert()

double SCH_EASYEDAPRO_PARSER::Convert ( wxString  aValue)
static

Definition at line 67 of file sch_easyedapro_parser.cpp.

References _, and THROW_IO_ERROR.

Referenced by SizeToKi().

◆ ParseSchematic()

void SCH_EASYEDAPRO_PARSER::ParseSchematic ( SCHEMATIC aSchematic,
SCH_SHEET aRootSheet,
const nlohmann::json &  aProject,
std::map< wxString, EASYEDAPRO::SYM_INFO > &  aSymbolMap,
const std::map< wxString, EASYEDAPRO::BLOB > &  aBlobMap,
const std::vector< nlohmann::json > &  aLines,
const wxString &  aLibName 
)

Definition at line 811 of file sch_easyedapro_parser.cpp.

References SEG::A, SHAPE_LINE_CHAIN::Append(), SCH_SCREEN::Append(), ApplyAttrToField(), ApplyFontStyle(), ApplyLineStyle(), SEG::B, EDA_ITEM::ClearFlags(), SHAPE_LINE_CHAIN::CSegment(), SCHEMATIC::CurrentSheet(), DESCRIPTION_FIELD, VECTOR2< int >::ECOORD_MAX, ENDPOINT, get_opt(), SCH_SYMBOL::GetBodyAndPinsBoundingBox(), LIB_SYMBOL::GetFootprintField(), BOX2< Vec >::GetHeight(), SVG_IMPORT_PLUGIN::GetImageHeight(), SVG_IMPORT_PLUGIN::GetImageWidth(), GRAPHICS_IMPORTER::GetItems(), BOX2< Vec >::GetLeft(), LIB_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), SCH_SCREEN::GetPageSettings(), SCH_SHEET::GetScreen(), EDA_TEXT::GetText(), BOX2< Vec >::GetTop(), LIB_SYMBOL::GetValueField(), BOX2< Vec >::GetWidth(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_TOP, EASYEDAPRO::SYM_INFO::head, EASYEDAPRO::SYM_PIN::id, SVG_IMPORT_PLUGIN::Import(), EDA_IU_SCALE::IUToMils(), EDA_IU_SCALE::IUTomm(), EASYEDAPRO::SCH_ATTR::key, KiROUND(), LAYER_NOTES, LAYER_WIRE, SPIN_STYLE::LEFT, EASYEDAPRO::SYM_INFO::libSymbol, SVG_IMPORT_PLUGIN::LoadFromMemory(), BOX2< Vec >::Merge(), EDA_IU_SCALE::MilsToIU(), SCH_ITEM::MirrorHorizontally(), EASYEDAPRO::NETPORT, EASYEDAPRO::PIN_INFO::number, EASYEDAPRO::SYM_INFO::partUnits, EASYEDAPRO::PIN_INFO::pin, pin, EASYEDAPRO::SYM_INFO::pins, SHAPE_LINE_CHAIN::PointCount(), EASYEDAPRO::POWER_PORT, REFERENCE_FIELD, SPIN_STYLE::RIGHT, SCH_ITEM::Rotate(), SPIN_STYLE::RotateCCW(), ScalePos(), ScaleSize(), SCH_LINE_T, SCH_SYMBOL_T, schIUScale, SHAPE_LINE_CHAIN::SegmentCount(), EDA_ITEM::SetFlags(), PAGE_INFO::SetHeightMils(), GRAPHICS_IMPORT_PLUGIN::SetImporter(), GRAPHICS_IMPORTER::SetImportOffsetMM(), SCH_SCREEN::SetPageSettings(), GRAPHICS_IMPORTER::SetScale(), PAGE_INFO::SetWidthMils(), STARTPOINT, EASYEDAPRO::SYM_INFO::symbolAttr, EASYEDAPRO::SYM_HEAD::symbolType, text, EASYEDAPRO::ToKiCadLibID(), EDA_ITEM::Type(), UnescapeHTML(), VALUE_FIELD, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_IO_EASYEDAPRO::LoadSchematicFile().

◆ ParseSymbol()

EASYEDAPRO::SYM_INFO SCH_EASYEDAPRO_PARSER::ParseSymbol ( const std::vector< nlohmann::json > &  aLines)

◆ ResolveFieldVariables()

wxString SCH_EASYEDAPRO_PARSER::ResolveFieldVariables ( const wxString  aInput,
const std::map< wxString, wxString > &  aDeviceAttributes 
)
protected

Definition at line 224 of file sch_easyedapro_parser.cpp.

References get_def().

Referenced by ApplyAttrToField().

◆ ScalePos()

template<typename T >
static VECTOR2< T > SCH_EASYEDAPRO_PARSER::ScalePos ( VECTOR2< T >  aValue)
inlinestatic

Definition at line 91 of file sch_easyedapro_parser.h.

References ScaleSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by ApplyAttrToField(), and ParseSchematic().

◆ ScalePosSym()

template<typename T >
static VECTOR2< T > SCH_EASYEDAPRO_PARSER::ScalePosSym ( VECTOR2< T >  aValue)
inlinestatic

Definition at line 97 of file sch_easyedapro_parser.h.

References ScaleSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by ApplyAttrToField(), and ParseSymbol().

◆ ScaleSize() [1/2]

template<typename T >
static T SCH_EASYEDAPRO_PARSER::ScaleSize ( aValue)
inlinestatic

◆ ScaleSize() [2/2]

template<typename T >
static VECTOR2< T > SCH_EASYEDAPRO_PARSER::ScaleSize ( VECTOR2< T >  aValue)
inlinestatic

Definition at line 85 of file sch_easyedapro_parser.h.

References ScaleSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

◆ SizeToKi()

double SCH_EASYEDAPRO_PARSER::SizeToKi ( wxString  units)

Definition at line 78 of file sch_easyedapro_parser.cpp.

References Convert(), and ScaleSize().

Member Data Documentation

◆ m_schematic

SCHEMATIC* SCH_EASYEDAPRO_PARSER::m_schematic
protected

Definition at line 113 of file sch_easyedapro_parser.h.

Referenced by SCH_EASYEDAPRO_PARSER().


The documentation for this class was generated from the following files: