KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_easyedapro_v3_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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef SCH_EASYEDAPRO_V3_PARSER_H_
25#define SCH_EASYEDAPRO_V3_PARSER_H_
26
29
31
32
33namespace EASYEDAPRO
34{
36int AlignToFontV( const wxString& aAlign );
37int AlignToFontH( const wxString& aAlign );
38} // namespace EASYEDAPRO
39
40
42{
43public:
44 explicit SCH_EASYEDAPRO_V3_PARSER( SCHEMATIC* aSchematic,
45 PROGRESS_REPORTER* aProgressReporter );
46
48 const EASYEDAPRO::V3_DOC_RAW& aDoc,
49 const std::map<wxString, wxString>& aDeviceAttributes,
50 const std::map<wxString, EASYEDAPRO::BLOB>& aBlobMap = {} );
51
52 void ParseSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet,
53 const nlohmann::json& aProject,
54 std::map<wxString, EASYEDAPRO::SYM_INFO>& aSymbolMap,
55 const std::map<wxString, EASYEDAPRO::BLOB>& aBlobMap,
56 const EASYEDAPRO::V3_DOC_RAW& aDoc,
57 const wxString& aLibName );
58
59private:
61
62 template <typename T>
63 void ApplyV3FontStyle( T& text, const nlohmann::json& aInner,
64 const char* aAlignField = "align" );
65
66 template <typename T>
67 void ApplyV3LineStyle( T& shape, const nlohmann::json& aInner );
68};
69
70
71#endif // SCH_EASYEDAPRO_V3_PARSER_H_
A progress reporter interface for use in multi-threaded environments.
Holds all the data relating to one schematic.
Definition schematic.h:90
void ParseSchematic(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const nlohmann::json &aProject, std::map< wxString, EASYEDAPRO::SYM_INFO > &aSymbolMap, const std::map< wxString, EASYEDAPRO::BLOB > &aBlobMap, const EASYEDAPRO::V3_DOC_RAW &aDoc, const wxString &aLibName)
void ApplyV3LineStyle(T &shape, const nlohmann::json &aInner)
void ApplyV3FontStyle(T &text, const nlohmann::json &aInner, const char *aAlignField="align")
SCH_EASYEDAPRO_V3_PARSER(SCHEMATIC *aSchematic, PROGRESS_REPORTER *aProgressReporter)
EASYEDAPRO::SYM_INFO ParseSymbol(const EASYEDAPRO::V3_DOC_RAW &aDoc, const std::map< wxString, wxString > &aDeviceAttributes, const std::map< wxString, EASYEDAPRO::BLOB > &aBlobMap={})
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
int AlignToFontV(const wxString &aAlign)
Map an EasyEDA "HORIZ_VERT" alignment token to a KiCad justify code (0 top/left, 1 center,...
int AlignToFontH(const wxString &aAlign)
Raw parsed document from an EasyEDA Pro v3 .epru stream.