本文整理汇总了C++中SCH_MARKER::GetReporter方法的典型用法代码示例。如果您正苦于以下问题:C++ SCH_MARKER::GetReporter方法的具体用法?C++ SCH_MARKER::GetReporter怎么用?C++ SCH_MARKER::GetReporter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCH_MARKER
的用法示例。
在下文中一共展示了SCH_MARKER::GetReporter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteDiagnosticERC
bool WriteDiagnosticERC( const wxString& aFullFileName )
{
wxString msg;
wxFFile file( aFullFileName, wxT( "wt" ) );
if( !file.IsOpened() )
return false;
msg = _( "ERC report" );
msg << wxT(" (") << DateAndTime() << wxT( ", " )
<< _( "Encoding UTF8" ) << wxT( " )\n" );
int err_count = 0;
int warn_count = 0;
int total_count = 0;
SCH_SHEET_LIST sheetList;
SCH_SHEET_PATH* sheet;
for( sheet = sheetList.GetFirst(); sheet != NULL; sheet = sheetList.GetNext() )
{
msg << wxString::Format( _( "\n***** Sheet %s\n" ),
GetChars( sheet->PathHumanReadable() ) );
for( SCH_ITEM* item = sheet->LastDrawList(); item != NULL; item = item->Next() )
{
if( item->Type() != SCH_MARKER_T )
continue;
SCH_MARKER* marker = (SCH_MARKER*) item;
if( marker->GetMarkerType() != MARKER_BASE::MARKER_ERC )
continue;
total_count++;
if( marker->GetErrorLevel() == MARKER_BASE::MARKER_SEVERITY_ERROR )
err_count++;
if( marker->GetErrorLevel() == MARKER_BASE::MARKER_SEVERITY_WARNING )
warn_count++;
msg << marker->GetReporter().ShowReport();
}
}
msg << wxString::Format( _( "\n ** ERC messages: %d Errors %d Warnings %d\n" ),
total_count, err_count, warn_count );
// Currently: write report unsing UTF8 (as usual in Kicad).
// TODO: see if we can use the current encoding page (mainly for Windows users),
// Or other format (HTML?)
file.Write( msg );
// wxFFile dtor will close the file.
return true;
}
示例2: WriteDiagnosticERC
bool WriteDiagnosticERC( const wxString& aFullFileName )
{
SCH_ITEM* item;
SCH_MARKER* marker;
static FILE* file;
SCH_SHEET_PATH* sheet;
wxString msg;
int count = 0;
if( ( file = wxFopen( aFullFileName, wxT( "wt" ) ) ) == NULL )
return false;
msg = _( "ERC report" );
fprintf( file, "%s (%s)\n", TO_UTF8( msg ), TO_UTF8( DateAndTime() ) );
SCH_SHEET_LIST sheetList;
for( sheet = sheetList.GetFirst(); sheet != NULL; sheet = sheetList.GetNext() )
{
msg.Printf( _( "\n***** Sheet %s\n" ), GetChars( sheet->PathHumanReadable() ) );
fprintf( file, "%s", TO_UTF8( msg ) );
for( item = sheet->LastDrawList(); item != NULL; item = item->Next() )
{
if( item->Type() != SCH_MARKER_T )
continue;
marker = (SCH_MARKER*) item;
if( marker->GetMarkerType() != MARK_ERC )
continue;
if( marker->GetMarkerType() == ERR )
count++;
msg = marker->GetReporter().ShowReport();
fprintf( file, "%s", TO_UTF8( msg ) );
}
}
msg.Printf( _( "\n >> Errors ERC: %d\n" ), count );
fprintf( file, "%s", TO_UTF8( msg ) );
fclose( file );
return true;
}