KiCad PCB EDA Suite
pcbnew_scripting_helpers.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) 2012 NBEE Embedded Systems, Miguel Angel Ajo <[email protected]>
5  * Copyright (C) 1992-2021 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 
30 #include <Python.h>
31 #undef HAVE_CLOCK_GETTIME // macro is defined in Python.h and causes redefine warning
32 
34 
35 #include <tool/tool_manager.h>
36 #include <action_plugin.h>
37 #include <board.h>
38 #include <board_design_settings.h>
39 #include <pcb_marker.h>
40 #include <cstdlib>
41 #include <drc/drc_engine.h>
42 #include <drc/drc_item.h>
43 #include <fp_lib_table.h>
44 #include <ignore.h>
45 #include <io_mgr.h>
46 #include <string_utils.h>
47 #include <macros.h>
49 #include <project.h>
50 #include <project/net_settings.h>
51 #include <project/project_file.h>
53 #include <specctra.h>
56 #include <locale_io.h>
57 #include <wx/app.h>
58 
59 
60 static PCB_EDIT_FRAME* s_PcbEditFrame = nullptr;
62 
63 
65 {
66  if( s_PcbEditFrame )
67  return s_PcbEditFrame->GetBoard();
68  else
69  return nullptr;
70 }
71 
72 
74 {
75  s_PcbEditFrame = aPcbEditFrame;
76 }
77 
78 
79 BOARD* LoadBoard( wxString& aFileName )
80 {
81  if( aFileName.EndsWith( KiCadPcbFileExtension ) )
82  return LoadBoard( aFileName, IO_MGR::KICAD_SEXP );
83  else if( aFileName.EndsWith( LegacyPcbFileExtension ) )
84  return LoadBoard( aFileName, IO_MGR::LEGACY );
85 
86  // as fall back for any other kind use the legacy format
87  return LoadBoard( aFileName, IO_MGR::LEGACY );
88 }
89 
90 
92 {
93  if( !s_SettingsManager )
94  {
95  if( s_PcbEditFrame )
96  {
98  }
99  else
100  {
101  // Ensure wx system settings stuff is available
102  ignore_unused( wxTheApp );
103  s_SettingsManager = new SETTINGS_MANAGER( true );
104  }
105  }
106 
107  return s_SettingsManager;
108 }
109 
110 
112 {
113  // For some reasons, LoadProject() needs a C locale, so ensure we have the right locale
114  // This is mainly when running QA Python tests
116 
118 
119  if( !project )
120  {
123  }
124 
125  return project;
126 }
127 
128 
129 BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat )
130 {
131  wxFileName pro = aFileName;
132  pro.SetExt( ProjectFileExtension );
133  pro.MakeAbsolute();
134  wxString projectPath = pro.GetFullPath();
135 
136  // Ensure the "C" locale is temporary set, before reading any file
137  // It also avoid wxWidget alerts about locale issues, later, when using Python 3
139 
140  PROJECT* project = GetSettingsManager()->GetProject( projectPath );
141 
142  if( !project )
143  {
144  GetSettingsManager()->LoadProject( projectPath, false );
145  project = GetSettingsManager()->GetProject( projectPath );
146  }
147  else if( s_PcbEditFrame && project == &GetSettingsManager()->Prj() )
148  {
149  // Project is already loaded? Then so is the board
150  return s_PcbEditFrame->GetBoard();
151  }
152 
153  // Board cannot be loaded without a project, so create the default project
154  if( !project )
156 
157  BOARD* brd = IO_MGR::Load( aFormat, aFileName );
158 
159  if( brd )
160  {
161  brd->SetProject( project );
162 
164  project->GetProjectFile().NetSettings().RebuildNetClassAssignments();
165 
166  // Move legacy view settings to local project settings
167  if( !brd->m_LegacyVisibleLayers.test( Rescue ) )
168  project->GetLocalSettings().m_VisibleLayers = brd->m_LegacyVisibleLayers;
169 
171  project->GetLocalSettings().m_VisibleItems = brd->m_LegacyVisibleItems;
172 
174  bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( brd, &bds );
175 
176  try
177  {
178  wxFileName rules = pro;
179  rules.SetExt( DesignRulesFileExtension );
180  bds.m_DRCEngine->InitEngine( rules );
181  }
182  catch( ... )
183  {
184  // Best efforts...
185  }
186 
187  for( PCB_MARKER* marker : brd->ResolveDRCExclusions() )
188  brd->Add( marker );
189 
190  brd->BuildConnectivity();
191  brd->BuildListOfNets();
193  }
194 
195  return brd;
196 }
197 
198 
199 BOARD* NewBoard( wxString& aFileName )
200 {
201  wxFileName boardFn = aFileName;
202  wxFileName proFn = aFileName;
203  proFn.SetExt( ProjectFileExtension );
204  proFn.MakeAbsolute();
205 
206  wxString projectPath = proFn.GetFullPath();
207 
208  // Ensure the "C" locale is temporary set, before reading any file
209  // It also avoids wxWidgets alerts about locale issues, later, when using Python 3
211 
212  GetSettingsManager()->LoadProject( projectPath, false );
213  PROJECT* project = GetSettingsManager()->GetProject( projectPath );
214 
215  BOARD* brd = new BOARD();
216 
217  brd->SetProject( project );
219  bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( brd, &bds );
220 
221  SaveBoard( aFileName, brd );
222 
223  return brd;
224 }
225 
226 
228 {
229  // Creating a new board is not possible if running inside KiCad
230  if( s_PcbEditFrame )
231  return nullptr;
232 
233  BOARD* brd = new BOARD();
234 
235  brd->SetProject( GetDefaultProject() );
236 
237  return brd;
238 }
239 
240 
241 bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat )
242 {
243  aBoard->BuildConnectivity();
245 
246  try
247  {
248  IO_MGR::Save( aFormat, aFileName, aBoard, nullptr );
249  }
250  catch( ... )
251  {
252  return false;
253  }
254 
255  wxFileName pro = aFileName;
256  pro.SetExt( ProjectFileExtension );
257  pro.MakeAbsolute();
258  wxString projectPath = pro.GetFullPath();
259 
260  GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() );
261 
262  return true;
263 }
264 
265 
266 bool SaveBoard( wxString& aFileName, BOARD* aBoard )
267 {
268  return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP );
269 }
270 
271 
273 {
274  BOARD* board = GetBoard();
275 
276  if( !board )
277  return nullptr;
278 
279  PROJECT* project = board->GetProject();
280 
281  if( !project )
282  return nullptr;
283 
284  return project->PcbFootprintLibs();
285 }
286 
287 
288 wxArrayString GetFootprintLibraries()
289 {
290  wxArrayString footprintLibraryNames;
291 
293 
294  if( !tbl )
295  return footprintLibraryNames;
296 
297  for( const wxString& name : tbl->GetLogicalLibs() )
298  footprintLibraryNames.Add( name );
299 
300  return footprintLibraryNames;
301 }
302 
303 
304 wxArrayString GetFootprints( const wxString& aNickName )
305 {
306  wxArrayString footprintNames;
307 
309 
310  if( !tbl )
311  return footprintNames;
312 
313  tbl->FootprintEnumerate( footprintNames, aNickName, true );
314 
315  return footprintNames;
316 }
317 
318 
319 bool ExportSpecctraDSN( wxString& aFullFilename )
320 {
321  if( s_PcbEditFrame )
322  {
323  bool ok = s_PcbEditFrame->ExportSpecctraFile( aFullFilename );
324  return ok;
325  }
326  else
327  {
328  return false;
329  }
330 }
331 
332 
333 bool ExportSpecctraDSN( BOARD* aBoard, wxString& aFullFilename )
334 {
335  try
336  {
337  ExportBoardToSpecctraFile( aBoard, aFullFilename );
338  }
339  catch( ... )
340  {
341  return false;
342  }
343 
344  return true;
345 }
346 
347 
348 bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles,
349  bool aUseRelativePaths, const wxString& a3D_Subdir, double aXRef, double aYRef )
350 {
351  if( s_PcbEditFrame )
352  {
353  bool ok = s_PcbEditFrame->ExportVRML_File( aFullFileName, aMMtoWRMLunit,
354  aExport3DFiles, aUseRelativePaths,
355  a3D_Subdir, aXRef, aYRef );
356  return ok;
357  }
358  else
359  {
360  return false;
361  }
362 }
363 
364 bool ImportSpecctraSES( wxString& aFullFilename )
365 {
366  if( s_PcbEditFrame )
367  {
368  bool ok = s_PcbEditFrame->ImportSpecctraSession( aFullFilename );
369  return ok;
370  }
371  else
372  {
373  return false;
374  }
375 }
376 
377 
378 bool ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName, wxString* aLibPath )
379 {
380  if( s_PcbEditFrame )
381  {
382  s_PcbEditFrame->ExportFootprintsToLibrary( aStoreInNewLib, aLibName, aLibPath );
383  return true;
384  }
385  else
386  {
387  return false;
388  }
389 }
390 
391 void Refresh()
392 {
393  if( s_PcbEditFrame )
394  {
396  BOARD* board = s_PcbEditFrame->GetBoard();
398 
399  canvas->SyncLayersVisibility( board );
400 
401  canvas->GetView()->Clear();
402  canvas->GetView()->InitPreview();
403  canvas->GetGAL()->SetGridOrigin( VECTOR2D( board->GetDesignSettings().GetGridOrigin() ) );
404  canvas->DisplayBoard( board );
405 
406  // allow tools to re-add their view items (selection previews, grids, etc.)
407  if( toolMgr )
408  toolMgr->ResetTools( TOOL_BASE::GAL_SWITCH );
409 
410  // reload the drawing-sheet
412 
413  board->BuildConnectivity();
414 
415  canvas->Refresh();
416  }
417 }
418 
419 
421 {
422  if( s_PcbEditFrame )
424 }
425 
426 
428 {
429  if( s_PcbEditFrame )
430  return static_cast<int>( s_PcbEditFrame->GetUserUnits() );
431 
432  return -1;
433 }
434 
435 
437 {
439 }
440 
441 
442 bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
443  bool aReportAllTrackErrors )
444 {
445  wxCHECK( aBoard, false );
446 
447  BOARD_DESIGN_SETTINGS& bds = aBoard->GetDesignSettings();
448  std::shared_ptr<DRC_ENGINE> engine = bds.m_DRCEngine;
449 
450  if( !engine )
451  {
452  bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
453  engine = bds.m_DRCEngine;
454  }
455 
456  wxCHECK( engine, false );
457 
458  wxFileName fn = aBoard->GetFileName();
459  fn.SetExt( DesignRulesFileExtension );
460  PROJECT* prj = nullptr;
461 
462  if( aBoard->GetProject() )
463  prj = aBoard->GetProject();
464  else if( s_SettingsManager )
465  prj = &s_SettingsManager->Prj();
466 
467  wxCHECK( prj, false );
468 
469  wxString drcRulesPath = prj->AbsolutePath( fn.GetFullName() );
470 
471  try
472  {
473  engine->InitEngine( drcRulesPath );
474  }
475  catch( PARSE_ERROR& )
476  {
477  return false;
478  }
479 
480  std::vector<std::shared_ptr<DRC_ITEM>> footprints;
481  std::vector<std::shared_ptr<DRC_ITEM>> unconnected;
482  std::vector<std::shared_ptr<DRC_ITEM>> violations;
483 
484  engine->SetProgressReporter( nullptr );
485 
486  engine->SetViolationHandler(
487  [&]( const std::shared_ptr<DRC_ITEM>& aItem, wxPoint aPos )
488  {
489  if( aItem->GetErrorCode() == DRCE_MISSING_FOOTPRINT
490  || aItem->GetErrorCode() == DRCE_DUPLICATE_FOOTPRINT
491  || aItem->GetErrorCode() == DRCE_EXTRA_FOOTPRINT
492  || aItem->GetErrorCode() == DRCE_NET_CONFLICT )
493  {
494  footprints.push_back( aItem );
495  }
496  else if( aItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS )
497  {
498  unconnected.push_back( aItem );
499  }
500  else
501  {
502  violations.push_back( aItem );
503  }
504  } );
505 
506  engine->RunTests( aUnits, aReportAllTrackErrors, false );
507  engine->ClearViolationHandler();
508 
509  // TODO: Unify this with DIALOG_DRC::writeReport
510 
511  FILE* fp = wxFopen( aFileName, wxT( "w" ) );
512 
513  if( fp == nullptr )
514  return false;
515 
516  std::map<KIID, EDA_ITEM*> itemMap;
517  aBoard->FillItemMap( itemMap );
518 
519  fprintf( fp, "** Drc report for %s **\n", TO_UTF8( aBoard->GetFileName() ) );
520 
521  wxDateTime now = wxDateTime::Now();
522 
523  fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
524 
525  fprintf( fp, "\n** Found %d DRC violations **\n", static_cast<int>( violations.size() ) );
526 
527  for( const std::shared_ptr<DRC_ITEM>& item : violations )
528  {
529  SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
530  fprintf( fp, "%s", TO_UTF8( item->ShowReport( aUnits, severity, itemMap ) ) );
531  }
532 
533  fprintf( fp, "\n** Found %d unconnected pads **\n", static_cast<int>( unconnected.size() ) );
534 
535  for( const std::shared_ptr<DRC_ITEM>& item : unconnected )
536  {
537  SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
538  fprintf( fp, "%s", TO_UTF8( item->ShowReport( aUnits, severity, itemMap ) ) );
539  }
540 
541  fprintf( fp, "\n** Found %d Footprint errors **\n", static_cast<int>( footprints.size() ) );
542 
543  for( const std::shared_ptr<DRC_ITEM>& item : footprints )
544  {
545  SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
546  fprintf( fp, "%s", TO_UTF8( item->ShowReport( aUnits, severity, itemMap ) ) );
547  }
548 
549  fprintf( fp, "\n** End of Report **\n" );
550  fclose( fp );
551 
552  return true;
553 }
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
BOARD * LoadBoard(wxString &aFileName)
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
bool WriteDRCReport(BOARD *aBoard, const wxString &aFileName, EDA_UNITS aUnits, bool aReportAllTrackErrors)
Run the DRC check on the given board and writes the results to a report file.
void BuildListOfNets()
Definition: board.h:659
void SetPageSettings(const PAGE_INFO &aPageSettings) override
const PAGE_INFO & GetPageSettings() const
Definition: board.h:536
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
static bool IsActionRunning()
Container for project specific data.
Definition: project.h:62
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
Definition: board.h:269
SETTINGS_MANAGER * GetSettingsManager() const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
int GetUserUnits()
Return the currently selected user unit value for the interface.
const std::string ProjectFileExtension
const std::string LegacyPcbFileExtension
PROJECT & Prj()
Definition: kicad.cpp:403
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
const std::string DesignRulesFileExtension
bool ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName, wxString *aLibPath)
Save footprints in a library:
wxArrayString GetFootprints(const wxString &aNickName)
Get the names of all of the footprints available in a footprint library.
PROJECT * GetProject() const
Definition: board.h:361
void InitPreview()
Definition: view.cpp:1607
const std::string KiCadPcbFileExtension
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
bool ExportVRML_File(const wxString &aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Create the file(s) exporting current BOARD to a VRML file.
const wxPoint & GetGridOrigin()
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
const wxString & GetFileName() const
Definition: board.h:229
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:590
void ExportBoardToSpecctraFile(BOARD *aBoard, const wxString &aFullFilename)
Helper method to export board to DSN file.
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:269
This file contains miscellaneous commonly used macros and functions.
bool IsActionRunning()
Are we currently in an action plugin?
wxArrayString GetFootprintLibraries()
Get the nicknames of all of the footprint libraries configured in pcbnew in both the project and glob...
This is the end of the layers used for visibility bit masks in Pcbnew.
Definition: layer_ids.h:233
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aNickname, bool aBestEfforts)
Return a list of footprint names contained within the library given by aNickname.
Master controller class:
Definition: tool_manager.h:54
void SynchronizeNetsAndNetClasses()
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1394
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
Definition: board.cpp:608
std::vector< PCB_MARKER * > ResolveDRCExclusions()
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:208
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
Definition: layer_ids.h:260
VECTOR2< double > VECTOR2D
Definition: vector2d.h:621
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Clear()
Remove all items from the view.
Definition: view.cpp:1100
static SETTINGS_MANAGER * s_SettingsManager
bool ImportSpecctraSES(wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
void ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName=wxEmptyString, wxString *aLibPath=nullptr)
Save footprints in a library:
Definition of file extensions used in Kicad.
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
SEVERITY GetSeverity(int aDRCErrorCode)
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
SEVERITY
FP_LIB_TABLE * GetFootprintLibraryTable()
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
bool ExportSpecctraDSN(wxString &aFullFilename)
Will export the current BOARD to a specctra dsn file.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
SETTINGS_MANAGER * GetSettingsManager()
PROJECT * GetDefaultProject()
BOARD * GetBoard()
void BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition: board.cpp:137
EDA_UNITS
Definition: eda_units.h:38
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Loads a project or sets up a new project with a specified path.
void SetProject(PROJECT *aProject)
Link a board to a given project.
Definition: board.cpp:143
bool ImportSpecctraSession(const wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
bool SaveBoard(wxString &aFileName, BOARD *aBoard, IO_MGR::PCB_FILE_T aFormat)
A filename or source description, a problem input line, a line number, a byte offset,...
Definition: ki_exception.h:118
Class PCBNEW_ACTION_PLUGINS.
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:55
const char * name
Definition: DXF_plotter.cpp:56
bool ExportVRML(const wxString &aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Export the current BOARD to a VRML (wrl) file.
static void Save(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aBoard, const PROPERTIES *aProperties=nullptr)
Write either a full aBoard to a storage file in a format that this implementation knows about,...
Definition: io_mgr.cpp:174
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
The main frame for Pcbnew.
void ignore_unused(const T &)
Definition: ignore.h:24
void SaveProjectAs(const wxString &aFullPath, PROJECT *aProject=nullptr)
Sets the currently loaded project path and saves it (pointers remain valid) Note that this will not m...
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
BOARD * CreateEmptyBoard()
Construct a default BOARD with a temporary (no filename) project.
BOARD * GetBoard() const
static BOARD * Load(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aAppendToMe=nullptr, const PROPERTIES *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Find the requested PLUGIN and if found, calls the PLUGIN::Load() function on it using the arguments p...
Definition: io_mgr.cpp:158
PCB_FILE_T
The set of file types that the IO_MGR knows about, and for which there has been a plugin written.
Definition: io_mgr.h:53
Rendering engine changes.
Definition: tool_base.h:81
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:924
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:265
BOARD * NewBoard(wxString &aFileName)
Creates a new board and project with the given filename (will overwrite existing files!...
std::shared_ptr< DRC_ENGINE > m_DRCEngine
PROJECT * GetProject(const wxString &aFullPath) const
Retrieves a loaded project by name.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
static PCB_EDIT_FRAME * s_PcbEditFrame
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
bool ExportSpecctraFile(const wxString &aFullFilename)
Export the current BOARD to a specctra dsn file.
S-expression Pcbnew file format.
Definition: io_mgr.h:56
Container for design settings for a BOARD object.
GAL_SET m_LegacyVisibleItems
Definition: board.h:266