29 #include <wx/cmdline.h> 62 auto &manager =
Pgm().GetSettingsManager();
64 wxFileName pro( filename );
65 wxFileName brdName ( filename );
66 wxFileName schName ( filename );
67 wxFileName ruleFileName ( filename );
76 brdName.MakeAbsolute();
77 schName.MakeAbsolute();
78 ruleFileName.MakeAbsolute();
81 manager.LoadProject( pro.GetFullPath() );
85 std::string( brdName.GetFullPath().ToUTF8() ) ).release() );
94 if( wxFileExists( schName.GetFullPath() ) )
107 std::shared_ptr<DRC_ENGINE> drcEngine(
new DRC_ENGINE );
111 project.
board->GetDesignSettings().m_DRCEngine = drcEngine;
113 drcEngine->SetBoard( project.
board.get() );
114 drcEngine->SetDesignSettings( &project.
board->GetDesignSettings() );
118 drcEngine->SetViolationHandler(
119 [&](
const std::shared_ptr<DRC_ITEM>& aItem, wxPoint aPos )
126 drcEngine->SetDebugOverlay( aDebugOverlay );
128 for(
auto provider : drcEngine->GetTestProviders() )
140 catch(
const ClipperLib::clipperException& e )
Design Rule Checker object that performs all the DRC tests.
std::shared_ptr< BOARD > board
const std::string ProjectFileExtension
const std::string DesignRulesFileExtension
const std::string KiCadPcbFileExtension
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
void Print(const wxString &aMessage)
Definition of file extensions used in Kicad.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
int runDRCProto(PROJECT_CONTEXT project, std::shared_ptr< KIGFX::VIEW_OVERLAY > aDebugOverlay)
const std::string KiCadSchematicFileExtension
General utilities for PCB file IO for QA programs.
std::unique_ptr< BOARD > ReadBoardFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
Read a board from a file, or another stream, as appropriate.
PROJECT_CONTEXT loadKicadProject(wxString filename, OPT< wxString > rulesFilePath)