KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_easyeda_parser.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 Alex Shvartzkop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef SCH_EASYEDA_PARSER_H_
22#define SCH_EASYEDA_PARSER_H_
23
26
27#include <sch_io/sch_io_mgr.h>
28
29
30class EDA_TEXT;
31
33{
34public:
35 explicit SCH_EASYEDA_PARSER( SCHEMATIC* aSchematic, PROGRESS_REPORTER* aProgressReporter );
37
38 double ScaleSize( double aValue ) override
39 {
40 return KiROUND( schIUScale.MilsToIU( aValue * 10 ) );
41 }
42
43 template <typename T>
45 {
46 return VECTOR2<T>( RelPosX( aVec.x ), RelPosY( aVec.y ) );
47 }
48
49 std::pair<LIB_SYMBOL*, bool> MakePowerSymbol( const wxString& aFlagTypename,
50 const wxString& aNetname );
51
52 void ParseSymbolShapes( LIB_SYMBOL* aContainer, std::map<wxString, wxString> paramMap,
53 wxArrayString aShapes );
54
55 LIB_SYMBOL* ParseSymbol( const VECTOR2D& aOrigin, std::map<wxString, wxString> aParams,
56 wxArrayString aShapes );
57
58 void ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet, const wxString& aFileName,
59 wxArrayString aShapes );
60
61private:
63};
64
65
66#endif // SCH_EASYEDA_PARSER_H_
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:123
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:986
double RelPosX(double aValue)
double RelPosY(double aValue)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:89
Define a library symbol object.
Definition lib_symbol.h:79
A progress reporter interface for use in multi-threaded environments.
Holds all the data relating to one schematic.
Definition schematic.h:90
void ParseSymbolShapes(LIB_SYMBOL *aContainer, std::map< wxString, wxString > paramMap, wxArrayString aShapes)
std::pair< LIB_SYMBOL *, bool > MakePowerSymbol(const wxString &aFlagTypename, const wxString &aNetname)
double ScaleSize(double aValue) override
void ParseSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxString &aFileName, wxArrayString aShapes)
VECTOR2< T > RelPosSym(const VECTOR2< T > &aVec)
LIB_SYMBOL * ParseSymbol(const VECTOR2D &aOrigin, std::map< wxString, wxString > aParams, wxArrayString aShapes)
SCH_EASYEDA_PARSER(SCHEMATIC *aSchematic, PROGRESS_REPORTER *aProgressReporter)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
Define a general 2D-vector/point.
Definition vector2d.h:67
VECTOR2< double > VECTOR2D
Definition vector2d.h:682