KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_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 PCB_IO_EASYEDAPRO_V3_H_
25#define PCB_IO_EASYEDAPRO_V3_H_
26
28#include <pcb_io/pcb_io.h>
29
30#include <memory>
31#include <vector>
32
33namespace EASYEDAPRO
34{
35class V3_DOC_PARSER;
36}
37
38
40{
41public:
44
46 {
47 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Pro v3 project" ), { "epro2" } );
48 }
49
51 {
52 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Pro v3 files" ), { "elibz2" } );
53 }
54
55 bool CanReadBoard( const wxString& aFileName ) const override;
56
57 std::vector<std::pair<wxString, wxString>> EnumerateProjectBoards( const wxString& aFileName ) const override;
58
59 bool CanReadLibrary( const wxString& aFileName ) const override;
60
61 long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
62
63 void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, bool aBestEfforts,
64 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
65
66 std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
67 wxString GetImportedDesignRules() const override { return m_importedDesignRules; }
68
69
70 std::unique_ptr<FOOTPRINT> FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
71 bool aKeepUUID = false,
72 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
73
74 bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
75
76protected:
77 void loadBoard( const wxString& aFileName, BOARD& aBoard, bool aIsNewLoad,
78 const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
79
80private:
81 const EASYEDAPRO::V3_DOC_PARSER& getCachedLibraryParser( const wxString& aLibraryPath ) const;
82
83 mutable wxString m_cachedLibraryPath;
84 mutable long long m_cachedLibraryTimestamp = -1;
85 mutable std::unique_ptr<EASYEDAPRO::V3_DOC_PARSER> m_cachedLibraryParser;
86
88 std::vector<std::unique_ptr<FOOTPRINT>> m_importedLibFootprints;
90};
91
92
93#endif // PCB_IO_EASYEDAPRO_V3_H_
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
Parses EasyEDA Pro v3 .epro2 archives.
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
std::unique_ptr< EASYEDAPRO::V3_DOC_PARSER > m_cachedLibraryParser
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
wxString GetImportedDesignRules() const override
Return custom DRC rules generated while importing the most recent board.
bool CanReadBoard(const wxString &aFileName) const override
~PCB_IO_EASYEDAPRO_V3() override
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
void loadBoard(const wxString &aFileName, BOARD &aBoard, bool aIsNewLoad, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Parse aFileName into aBoard.
std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints() override
Return a container with the cached library footprints generated in the last call to Load.
std::vector< std::unique_ptr< FOOTPRINT > > m_importedLibFootprints
Definitions from the last LoadBoard, cloned out to the import reconciler on request.
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
std::vector< std::pair< wxString, wxString > > EnumerateProjectBoards(const wxString &aFileName) const override
Check if this PCB_IO can read the specified board file.
const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override
Return board file description for the PCB_IO.
std::unique_ptr< FOOTPRINT > FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
const EASYEDAPRO::V3_DOC_PARSER & getCachedLibraryParser(const wxString &aLibraryPath) const
PCB_IO(const wxString &aName)
Definition pcb_io.h:372
Plugin class for import plugins that support choosing a project.
Container for project specific data.
Definition project.h:63
#define _HKI(x)
Definition page_info.cpp:40
Container that describes file type info.
Definition io_base.h:43