KiCad PCB EDA Suite
Loading...
Searching...
No Matches
import_proj.cpp
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) 2019 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include "import_proj.h"
23#include <macros.h>
24#include <string_utils.h>
25#include <richio.h>
26
27#include <wx/fileconf.h>
28#include <wx/filedlg.h>
29#include <wx/msgdlg.h>
30#include <wx/tokenzr.h>
31#include <wx/dir.h>
32#include <wx/textfile.h>
33#include <wx/wfstream.h>
34
35#include <kiway.h>
36#include <kiway_player.h>
37#include <kicad_manager_frame.h>
38#include <pcb_edit_frame.h>
39#include <sch_edit_frame.h>
40
41#include <sch_io/sch_io_mgr.h>
42#include <pcb_io/pcb_io_mgr.h>
43#include <project_sch.h>
44#include <project_pcb.h>
45
49#include <io/pads/pads_common.h>
51
52#include <wx/log.h>
53
54
56 const std::vector<wxString>& aSchFileExtensions,
57 const std::vector<wxString>& aPcbFileExtensions ) :
58 m_frame( aFrame ),
59 m_schExtenstions( aSchFileExtensions ), m_pcbExtenstions( aPcbFileExtensions )
60{
61}
62
63
65{
66 // Append a new directory with the same name of the project file
67 // Keep iterating until we find an empty directory
68 wxString newDir = m_TargetProj.GetName();
69 int attempt = 0;
70
71 m_TargetProj.AppendDir( newDir );
72
73 while( m_TargetProj.DirExists() )
74 {
75 m_TargetProj.RemoveLastDir();
76 wxString suffix = wxString::Format( "_%d", ++attempt );
77 m_TargetProj.AppendDir( newDir + suffix );
78 }
79}
80
81
83{
84 wxString m_file;
85
86public:
87 SCOPED_FILE_REMOVER( const wxString& aFile ) : m_file( aFile ) {}
88 ~SCOPED_FILE_REMOVER() { wxRemoveFile( m_file ); }
89};
90
91
92void IMPORT_PROJ_HELPER::ImportIndividualFile( KICAD_T aFT, int aImportedFileType )
93{
94 FRAME_T frame_type;
95 wxString appImportFile;
96 std::vector<wxString> neededExts;
97
98 switch( aFT )
99 {
100 case SCHEMATIC_T:
101 neededExts = m_schExtenstions;
102 frame_type = FRAME_SCH;
103 break;
104
105 case PCB_T:
106 neededExts = m_pcbExtenstions;
107 frame_type = FRAME_PCB_EDITOR;
108 break;
109
110 default: return;
111 }
112
113 std::vector<SCOPED_FILE_REMOVER> copiedFiles;
114
115 for( wxString ext : neededExts )
116 {
117 if( ext == wxS( "INPUT" ) )
118 ext = m_InputFile.GetExt();
119
120 wxFileName candidate = m_InputFile;
121 candidate.SetExt( ext );
122
123 if( !candidate.FileExists() )
124 continue;
125
126 wxFileName targetFile( m_TargetProj.GetPath(), candidate.GetName(), candidate.GetExt() );
127
128 if( !targetFile.FileExists() )
129 {
130 bool copied = wxCopyFile( candidate.GetFullPath(), targetFile.GetFullPath(), false );
131
132 if( copied )
133 {
134 // Will be auto-removed
135 copiedFiles.emplace_back( targetFile.GetFullPath() );
136 }
137 }
138
139 // Pick the first file to pass to application
140 if( appImportFile.empty() && targetFile.FileExists() )
141 appImportFile = targetFile.GetFullPath();
142 }
143
144 if( appImportFile.empty() )
145 return;
146
147 doImport( appImportFile, frame_type, aImportedFileType );
148}
149
150
151void IMPORT_PROJ_HELPER::doImport( const wxString& aFile, FRAME_T aFrameType, int aImportedFileType )
152{
153 if( KIWAY_PLAYER* frame = m_frame->Kiway().Player( aFrameType, true ) )
154 {
155 std::stringstream ss;
156 ss << aImportedFileType << '\n' << TO_UTF8( aFile );
157
158 for( const auto& [key, value] : m_properties )
159 ss << '\n' << key << '\n' << value.wx_str();
160
161 std::string packet = ss.str();
162 frame->Kiway().ExpressMail( aFrameType, MAIL_IMPORT_FILE, packet, m_frame );
163
164 if( !frame->IsShownOnScreen() )
165 frame->Show( true );
166
167 // On Windows, Raise() does not bring the window on screen, when iconized
168 if( frame->IsIconized() )
169 frame->Iconize( false );
170
171 frame->Raise();
172 }
173}
174
175
177{
178 wxFileName fname = m_InputFile;
179
180 if( fname.GetExt() == wxS( "epro" ) || fname.GetExt() == wxS( "zip" ) )
181 {
182 nlohmann::json project = EASYEDAPRO::ReadProjectOrDeviceFile( fname.GetFullPath() );
183
184 std::map<wxString, EASYEDAPRO::PRJ_SCHEMATIC> prjSchematics = project.at( "schematics" );
185 std::map<wxString, EASYEDAPRO::PRJ_BOARD> prjBoards = project.at( "boards" );
186 std::map<wxString, wxString> prjPcbNames = project.at( "pcbs" );
187
188 std::vector<IMPORT_PROJECT_DESC> toImport =
190
191 if( toImport.size() > 1 )
192 toImport = DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( m_frame, toImport );
193
194 if( toImport.size() == 1 )
195 {
196 const IMPORT_PROJECT_DESC& desc = toImport[0];
197
198 m_properties["pcb_id"] = desc.PCBId;
199 m_properties["sch_id"] = desc.SchematicId;
200 }
201 else
202 {
203 m_properties["pcb_id"] = "";
204 m_properties["sch_id"] = "";
205 }
206 }
207}
208
209
210void IMPORT_PROJ_HELPER::addLocalLibraries( const std::set<wxString>& aNames, FRAME_T aFrameType )
211{
212 KIWAY_PLAYER* frame = m_frame->Kiway().Player( aFrameType, true );
213
214 std::stringstream ss;
215
216 // First line is the source project directory so the handler can distinguish
217 // project-local libraries from external fixed-path references.
218 ss << TO_UTF8( m_InputFile.GetPath() ) << '\n';
219
220 for( const wxString& name : aNames )
221 {
222 wxFileName fname( name );
223 fname.MakeAbsolute( m_InputFile.GetPath() );
224 ss << TO_UTF8( fname.GetFullPath() ) << '\n';
225 }
226
227 std::string packet = ss.str();
228 frame->Kiway().ExpressMail( aFrameType, MAIL_ADD_LOCAL_LIB, packet, m_frame );
229}
230
231
233{
234 wxFileConfig config( wxEmptyString, wxEmptyString, wxEmptyString, m_InputFile.GetFullPath(),
235 wxCONFIG_USE_NO_ESCAPE_CHARACTERS );
236
237 wxString groupname;
238 long groupid;
239
240 std::set<wxString> sch_file;
241 std::set<wxString> sch_libs;
242 std::set<wxString> pcb_libs;
243
244 wxString pcb_file;
245 int pcb_file_type = PCB_IO_MGR::ALTIUM_DESIGNER;
246
247 auto matchPcbExt = []( const wxString& aExt ) -> int
248 {
249 if( !aExt.CmpNoCase( wxS( "PcbDoc" ) ) )
251
252 if( !aExt.CmpNoCase( wxS( "CSPcbDoc" ) ) )
254
255 if( !aExt.CmpNoCase( wxS( "CMPcbDoc" ) ) )
257
258 if( !aExt.CmpNoCase( wxS( "SWPcbDoc" ) ) )
260
261 return -1;
262 };
263
264 for( bool more = config.GetFirstGroup( groupname, groupid ); more;
265 more = config.GetNextGroup( groupname, groupid ) )
266 {
267 if( !groupname.StartsWith( wxS( "Document" ) ) )
268 continue;
269
270 wxString number = groupname.Mid( 8 );
271 long docNumber;
272
273 if( !number.ToLong( &docNumber ) )
274 continue;
275
276 wxString path = config.Read( groupname + wxS( "/DocumentPath" ), wxEmptyString );
277
278 if( path.empty() )
279 continue;
280
281 wxFileName fname( path, wxPATH_WIN );
282
283 if( !fname.IsAbsolute() )
284 fname.MakeAbsolute( m_InputFile.GetPath() );
285
286 int pcbType = matchPcbExt( fname.GetExt() );
287
288 if( pcbType >= 0 && pcb_file.empty() )
289 {
290 pcb_file = fname.GetFullPath();
291 pcb_file_type = pcbType;
292 }
293
294 if( !fname.GetExt().CmpNoCase( "SCHDOC" ) )
295 sch_file.insert( fname.GetFullPath() );
296
297 if( !fname.GetExt().CmpNoCase( "PCBLIB" ) )
298 pcb_libs.insert( fname.GetFullPath() );
299
300 if( !fname.GetExt().CmpNoCase( "SCHLIB" ) )
301 sch_libs.insert( fname.GetFullPath() );
302 }
303
304 addLocalLibraries( sch_libs, FRAME_SCH );
306
307 m_properties["project_file"] = m_InputFile.GetFullPath();
308
309 int ii = 0;
310
311 for( auto& path : sch_file )
312 {
313 std::string key = "sch" + std::to_string( ii++ );
314 m_properties[key] = path.ToStdString();
315 }
316
317 if( !sch_file.empty() )
318 doImport( "", FRAME_SCH, SCH_IO_MGR::SCH_ALTIUM );
319
320 if( !pcb_file.empty() )
321 doImport( pcb_file, FRAME_PCB_EDITOR, pcb_file_type );
322}
323
324
326{
327 m_properties.clear();
328
330
331 if( !related.HasPcb() && !related.HasSchematic() )
332 return;
333
334 std::vector<SCOPED_FILE_REMOVER> copiedFiles;
335
336 auto copyAndImport = [&]( const wxString& sourceFile, FRAME_T frameType, int fileType )
337 {
338 if( sourceFile.IsEmpty() )
339 return;
340
341 wxFileName srcFn( sourceFile );
342 wxFileName targetFile( m_TargetProj.GetPath(), srcFn.GetName(), srcFn.GetExt() );
343
344 if( !targetFile.FileExists() )
345 {
346 bool copied = wxCopyFile( srcFn.GetFullPath(), targetFile.GetFullPath(), false );
347
348 if( copied )
349 copiedFiles.emplace_back( targetFile.GetFullPath() );
350 }
351
352 if( targetFile.FileExists() )
353 doImport( targetFile.GetFullPath(), frameType, fileType );
354 };
355
356 copyAndImport( related.schematicFile, FRAME_SCH, SCH_IO_MGR::SCH_PADS );
357 copyAndImport( related.pcbFile, FRAME_PCB_EDITOR, PCB_IO_MGR::PADS );
358}
359
360
362{
363 wxFileName prjFile = m_InputFile;
364
365 if( prjFile.GetExt().CmpNoCase( "prj" ) != 0 )
366 return;
367
368 wxTextFile file;
369
370 if( !file.Open( prjFile.GetFullPath() ) )
371 {
372 wxLogWarning( _( "Could not open gEDA / Lepton EDA project file '%s'." ), prjFile.GetFullPath() );
373 return;
374 }
375
376 std::vector<wxFileName> schFiles;
377 wxString outputName;
378 wxString elementsDir;
379
380 for( size_t i = 0; i < file.GetLineCount(); ++i )
381 {
382 wxString line = file.GetLine( i );
383
384 line.Trim( true );
385 line.Trim( false );
386
387 if( line.IsEmpty() )
388 continue;
389
390 if( line.StartsWith( wxT( "#" ) ) || line.StartsWith( wxT( ";" ) ) )
391 continue;
392
393 int commentPos = line.Find( wxT( "#" ) );
394
395 if( commentPos != wxNOT_FOUND )
396 {
397 line = line.Left( commentPos );
398 line.Trim( true );
399 line.Trim( false );
400 }
401
402 if( line.IsEmpty() )
403 continue;
404
405 wxStringTokenizer tok( line );
406
407 if( !tok.HasMoreTokens() )
408 continue;
409
410 wxString keyword = tok.GetNextToken();
411
412 if( keyword.CmpNoCase( "schematics" ) == 0 )
413 {
414 while( tok.HasMoreTokens() )
415 {
416 wxString schToken = tok.GetNextToken();
417 wxFileName schFile( schToken );
418
419 if( !schFile.IsAbsolute() )
420 schFile.MakeAbsolute( prjFile.GetPath() );
421
422 schFiles.push_back( schFile );
423 }
424 }
425 else if( keyword.CmpNoCase( "output-name" ) == 0 )
426 {
427 wxString rest = line.Mid( keyword.length() );
428 rest.Trim( true );
429 rest.Trim( false );
430 outputName = rest;
431 }
432 else if( keyword.CmpNoCase( "elements-dir" ) == 0 )
433 {
434 wxString rest = line.Mid( keyword.length() );
435 rest.Trim( true );
436 rest.Trim( false );
437 elementsDir = rest;
438 }
439 }
440
441 if( !elementsDir.IsEmpty() )
442 {
443 wxFileName elementsPath( elementsDir );
444
445 if( !elementsPath.IsAbsolute() )
446 elementsPath.MakeAbsolute( prjFile.GetPath() );
447
448 m_properties["elements_dir"] = elementsPath.GetFullPath().ToStdString();
449 }
450
451 if( schFiles.empty() )
452 {
453 wxFileName candidate = prjFile;
454 candidate.SetExt( wxS( "sch" ) );
455
456 if( candidate.FileExists() )
457 schFiles.push_back( candidate );
458 }
459
460 auto promptForMissingFile =
461 [&]( const wxString& aTitle, const wxString& aWildcard, wxFileName& aFile ) -> bool
462 {
463 wxString defaultDir = aFile.GetPath();
464
465 if( defaultDir.IsEmpty() )
466 defaultDir = prjFile.GetPath();
467
468 wxFileDialog dlg( m_frame, aTitle, defaultDir, wxEmptyString, aWildcard,
469 wxFD_OPEN | wxFD_FILE_MUST_EXIST );
470
471 if( dlg.ShowModal() == wxID_OK )
472 {
473 aFile.Assign( dlg.GetPath() );
474 return true;
475 }
476
477 aFile.Clear();
478 return false;
479 };
480
481 std::vector<wxFileName> resolvedSchFiles;
482 const wxString schWildcard = _( "gEDA / Lepton EDA schematic files" ) + wxS( " (*.sch)|*.sch" );
483
484 for( wxFileName schFile : schFiles )
485 {
486 if( !schFile.FileExists() )
487 {
488 if( !promptForMissingFile( _( "Locate gEDA / Lepton EDA Schematic" ), schWildcard, schFile ) )
489 continue;
490 }
491
492 resolvedSchFiles.push_back( schFile );
493 }
494
495 if( schFiles.empty() && resolvedSchFiles.empty() )
496 {
497 wxFileName schFile;
498
499 if( promptForMissingFile( _( "Locate gEDA / Lepton EDA Schematic" ), schWildcard, schFile ) )
500 resolvedSchFiles.push_back( schFile );
501 }
502
503 if( resolvedSchFiles.size() > 1 )
504 {
505 // Pass additional schematic files as a semicolon-delimited property so the
506 // importer can create sub-sheets for each additional page within a single
507 // KiCad project hierarchy.
508 wxString additionalFiles;
509
510 for( size_t i = 1; i < resolvedSchFiles.size(); i++ )
511 {
512 if( !additionalFiles.IsEmpty() )
513 additionalFiles += wxT( ";" );
514
515 additionalFiles += resolvedSchFiles[i].GetFullPath();
516 }
517
518 m_properties["additional_schematics"] = additionalFiles.ToStdString();
519 }
520
521 // Auto-discover subdirectories containing .sym files and pass them as
522 // additional search paths for the importer's symbol resolution.
523 auto discoverSymDirs = [&]( const wxString& aBaseDir, wxString& aSymPaths )
524 {
525 wxDir dir( aBaseDir );
526
527 if( !dir.IsOpened() )
528 return;
529
530 wxString subdir;
531 bool cont = dir.GetFirst( &subdir, wxEmptyString, wxDIR_DIRS );
532
533 while( cont )
534 {
535 wxString subdirPath = aBaseDir + wxFileName::GetPathSeparator() + subdir;
536 wxDir childDir( subdirPath );
537
538 if( childDir.IsOpened() && childDir.HasFiles( wxT( "*.sym" ) ) )
539 {
540 if( !aSymPaths.IsEmpty() )
541 aSymPaths += wxT( "\n" );
542
543 aSymPaths += subdirPath;
544 }
545
546 cont = dir.GetNext( &subdir );
547 }
548 };
549
550 wxString symPaths;
551 discoverSymDirs( prjFile.GetPath(), symPaths );
552
553 if( !resolvedSchFiles.empty() )
554 {
555 wxString schDir = resolvedSchFiles[0].GetPath();
556
557 if( schDir != prjFile.GetPath() )
558 discoverSymDirs( schDir, symPaths );
559 }
560
561 if( !symPaths.IsEmpty() )
562 m_properties["sym_search_paths"] = symPaths.ToStdString();
563
564 if( !resolvedSchFiles.empty() )
565 doImport( resolvedSchFiles[0].GetFullPath(), FRAME_SCH, SCH_IO_MGR::SCH_GEDA );
566
567 wxFileName layoutDir( prjFile.GetPath(), wxEmptyString );
568 layoutDir.RemoveLastDir();
569 layoutDir.AppendDir( wxS( "layout" ) );
570
571 wxFileName pcbFile;
572
573 if( !outputName.IsEmpty() )
574 {
575 wxFileName candidate( layoutDir.GetPath(), outputName, wxS( "pcb" ) );
576
577 if( candidate.FileExists() )
578 pcbFile = candidate;
579 }
580
581 if( !pcbFile.FileExists() )
582 {
583 wxFileName candidate( prjFile.GetPath(), prjFile.GetName(), wxS( "pcb" ) );
584
585 if( candidate.FileExists() )
586 pcbFile = candidate;
587 }
588
589 if( !pcbFile.FileExists() )
590 {
591 wxFileName candidate( layoutDir.GetPath(), prjFile.GetName(), wxS( "pcb" ) );
592
593 if( candidate.FileExists() )
594 pcbFile = candidate;
595 }
596
597 const wxString pcbWildcard = _( "gEDA / Lepton EDA PCB files" ) + wxS( " (*.pcb)|*.pcb" );
598
599 if( !pcbFile.FileExists() )
600 promptForMissingFile( _( "Locate gEDA / Lepton EDA PCB" ), pcbWildcard, pcbFile );
601
602 if( pcbFile.FileExists() )
603 doImport( pcbFile.GetFullPath(), FRAME_PCB_EDITOR, PCB_IO_MGR::GEDA_PCB );
604}
605
606
607void IMPORT_PROJ_HELPER::ImportFiles( int aImportedSchFileType, int aImportedPcbFileType )
608{
609 m_properties.clear();
610
611 if( aImportedSchFileType == SCH_IO_MGR::SCH_EASYEDAPRO
612 || aImportedPcbFileType == PCB_IO_MGR::EASYEDAPRO )
613 {
615 }
616 else if( aImportedSchFileType == SCH_IO_MGR::SCH_ALTIUM
617 || aImportedPcbFileType == PCB_IO_MGR::ALTIUM_DESIGNER )
618 {
620 return;
621 }
622 else if( aImportedSchFileType == SCH_IO_MGR::SCH_GEDA )
623 {
624 if( m_InputFile.GetExt().CmpNoCase( "prj" ) == 0 )
625 {
627 }
628 else if( m_InputFile.GetExt().CmpNoCase( "pcb" ) == 0 )
629 {
630 ImportIndividualFile( PCB_T, aImportedPcbFileType );
631 }
632 else
633 {
634 // When importing a bare .sch file, pass the original source directory
635 // so the importer can find symbols in subdirectories relative to the
636 // gEDA / Lepton EDA schematic, even though the file may be copied to a new location
637 // for the KiCad project.
638 wxString sourceDir = m_InputFile.GetPath();
639 wxString symPaths = sourceDir;
640
641 auto discoverSymDirs = [&]( const wxString& aBaseDir )
642 {
643 wxDir dir( aBaseDir );
644
645 if( !dir.IsOpened() )
646 return;
647
648 wxString subdir;
649 bool cont = dir.GetFirst( &subdir, wxEmptyString, wxDIR_DIRS );
650
651 while( cont )
652 {
653 wxString subdirPath =
654 aBaseDir + wxFileName::GetPathSeparator() + subdir;
655 wxDir childDir( subdirPath );
656
657 if( childDir.IsOpened() && childDir.HasFiles( wxT( "*.sym" ) ) )
658 symPaths += wxT( "\n" ) + subdirPath;
659
660 cont = dir.GetNext( &subdir );
661 }
662 };
663
664 discoverSymDirs( sourceDir );
665 m_properties["sym_search_paths"] = symPaths.ToStdString();
666
667 doImport( m_InputFile.GetFullPath(), FRAME_SCH, SCH_IO_MGR::SCH_GEDA );
668 ImportIndividualFile( PCB_T, aImportedPcbFileType );
669 }
670
671 return;
672 }
673
674 ImportIndividualFile( SCHEMATIC_T, aImportedSchFileType );
675 ImportIndividualFile( PCB_T, aImportedPcbFileType );
676}
const char * name
static std::vector< IMPORT_PROJECT_DESC > RunModal(wxWindow *aParent, const std::vector< IMPORT_PROJECT_DESC > &aProjectDesc)
Create and show a dialog (modal) and returns the data from it after completion.
wxFileName m_TargetProj
Definition import_proj.h:63
void EasyEDAProProjectHandler()
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:68
void FindEmptyTargetDir()
Appends a new directory with the name of the project file Keep iterating until an empty directory is ...
std::vector< wxString > m_pcbExtenstions
Definition import_proj.h:74
KICAD_MANAGER_FRAME * m_frame
Definition import_proj.h:66
void ImportFiles(int aImportedSchFileType, int aImportedPcbFileType)
Converts imported files to kicad type files.
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:62
std::vector< wxString > m_schExtenstions
Definition import_proj.h:73
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.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr, bool aFromOtherThread=false)
Send aPayload to aDestination from aSource.
Definition kiway.cpp:505
@ GEDA_PCB
Geda PCB file formats.
Definition pcb_io_mgr.h:69
@ ALTIUM_DESIGNER
Definition pcb_io_mgr.h:63
@ ALTIUM_CIRCUIT_MAKER
Definition pcb_io_mgr.h:61
@ ALTIUM_CIRCUIT_STUDIO
Definition pcb_io_mgr.h:62
SCOPED_FILE_REMOVER(const wxString &aFile)
#define _(s)
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition frame_type.h:33
@ FRAME_PCB_EDITOR
Definition frame_type.h:42
@ FRAME_SCH
Definition frame_type.h:34
This file contains miscellaneous commonly used macros and functions.
@ MAIL_IMPORT_FILE
Definition mail_type.h:48
@ MAIL_ADD_LOCAL_LIB
Definition mail_type.h:54
std::vector< IMPORT_PROJECT_DESC > ProjectToSelectorDialog(const nlohmann::json &aProject, bool aPcbOnly=false, bool aSchOnly=false)
nlohmann::json ReadProjectOrDeviceFile(const wxString &aZipFileName)
RELATED_FILES FindRelatedPadsFiles(const wxString &aFilePath)
Find related PADS project files from a given source file.
Common utilities and types for parsing PADS file formats.
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Describes how non-KiCad boards and schematics should be imported as KiCad projects.
Result of detecting related PADS project files.
Definition pads_common.h:73
wxString schematicFile
Path to schematic file if found.
Definition pads_common.h:75
wxString pcbFile
Path to PCB file if found.
Definition pads_common.h:74
bool copied
std::string path
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition typeinfo.h:78
@ PCB_T
Definition typeinfo.h:82
@ SCHEMATIC_T
Definition typeinfo.h:208
Definition of file extensions used in Kicad.