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>
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>
53#include <specctra.h>
56#include <locale_io.h>
57#include <wx/app.h>
58
59
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
79BOARD* 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{
94 {
95 if( s_PcbEditFrame )
96 {
98 }
99 else
100 {
101 // Ensure wx system settings stuff is available
102 ignore_unused( wxTheApp );
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
129BOARD* 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 if( wxFileExists( projectPath ) )
145 {
146 GetSettingsManager()->LoadProject( projectPath, false );
147 project = GetSettingsManager()->GetProject( projectPath );
148 }
149 }
150 else if( s_PcbEditFrame && project == &GetSettingsManager()->Prj() )
151 {
152 // Project is already loaded? Then so is the board
153 return s_PcbEditFrame->GetBoard();
154 }
155
156 // Board cannot be loaded without a project, so create the default project
157 if( !project )
159
160 BOARD* brd = IO_MGR::Load( aFormat, aFileName );
161
162 if( brd )
163 {
164 brd->SetProject( project );
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
199BOARD* 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
236
237 return brd;
238}
239
240
241bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat, bool aSkipSettings )
242{
243 aBoard->BuildConnectivity();
245
246 // Ensure the "C" locale is temporary set, before saving any file
247 // It also avoid wxWidget alerts about locale issues, later, when using Python 3
249
250 try
251 {
252 IO_MGR::Save( aFormat, aFileName, aBoard, nullptr );
253 }
254 catch( ... )
255 {
256 return false;
257 }
258
259 if( !aSkipSettings )
260 {
261 wxFileName pro = aFileName;
262 pro.SetExt( ProjectFileExtension );
263 pro.MakeAbsolute();
264
265 GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() );
266 }
267
268 return true;
269}
270
271
272bool SaveBoard( wxString& aFileName, BOARD* aBoard, bool aSkipSettings )
273{
274 return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP, aSkipSettings );
275}
276
277
279{
280 BOARD* board = GetBoard();
281
282 if( !board )
283 return nullptr;
284
285 PROJECT* project = board->GetProject();
286
287 if( !project )
288 return nullptr;
289
290 return project->PcbFootprintLibs();
291}
292
293
295{
296 wxArrayString footprintLibraryNames;
297
299
300 if( !tbl )
301 return footprintLibraryNames;
302
303 for( const wxString& name : tbl->GetLogicalLibs() )
304 footprintLibraryNames.Add( name );
305
306 return footprintLibraryNames;
307}
308
309
310wxArrayString GetFootprints( const wxString& aNickName )
311{
312 wxArrayString footprintNames;
313
315
316 if( !tbl )
317 return footprintNames;
318
319 tbl->FootprintEnumerate( footprintNames, aNickName, true );
320
321 return footprintNames;
322}
323
324
325bool ExportSpecctraDSN( wxString& aFullFilename )
326{
327 if( s_PcbEditFrame )
328 {
329 bool ok = s_PcbEditFrame->ExportSpecctraFile( aFullFilename );
330 return ok;
331 }
332 else
333 {
334 return false;
335 }
336}
337
338
339bool ExportSpecctraDSN( BOARD* aBoard, wxString& aFullFilename )
340{
341 try
342 {
343 ExportBoardToSpecctraFile( aBoard, aFullFilename );
344 }
345 catch( ... )
346 {
347 return false;
348 }
349
350 return true;
351}
352
353
354bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles,
355 bool aUseRelativePaths, const wxString& a3D_Subdir, double aXRef, double aYRef )
356{
357 if( s_PcbEditFrame )
358 {
359 bool ok = s_PcbEditFrame->ExportVRML_File( aFullFileName, aMMtoWRMLunit,
360 aExport3DFiles, aUseRelativePaths,
361 a3D_Subdir, aXRef, aYRef );
362 return ok;
363 }
364 else
365 {
366 return false;
367 }
368}
369
370bool ImportSpecctraSES( wxString& aFullFilename )
371{
372 if( s_PcbEditFrame )
373 {
374 bool ok = s_PcbEditFrame->ImportSpecctraSession( aFullFilename );
375 return ok;
376 }
377 else
378 {
379 return false;
380 }
381}
382
383
384bool ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName, wxString* aLibPath )
385{
386 if( s_PcbEditFrame )
387 {
388 s_PcbEditFrame->ExportFootprintsToLibrary( aStoreInNewLib, aLibName, aLibPath );
389 return true;
390 }
391 else
392 {
393 return false;
394 }
395}
396
398{
399 if( s_PcbEditFrame )
400 {
402 BOARD* board = s_PcbEditFrame->GetBoard();
404
405 canvas->SyncLayersVisibility( board );
406
407 canvas->GetView()->Clear();
408 canvas->GetView()->InitPreview();
409 canvas->GetGAL()->SetGridOrigin( VECTOR2D( board->GetDesignSettings().GetGridOrigin() ) );
410 canvas->DisplayBoard( board );
411
412 // allow tools to re-add their view items (selection previews, grids, etc.)
413 if( toolMgr )
415
416 // reload the drawing-sheet
418
419 board->BuildConnectivity();
420
421 canvas->Refresh();
422 }
423}
424
425
427{
428 if( s_PcbEditFrame )
430}
431
432
434{
435 if( s_PcbEditFrame )
436 return static_cast<int>( s_PcbEditFrame->GetUserUnits() );
437
438 return -1;
439}
440
441
443{
445}
446
447
448bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
449 bool aReportAllTrackErrors )
450{
451 wxCHECK( aBoard, false );
452
454 std::shared_ptr<DRC_ENGINE> engine = bds.m_DRCEngine;
455 UNITS_PROVIDER unitsProvider( pcbIUScale, aUnits );
456
457 if( !engine )
458 {
459 bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
460 engine = bds.m_DRCEngine;
461 }
462
463 wxCHECK( engine, false );
464
465 wxFileName fn = aBoard->GetFileName();
466 fn.SetExt( DesignRulesFileExtension );
467 PROJECT* prj = nullptr;
468
469 if( aBoard->GetProject() )
470 prj = aBoard->GetProject();
471 else if( s_SettingsManager )
472 prj = &s_SettingsManager->Prj();
473
474 wxCHECK( prj, false );
475
476 wxString drcRulesPath = prj->AbsolutePath( fn.GetFullName() );
477
478 try
479 {
480 engine->InitEngine( drcRulesPath );
481 }
482 catch( PARSE_ERROR& )
483 {
484 return false;
485 }
486
487 std::vector<std::shared_ptr<DRC_ITEM>> footprints;
488 std::vector<std::shared_ptr<DRC_ITEM>> unconnected;
489 std::vector<std::shared_ptr<DRC_ITEM>> violations;
490
491 engine->SetProgressReporter( nullptr );
492
493 engine->SetViolationHandler(
494 [&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2D aPos, int aLayer )
495 {
496 if( aItem->GetErrorCode() == DRCE_MISSING_FOOTPRINT
497 || aItem->GetErrorCode() == DRCE_DUPLICATE_FOOTPRINT
498 || aItem->GetErrorCode() == DRCE_EXTRA_FOOTPRINT
499 || aItem->GetErrorCode() == DRCE_NET_CONFLICT )
500 {
501 footprints.push_back( aItem );
502 }
503 else if( aItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS )
504 {
505 unconnected.push_back( aItem );
506 }
507 else
508 {
509 violations.push_back( aItem );
510 }
511 } );
512
513 engine->RunTests( aUnits, aReportAllTrackErrors, false );
514 engine->ClearViolationHandler();
515
516 // TODO: Unify this with DIALOG_DRC::writeReport
517
518 FILE* fp = wxFopen( aFileName, wxT( "w" ) );
519
520 if( fp == nullptr )
521 return false;
522
523 std::map<KIID, EDA_ITEM*> itemMap;
524 aBoard->FillItemMap( itemMap );
525
526 fprintf( fp, "** Drc report for %s **\n", TO_UTF8( aBoard->GetFileName() ) );
527
528 wxDateTime now = wxDateTime::Now();
529
530 fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
531
532 fprintf( fp, "\n** Found %d DRC violations **\n", static_cast<int>( violations.size() ) );
533
534 for( const std::shared_ptr<DRC_ITEM>& item : violations )
535 {
536 SEVERITY severity = item->GetParent()->GetSeverity();
537 fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
538 }
539
540 fprintf( fp, "\n** Found %d unconnected pads **\n", static_cast<int>( unconnected.size() ) );
541
542 for( const std::shared_ptr<DRC_ITEM>& item : unconnected )
543 {
544 SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
545 fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
546 }
547
548 fprintf( fp, "\n** Found %d Footprint errors **\n", static_cast<int>( footprints.size() ) );
549
550 for( const std::shared_ptr<DRC_ITEM>& item : footprints )
551 {
552 SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
553 fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
554 }
555
556 fprintf( fp, "\n** End of Report **\n" );
557 fclose( fp );
558
559 return true;
560}
const char * name
Definition: DXF_plotter.cpp:56
Class PCBNEW_ACTION_PLUGINS.
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
static bool IsActionRunning()
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
const VECTOR2I & GetGridOrigin()
SEVERITY GetSeverity(int aDRCErrorCode)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:696
GAL_SET m_LegacyVisibleItems
Definition: board.h:339
void BuildListOfNets()
Definition: board.h:742
const PAGE_INFO & GetPageSettings() const
Definition: board.h:624
void SynchronizeNetsAndNetClasses()
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1470
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:338
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:169
const wxString & GetFileName() const
Definition: board.h:302
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:1022
PROJECT * GetProject() const
Definition: board.h:440
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:628
std::vector< PCB_MARKER * > ResolveDRCExclusions()
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:275
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:162
SETTINGS_MANAGER * GetSettingsManager() const
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...
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aNickname, bool aBestEfforts)
Return a list of footprint names contained within the library given by aNickname.
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:54
@ LEGACY
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:55
@ KICAD_SEXP
S-expression Pcbnew file format.
Definition: io_mgr.h:56
static BOARD * Load(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aAppendToMe=nullptr, const STRING_UTF8_MAP *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:162
static void Save(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr)
Write either a full aBoard to a storage file in a format that this implementation knows about,...
Definition: io_mgr.cpp:178
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
void Clear()
Remove all items from the view.
Definition: view.cpp:1096
void InitPreview()
Definition: view.cpp:1611
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:41
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
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.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
The main frame for Pcbnew.
void SetPageSettings(const PAGE_INFO &aPageSettings) override
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
void ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName=wxEmptyString, wxString *aLibPath=nullptr)
Save footprints in a library:
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 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.
bool ExportSpecctraFile(const wxString &aFullFilename)
Export the current BOARD to a specctra dsn file.
Container for project specific data.
Definition: project.h:63
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:305
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...
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Loads a project or sets up a new project with a specified path.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieves a loaded project by name.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
@ GAL_SWITCH
Rendering engine changes.
Definition: tool_base.h:81
Master controller class:
Definition: tool_manager.h:55
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Reset all tools (i.e.
EDA_UNITS GetUserUnits() const
@ DRCE_UNCONNECTED_ITEMS
Definition: drc_item.h:39
@ DRCE_DUPLICATE_FOOTPRINT
Definition: drc_item.h:71
@ DRCE_EXTRA_FOOTPRINT
Definition: drc_item.h:72
@ DRCE_NET_CONFLICT
Definition: drc_item.h:73
@ DRCE_MISSING_FOOTPRINT
Definition: drc_item.h:70
EDA_UNITS
Definition: eda_units.h:43
const std::string LegacyPcbFileExtension
const std::string KiCadPcbFileExtension
const std::string ProjectFileExtension
const std::string DesignRulesFileExtension
void ignore_unused(const T &)
Definition: ignore.h:24
PROJECT & Prj()
Definition: kicad.cpp:555
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
Definition: layer_ids.h:226
@ Rescue
Definition: layer_ids.h:133
#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:264
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
bool ImportSpecctraSES(wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
SETTINGS_MANAGER * GetSettingsManager()
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.
BOARD * CreateEmptyBoard()
Construct a default BOARD with a temporary (no filename) project.
wxArrayString GetFootprintLibraries()
Get the nicknames of all of the footprint libraries configured in pcbnew in both the project and glob...
FP_LIB_TABLE * GetFootprintLibraryTable()
int GetUserUnits()
Return the currently selected user unit value for the interface.
wxArrayString GetFootprints(const wxString &aNickName)
Get the names of all of the footprints available in a footprint library.
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
static PCB_EDIT_FRAME * s_PcbEditFrame
bool IsActionRunning()
Are we currently in an action plugin?
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
bool SaveBoard(wxString &aFileName, BOARD *aBoard, IO_MGR::PCB_FILE_T aFormat, bool aSkipSettings)
bool ExportSpecctraDSN(wxString &aFullFilename)
Will export the current BOARD to a specctra dsn file.
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
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 SETTINGS_MANAGER * s_SettingsManager
BOARD * GetBoard()
bool ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName, wxString *aLibPath)
Save footprints in a library:
PROJECT * GetDefaultProject()
BOARD * NewBoard(wxString &aFileName)
Creates a new board and project with the given filename (will overwrite existing files!...
BOARD * LoadBoard(wxString &aFileName)
SEVERITY
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:74
void ExportBoardToSpecctraFile(BOARD *aBoard, const wxString &aFullFilename)
Helper method to export board to DSN file.
A filename or source description, a problem input line, a line number, a byte offset,...
Definition: ki_exception.h:119
VECTOR2< double > VECTOR2D
Definition: vector2d.h:617
Definition of file extensions used in Kicad.