KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_eagle_plugin.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) 2017 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Alejandro García Montoro <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
23
24#include <map>
25#include <set>
26
27#include <core/ignore.h>
28#include <kiway.h>
29#include <pgm_base.h>
30#include <lib_symbol.h>
31#include <sch_io/sch_io.h>
32#include <schematic.h>
33#include <sch_sheet.h>
34#include <sch_screen.h>
35#include <sch_symbol.h>
36#include <sch_pin.h>
37#include <sch_label.h>
38#include <sch_line.h>
39#include <sch_sheet_path.h>
42#include <wx/filename.h>
43#include <wx/stdpaths.h>
45
50{
51 IO_RELEASER<SCH_IO> pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ) );
52 BOOST_CHECK_NE( pi.get(), nullptr );
53}
54
55
59static wxFileName getEagleTestSchematic( const wxString& sch_file )
60{
61 wxFileName fn( KI_TEST::GetEeschemaTestDataDir() );
62 fn.AppendDir( "io" );
63 fn.AppendDir( "eagle" );
64 fn.SetFullName( sch_file );
65
66 return fn;
67}
68
69
78static SCH_SHEET* loadEagleSchematic( const wxFileName& aEagleFn,
79 const wxString& aProjectStem,
80 std::unique_ptr<SCHEMATIC>& aSchematic )
81{
82 // Stage the project in a private, freshly-emptied directory. The Eagle importer writes a
83 // "<stem>-eagle-import.kicad_sym" library plus a sym-lib-table into the project directory and
84 // keys duplicate-symbol-name disambiguation off the on-disk library, so leftover files from a
85 // previous run in the shared temp directory would make the imported symbol names
86 // non-deterministic.
87 wxString sep = wxFileName::GetPathSeparator();
88 wxString projectDir = wxStandardPaths::Get().GetTempDir() + sep + aProjectStem
89 + wxT( "-eagle-qa" );
90
91 if( wxDirExists( projectDir ) )
92 wxFileName::Rmdir( projectDir, wxPATH_RMDIR_RECURSIVE );
93
94 wxFileName::Mkdir( projectDir, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
95
96 wxString projectPath = projectDir + sep + aProjectStem + wxT( ".kicad_pro" );
97
98 Pgm().GetSettingsManager().LoadProject( projectPath );
100 Pgm().GetLibraryManager().LoadProjectTables( project.GetProjectDirectory() );
101
102 aSchematic = std::make_unique<SCHEMATIC>( &project );
103 aSchematic->Reset();
104
105 IO_RELEASER<SCH_IO> pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_EAGLE ) );
106 BOOST_REQUIRE( pi.get() != nullptr );
107
108 SCH_SHEET* loadedSheet = nullptr;
109
110 try
111 {
112 loadedSheet = pi->LoadSchematicFile( aEagleFn.GetFullPath(), aSchematic.get() );
113 }
114 catch( const std::exception& e )
115 {
116 BOOST_FAIL( std::string( "LoadSchematicFile threw: " ) + e.what() );
117 }
118 catch( ... )
119 {
120 BOOST_FAIL( "LoadSchematicFile threw unknown exception" );
121 }
122
123 BOOST_REQUIRE( loadedSheet != nullptr );
124 return loadedSheet;
125}
126
127
136BOOST_AUTO_TEST_CASE( ImportHierarchy )
137{
138 const wxFileName eagleFn = getEagleTestSchematic( "eagle-import-testfile.sch" );
139 BOOST_REQUIRE( wxFileExists( eagleFn.GetFullPath() ) );
140
141 std::unique_ptr<SCHEMATIC> schematic;
142 SCH_SHEET* loadedSheet = loadEagleSchematic( eagleFn, wxS( "eagle_test" ), schematic );
143
144 // The returned sheet must be the virtual root (niluuid).
145 BOOST_CHECK( loadedSheet->m_Uuid == niluuid );
146
147 const std::vector<SCH_SHEET*>& topSheets = schematic->GetTopLevelSheets();
148
149 // The test file has exactly 2 Eagle pages; there must be no spurious default sheet.
150 BOOST_CHECK_EQUAL( topSheets.size(), 2 );
151
152 for( SCH_SHEET* sheet : topSheets )
153 {
154 // No top-level sheet should be the virtual root.
155 BOOST_CHECK( sheet != nullptr );
156 BOOST_CHECK( sheet->m_Uuid != niluuid );
157
158 // Every page must have a screen with a non-empty filename so SaveProject can
159 // write it to disk.
160 BOOST_REQUIRE( sheet->GetScreen() != nullptr );
161 BOOST_CHECK( !sheet->GetScreen()->GetFileName().IsEmpty() );
162 }
163
164 // Verify the hierarchy paths match the symbol instance paths so PCB update works.
165 // Each symbol's hierarchical reference must have a path matching one of the top-level
166 // sheet paths in the hierarchy.
167 SCH_SHEET_LIST hierarchy = schematic->BuildSheetListSortedByPageNumbers();
168 BOOST_CHECK_EQUAL( hierarchy.size(), 2 );
169
170 std::set<KIID_PATH> hierPaths;
171
172 for( const SCH_SHEET_PATH& path : hierarchy )
173 hierPaths.insert( path.Path() );
174
175 int totalSymbols = 0;
176 int orphanedSymbols = 0;
177
178 for( const SCH_SHEET_PATH& sheetPath : hierarchy )
179 {
180 SCH_SCREEN* screen = sheetPath.LastScreen();
181
182 if( !screen )
183 continue;
184
185 for( const EDA_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
186 {
187 const SCH_SYMBOL* sym = static_cast<const SCH_SYMBOL*>( item );
188 ++totalSymbols;
189
190 bool foundMatch = false;
191
192 for( const SCH_SYMBOL_INSTANCE& inst : sym->GetInstances() )
193 {
194 if( hierPaths.count( inst.m_Path ) )
195 {
196 foundMatch = true;
197 break;
198 }
199 }
200
201 if( !foundMatch )
202 ++orphanedSymbols;
203 }
204 }
205
206 BOOST_CHECK_GT( totalSymbols, 0 );
207 BOOST_CHECK_EQUAL( orphanedSymbols, 0 );
208}
209
210
224BOOST_AUTO_TEST_CASE( LabelsRemainGlobalForFlatNamespace )
225{
226 const wxFileName eagleFn = getEagleTestSchematic( "eagle-import-testfile.sch" );
227 BOOST_REQUIRE( wxFileExists( eagleFn.GetFullPath() ) );
228
229 std::unique_ptr<SCHEMATIC> schematic;
230 loadEagleSchematic( eagleFn, wxS( "eagle_label_kind" ), schematic );
231
232 // Bucket every label in the imported schematic by kind + text so we can verify that
233 // each named Eagle net produced a global label and no leftover local SCH_LABEL exists
234 // with that name. Bus labels (e.g. "A[1..3]") must stay local.
235 SCH_SHEET_LIST hierarchy = schematic->BuildSheetListSortedByPageNumbers();
236
237 std::unordered_set<wxString> globalTexts;
238 std::unordered_set<wxString> localTexts;
239
240 for( const SCH_SHEET_PATH& sheetPath : hierarchy )
241 {
242 SCH_SCREEN* screen = sheetPath.LastScreen();
243
244 if( !screen )
245 continue;
246
247 for( SCH_ITEM* item : screen->Items().OfType( SCH_GLOBAL_LABEL_T ) )
248 globalTexts.insert( static_cast<SCH_LABEL_BASE*>( item )->GetText() );
249
250 for( SCH_ITEM* item : screen->Items().OfType( SCH_LABEL_T ) )
251 localTexts.insert( static_cast<SCH_LABEL_BASE*>( item )->GetText() );
252 }
253
254 // Named Eagle nets must produce at least one global label each, and none of these
255 // names may appear as a local SCH_LABEL — that would reintroduce the "/X" sheet-path
256 // prefix that broke board update.
257 const std::vector<wxString> expectedGlobalNets = {
258 wxS( "A1" ), wxS( "A2" ), wxS( "A3" ),
259 wxS( "B1" ), wxS( "B2" ), wxS( "B3" )
260 };
261
262 for( const wxString& netName : expectedGlobalNets )
263 {
264 BOOST_CHECK_MESSAGE( globalTexts.count( netName ) > 0,
265 "Missing global Eagle net label '" << netName.ToStdString()
266 << "' — flat namespace requires SCH_GLOBALLABEL." );
267 BOOST_CHECK_MESSAGE( localTexts.count( netName ) == 0,
268 "Found local SCH_LABEL '" << netName.ToStdString()
269 << "' — Eagle net should be global." );
270 }
271
272 // Bus labels (e.g. "A[1..3]") must stay local: Eagle buses are visual groupings, not
273 // electrical signals, so globalizing them would merge same-named buses project-wide.
274 const std::vector<wxString> expectedLocalBuses = {
275 wxS( "A[1..3]" ), wxS( "B[1..3]" )
276 };
277
278 for( const wxString& busName : expectedLocalBuses )
279 {
280 BOOST_CHECK_MESSAGE( globalTexts.count( busName ) == 0,
281 "Found global SCH_GLOBALLABEL '" << busName.ToStdString()
282 << "' — Eagle bus should remain a local SCH_LABEL." );
283 }
284}
285
286
297BOOST_AUTO_TEST_CASE( PinNameTagStripped )
298{
299 const wxFileName eagleFn = getEagleTestSchematic( "issue24483_pin_tag.sch" );
300 BOOST_REQUIRE( wxFileExists( eagleFn.GetFullPath() ) );
301
302 std::unique_ptr<SCHEMATIC> schematic;
303 loadEagleSchematic( eagleFn, wxS( "eagle_pin_tag" ), schematic );
304
305 SCH_SHEET_LIST hierarchy = schematic->BuildSheetListSortedByPageNumbers();
306
307 // Key symbols by their library item name (e.g. "MYDEV"); the annotated reference is
308 // unreliable here because the no-connect device is annotated with a '#' power prefix. A
309 // single Eagle library imports without a library-name prefix on the symbol; the prefix is
310 // only added to disambiguate duplicate names across multiple Eagle libraries.
311 std::map<wxString, const SCH_SYMBOL*> symbolByLibItem;
312
313 for( const SCH_SHEET_PATH& sheetPath : hierarchy )
314 {
315 SCH_SCREEN* screen = sheetPath.LastScreen();
316
317 if( !screen )
318 continue;
319
320 for( const EDA_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
321 {
322 const SCH_SYMBOL* sym = static_cast<const SCH_SYMBOL*>( item );
323 symbolByLibItem[sym->GetLibId().GetLibItemName().wx_str()] = sym;
324 }
325 }
326
327 // The connected device maps pins to pads through <connect>; the no-connect device has no
328 // <connect> so pins are auto-numbered. Both paths must strip the tag from the display name.
329 BOOST_REQUIRE( symbolByLibItem.count( wxS( "MYDEV" ) ) == 1 );
330 BOOST_REQUIRE( symbolByLibItem.count( wxS( "MYDEV_NC" ) ) == 1 );
331
332 auto collectNames = []( const SCH_SYMBOL* aSym )
333 {
334 std::multiset<wxString> names;
335
336 for( const SCH_PIN* pin : aSym->GetAllLibPins() )
337 names.insert( pin->GetName() );
338
339 return names;
340 };
341
342 // No display name on either symbol may retain the "@<tag>" suffix.
343 for( const auto& [libItem, sym] : symbolByLibItem )
344 {
345 for( const SCH_PIN* pin : sym->GetAllLibPins() )
346 {
347 BOOST_CHECK_MESSAGE( pin->GetName().Find( '@' ) == wxNOT_FOUND,
348 libItem.ToStdString() << " pin kept Eagle tag '"
349 << pin->GetName().ToStdString() << "'." );
350 }
351 }
352
353 // For the connected device, the two "IN@n" pins must both display as "IN" yet keep their
354 // distinct pad mapping, and "NC@3" must strip to "NC".
355 std::map<wxString, wxString> nameByPad;
356
357 for( const SCH_PIN* pin : symbolByLibItem[wxS( "MYDEV" )]->GetAllLibPins() )
358 nameByPad[pin->GetNumber()] = pin->GetName();
359
360 BOOST_CHECK_EQUAL( nameByPad["1"], wxString( wxS( "IN" ) ) );
361 BOOST_CHECK_EQUAL( nameByPad["2"], wxString( wxS( "IN" ) ) );
362 BOOST_CHECK_EQUAL( nameByPad["3"], wxString( wxS( "GND" ) ) );
363 BOOST_CHECK_EQUAL( nameByPad["4"], wxString( wxS( "NC" ) ) );
364
365 // The no-connect device keeps every pin, so both tagged "IN" pins survive the strip.
366 std::multiset<wxString> ncNames = collectNames( symbolByLibItem[wxS( "MYDEV_NC" )] );
367 BOOST_CHECK_EQUAL( ncNames.count( wxS( "IN" ) ), 2 );
368 BOOST_CHECK_EQUAL( ncNames.count( wxS( "GND" ) ), 1 );
369 BOOST_CHECK_EQUAL( ncNames.count( wxS( "NC" ) ), 1 );
370}
371
372
384BOOST_AUTO_TEST_CASE( DetachedLabelProjectsOntoWire )
385{
386 const wxFileName eagleFn = getEagleTestSchematic( "eagle-import-testfile.sch" );
387 BOOST_REQUIRE( wxFileExists( eagleFn.GetFullPath() ) );
388
389 std::unique_ptr<SCHEMATIC> schematic;
390 loadEagleSchematic( eagleFn, wxS( "eagle_detached_label" ), schematic );
391
392 SCH_LABEL_BASE* detached = nullptr;
393 SCH_SCREEN* screen = nullptr;
394
395 for( const SCH_SHEET_PATH& sheetPath : schematic->BuildSheetListSortedByPageNumbers() )
396 {
397 SCH_SCREEN* sheetScreen = sheetPath.LastScreen();
398
399 if( !sheetScreen )
400 continue;
401
402 for( SCH_ITEM* item : sheetScreen->Items().OfType( SCH_GLOBAL_LABEL_T ) )
403 {
404 if( static_cast<SCH_LABEL_BASE*>( item )->GetText() == wxS( "DETACHEDLABEL" ) )
405 {
406 detached = static_cast<SCH_LABEL_BASE*>( item );
407 screen = sheetScreen;
408 }
409 }
410 }
411
412 BOOST_REQUIRE_MESSAGE( detached, "DETACHEDLABEL global label not imported" );
413
414 // Positions carry an import-time sheet translation, so all checks are made relative to
415 // the wire's own endpoints.
416 const VECTOR2I labelPos = detached->GetPosition();
417 SEG wire;
418 double wireDist = std::numeric_limits<double>::max();
419
420 for( SCH_ITEM* item : screen->Items().OfType( SCH_LINE_T ) )
421 {
422 SCH_LINE* line = static_cast<SCH_LINE*>( item );
423
424 if( !line->IsWire() )
425 continue;
426
427 SEG seg( line->GetStartPoint(), line->GetEndPoint() );
428 double d = seg.Distance( labelPos );
429
430 if( d < wireDist )
431 {
432 wireDist = d;
433 wire = seg;
434 }
435 }
436
437 // The label must be on the wire.
438 BOOST_CHECK_MESSAGE( wireDist <= schIUScale.MilsToIU( 1 ),
439 "Label is " << ( wireDist / schIUScale.IU_PER_MM )
440 << " mm from its wire" );
441
442 // The wire is 40 mm long and the label sat 10 mm from the left end. Perpendicular
443 // projection preserves that; the old endpoint/midpoint snap would put it at 0 mm
444 // (endpoint) or 20 mm (midpoint) from the left end.
445 const VECTOR2I leftEnd = wire.A.x <= wire.B.x ? wire.A : wire.B;
446 const double offsetMM = std::abs( labelPos.x - leftEnd.x ) / (double) schIUScale.IU_PER_MM;
447
448 BOOST_CHECK_MESSAGE( std::abs( offsetMM - 10.0 ) < 1.0,
449 "Label projected to " << offsetMM
450 << " mm from the wire's left end, expected 10 mm" );
451}
452
453
454// issue 24829 dropped net labels under the raw netbuslabel element name
455// and lost symbols whose variant ordinal above 127 sign-extended negative
456BOOST_AUTO_TEST_CASE( BinaryNetLabelAndHighVariantImported )
457{
458 const wxFileName eagleFn = getEagleTestSchematic( "issue24829_brenner.sch" );
459 BOOST_REQUIRE( wxFileExists( eagleFn.GetFullPath() ) );
460
461 std::unique_ptr<SCHEMATIC> schematic;
462 loadEagleSchematic( eagleFn, wxS( "eagle_brenner_24829" ), schematic );
463
464 int symbolCount = 0;
465 SCH_SYMBOL* c4 = nullptr;
466 SCH_LABEL_BASE* netLabel = nullptr;
467
468 for( const SCH_SHEET_PATH& sheetPath : schematic->BuildSheetListSortedByPageNumbers() )
469 {
470 SCH_SCREEN* screen = sheetPath.LastScreen();
471
472 if( !screen )
473 continue;
474
475 for( SCH_ITEM* item : screen->Items() )
476 {
477 if( item->Type() == SCH_LABEL_T || item->Type() == SCH_GLOBAL_LABEL_T
478 || item->Type() == SCH_HIER_LABEL_T )
479 {
480 netLabel = static_cast<SCH_LABEL_BASE*>( item );
481 }
482 else if( item->Type() == SCH_SYMBOL_T )
483 {
484 ++symbolCount;
485 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
486
487 if( sym->GetField( FIELD_T::REFERENCE )->GetText() == wxS( "C4" ) )
488 c4 = sym;
489 }
490 }
491 }
492
493 // single placed net label on VSS, previously dropped entirely
494 BOOST_REQUIRE_MESSAGE( netLabel, "placed net label was not imported" );
495 BOOST_CHECK_EQUAL( netLabel->GetText(), wxS( "VSS" ) );
496
497 // 36 placed instances, C4 is CPOL-EU with variant ordinal 131
498 BOOST_CHECK_EQUAL( symbolCount, 36 );
499 BOOST_REQUIRE_MESSAGE( c4, "CPOL-EU symbol C4 (variant ordinal 131) was not imported" );
500 BOOST_CHECK( c4->GetLibSymbolRef() != nullptr );
501}
502
503
508BOOST_AUTO_TEST_CASE( LibrarySymbolFieldsKeepTheirText )
509{
510 const wxFileName eagleFn = getEagleTestSchematic( "issue24829_brenner.sch" );
511 BOOST_REQUIRE( wxFileExists( eagleFn.GetFullPath() ) );
512
513 std::unique_ptr<SCHEMATIC> schematic;
514 loadEagleSchematic( eagleFn, wxS( "eagle_field_text" ), schematic );
515
516 std::map<wxString, LIB_SYMBOL*> libSymbolByRef;
517
518 for( const SCH_SHEET_PATH& sheetPath : schematic->BuildSheetListSortedByPageNumbers() )
519 {
520 SCH_SCREEN* screen = sheetPath.LastScreen();
521
522 if( !screen )
523 continue;
524
525 for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
526 {
527 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
528
529 if( sym->GetLibSymbolRef() )
530 libSymbolByRef[sym->GetField( FIELD_T::REFERENCE )->GetText()] = sym->GetLibSymbolRef().get();
531 }
532 }
533
534 BOOST_REQUIRE_GT( libSymbolByRef.size(), 0 );
535
536 int prefixCount = 0;
537
538 for( const auto& [ref, libSymbol] : libSymbolByRef )
539 {
540 const wxString libRef = libSymbol->GetReferenceField().GetText();
541 const wxString libValue = libSymbol->GetValueField().GetText();
542
543 BOOST_CHECK_MESSAGE( !libRef.Contains( wxS( "${" ) ),
544 ref.ToStdString() << " library reference prefix is '"
545 << libRef.ToStdString() << "'" );
546 BOOST_CHECK_MESSAGE( !libValue.Contains( wxS( "${" ) ),
547 ref.ToStdString() << " library value is '"
548 << libValue.ToStdString() << "'" );
549
550 // A deviceset can declare no prefix, which correctly leaves the field empty
551 if( libRef.IsEmpty() )
552 continue;
553
554 // Eagle names each part from the deviceset prefix and a number
555 wxString expectedPrefix = ref;
556
557 while( !expectedPrefix.IsEmpty() && wxIsdigit( expectedPrefix.Last() ) )
558 expectedPrefix.RemoveLast();
559
560 BOOST_CHECK_MESSAGE( libRef == expectedPrefix,
561 ref.ToStdString() << " library reference prefix is '"
562 << libRef.ToStdString() << "', expected '"
563 << expectedPrefix.ToStdString() << "'" );
564
565 ++prefixCount;
566 }
567
568 // Keep the prefix check from becoming vacuous if the fields come back empty
569 BOOST_CHECK_GT( prefixCount, 30 );
570}
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:123
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
const KIID m_Uuid
Definition eda_item.h:597
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:118
EE_TYPE OfType(KICAD_T aType) const
Definition sch_rtree.h:248
void LoadProjectTables(std::initializer_list< LIBRARY_TABLE_TYPE > aTablesToLoad={})
(Re)loads the project library tables in the given list, or all tables if no list is given
const UTF8 & GetLibItemName() const
Definition lib_id.h:98
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:123
virtual LIBRARY_MANAGER & GetLibraryManager() const
Definition pgm_base.h:125
Container for project specific data.
Definition project.h:63
virtual const wxString & GetText() const override
Return the string associated with the text object.
Definition sch_field.h:138
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
Segment description base class to describe items which have 2 end points (track, wire,...
Definition sch_line.h:39
bool IsWire() const
Return true if the line is a wire.
VECTOR2I GetEndPoint() const
Definition sch_line.h:145
VECTOR2I GetStartPoint() const
Definition sch_line.h:136
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Definition sch_screen.h:118
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:48
Schematic symbol object.
Definition sch_symbol.h:75
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
Definition sch_symbol.h:134
const LIB_ID & GetLibId() const override
Definition sch_symbol.h:164
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition sch_symbol.h:183
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
VECTOR2I GetPosition() const override
Definition sch_text.h:143
Definition seg.h:38
VECTOR2I A
Definition seg.h:45
VECTOR2I B
Definition seg.h:46
int Distance(const SEG &aSeg) const
Compute minimum Euclidean distance to segment aSeg.
Definition seg.cpp:709
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
wxString wx_str() const
Definition utf8.cpp:41
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
Definition io_mgr.h:33
KIID niluuid(0)
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:411
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
A simple container for schematic symbol instance information.
@ REFERENCE
Field Reference of part, i.e. "IC21".
BOOST_AUTO_TEST_CASE(FindPlugin)
Checks that the SCH_IO manager finds the Eagle plugin.
static wxFileName getEagleTestSchematic(const wxString &sch_file)
Get a schematic file from the test data eagle subdir.
static SCH_SHEET * loadEagleSchematic(const wxFileName &aEagleFn, const wxString &aProjectStem, std::unique_ptr< SCHEMATIC > &aSchematic)
Common Eagle-import scaffolding: stage a fresh project under tempDir, configure the library manager,...
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
std::string path
KIBIS_PIN * pin
BOOST_CHECK_EQUAL(result, "25.4")
@ SCH_LINE_T
Definition typeinfo.h:159
@ SCH_SYMBOL_T
Definition typeinfo.h:168
@ SCH_LABEL_T
Definition typeinfo.h:163
@ SCH_HIER_LABEL_T
Definition typeinfo.h:165
@ SCH_GLOBAL_LABEL_T
Definition typeinfo.h:164
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
Definition of file extensions used in Kicad.