101 wxString fileName =
m_board->GetFileName();
103 if( fileName.IsEmpty() )
112 wxFileName pro = fileName;
125 if( !
m_board || aFileName.IsEmpty() )
128 wxString outPath = aFileName;
132 if( success && aCreateProject )
134 wxFileName pro = aFileName;
151 std::unique_ptr<NETLIST_READER> netlistReader(
154 if( !netlistReader.get() )
156 msg.Printf(
_(
"Cannot open netlist file '%s'." ), aFilename );
161 netlistReader->LoadNetlist();
166 msg.Printf(
_(
"Error loading netlist.\n%s" ), ioe.
What().GetData() );
195 if( drcTool->GetDRCEngine() )
218 wxString fileName =
m_board->GetFileName();
220 if( fileName.IsEmpty() || !wxFileExists( fileName ) )
228 std::unique_ptr<BOARD> reloaded;
242 m_board = std::move( reloaded );
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
static bool SaveBoard(wxString &aFileName, BOARD &aBoard, PCB_IO_MGR::PCB_FILE_T aFormat)
static std::unique_ptr< BOARD > Load(const wxString &aFileName, PCB_IO_MGR::PCB_FILE_T aFormat, PROJECT *aProject, const OPTIONS &aOptions)
Update the BOARD with a new netlist.
std::vector< FOOTPRINT * > GetAddedFootprints() const
Information pertinent to a Pcbnew printed circuit board.
void CompileRatsnest()
Rebuild the entire board ratsnest.
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
wxString GetDesignRulesPath() const
Return the absolute path to the design rules file for this board.
COMPONENT_CLASS_MANAGER & GetComponentClassManager()
Gets the component class manager.
void InvalidateComponentClasses()
Invalidates any caches component classes and recomputes caches if required.
void RebuildRequiredCaches(FOOTPRINT *aFootprint=nullptr) const
Rebuilds any caches that may be required by custom assignment rules.
BOARD * GetBoard() const override
bool RevertToSaved() override
bool SavePcbCopy(const wxString &aFileName, bool aCreateProject, bool aHeadless) override
void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater) override
Post-import board sync (nets, classes, DRC, ratsnest, new footprint placement).
PROJECT & Prj() const override
TOOL_MANAGER * GetToolManager() const override
std::unique_ptr< TOOL_MANAGER > m_toolManager
bool SaveBoard() override
~HEADLESS_PCB_CONTEXT() override
HEADLESS_PCB_CONTEXT(std::unique_ptr< BOARD > aBoard, PROJECT *aProject, APP_SETTINGS_BASE *aSettings, KIWAY *aKiway=nullptr)
std::unique_ptr< BOARD > m_board
std::unique_ptr< BOARD_NETLIST_UPDATER > MakeNetlistUpdater() override
Create a netlist updater bound to this context's board.
bool ReadNetlistFromFile(const wxString &aFilename, NETLIST &aNetlist, REPORTER &aReporter) override
Read a netlist file and preload component footprints.
wxString GetCurrentFileName() const override
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
static NETLIST_READER * GetNetlistReader(NETLIST *aNetlist, const wxString &aNetlistFileName, const wxString &aCompFootprintFileName=wxEmptyString)
Attempt to determine the net list file type of aNetlistFileName and return the appropriate NETLIST_RE...
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
virtual SETTINGS_MANAGER & GetSettingsManager() const
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
void SaveProjectAs(const wxString &aFullPath, PROJECT *aProject=nullptr)
Set the currently loaded project path and saves it (pointers remain valid).
static const std::string ProjectFileExtension
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
void LoadNetlistFootprints(BOARD *aBoard, NETLIST &aNetlist, REPORTER &aReporter)
Load the footprints for each #SCH_COMPONENT in aNetlist from the list of libraries.
PGM_BASE & Pgm()
The global program "get" accessor.
T * GetAppSettings(const char *aFilename)
A filename or source description, a problem input line, a line number, a byte offset,...