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 (C) 2023 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, you may find one here:
19
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20
* or you may search the http://www.gnu.org website for the version 2 license,
21
* or you may write to the Free Software Foundation, Inc.,
22
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23
*/
24
25
#ifndef SCH_EASYEDA_PARSER_H_
26
#define SCH_EASYEDA_PARSER_H_
27
28
#include <
io/easyeda/easyeda_parser_base.h
>
29
#include <
io/easyeda/easyeda_parser_structs.h
>
30
31
#include <
sch_io/sch_io_mgr.h
>
32
33
34
class
EDA_TEXT
;
35
36
class
SCH_EASYEDA_PARSER
:
public
EASYEDA_PARSER_BASE
37
{
38
public
:
39
explicit
SCH_EASYEDA_PARSER
(
SCHEMATIC
* aSchematic,
PROGRESS_REPORTER
* aProgressReporter );
40
~SCH_EASYEDA_PARSER
();
41
42
double
ScaleSize
(
double
aValue )
override
43
{
44
return
KiROUND
(
schIUScale
.
MilsToIU
( aValue * 10 ) );
45
}
46
47
template
<
typename
T>
48
VECTOR2<T>
RelPosSym
(
const
VECTOR2<T>
& aVec )
49
{
50
return
VECTOR2<T>
(
RelPosX
( aVec.
x
),
RelPosY
( aVec.
y
) );
51
}
52
53
std::pair<LIB_SYMBOL*, bool>
MakePowerSymbol
(
const
wxString& aFlagTypename,
54
const
wxString& aNetname );
55
56
void
ParseSymbolShapes
(
LIB_SYMBOL
* aContainer, std::map<wxString, wxString> paramMap,
57
wxArrayString aShapes );
58
59
LIB_SYMBOL
*
ParseSymbol
(
const
VECTOR2D
& aOrigin, std::map<wxString, wxString> aParams,
60
wxArrayString aShapes );
61
62
void
ParseSchematic
(
SCHEMATIC
* aSchematic,
SCH_SHEET
* aRootSheet,
const
wxString& aFileName,
63
wxArrayString aShapes );
64
65
private
:
66
SCHEMATIC
*
m_schematic
;
67
};
68
69
70
#endif
// SCH_EASYEDA_PARSER_H_
schIUScale
constexpr EDA_IU_SCALE schIUScale
Definition:
base_units.h:110
KiROUND
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition:
box2.h:990
EASYEDA_PARSER_BASE
Definition:
easyeda_parser_base.h:35
EASYEDA_PARSER_BASE::RelPosX
double RelPosX(double aValue)
Definition:
easyeda_parser_base.cpp:44
EASYEDA_PARSER_BASE::RelPosY
double RelPosY(double aValue)
Definition:
easyeda_parser_base.cpp:51
EDA_TEXT
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition:
eda_text.h:80
LIB_SYMBOL
Define a library symbol object.
Definition:
lib_symbol.h:78
PROGRESS_REPORTER
A progress reporter interface for use in multi-threaded environments.
Definition:
progress_reporter.h:39
SCHEMATIC
Holds all the data relating to one schematic.
Definition:
schematic.h:77
SCH_EASYEDA_PARSER
Definition:
sch_easyeda_parser.h:37
SCH_EASYEDA_PARSER::ParseSymbolShapes
void ParseSymbolShapes(LIB_SYMBOL *aContainer, std::map< wxString, wxString > paramMap, wxArrayString aShapes)
Definition:
sch_easyeda_parser.cpp:394
SCH_EASYEDA_PARSER::~SCH_EASYEDA_PARSER
~SCH_EASYEDA_PARSER()
Definition:
sch_easyeda_parser.cpp:69
SCH_EASYEDA_PARSER::MakePowerSymbol
std::pair< LIB_SYMBOL *, bool > MakePowerSymbol(const wxString &aFlagTypename, const wxString &aNetname)
Definition:
sch_easyeda_parser.cpp:984
SCH_EASYEDA_PARSER::ScaleSize
double ScaleSize(double aValue) override
Definition:
sch_easyeda_parser.h:42
SCH_EASYEDA_PARSER::ParseSchematic
void ParseSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxString &aFileName, wxArrayString aShapes)
Definition:
sch_easyeda_parser.cpp:1067
SCH_EASYEDA_PARSER::RelPosSym
VECTOR2< T > RelPosSym(const VECTOR2< T > &aVec)
Definition:
sch_easyeda_parser.h:48
SCH_EASYEDA_PARSER::m_schematic
SCHEMATIC * m_schematic
Definition:
sch_easyeda_parser.h:66
SCH_EASYEDA_PARSER::ParseSymbol
LIB_SYMBOL * ParseSymbol(const VECTOR2D &aOrigin, std::map< wxString, wxString > aParams, wxArrayString aShapes)
Definition:
sch_easyeda_parser.cpp:923
SCH_SHEET
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition:
sch_sheet.h:57
VECTOR2
Define a general 2D-vector/point.
Definition:
vector2d.h:71
VECTOR2::x
T x
Definition:
vector2d.h:79
VECTOR2::y
T y
Definition:
vector2d.h:79
easyeda_parser_base.h
easyeda_parser_structs.h
sch_io_mgr.h
EDA_IU_SCALE::MilsToIU
constexpr int MilsToIU(int mils) const
Definition:
base_units.h:93
src
eeschema
sch_io
easyeda
sch_easyeda_parser.h
Generated on Sun Dec 22 2024 00:05:21 for KiCad PCB EDA Suite by
1.9.6