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 <
plugins/easyeda/easyeda_parser_base.h
>
29
#include <
plugins/easyeda/easyeda_parser_structs.h
>
30
31
#include <
sch_io_mgr.h
>
32
#include <
pin_type.h
>
33
#include <
layer_ids.h
>
34
#include <wx/filename.h>
35
#include <
plotters/plotter.h
>
36
37
38
class
EDA_TEXT
;
39
class
LIB_SHAPE
;
40
class
LIB_PIN
;
41
class
SCH_LABEL_BASE
;
42
class
SCH_SYMBOL
;
43
class
SCH_TEXT
;
44
class
SCH_SHAPE
;
45
46
class
SCH_EASYEDA_PARSER
:
public
EASYEDA_PARSER_BASE
47
{
48
public
:
49
explicit
SCH_EASYEDA_PARSER
(
SCHEMATIC
* aSchematic,
PROGRESS_REPORTER
* aProgressReporter );
50
~SCH_EASYEDA_PARSER
();
51
52
double
ScaleSize
(
double
aValue )
override
53
{
54
return
KiROUND
(
schIUScale
.
MilsToIU
( aValue * 10 ) );
55
}
56
57
template
<
typename
T>
58
VECTOR2<T>
RelPosSym
(
const
VECTOR2<T>
& aVec )
59
{
60
return
VECTOR2<T>
(
RelPosX
( aVec.
x
), -
RelPosY
( aVec.
y
) );
61
}
62
63
std::pair<LIB_SYMBOL*, bool>
MakePowerSymbol
(
const
wxString& aFlagTypename,
64
const
wxString& aNetname );
65
66
void
ParseSymbolShapes
(
LIB_SYMBOL
* aContainer, std::map<wxString, wxString> paramMap,
67
wxArrayString aShapes );
68
69
LIB_SYMBOL
*
ParseSymbol
(
const
VECTOR2D
& aOrigin, std::map<wxString, wxString> aParams,
70
wxArrayString aShapes );
71
72
void
ParseSchematic
(
SCHEMATIC
* aSchematic,
SCH_SHEET
* aRootSheet,
const
wxString& aFileName,
73
wxArrayString aShapes );
74
75
private
:
76
SCHEMATIC
*
m_schematic
;
77
};
78
79
80
#endif
// SCH_EASYEDA_PARSER_H_
schIUScale
constexpr EDA_IU_SCALE schIUScale
Definition:
base_units.h:111
EASYEDA_PARSER_BASE
Definition:
easyeda_parser_base.h:33
EASYEDA_PARSER_BASE::RelPosX
double RelPosX(double aValue)
Definition:
easyeda_parser_base.cpp:43
EASYEDA_PARSER_BASE::RelPosY
double RelPosY(double aValue)
Definition:
easyeda_parser_base.cpp:50
EDA_TEXT
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition:
eda_text.h:80
LIB_PIN
Definition:
lib_pin.h:42
LIB_SHAPE
Definition:
lib_shape.h:33
LIB_SYMBOL
Define a library symbol object.
Definition:
lib_symbol.h:99
PROGRESS_REPORTER
A progress reporter interface for use in multi-threaded environments.
Definition:
progress_reporter.h:37
SCHEMATIC
Holds all the data relating to one schematic.
Definition:
schematic.h:75
SCH_EASYEDA_PARSER
Definition:
sch_easyeda_parser.h:47
SCH_EASYEDA_PARSER::ParseSymbolShapes
void ParseSymbolShapes(LIB_SYMBOL *aContainer, std::map< wxString, wxString > paramMap, wxArrayString aShapes)
Definition:
sch_easyeda_parser.cpp:426
SCH_EASYEDA_PARSER::~SCH_EASYEDA_PARSER
~SCH_EASYEDA_PARSER()
Definition:
sch_easyeda_parser.cpp:59
SCH_EASYEDA_PARSER::MakePowerSymbol
std::pair< LIB_SYMBOL *, bool > MakePowerSymbol(const wxString &aFlagTypename, const wxString &aNetname)
Definition:
sch_easyeda_parser.cpp:989
SCH_EASYEDA_PARSER::ScaleSize
double ScaleSize(double aValue) override
Definition:
sch_easyeda_parser.h:52
SCH_EASYEDA_PARSER::ParseSchematic
void ParseSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxString &aFileName, wxArrayString aShapes)
Definition:
sch_easyeda_parser.cpp:1072
SCH_EASYEDA_PARSER::RelPosSym
VECTOR2< T > RelPosSym(const VECTOR2< T > &aVec)
Definition:
sch_easyeda_parser.h:58
SCH_EASYEDA_PARSER::m_schematic
SCHEMATIC * m_schematic
Definition:
sch_easyeda_parser.h:76
SCH_EASYEDA_PARSER::ParseSymbol
LIB_SYMBOL * ParseSymbol(const VECTOR2D &aOrigin, std::map< wxString, wxString > aParams, wxArrayString aShapes)
Definition:
sch_easyeda_parser.cpp:951
SCH_LABEL_BASE
Definition:
sch_label.h:127
SCH_SHAPE
Definition:
sch_shape.h:33
SCH_SHEET
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition:
sch_sheet.h:57
SCH_SYMBOL
Schematic symbol object.
Definition:
sch_symbol.h:81
SCH_TEXT
Definition:
sch_text.h:39
VECTOR2
Define a general 2D-vector/point.
Definition:
vector2d.h:70
VECTOR2::x
T x
Definition:
vector2d.h:78
VECTOR2::y
T y
Definition:
vector2d.h:78
easyeda_parser_base.h
easyeda_parser_structs.h
layer_ids.h
pin_type.h
plotter.h
sch_io_mgr.h
EDA_IU_SCALE::MilsToIU
constexpr int MilsToIU(int mils) const
Definition:
base_units.h:94
KiROUND
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition:
util.h:85
src
eeschema
sch_plugins
easyeda
sch_easyeda_parser.h
Generated on Wed Dec 6 2023 00:04:06 for KiCad PCB EDA Suite by
1.9.5