KiCad PCB EDA Suite
pcbnew_scripting_helpers.h
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) 2013 NBEE Embedded Systems SL, Miguel Angel Ajo <[email protected]>
5  * Copyright (C) 2013-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 
25 #ifndef __PCBNEW_SCRIPTING_HELPERS_H
26 #define __PCBNEW_SCRIPTING_HELPERS_H
27 
28 #include <pcb_edit_frame.h>
29 #include <io_mgr.h>
30 
31 /* we could be including all these methods as static in a class, but
32  * we want plain pcbnew.<method_name> access from python
33  */
34 
35 #ifndef SWIG
36 void ScriptingSetPcbEditFrame( PCB_EDIT_FRAME* aPCBEdaFrame );
37 
38 #endif
39 
40 // For Python scripts: return the current board.
41 BOARD* GetBoard();
42 
43 BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat );
44 
45 // Default LoadBoard() to load .kicad_pcb files:.
46 BOARD* LoadBoard( wxString& aFileName );
47 
54 BOARD* NewBoard( wxString& aFileName );
55 
57 
64 
72 bool SaveBoard( wxString& aFileName, BOARD* aBoard );
73 
80 wxArrayString GetFootprintLibraries();
81 
88 wxArrayString GetFootprints( const wxString& aNickName );
89 
97 bool ExportSpecctraDSN( wxString& aFullFilename );
98 
108 bool ExportSpecctraDSN( BOARD* aBoard, wxString& aFullFilename );
109 
116 bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles,
117  bool aUseRelativePaths, const wxString& a3D_Subdir, double aXRef, double aYRef );
118 
127 bool ImportSpecctraSES( wxString& aFullFilename );
128 
140 bool ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName = wxEmptyString,
141  wxString* aLibPath = nullptr );
142 
151 void Refresh();
152 
159 void UpdateUserInterface();
160 
166 int GetUserUnits();
167 
171 bool IsActionRunning();
172 
185 bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
186  bool aReportAllTrackErrors );
187 
188 #endif // __PCBNEW_SCRIPTING_HELPERS_H
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.
BOARD * CreateEmptyBoard()
Construct a default BOARD with a temporary (no filename) project.
bool IsActionRunning()
Are we currently in an action plugin?
bool ExportSpecctraDSN(wxString &aFullFilename)
Will export the current BOARD to a specctra dsn file.
bool SaveBoard(wxString &aFileName, BOARD *aBoard)
Saves a copy of the given board and its associated project to the given path.
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPCBEdaFrame)
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.
wxArrayString GetFootprintLibraries()
Get the nicknames of all of the footprint libraries configured in pcbnew in both the project and glob...
BOARD * LoadBoard(wxString &aFileName, IO_MGR::PCB_FILE_T aFormat)
bool ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName=wxEmptyString, wxString *aLibPath=nullptr)
Save footprints in a library:
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()
int GetUserUnits()
Return the currently selected user unit value for the interface.
BOARD * NewBoard(wxString &aFileName)
Creates a new board and project with the given filename (will overwrite existing files!...
EDA_UNITS
Definition: eda_units.h:38
BOARD * GetBoard()
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
The main frame for Pcbnew.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
wxArrayString GetFootprints(const wxString &aNickName)
Get the names of all of the footprints available in a footprint library.
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
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