本文整理汇总了C++中SCH_MARKER::GetErrorLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ SCH_MARKER::GetErrorLevel方法的具体用法?C++ SCH_MARKER::GetErrorLevel怎么用?C++ SCH_MARKER::GetErrorLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCH_MARKER
的用法示例。
在下文中一共展示了SCH_MARKER::GetErrorLevel方法的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: GetMarkerCount
int SCH_SCREENS::GetMarkerCount( enum MARKER_BASE::TYPEMARKER aMarkerType,
enum MARKER_BASE::MARKER_SEVERITY aSeverity )
{
int count = 0;
for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
{
for( SCH_ITEM* item = screen->GetDrawItems(); item; item = item->Next() )
{
if( item->Type() != SCH_MARKER_T )
continue;
SCH_MARKER* marker = (SCH_MARKER*) item;
if( ( aMarkerType != MARKER_BASE::MARKER_UNSPEC ) &&
( marker->GetMarkerType() != aMarkerType ) )
continue;
if( aSeverity == MARKER_BASE::MARKER_SEVERITY_UNSPEC ||
aSeverity == marker->GetErrorLevel() )
count++;
}
}
return count;
}