KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_io_easyeda.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_IO_EASYEDA_H_
26#define SCH_IO_EASYEDA_H_
27
28#include <sch_io/sch_io.h>
29#include <sch_io/sch_io_mgr.h>
30#include <reporter.h>
31#include <wx/arrstr.h>
32
33
34class SCH_SHEET;
35class SCH_SCREEN;
36
37
38class SCH_IO_EASYEDA : public SCH_IO
39{
40public:
41 SCH_IO_EASYEDA() : SCH_IO( wxS( "EasyEDA (JLCEDA) Schematic" ) )
42 {
44 }
45
47
49 {
50 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Std files" ), { "json" } );
51 }
52
53 const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override { return GetSchematicFileDesc(); }
54
55 bool CanReadSchematicFile( const wxString& aFileName ) const override;
56
57 bool CanReadLibrary( const wxString& aFileName ) const override;
58
59 int GetModifyHash() const override;
60
61 SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
62 SCH_SHEET* aAppendToMe = nullptr,
63 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
64
65 void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
66 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
67
68 void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
69 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
70
71 LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
72 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
73
74 bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
75};
76
77
78#endif // SCH_IO_EASYEDA_H_
REPORTER * m_reporter
Reporter to log errors/warnings to, may be nullptr.
Definition: io_base.h:218
Define a library symbol object.
Definition: lib_symbol.h:78
Holds all the data relating to one schematic.
Definition: schematic.h:77
const IO_BASE::IO_FILE_DESC GetSchematicFileDesc() const override
Returns schematic file description for the SCH_IO.
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
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,...
int GetModifyHash() const override
Return the modification hash from the library cache.
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.
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
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...
Base class that schematic file and library loading and saving plugins should derive from.
Definition: sch_io.h:57
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
static REPORTER & GetInstance()
Definition: reporter.cpp:199
#define _HKI(x)
Container that describes file type info.
Definition: io_base.h:43