KiCad PCB EDA Suite
|
#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 | |
SCHEMATIC * | m_schematic |
Definition at line 59 of file sch_easyedapro_parser.h.
|
explicit |
Definition at line 67 of file sch_easyedapro_parser.cpp.
References m_schematic.
SCH_EASYEDAPRO_PARSER::~SCH_EASYEDAPRO_PARSER | ( | ) |
Definition at line 74 of file sch_easyedapro_parser.cpp.
|
protected |
Definition at line 298 of file sch_easyedapro_parser.cpp.
References ANGLE_HORIZONTAL, ANGLE_VERTICAL, ApplyFontStyle(), EASYEDAPRO::SCH_ATTR::fontStyle, EASYEDAPRO::SCH_ATTR::keyVisible, EASYEDAPRO::SCH_ATTR::position, ResolveFieldVariables(), EASYEDAPRO::SCH_ATTR::rotation, ScalePos(), ScalePosSym(), SCH_SYMBOL_T, SYM_MIRROR_X, SYM_MIRROR_Y, SYM_ORIENT_0, SYM_ORIENT_180, SYM_ORIENT_270, SYM_ORIENT_90, text, EASYEDAPRO::SCH_ATTR::value, and EASYEDAPRO::SCH_ATTR::valVisible.
Referenced by ParseSchematic(), and ParseSymbol().
|
protected |
Definition at line 112 of file sch_easyedapro_parser.cpp.
References color, KIFONT::FONT::GetFont(), 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, ScaleSize(), and text.
Referenced by ApplyAttrToField(), ParseSchematic(), and ParseSymbol().
|
protected |
Definition at line 191 of file sch_easyedapro_parser.cpp.
References color, ConvertStrokeStyle(), ScaleSize(), STROKE_PARAMS::SetColor(), STROKE_PARAMS::SetLineStyle(), and STROKE_PARAMS::SetWidth().
Referenced by ParseSchematic(), and ParseSymbol().
|
static |
Definition at line 79 of file sch_easyedapro_parser.cpp.
References _, and THROW_IO_ERROR.
Referenced by SizeToKi().
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().
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().
|
protected |
Definition at line 236 of file sch_easyedapro_parser.cpp.
References get_def().
Referenced by ApplyAttrToField().
|
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().
|
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().
|
inlinestatic |
Definition at line 72 of file sch_easyedapro_parser.h.
References KiROUND(), EDA_IU_SCALE::MilsToIU(), and schIUScale.
Referenced by ApplyFontStyle(), ApplyLineStyle(), ParseSchematic(), ParseSymbol(), ScalePos(), ScalePosSym(), ScaleSize(), and SizeToKi().
|
inlinestatic |
Definition at line 78 of file sch_easyedapro_parser.h.
References ScaleSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
double SCH_EASYEDAPRO_PARSER::SizeToKi | ( | wxString | units | ) |
Definition at line 90 of file sch_easyedapro_parser.cpp.
References Convert(), and ScaleSize().
|
protected |
Definition at line 107 of file sch_easyedapro_parser.h.
Referenced by SCH_EASYEDAPRO_PARSER().