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;
31class REPORTER;
32
34{
35public:
36 SCH_EASYEDA_PARSER( SCHEMATIC* aSchematic, PROGRESS_REPORTER* aProgressReporter, REPORTER* aReporter );
38
39 double ScaleSize( double aValue ) override
40 {
41 return KiROUND( schIUScale.MilsToIU( aValue * 10 ) );
42 }
43
44 template <typename T>
46 {
47 return VECTOR2<T>( RelPosX( aVec.x ), RelPosY( aVec.y ) );
48 }
49
50 std::pair<LIB_SYMBOL*, bool> MakePowerSymbol( const wxString& aFlagTypename,
51 const wxString& aNetname );
52
53 void ParseSymbolShapes( LIB_SYMBOL* aContainer, std::map<wxString, wxString> paramMap,
54 wxArrayString aShapes );
55
56 LIB_SYMBOL* ParseSymbol( const VECTOR2D& aOrigin, std::map<wxString, wxString> aParams,
57 wxArrayString aShapes );
58
59 void ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet, const wxString& aFileName,
60 wxArrayString aShapes );
61
62private:
63 bool checkTextFields( const wxArrayString& aArr );
64
67};
68
69
70#endif // SCH_EASYEDA_PARSER_H_
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:130
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:985
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:94
Define a library symbol object.
Definition lib_symbol.h:114
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
Holds all the data relating to one schematic.
Definition schematic.h:155
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)
bool checkTextFields(const wxArrayString &aArr)
SCH_EASYEDA_PARSER(SCHEMATIC *aSchematic, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter)
LIB_SYMBOL * ParseSymbol(const VECTOR2D &aOrigin, std::map< wxString, wxString > aParams, wxArrayString aShapes)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:50
Define a general 2D-vector/point.
Definition vector2d.h:67
VECTOR2< double > VECTOR2D
Definition vector2d.h:707