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, const std::map< wxString, wxString > &aDeviceAttributes)
 
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 59 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 67 of file sch_easyedapro_parser.cpp.

References m_schematic.

◆ ~SCH_EASYEDAPRO_PARSER()

SCH_EASYEDAPRO_PARSER::~SCH_EASYEDAPRO_PARSER ( )

Definition at line 74 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 79 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 856 of file sch_easyedapro_parser.cpp.

References SEG::A, std::abs(), EASYEDAPRO::AnyMapToStringMap(), SHAPE_LINE_CHAIN::Append(), SCH_SCREEN::Append(), ApplyAttrToField(), ApplyFontStyle(), ApplyLineStyle(), SEG::B, SPIN_STYLE::BOTTOM, c_attributesWhitelist, EDA_ITEM::ClearFlags(), SHAPE_LINE_CHAIN::CSegment(), SCHEMATIC::CurrentSheet(), DESCRIPTION_FIELD, VECTOR2< int32_t >::ECOORD_MAX, ENDPOINT, get_def(), get_opt(), SCH_SYMBOL::GetBodyAndPinsBoundingBox(), BOX2< Vec >::GetCenter(), 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(), REFERENCE_IMAGE::GetSize(), 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, BOX2< Vec >::Offset(), EASYEDAPRO::SYM_INFO::partUnits, EASYEDAPRO::PIN_INFO::pin, pin, EASYEDAPRO::SYM_INFO::pins, SHAPE_LINE_CHAIN::PointCount(), EASYEDAPRO::POWER_PORT, REFERENCE_IMAGE::ReadImageFile(), REFERENCE_FIELD, SPIN_STYLE::RIGHT, SCH_ITEM::Rotate(), ScalePos(), ScaleSize(), SCH_LINE_T, SCH_SYMBOL_T, schIUScale, SHAPE_LINE_CHAIN::SegmentCount(), EDA_ITEM::SetFlags(), PAGE_INFO::SetHeightMils(), REFERENCE_IMAGE::SetImageScale(), GRAPHICS_IMPORT_PLUGIN::SetImporter(), GRAPHICS_IMPORTER::SetImportOffsetMM(), SCH_SCREEN::SetPageSettings(), GRAPHICS_IMPORTER::SetScale(), PAGE_INFO::SetWidthMils(), STARTPOINT, EASYEDAPRO::SYM_HEAD::symbolType, text, EASYEDAPRO::ToKiCadLibID(), EDA_ITEM::Type(), UnescapeHTML(), SPIN_STYLE::UP, 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,
const std::map< wxString, wxString > &  aDeviceAttributes 
)

Definition at line 399 of file sch_easyedapro_parser.cpp.

References _, LIB_SYMBOL::AddDrawItem(), LIB_SYMBOL::AddField(), ApplyAttrToField(), ApplyFontStyle(), ApplyLineStyle(), c_attributesWhitelist, ConvertImageToLibShapes(), LIB_SYMBOL::FindField(), get_opt(), SVG_IMPORT_PLUGIN::GetImageHeight(), SVG_IMPORT_PLUGIN::GetImageWidth(), GRAPHICS_IMPORTER::GetItems(), LIB_SYMBOL::GetName(), LIB_SYMBOL::GetNextAvailableFieldId(), LIB_SYMBOL::GetReferenceField(), LIB_SYMBOL::GetValueField(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_TOP, EASYEDAPRO::SYM_INFO::head, SVG_IMPORT_PLUGIN::Import(), EDA_IU_SCALE::IUTomm(), EASYEDAPRO::SCH_ATTR::key, LAYER_DEVICE, EASYEDAPRO::SYM_INFO::libSymbol, SVG_IMPORT_PLUGIN::LoadFromMemory(), EDA_IU_SCALE::MilsToIU(), EASYEDAPRO::PIN_INFO::name, EASYEDAPRO::NETPORT, EASYEDAPRO::PIN_INFO::number, EASYEDAPRO::SYM_INFO::partUnits, EASYEDAPRO::PIN_INFO::pin, pin, EASYEDAPRO::SYM_INFO::pins, EASYEDAPRO::POWER_PORT, scale, ScalePosSym(), ScaleSize(), schIUScale, LIB_SYMBOL::SetDescription(), GRAPHICS_IMPORT_PLUGIN::SetImporter(), GRAPHICS_IMPORTER::SetImportOffsetMM(), LIB_SYMBOL::SetKeyWords(), LIB_SYMBOL::SetPower(), GRAPHICS_IMPORTER::SetScale(), SYMBOL::SetShowPinNames(), SYMBOL::SetShowPinNumbers(), SCH_FIELD::SetText(), LIB_SYMBOL::SetUnitCount(), EDA_TEXT::SetVisible(), EASYEDAPRO::SYM_INFO::symbolAttr, EASYEDAPRO::SYM_HEAD::symbolType, text, UnescapeHTML(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by SCH_IO_EASYEDAPRO::LoadAllDataFromProject(), and loadSymbol().

◆ ResolveFieldVariables()

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

Definition at line 236 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 84 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 90 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 78 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 90 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 107 of file sch_easyedapro_parser.h.

Referenced by SCH_EASYEDAPRO_PARSER().


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