KiCad PCB EDA Suite
|
#include <pcb_io_easyedapro_parser.h>
Public Member Functions | |
PCB_IO_EASYEDAPRO_PARSER (BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter) | |
~PCB_IO_EASYEDAPRO_PARSER () | |
PCB_LAYER_ID | LayerToKi (int aLayer) |
FOOTPRINT * | ParseFootprint (const nlohmann::json &aProject, const wxString &aFpUuid, const std::vector< nlohmann::json > &aLines) |
void | ParseBoard (BOARD *aBoard, const nlohmann::json &aProject, std::map< wxString, std::unique_ptr< FOOTPRINT > > &aFootprintMap, const std::map< wxString, EASYEDAPRO::BLOB > &aBlobMap, const std::multimap< wxString, EASYEDAPRO::POURED > &aPouredMap, const std::vector< nlohmann::json > &aLines, const wxString &aFpLibName) |
std::vector< std::unique_ptr< PCB_SHAPE > > | ParsePoly (BOARD_ITEM_CONTAINER *aContainer, nlohmann::json polyData, bool aClosed, bool aInFill) const |
SHAPE_LINE_CHAIN | ParseContour (nlohmann::json polyData, bool aInFill, double aArcAccuracy=SHAPE_ARC::DefaultAccuracyForPCB()) const |
Static Public Member Functions | |
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) |
static double | Convert (wxString aValue) |
Private Member Functions | |
std::unique_ptr< PAD > | createPAD (FOOTPRINT *aFootprint, const nlohmann::json &line) |
void | fillFootprintModelInfo (FOOTPRINT *footprint, const wxString &modelUuid, const wxString &modelTitle, const wxString &modelTransform) const |
Private Attributes | |
BOARD * | m_board |
VECTOR2D | m_relOrigin |
Definition at line 47 of file pcb_io_easyedapro_parser.h.
|
explicit |
Definition at line 81 of file pcb_io_easyedapro_parser.cpp.
References m_board.
PCB_IO_EASYEDAPRO_PARSER::~PCB_IO_EASYEDAPRO_PARSER | ( | ) |
Definition at line 87 of file pcb_io_easyedapro_parser.cpp.
|
static |
Definition at line 70 of file pcb_io_easyedapro_parser.cpp.
References _, and THROW_IO_ERROR.
Referenced by fillFootprintModelInfo().
|
private |
Definition at line 588 of file pcb_io_easyedapro_parser.cpp.
References std::abs(), PADSTACK::ALL_LAYERS, ANGLE_90, EDA_ANGLE::AsDegrees(), B_Cu, DEGREES_T, F_Cu, Flip(), LayerToKi(), EDA_ANGLE::Normalize90(), pad, ParsePoly(), PAD::PTHMask(), ScalePos(), ScaleSize(), PAD::SMDMask(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseBoard(), and ParseFootprint().
|
private |
Definition at line 203 of file pcb_io_easyedapro_parser.cpp.
References FOOTPRINT::AddField(), Cmts_User, Convert(), EscapeString(), FOOTPRINT::GetFieldByName(), FOOTPRINT::GetFieldCount(), EDA_IU_SCALE::IUTomm(), FP_3DMODEL::m_Filename, FP_3DMODEL::m_Offset, FP_3DMODEL::m_Rotation, MODEL_SIZE_KEY, FOOTPRINT::Models(), pcbIUScale, QUERY_MODEL_UUID_KEY, ScaleSize(), BOARD_ITEM::SetLayer(), EDA_TEXT::SetText(), EDA_TEXT::SetVisible(), VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Referenced by ParseBoard(), and ParseFootprint().
PCB_LAYER_ID PCB_IO_EASYEDAPRO_PARSER::LayerToKi | ( | int | aLayer | ) |
Definition at line 92 of file pcb_io_easyedapro_parser.cpp.
References B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, Dwgs_User, Eco2_User, Edge_Cuts, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, In10_Cu, In11_Cu, In12_Cu, In13_Cu, In14_Cu, In15_Cu, In16_Cu, In17_Cu, In18_Cu, In19_Cu, In1_Cu, In20_Cu, In21_Cu, In22_Cu, In23_Cu, In24_Cu, In25_Cu, In26_Cu, In27_Cu, In28_Cu, In29_Cu, In2_Cu, In30_Cu, In3_Cu, In4_Cu, In5_Cu, In6_Cu, In7_Cu, In8_Cu, In9_Cu, User_1, User_2, User_3, User_4, User_5, User_6, and User_7.
Referenced by createPAD(), ParseBoard(), and ParseFootprint().
void PCB_IO_EASYEDAPRO_PARSER::ParseBoard | ( | BOARD * | aBoard, |
const nlohmann::json & | aProject, | ||
std::map< wxString, std::unique_ptr< FOOTPRINT > > & | aFootprintMap, | ||
const std::map< wxString, EASYEDAPRO::BLOB > & | aBlobMap, | ||
const std::multimap< wxString, EASYEDAPRO::POURED > & | aPouredMap, | ||
const std::vector< nlohmann::json > & | aLines, | ||
const wxString & | aFpLibName | ||
) |
Definition at line 951 of file pcb_io_easyedapro_parser.cpp.
References SEG::A, BOARD::Add(), SHAPE_POLY_SET::AddOutline(), AlignText(), PADSTACK::ALL_LAYERS, ANGLE_0, SHAPE_POLY_SET::Append(), ARC_HIGH_DEF, ARC_LOW_DEF, SEG::B, B_Cu, SHAPE_LINE_CHAIN::BBox(), SHAPE_POLY_SET::BBox(), SHAPE_POLY_SET::BooleanAdd(), SHAPE_POLY_SET::BooleanSubtract(), BOARD::ComputeBoundingBox(), ConnectBoardShapes(), SHAPE_ARC::ConstructFromStartEndCenter(), SHAPE_POLY_SET::CPolygons(), createPAD(), SHAPE_LINE_CHAIN::CSegment(), DEG2RAD(), DEGREES_T, delta, BOARD::Drawings(), Edge_Cuts, ERROR_INSIDE, fillFootprintModelInfo(), BOARD::FindNet(), EASYEDAPRO::PCB_ATTR::fontName, SHAPE_POLY_SET::Fracture(), get_opt(), BOX2< Vec >::GetCenter(), BOARD::GetDesignSettings(), BOARD::GetEnabledLayers(), KIFONT::FONT::GetFont(), PAGE_INFO::GetHeightMils(), BOARD::GetNetCount(), BOX2< Vec >::GetOrigin(), BOARD::GetPageSettings(), SHAPE_LINE_CHAIN::GetPoint(), REFERENCE_IMAGE::GetSize(), BOX2< Vec >::GetSize(), PAGE_INFO::GetWidthMils(), group, EASYEDAPRO::PCB_ATTR::height, EASYEDAPRO::IMPORT_POURED, SHAPE_POLY_SET::Inflate(), EASYEDAPRO::PCB_ATTR::inverted, IsBackLayer(), SHAPE_POLY_SET::IsEmpty(), EASYEDAPRO::POURED::isPoly, EASYEDAPRO::PCB_ATTR::key, EASYEDAPRO::PCB_ATTR::keyVisible, KiROUND(), EASYEDAPRO::PCB_ATTR::layer, LayerToKi(), BOARD_DESIGN_SETTINGS::m_MinClearance, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, BOX2< Vec >::Merge(), EDA_IU_SCALE::MilsToIU(), BITMAP_BASE::Mirror(), MIRROR(), EDA_IU_SCALE::mmToIU(), BOARD::Move(), REFERENCE_IMAGE::MutableImage(), SHAPE_RECT::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, EASYEDAPRO::POURED::parentId, ParseContour(), ParsePoly(), PCB_SHAPE_T, pcbIUScale, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, SHAPE_LINE_CHAIN::PointCount(), EASYEDAPRO::POURED::polyData, EASYEDAPRO::PCB_ATTR::position, REFERENCE_IMAGE::ReadImageFile(), SHAPE_POLY_SET::RebuildHolesFromContours(), REFERENCE_FIELD, EASYEDAPRO::PCB_ATTR::rotation, scale, ScalePos(), ScaleSize(), SHAPE_LINE_CHAIN::SegmentCount(), BASE_SET::set(), BOARD_DESIGN_SETTINGS::SetAuxOrigin(), SHAPE_LINE_CHAIN::SetClosed(), BOARD::SetEnabledLayers(), REFERENCE_IMAGE::SetImageScale(), BOARD::SetLayerName(), SHAPE_LINE_CHAIN::SetPoint(), SHAPE_JOIN_DISTANCE, SHAPE_POLY_SET::Simplify(), EASYEDAPRO::PCB_ATTR::strokeWidth, text, EASYEDAPRO::PCB_ATTR::textOrigin, EASYEDAPRO::ToKiCadLibID(), TransformOvalToPolygon(), EASYEDAPRO::POURED::unki, EASYEDAPRO::PCB_ATTR::value, EASYEDAPRO::PCB_ATTR::valVisible, via, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_IO_EASYEDAPRO::LoadBoard().
SHAPE_LINE_CHAIN PCB_IO_EASYEDAPRO_PARSER::ParseContour | ( | nlohmann::json | polyData, |
bool | aInFill, | ||
double | aArcAccuracy = SHAPE_ARC::DefaultAccuracyForPCB() |
||
) | const |
Definition at line 459 of file pcb_io_easyedapro_parser.cpp.
References SHAPE_LINE_CHAIN::Append(), ARC_HIGH_DEF, SHAPE_ARC::ConstructFromStartEndCenter(), DEG2RAD(), DEGREES_T, delta, ERROR_INSIDE, BEZIER_POLY::GetPoly(), RotatePoint(), ScalePos(), ScaleSize(), TransformCircleToPolygon(), TransformRoundChamferedRectToPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ParseBoard(), and ParseFootprint().
FOOTPRINT * PCB_IO_EASYEDAPRO_PARSER::ParseFootprint | ( | const nlohmann::json & | aProject, |
const wxString & | aFpUuid, | ||
const std::vector< nlohmann::json > & | aLines | ||
) |
Definition at line 729 of file pcb_io_easyedapro_parser.cpp.
References FOOTPRINT::Add(), SHAPE_POLY_SET::AddOutline(), ARC_HIGH_DEF, SHAPE_POLY_SET::BBox(), ConnectBoardShapes(), SHAPE_POLY_SET::CPolygons(), createPAD(), Edge_Cuts, ERROR_INSIDE, FOOTPRINT::Fields(), fillFootprintModelInfo(), get_def(), get_opt(), FOOTPRINT::GetField(), FOOTPRINT::GraphicalItems(), group, EASYEDAPRO::PCB_ATTR::key, LayerToKi(), m_board, EDA_IU_SCALE::mmToIU(), SHAPE_POLY_SET::OutlineCount(), pad, ParseContour(), ParsePoly(), PCB_SHAPE_T, pcbIUScale, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, SHAPE_POLY_SET::RebuildHolesFromContours(), REFERENCE_FIELD, ScaleSize(), SHAPE_LINE_CHAIN::SetClosed(), EDA_TEXT::SetText(), SHAPE_JOIN_DISTANCE, SHAPE_POLY_SET::Simplify(), and EASYEDAPRO::PCB_ATTR::value.
Referenced by PCB_IO_EASYEDAPRO::FootprintLoad(), PCB_IO_EASYEDAPRO::LoadAllDataFromProject(), and PCB_IO_EASYEDAPRO::LoadBoard().
std::vector< std::unique_ptr< PCB_SHAPE > > PCB_IO_EASYEDAPRO_PARSER::ParsePoly | ( | BOARD_ITEM_CONTAINER * | aContainer, |
nlohmann::json | polyData, | ||
bool | aClosed, | ||
bool | aInFill | ||
) | const |
Definition at line 262 of file pcb_io_easyedapro_parser.cpp.
References SEG::A, addSegment(), SHAPE_LINE_CHAIN::Append(), SEG::B, DEG2RAD(), DEGREES_T, delta, SHAPE_LINE_CHAIN::PointCount(), ScalePos(), SHAPE_LINE_CHAIN::Segment(), SHAPE_LINE_CHAIN::SegmentCount(), SHAPE_LINE_CHAIN::SetClosed(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by createPAD(), ParseBoard(), and ParseFootprint().
|
inlinestatic |
Definition at line 68 of file pcb_io_easyedapro_parser.h.
References ScaleSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by createPAD(), ParseBoard(), ParseContour(), and ParsePoly().
|
inlinestatic |
Definition at line 56 of file pcb_io_easyedapro_parser.h.
References KiROUND().
Referenced by createPAD(), fillFootprintModelInfo(), ParseBoard(), ParseContour(), ParseFootprint(), ScalePos(), and ScaleSize().
|
inlinestatic |
Definition at line 62 of file pcb_io_easyedapro_parser.h.
References ScaleSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Definition at line 92 of file pcb_io_easyedapro_parser.h.
Referenced by ParseFootprint(), and PCB_IO_EASYEDAPRO_PARSER().
|
private |
Definition at line 93 of file pcb_io_easyedapro_parser.h.