Use a standard HTML reporter for Symbol Checker.

This commit is contained in:
Jeff Young 2022-03-26 14:22:31 +00:00
parent d5533e7999
commit 1c158a4ea4
2 changed files with 13 additions and 35 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="16" />
<FileVersion major="1" minor="15" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
@ -14,7 +14,6 @@
<property name="file">dialog_display_html_text_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_display_html_text_base</property>
@ -26,7 +25,6 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -52,7 +50,6 @@
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -62,7 +59,7 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="border">10</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxHtmlWindow" expanded="0">

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 CERN
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -39,26 +39,11 @@
#include <eda_doc.h>
#include <sch_marker.h>
#include <project.h>
#include <dialogs/dialog_display_html_text_base.h>
#include <dialogs/html_message_box.h>
#include <dialogs/dialog_erc.h>
#include <math/util.h> // for KiROUND
class DIALOG_DISPLAY_HTML_TEXT : public DIALOG_DISPLAY_HTML_TEXT_BASE
{
public:
DIALOG_DISPLAY_HTML_TEXT( wxWindow* aParent, wxWindowID aId, const wxString& aTitle,
const wxPoint& aPos, const wxSize& aSize, long aStyle = 0 ) :
DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, aId, aTitle, aPos, aSize, aStyle )
{ }
~DIALOG_DISPLAY_HTML_TEXT()
{ }
void SetPage( const wxString& message ) { m_htmlWindow->SetPage( message ); }
};
EE_INSPECTION_TOOL::EE_INSPECTION_TOOL() :
EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.InspectionTool" ),
m_ercDialog( nullptr )
@ -259,7 +244,7 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
if( symbol->HasConversion() && next->GetConvert() )
{
if( symbol->GetUnitCount() <= 1 )
if( pin->GetUnit() == 0 || next->GetUnit() == 0 )
{
msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%.3f, %.3f)</b>"
" conflicts with pin %s%s at location <b>(%.3f, %.3f)</b>"
@ -286,13 +271,13 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
pinName,
MessageTextFromValue( units, pin->GetPosition().x ),
MessageTextFromValue( units, -pin->GetPosition().y ),
'A' + next->GetUnit() - 1,
'A' + pin->GetUnit() - 1 );
symbol->GetUnitReference( next->GetUnit() ),
symbol->GetUnitReference( pin->GetUnit() ) );
}
}
else
{
if( symbol->GetUnitCount() <= 1 )
if( pin->GetUnit() == 0 || next->GetUnit() == 0 )
{
msg.Printf( _( "<b>Duplicate pin %s</b> %s at location <b>(%s, %s)</b>"
" conflicts with pin %s%s at location <b>(%s, %s)</b>." ),
@ -318,8 +303,8 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
pinName,
MessageTextFromValue( units, pin->GetPosition().x ),
MessageTextFromValue( units, -pin->GetPosition().y ),
'A' + next->GetUnit() - 1,
'A' + pin->GetUnit() - 1 );
symbol->GetUnitReference( next->GetUnit() ),
symbol->GetUnitReference( pin->GetUnit() ) );
}
}
@ -450,16 +435,12 @@ int EE_INSPECTION_TOOL::CheckSymbol( const TOOL_EVENT& aEvent )
}
else
{
wxString outmsg;
HTML_MESSAGE_BOX dlg( m_frame, _( "Symbol Warnings" ) );
for( const wxString& single_msg : messages )
outmsg += single_msg;
dlg.AddHTML_Text( single_msg );
DIALOG_DISPLAY_HTML_TEXT error_display( m_frame, wxID_ANY, _( "Symbol Warnings" ),
wxDefaultPosition, wxSize( 700, 350 ) );
error_display.SetPage( outmsg );
error_display.ShowModal();
dlg.ShowModal();
}
return 0;