41 std::shared_ptr<RC_ITEMS_PROVIDER> aMarkersProvider,
42 std::shared_ptr<RC_ITEMS_PROVIDER> aRatsnestProvider,
43 std::shared_ptr<RC_ITEMS_PROVIDER> aFpWarningsProvider) :
61 FILE* fp = wxFopen( aFullFileName, wxT(
"w" ) );
71 wxFileName fn(
m_board->GetFileName() );
72 fprintf( fp,
"** Drc report for %s **\n",
TO_UTF8( fn.GetFullName() ) );
80 fprintf( fp,
"\n** Found %d DRC violations **\n", count );
82 for(
int i = 0; i < count; ++i )
85 SEVERITY severity = item->GetParent()->GetSeverity();
90 fprintf( fp,
"%s",
TO_UTF8( item->ShowReport( &unitsProvider, severity, itemResolver ) ) );
95 fprintf( fp,
"\n** Found %d unconnected pads **\n", count );
97 for(
int i = 0; i < count; ++i )
102 fprintf( fp,
"%s",
TO_UTF8( item->ShowReport( &unitsProvider, severity, itemResolver ) ) );
107 fprintf( fp,
"\n** Found %d Footprint errors **\n", count );
109 for(
int i = 0; i < count; ++i )
114 fprintf( fp,
"%s",
TO_UTF8( item->ShowReport( &unitsProvider, severity, itemResolver ) ) );
117 fprintf( fp,
"\n** Ignored checks **\n" );
119 bool hasIgnored =
false;
123 int code = item.get().GetErrorCode();
125 if( code > 0 && bds.
Ignore( code ) )
133 fprintf( fp,
" - %s\n",
TO_UTF8(
_(
"None" ) ) );
135 fprintf( fp,
"\n** End of Report **\n" );
145 std::ofstream jsonFileStream( aFullFileName.fn_str() );
153 wxFileName fn(
m_board->GetFileName() );
154 reportHead.
$schema =
"https://schemas.kicad.org/drc.v1.json";
155 reportHead.
source = fn.GetFullName();
173 SEVERITY severity = item->GetParent()->GetSeverity();
176 severity = bds.
GetSeverity( item->GetErrorCode() );
179 item->GetJsonViolation( violation, &unitsProvider, severity, itemResolver );
190 item->GetJsonViolation( violation, &unitsProvider, severity, itemResolver );
202 item->GetJsonViolation( violation, &unitsProvider, severity, itemResolver );
209 int code = item.get().GetErrorCode();
211 if( code > 0 && bds.
Ignore( code ) )
214 ignoredCheck.
key = item.get().GetSettingsKey();
220 nlohmann::json saveJson = nlohmann::json( reportHead );
221 jsonFileStream << std::setw( 4 ) << saveJson << std::endl;
222 jsonFileStream.flush();
223 jsonFileStream.close();
constexpr EDA_IU_SCALE pcbIUScale
wxString GetMajorMinorPatchVersion()
Get the major, minor and patch version in a string major.minor.patch This is extracted by CMake from ...
Container for design settings for a BOARD object.
bool Ignore(int aDRCErrorCode) const
Return true if the DRC error code's severity is RPT_SEVERITY_ERROR.
SEVERITY GetSeverity(int aDRCErrorCode) const
Return the severity of a given DRC error code.
Implements the RC_ITEM_RESOLVER interface to resolve PCB items by their KIID.
Information pertinent to a Pcbnew printed circuit board.
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
std::shared_ptr< RC_ITEMS_PROVIDER > m_ratsnestProvider
bool WriteJsonReport(const wxString &aFullFileName)
std::shared_ptr< RC_ITEMS_PROVIDER > m_markersProvider
bool WriteTextReport(const wxString &aFullFileName)
DRC_REPORT(BOARD *aBoard, EDA_UNITS aReportUnits, std::shared_ptr< RC_ITEMS_PROVIDER > aMarkersProvider, std::shared_ptr< RC_ITEMS_PROVIDER > aRatsnestProvider, std::shared_ptr< RC_ITEMS_PROVIDER > aFpWarningsProvider)
std::shared_ptr< RC_ITEMS_PROVIDER > m_fpWarningsProvider
static wxString StripMarkup(const wxString &aValue)
Flatten [label](url) markup, keeping just the label.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
This file contains miscellaneous commonly used macros and functions.
KICOMMON_API wxString GetLabel(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
wxString formatSeverities(int aSeverities)
Convert a severity mask to a human-readable comma-separated string.
wxString GetISO8601CurrentDateTime()
std::vector< wxString > included_severities
std::vector< VIOLATION > unconnected_items
std::vector< IGNORED_CHECK > ignored_checks
std::vector< VIOLATION > violations
std::vector< VIOLATION > schematic_parity
wxString coordinate_units