KiCad PCB EDA Suite
Loading...
Searching...
No Matches
import_proj.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 modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef IMPORT_PROJ_H
21#define IMPORT_PROJ_H
22
23#include <wx/filename.h>
24#include <core/typeinfo.h>
25#include <core/utf8.h>
26#include <frame_type.h>
27
28#include <map>
29#include <set>
30
32
37{
38public:
40 const std::vector<wxString>& aSchFileExtensions,
41 const std::vector<wxString>& aPcbFileExtensions );
42
47 void FindEmptyTargetDir();
48
55 void ImportFiles( int aImportedSchFileType, int aImportedPcbFileType );
56
60 void ImportPadsFiles();
61
65 void SaveImportedFiles();
66
67 wxFileName m_InputFile;
68 wxFileName m_TargetProj;
69
70private:
72
73 std::map<std::string, UTF8> m_properties;
74
75 std::set<FRAME_T> m_importedFrames;
76
77 std::vector<wxString> m_copiedSchPaths;
78 std::vector<wxString> m_copiedPcbPaths;
79
80 std::vector<wxString> m_schExtenstions;
81 std::vector<wxString> m_pcbExtenstions;
82
83 void ImportIndividualFile( KICAD_T aKicad_T, int aImportedFileType );
84
85 void doImport( const wxString& aFile, FRAME_T aFrameType, int aImportedFileType );
86
87 void addLocalLibraries( const std::set<wxString>& aLibName, FRAME_T aFrameType );
88
94
96 wxString joinSourceLibNicknames( const std::set<wxString>& aPaths ) const;
97
98 void EasyEDAProProjectHandler( int aImportedSchFileType, int aImportedPcbFileType );
99
101
102 void GedaProjectHandler();
103
107 void OrcadProjectHandler();
108
116};
117
118#endif
void SaveImportedFiles()
Saves every design an editor imported, so the new project exists on disk.
void OrcadProjectHandler()
Imports the OrCAD schematic, then offers to import an associated Allegro board.
wxFileName m_TargetProj
Definition import_proj.h:68
std::vector< wxString > m_copiedSchPaths
Definition import_proj.h:77
wxString joinSourceLibNicknames(const std::set< wxString > &aPaths) const
Join the basenames of the given library paths into a source-library property value.
IMPORT_PROJ_HELPER(KICAD_MANAGER_FRAME *aframe, const std::vector< wxString > &aSchFileExtensions, const std::vector< wxString > &aPcbFileExtensions)
std::map< std::string, UTF8 > m_properties
Definition import_proj.h:73
void FindEmptyTargetDir()
Appends a new directory with the name of the project file Keep iterating until an empty directory is ...
void EasyEDAProProjectHandler(int aImportedSchFileType, int aImportedPcbFileType)
std::vector< wxString > m_pcbExtenstions
Definition import_proj.h:81
std::set< FRAME_T > m_importedFrames
editors whose import succeeded
Definition import_proj.h:75
void setImportCacheNickname()
Pre-commit one collision-free generated footprint-cache nickname into m_properties so the schematic a...
KICAD_MANAGER_FRAME * m_frame
Definition import_proj.h:71
void ImportFiles(int aImportedSchFileType, int aImportedPcbFileType)
Converts imported files to kicad type files.
void EasyPcProjectHandler()
Imports an Easy-PC / DesignSpark project, or a schematic and board pair.
std::vector< wxString > m_copiedPcbPaths
Definition import_proj.h:78
void addLocalLibraries(const std::set< wxString > &aLibName, FRAME_T aFrameType)
void ImportIndividualFile(KICAD_T aKicad_T, int aImportedFileType)
wxFileName m_InputFile
Definition import_proj.h:67
std::vector< wxString > m_schExtenstions
Definition import_proj.h:80
void ImportPadsFiles()
Converts PADS ASCII schematic and PCB files to KiCad type files.
void doImport(const wxString &aFile, FRAME_T aFrameType, int aImportedFileType)
The main KiCad project manager frame.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition frame_type.h:29
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:70