KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_io_easyedapro_v3.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_IO_EASYEDAPRO_V3_H_
25#define SCH_IO_EASYEDAPRO_V3_H_
26
28#include <sch_io/sch_io.h>
29
30#include <memory>
31
32
33class SCH_SHEET;
34class SCH_SCREEN;
35
36namespace EASYEDAPRO
37{
38class V3_DOC_PARSER;
39}
40
41
43{
44public:
47
49 {
50 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Pro v3 files" ), { "epro2" } );
51 }
52
54 {
55 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Pro v3 files" ), { "elibz2" } );
56 }
57
58 bool CanReadSchematicFile( const wxString& aFileName ) const override;
59
60 bool CanReadLibrary( const wxString& aFileName ) const override;
61
62 int GetModifyHash() const override { return 0; }
63
64 SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* aAppendToMe = nullptr,
65 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
66
67 void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
68 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
69
70 void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
71 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
72
73 LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
74 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
75
76 bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
77
78private:
79 const EASYEDAPRO::V3_DOC_PARSER& getCachedLibraryParser( const wxString& aLibraryPath ) const;
80
81 mutable wxString m_cachedLibraryPath;
82 mutable long long m_cachedLibraryTimestamp = -1;
83 mutable std::unique_ptr<EASYEDAPRO::V3_DOC_PARSER> m_cachedLibraryParser;
84};
85
86
87#endif // SCH_IO_EASYEDAPRO_V3_H_
Parses EasyEDA Pro v3 .epro2 archives.
Define a library symbol object.
Definition lib_symbol.h:114
Plugin class for import plugins that support choosing a project.
Holds all the data relating to one schematic.
Definition schematic.h:90
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
std::unique_ptr< EASYEDAPRO::V3_DOC_PARSER > m_cachedLibraryParser
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load information from some input file format that this SCH_IO implementation knows about,...
const EASYEDAPRO::V3_DOC_PARSER & getCachedLibraryParser(const wxString &aLibraryPath) const
~SCH_IO_EASYEDAPRO_V3() override
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
const IO_BASE::IO_FILE_DESC GetSchematicFileDesc() const override
Returns schematic file description for the SCH_IO.
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
int GetModifyHash() const override
Return the modification hash from the library cache.
SCH_IO(const wxString &aName)
Definition sch_io.h:375
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
#define _HKI(x)
Definition page_info.cpp:40
Container that describes file type info.
Definition io_base.h:43