29#include <wx/cmdline.h>
65 wxFileName pro( filename );
66 wxFileName brdName ( filename );
67 wxFileName schName ( filename );
68 wxFileName ruleFileName ( filename );
70 pro.SetExt( ProjectFileExtension );
71 brdName.SetExt( KiCadPcbFileExtension );
72 schName.SetExt( KiCadSchematicFileExtension );
73 ruleFileName.SetExt( DesignRulesFileExtension );
75 brdName.MakeAbsolute();
76 schName.MakeAbsolute();
77 ruleFileName.MakeAbsolute();
80 manager.LoadProject( pro.GetFullPath() );
84 std::string( brdName.GetFullPath().ToUTF8() ) ).release() );
92 if( wxFileExists( schName.GetFullPath() ) )
105 std::shared_ptr<DRC_ENGINE> drcEngine(
new DRC_ENGINE );
109 project.board->GetDesignSettings().m_DRCEngine = drcEngine;
111 drcEngine->SetBoard(
project.board.get() );
112 drcEngine->SetDesignSettings( &
project.board->GetDesignSettings() );
116 drcEngine->SetViolationHandler(
117 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
VECTOR2I aPos,
int aLayer )
123 drcEngine->InitEngine(
project.rulesFilePath );
124 drcEngine->SetDebugOverlay( aDebugOverlay );
126 for(
auto provider : drcEngine->GetTestProviders() )
138 catch(
const ClipperLib::clipperException& e )
140 consoleLog.
Print( wxString::Format(
"Clipper exception %s occurred.", e.what() ) );
General utilities for PCB file IO for QA programs.
void Print(const wxString &aMessage)
Design Rule Checker object that performs all the DRC tests.
virtual SETTINGS_MANAGER & GetSettingsManager() const
PROJECT_CONTEXT loadKicadProject(const wxString &filename, std::optional< wxString > rulesFilePath)
int runDRCProto(PROJECT_CONTEXT project, std::shared_ptr< KIGFX::VIEW_OVERLAY > aDebugOverlay)
std::unique_ptr< BOARD > ReadBoardFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
Read a board from a file, or another stream, as appropriate.
PGM_BASE & Pgm()
The global Program "get" accessor.
std::shared_ptr< BOARD > board
Definition of file extensions used in Kicad.