KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_altium_sch_import.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 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#include <boost/test/unit_test.hpp>
21#include <qa_utils/file_utils.h>
23
24#include <connection_graph.h>
25#include <erc/erc.h>
26#include <lib_id.h>
27#include <reporter.h>
28#include <schematic.h>
30#include <sch_label.h>
31#include <sch_no_connect.h>
32#include <sch_line.h>
33#include <sch_screen.h>
34#include <sch_sheet.h>
35#include <sch_sheet_path.h>
36#include <sch_symbol.h>
38
39#include <map>
40#include <optional>
41#include <set>
42#include <vector>
43
44
45namespace
46{
47
48struct ALTIUM_SCH_IMPORT_FIXTURE
49{
50 ALTIUM_SCH_IMPORT_FIXTURE() :
51 m_loadInfoScope( &NULL_REPORTER::GetInstance() ),
52 m_schematic( nullptr )
53 {
54 m_settingsManager.LoadProject( "" );
55 m_schematic.SetProject( &m_settingsManager.Prj() );
56 m_schematic.Reset();
57 }
58
59 ~ALTIUM_SCH_IMPORT_FIXTURE() { m_schematic.Reset(); }
60
61 wxString dataFile( const wxString& aName ) const
62 {
63 return wxString::FromUTF8( KI_TEST::GetEeschemaTestDataDir()
64 + "/plugins/altium/issue22943/" )
65 + aName;
66 }
67
68 wxString issue24861DataFile( const wxString& aName ) const
69 {
70 return wxString::FromUTF8( KI_TEST::GetEeschemaTestDataDir()
71 + "/plugins/altium/issue24861/" )
72 + aName;
73 }
74
75 wxString issue22908DataFile( const wxString& aName ) const
76 {
77 return wxString::FromUTF8( KI_TEST::GetEeschemaTestDataDir()
78 + "/plugins/altium/issue22908/" )
79 + aName;
80 }
81
82 wxString ticket1303DataFile( const wxString& aName ) const
83 {
84 return wxString::FromUTF8( KI_TEST::GetEeschemaTestDataDir()
85 + "/plugins/altium/ticket1303/" )
86 + aName;
87 }
88
89 wxString issue16903DataFile( const wxString& aName ) const
90 {
91 return wxString::FromUTF8( KI_TEST::GetEeschemaTestDataDir()
92 + "/plugins/altium/issue16903/" )
93 + aName;
94 }
95
96 wxString eDPAdapterDataFile( const wxString& aName ) const
97 {
98 return wxString::FromUTF8( KI_TEST::GetTestDataRootDir()
99 + "pcbnew/plugins/altium/eDP_adapter_dvt1_source/" )
100 + aName;
101 }
102
103 // The fixture project has no symbol libraries, so every symbol link fails by design
104 LOAD_INFO_REPORTER_SCOPE m_loadInfoScope;
105 SETTINGS_MANAGER m_settingsManager;
106 SCHEMATIC m_schematic;
107};
108
109} // namespace
110
111
112BOOST_FIXTURE_TEST_SUITE( AltiumSchImport, ALTIUM_SCH_IMPORT_FIXTURE )
113
114
115// https://gitlab.com/kicad/code/kicad/-/issues/22943
116// A component placed from an external Altium library must be addressed by a well-formed library
117// id (source library nickname + real library reference) so it resolves against the library that
118// project import registers, instead of the importer's internal per-placement name.
119BOOST_AUTO_TEST_CASE( Issue22943_SourceLibrarySymbolLibId )
120{
121 SCH_IO_ALTIUM plugin;
122
123 SCH_SHEET* rootSheet = plugin.LoadSchematicFile( dataFile( "1_cover.SchDoc" ), &m_schematic );
124 BOOST_REQUIRE( rootSheet );
125 BOOST_REQUIRE( rootSheet->GetScreen() );
126
127 // The real reference names of every symbol contained in the source library.
128 wxArrayString libNames;
129 plugin.EnumerateSymbolLib( libNames, dataFile( "mounting_holes.SchLib" ) );
130
131 std::set<wxString> libSymbolNames( libNames.begin(), libNames.end() );
132 BOOST_REQUIRE( libSymbolNames.count( wxT( "MH M3" ) ) );
133
134 std::vector<SCH_SYMBOL*> fromMountingHoles;
135
136 for( SCH_ITEM* item : rootSheet->GetScreen()->Items().OfType( SCH_SYMBOL_T ) )
137 {
138 SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
139
140 if( sym->GetLibId().GetUniStringLibNickname() == wxT( "mounting_holes" ) )
141 fromMountingHoles.push_back( sym );
142 }
143
144 BOOST_REQUIRE( !fromMountingHoles.empty() );
145
146 // Every symbol drawn from the source library must name an item that actually exists there.
147 for( SCH_SYMBOL* sym : fromMountingHoles )
148 {
149 const LIB_ID& libId = sym->GetLibId();
150 BOOST_CHECK( libId.IsValid() );
151 BOOST_CHECK_MESSAGE( libSymbolNames.count( libId.GetUniStringLibItemName() ),
152 "Library id '" << libId.Format().wx_str()
153 << "' does not resolve in mounting_holes.SchLib" );
154 }
155}
156
157
158// A sheet may not take the file of the root or of a sheet the schematic already holds, or saving
159// would write one over the other
160BOOST_AUTO_TEST_CASE( SheetsClaimFilesNoOtherSheetSavesTo )
161{
162 KI_TEST::SCOPED_TEMP_DIR directory( "altium-sheet-files" );
163 const wxString projectFile = directory.PathStr() + "/2_cubesat_bus.kicad_pro";
164 BOOST_REQUIRE( wxCopyFile( KI_TEST::GetEeschemaTestDataDir() + "issue13591.kicad_pro", projectFile ) );
165
166 SETTINGS_MANAGER settings;
167 BOOST_REQUIRE( settings.LoadProject( projectFile ) );
168
169 SCHEMATIC schematic( nullptr );
170 schematic.SetProject( &settings.Prj() );
171 schematic.Reset();
172
173 auto sheetFiles =
174 []( SCH_SHEET* aSheet )
175 {
176 std::set<wxString> files;
177
178 for( SCH_ITEM* item : aSheet->GetScreen()->Items().OfType( SCH_SHEET_T ) )
179 files.insert( static_cast<SCH_SHEET*>( item )->GetFileName() );
180
181 return files;
182 };
183
184 SCH_IO_ALTIUM firstImport;
185 SCH_SHEET* root = firstImport.LoadSchematicFile( dataFile( "1_cover.SchDoc" ), &schematic );
186 BOOST_REQUIRE( root );
187
188 const std::set<wxString> hostFiles = sheetFiles( root );
189 BOOST_CHECK( hostFiles.contains( wxS( "2_cubesat_bus_1.kicad_sch" ) ) );
190
191 std::map<std::string, UTF8> properties{ { "hierarchical_sheet_load", "1" } };
192 auto appended = std::make_unique<SCH_SHEET>( &schematic );
193 appended->SetFileName( dataFile( "1_cover.SchDoc" ) );
194
195 SCH_IO_ALTIUM secondImport;
196 BOOST_REQUIRE( secondImport.LoadSchematicFile( dataFile( "1_cover.SchDoc" ), &schematic, appended.get(),
197 &properties ) );
198
199 for( const wxString& file : sheetFiles( appended.get() ) )
200 BOOST_CHECK_MESSAGE( !hostFiles.contains( file ), file << " is already saved by the host" );
201}
202
203
204// https://gitlab.com/kicad/code/kicad/-/issues/24861
205BOOST_AUTO_TEST_CASE( Issue24861_RepeatedSchematicChannels )
206{
207 SCH_IO_ALTIUM plugin;
208
209 std::map<std::string, UTF8> properties;
210 properties.emplace( "project_file", UTF8( issue24861DataFile( wxT( "Repeated_Schematic.PrjPcb" ) ) ) );
211 properties.emplace( "sch0", UTF8( issue24861DataFile( wxT( "Repeated_Schematic.SchDoc" ) ) ) );
212 properties.emplace( "sch1", UTF8( issue24861DataFile( wxT( "Channel.SchDoc" ) ) ) );
213
214 SCH_SHEET* rootSheet = plugin.LoadSchematicFile( wxEmptyString, &m_schematic, nullptr, &properties );
215 BOOST_REQUIRE( rootSheet );
216
217 const std::vector<SCH_SHEET*> topLevelSheets = m_schematic.GetTopLevelSheets();
218 BOOST_REQUIRE_EQUAL( topLevelSheets.size(), 1 );
219 BOOST_CHECK_EQUAL( topLevelSheets.front()->GetName(), wxT( "Repeated_Schematic" ) );
220
221 std::optional<SCH_SHEET_PATH> topLevelPath;
222 std::map<wxString, SCH_SHEET_PATH> channelPaths;
223
224 for( const SCH_SHEET_PATH& sheetPath : m_schematic.Hierarchy() )
225 {
226 SCH_SHEET* sheet = sheetPath.Last();
227
228 if( sheet && sheet->GetName() == wxT( "Repeated_Schematic" ) )
229 topLevelPath = sheetPath;
230 else if( sheet && sheet->GetName().StartsWith( wxT( "CH" ) ) )
231 channelPaths.emplace( sheet->GetName(), sheetPath );
232 }
233
234 BOOST_REQUIRE( topLevelPath );
235 BOOST_CHECK_EQUAL( topLevelPath->GetPageNumber(), wxT( "1" ) );
236
237 BOOST_REQUIRE_EQUAL( channelPaths.size(), 3 );
238 BOOST_CHECK_EQUAL( channelPaths.at( wxT( "CH1" ) ).GetPageNumber(), wxT( "2" ) );
239 BOOST_CHECK_EQUAL( channelPaths.at( wxT( "CH2" ) ).GetPageNumber(), wxT( "3" ) );
240 BOOST_CHECK_EQUAL( channelPaths.at( wxT( "CH3" ) ).GetPageNumber(), wxT( "4" ) );
241
242 std::set<wxString> ledReferences;
243 std::set<wxString> resistorReferences;
244
245 for( const auto& [channelName, sheetPath] : channelPaths )
246 {
247 for( SCH_ITEM* item : sheetPath.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
248 {
249 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
250 wxString ref = symbol->GetRef( &sheetPath );
251
252 if( ref.StartsWith( wxT( "LED" ) ) )
253 ledReferences.insert( ref );
254 else if( ref.StartsWith( wxT( "R" ) ) )
255 resistorReferences.insert( ref );
256 }
257 }
258
259 BOOST_CHECK( ledReferences == std::set<wxString>( { wxT( "LED1_CH1" ), wxT( "LED1_CH2" ),
260 wxT( "LED1_CH3" ) } ) );
261 BOOST_CHECK( resistorReferences == std::set<wxString>( { wxT( "R1_CH1" ), wxT( "R1_CH2" ),
262 wxT( "R1_CH3" ) } ) );
263}
264
265
266// Repeated channels save one file, so they must share one screen and the top-level sheet uuid must
267// match its file uuid or the per-channel references are dropped when the project is reloaded
268BOOST_AUTO_TEST_CASE( RepeatedChannelsShareOneSavedScreen )
269{
270 SCH_IO_ALTIUM plugin;
271
272 std::map<std::string, UTF8> properties;
273 properties.emplace( "project_file", UTF8( issue24861DataFile( wxT( "Repeated_Schematic.PrjPcb" ) ) ) );
274 properties.emplace( "sch0", UTF8( issue24861DataFile( wxT( "Repeated_Schematic.SchDoc" ) ) ) );
275 properties.emplace( "sch1", UTF8( issue24861DataFile( wxT( "Channel.SchDoc" ) ) ) );
276
277 BOOST_REQUIRE( plugin.LoadSchematicFile( wxEmptyString, &m_schematic, nullptr, &properties ) );
278
279 const std::vector<SCH_SHEET*> topLevelSheets = m_schematic.GetTopLevelSheets();
280 BOOST_REQUIRE_EQUAL( topLevelSheets.size(), 1 );
281 BOOST_CHECK( topLevelSheets.front()->m_Uuid == topLevelSheets.front()->GetScreen()->GetUuid() );
282
283 std::set<SCH_SCREEN*> channelScreens;
284
285 for( const SCH_SHEET_PATH& sheetPath : m_schematic.Hierarchy() )
286 {
287 if( sheetPath.Last()->GetName().StartsWith( wxT( "CH" ) ) )
288 channelScreens.insert( sheetPath.LastScreen() );
289 }
290
291 BOOST_CHECK_EQUAL( channelScreens.size(), 1 );
292}
293
294
295// https://gitlab.com/kicad/code/kicad/-/issues/22908
296// Only the 34 Generic No ERC crosses are no-connects, the four Specific No ERC checkboxes are not
297BOOST_AUTO_TEST_CASE( Issue22908_SpecificNoErcIsNotNoConnect )
298{
299 SCH_IO_ALTIUM plugin;
300
301 SCH_SHEET* rootSheet = plugin.LoadSchematicFile( issue22908DataFile( wxT( "3_mpcie.SchDoc" ) ), &m_schematic );
302 BOOST_REQUIRE( rootSheet );
303
304 SCH_SCREEN* screen = rootSheet->GetScreen();
305 BOOST_REQUIRE( screen );
306
307 // Altium places these in 10 mil units with the Y axis flipped about the page bottom
308 static const std::vector<VECTOR2I> crosses = {
309 { 360, 500 }, { 360, 540 }, { 360, 610 }, { 360, 600 }, { 360, 620 }, { 360, 530 }, { 360, 460 },
310 { 360, 450 }, { 170, 550 }, { 170, 540 }, { 170, 520 }, { 170, 510 }, { 170, 610 }, { 170, 590 },
311 { 170, 580 }, { 880, 500 }, { 880, 540 }, { 880, 610 }, { 880, 600 }, { 880, 620 }, { 880, 530 },
312 { 880, 460 }, { 880, 450 }, { 690, 550 }, { 690, 540 }, { 690, 520 }, { 690, 510 }, { 690, 610 },
313 { 690, 590 }, { 690, 580 }, { 480, 650 }, { 1000, 650 }, { 290, 340 }, { 810, 340 }
314 };
315
316 const int gridPitch = m_schematic.Settings().m_ConnectionGridSize;
317 const int pageHeight = screen->GetPageSettings().GetHeightIU( schIUScale.IU_PER_MILS );
318 const int flipY = ( pageHeight / gridPitch ) * gridPitch;
319
320 std::set<std::pair<int, int>> expected;
321
322 for( const VECTOR2I& cross : crosses )
323 expected.emplace( schIUScale.MilsToIU( cross.x * 10 ), flipY - schIUScale.MilsToIU( cross.y * 10 ) );
324
325 std::set<std::pair<int, int>> actual;
326
327 size_t actualCount = 0;
328
329 for( SCH_ITEM* item : screen->Items().OfType( SCH_NO_CONNECT_T ) )
330 {
331 ++actualCount;
332 actual.emplace( item->GetPosition().x, item->GetPosition().y );
333 }
334
335 BOOST_CHECK_EQUAL( actualCount, crosses.size() );
336 BOOST_CHECK( actual == expected );
337}
338
339
340// Support ticket #1303: an OrCad-derived Altium sheet symbol references several source files
341// through a single semicolon-separated filename ("pagea.SchDoc;pageb.SchDoc"), the two pages of one
342// multi-page block. The pages cross-reference each other (and one references itself). Every page
343// must be merged into the one sub-sheet screen, and the cyclic cross-references must not create a
344// recursive hierarchy that trips SCH_SHEET_LIST::BuildSheetList.
345BOOST_AUTO_TEST_CASE( Ticket1303_MultiPageBlock )
346{
347 SCH_IO_ALTIUM plugin;
348
349 SCH_SHEET* rootSheet = plugin.LoadSchematicFile( ticket1303DataFile( wxT( "overview.SchDoc" ) ),
350 &m_schematic, nullptr, nullptr );
351 BOOST_REQUIRE( rootSheet );
352 BOOST_REQUIRE( rootSheet->GetScreen() );
353
354 // Walking the hierarchy must not trip the recursion guard in SCH_SHEET_LIST::BuildSheetList.
355 // Before the fix this raised a wxASSERT (the pages resolved to sub-sheets whose remapped
356 // filenames collided in the ancestry).
357 SCH_SHEET_LIST hierarchy = m_schematic.Hierarchy();
358
359 // Both pages of the block land in a single merged sub-sheet screen; a regression drops one (or
360 // both), leaving the sheet empty. The screen also holds no residual sub-sheet symbols, since the
361 // cross-page references were pruned rather than descended into.
362 bool foundMergedScreen = false;
363
364 for( const SCH_SHEET_PATH& sheetPath : hierarchy )
365 {
366 SCH_SCREEN* screen = sheetPath.LastScreen();
367
368 if( !screen || screen == rootSheet->GetScreen() )
369 continue;
370
371 std::optional<VECTOR2I> posA;
372 std::optional<VECTOR2I> posB;
373
374 for( SCH_ITEM* item : screen->Items().OfType( SCH_LABEL_T ) )
375 {
376 SCH_LABEL* label = static_cast<SCH_LABEL*>( item );
377
378 if( label->GetText() == wxT( "ONLY_A" ) )
379 posA = label->GetPosition();
380 else if( label->GetText() == wxT( "ONLY_B" ) )
381 posB = label->GetPosition();
382 }
383
384 if( !posA || !posB )
385 continue;
386
387 foundMergedScreen = true;
388
389 // The cross-page references were pruned, not descended into: the merged screen holds no
390 // residual sub-sheet symbols.
391 int subSheetCount = 0;
392
393 for( SCH_ITEM* item : screen->Items().OfType( SCH_SHEET_T ) )
394 {
395 (void) item;
396 subSheetCount++;
397 }
398
399 BOOST_CHECK_EQUAL( subSheetCount, 0 );
400
401 // Page B is tiled below page A rather than superimposed, even though both labels sit at the
402 // same coordinates in their source files.
403 BOOST_CHECK_MESSAGE( *posA != *posB, "Merged pages must be tiled, not overlapping" );
404
405 // The pruned cross-reference sheet's pin was converted to a hierarchical label so the wire
406 // that terminated on it still connects by name.
407 bool foundSigLabel = false;
408
409 for( SCH_ITEM* item : screen->Items().OfType( SCH_HIER_LABEL_T ) )
410 {
411 if( static_cast<SCH_HIERLABEL*>( item )->GetText() == wxT( "SIG" ) )
412 foundSigLabel = true;
413 }
414
415 BOOST_CHECK_MESSAGE( foundSigLabel,
416 "Pruned sheet pin must survive as a hierarchical label" );
417 }
418
419 BOOST_CHECK_MESSAGE( foundMergedScreen,
420 "Both pages of the multi-file sheet symbol must load into one screen" );
421}
422
423
424// https://gitlab.com/kicad/code/kicad/-/issues/24843
425// Altium encodes symbol rotation as quarter turns that map one-for-one onto KiCad's
426// SYM_ORIENT_* angles. The importer must store the same angle Altium shows so a later
427// "Update Symbols from Library" against a canonical upright symbol does not rotate the
428// placement. The reference symbols below are non-mirrored so the stored angle reads back
429// directly, without GetOrientation()'s mirror normalization.
430BOOST_AUTO_TEST_CASE( Issue24843_SymbolOrientationMatchesAltium )
431{
432 SCH_IO_ALTIUM plugin;
433
434 // The source embeds images by absolute Windows paths that cannot resolve here
436
437 SCH_SHEET* rootSheet = plugin.LoadSchematicFile( eDPAdapterDataFile( "power.SchDoc" ),
438 &m_schematic );
439 BOOST_REQUIRE( rootSheet );
440
441 m_schematic.RefreshHierarchy();
442
443 // Reference designator -> Altium orientation angle read straight from the source records.
444 const std::map<wxString, SYMBOL_ORIENTATION_PROP> expected = {
445 { wxT( "L10P" ), SYMBOL_ORIENTATION_PROP::SYMBOL_ANGLE_0 }, // Altium ORIENTATION 0
446 { wxT( "C10P" ), SYMBOL_ORIENTATION_PROP::SYMBOL_ANGLE_90 }, // Altium ORIENTATION 1
447 { wxT( "R10P" ), SYMBOL_ORIENTATION_PROP::SYMBOL_ANGLE_180 }, // Altium ORIENTATION 2
448 { wxT( "C13P" ), SYMBOL_ORIENTATION_PROP::SYMBOL_ANGLE_270 }, // Altium ORIENTATION 3
449 };
450
451 std::map<wxString, SYMBOL_ORIENTATION_PROP> actual;
452
453 for( const SCH_SHEET_PATH& sheetPath : m_schematic.Hierarchy() )
454 {
455 for( SCH_ITEM* item : sheetPath.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
456 {
457 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
458 wxString ref = symbol->GetRef( &sheetPath );
459
460 if( expected.count( ref ) )
461 actual[ref] = symbol->GetOrientationProp();
462 }
463 }
464
465 for( const auto& [ref, angle] : expected )
466 {
467 BOOST_REQUIRE_MESSAGE( actual.count( ref ), "Symbol '" << ref << "' not found on import" );
468 BOOST_CHECK_MESSAGE( actual.at( ref ) == angle,
469 "Symbol '" << ref << "' imported with orientation " << actual.at( ref )
470 << ", expected " << angle );
471 }
472}
473
474
475// https://gitlab.com/kicad/code/kicad/-/issues/16903
476// Every connectable coordinate in this design sits on a 50 mil grid in Altium's own frame, so the
477// importer's Y flip must preserve that grid phase rather than shift the sheet off grid.
478BOOST_AUTO_TEST_CASE( Issue16903_ImportKeepsGeometryOnGrid )
479{
480 SCH_IO_ALTIUM plugin;
481
482 SCH_SHEET* rootSheet =
483 plugin.LoadSchematicFile( issue16903DataFile( wxT( "hierarchical_schematic_top.SchDoc" ) ),
484 &m_schematic );
485 BOOST_REQUIRE( rootSheet );
486
487 m_schematic.RefreshHierarchy();
488
489 ERC_TESTER tester( &m_schematic );
491}
492
493
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:130
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
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
Definition erc.h:60
int TestOffGridEndpoints()
Test pins and wire ends for being off grid.
Definition erc.cpp:3106
virtual void SetReporter(REPORTER *aReporter)
Set an optional reporter for warnings/errors.
Definition io_base.h:89
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
bool IsValid() const
Check if this LID_ID is valid.
Definition lib_id.h:168
UTF8 Format() const
Definition lib_id.cpp:132
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
Definition lib_id.h:108
const wxString GetUniStringLibNickname() const
Definition lib_id.h:84
static REPORTER & GetInstance()
Definition reporter.cpp:207
int GetHeightIU(double aIUScale) const
Get the page height in IU.
Definition page_info.h:163
Holds all the data relating to one schematic.
Definition schematic.h:149
void Reset()
Initialize this schematic to a blank one, unloading anything existing.
void SetProject(PROJECT *aPrj)
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,...
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.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:170
const PAGE_INFO & GetPageSettings() const
Definition sch_screen.h:144
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Definition sch_screen.h:122
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
wxString GetName() const
Definition sch_sheet.h:148
SCH_SCREEN * GetScreen() const
Definition sch_sheet.h:151
Schematic symbol object.
Definition sch_symbol.h:75
SYMBOL_ORIENTATION_PROP GetOrientationProp() const
Definition sch_symbol.h:307
const LIB_ID & GetLibId() const override
Definition sch_symbol.h:165
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
VECTOR2I GetPosition() const override
Definition sch_text.h:143
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.
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
Definition utf8.h:67
wxString wx_str() const
Definition utf8.cpp:41
std::string GetTestDataRootDir()
std::string GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
@ SYMBOL_ANGLE_180
Definition symbol.h:51
@ SYMBOL_ANGLE_0
Definition symbol.h:49
@ SYMBOL_ANGLE_90
Definition symbol.h:50
@ SYMBOL_ANGLE_270
Definition symbol.h:52
BOOST_AUTO_TEST_CASE(Issue22943_SourceLibrarySymbolLibId)
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
VECTOR3I expected(15, 30, 45)
int actual
BOOST_CHECK_EQUAL(result, "25.4")
@ SCH_NO_CONNECT_T
Definition typeinfo.h:156
@ SCH_SYMBOL_T
Definition typeinfo.h:168
@ SCH_LABEL_T
Definition typeinfo.h:163
@ SCH_SHEET_T
Definition typeinfo.h:171
@ SCH_HIER_LABEL_T
Definition typeinfo.h:165
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708