2019-07-16 19:34:07 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2023-03-09 11:25:32 +00:00
|
|
|
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2019-07-16 19:34:07 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2020-07-11 01:06:17 +00:00
|
|
|
#include <bitmaps.h>
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <pcb_group.h>
|
2019-08-12 14:41:45 +00:00
|
|
|
#include <tool/tool_manager.h>
|
2020-12-16 13:31:32 +00:00
|
|
|
#include <tools/pcb_selection_tool.h>
|
|
|
|
#include <tools/pcb_picker_tool.h>
|
2019-08-12 14:41:45 +00:00
|
|
|
#include <tools/edit_tool.h>
|
2020-07-11 01:06:17 +00:00
|
|
|
#include <pcb_painter.h>
|
2019-08-12 14:41:45 +00:00
|
|
|
#include <connectivity/connectivity_data.h>
|
2020-09-11 23:25:10 +00:00
|
|
|
#include <drc/drc_engine.h>
|
2022-09-25 15:19:50 +00:00
|
|
|
#include <dialogs/dialog_board_statistics.h>
|
2023-03-09 17:41:18 +00:00
|
|
|
#include <dialogs/dialog_book_reporter.h>
|
2023-03-13 16:03:48 +00:00
|
|
|
#include <dialogs/dialog_net_inspector.h>
|
2022-09-25 15:19:50 +00:00
|
|
|
#include <dialogs/panel_setup_rules_base.h>
|
2023-07-11 13:05:39 +00:00
|
|
|
#include <dialogs/dialog_footprint_associations.h>
|
2021-07-29 09:56:22 +00:00
|
|
|
#include <string_utils.h>
|
2023-03-06 23:05:44 +00:00
|
|
|
#include <tools/board_inspection_tool.h>
|
|
|
|
#include <fp_lib_table.h>
|
2023-07-30 19:39:07 +00:00
|
|
|
#include <pcb_shape.h>
|
2021-04-09 02:09:06 +00:00
|
|
|
#include <pcbnew_settings.h>
|
2021-01-14 09:37:08 +00:00
|
|
|
#include <widgets/appearance_controls.h>
|
2022-09-03 18:29:02 +00:00
|
|
|
#include <widgets/wx_html_report_box.h>
|
2023-03-10 17:15:40 +00:00
|
|
|
#include <widgets/footprint_diff_widget.h>
|
2021-05-20 22:59:23 +00:00
|
|
|
#include <drc/drc_item.h>
|
2021-06-06 19:03:10 +00:00
|
|
|
#include <pad.h>
|
2023-09-28 03:15:54 +00:00
|
|
|
#include <project_pcb.h>
|
2019-07-16 19:34:07 +00:00
|
|
|
|
2020-10-16 23:15:44 +00:00
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
BOARD_INSPECTION_TOOL::BOARD_INSPECTION_TOOL() :
|
2019-08-12 14:41:45 +00:00
|
|
|
PCB_TOOL_BASE( "pcbnew.InspectionTool" ),
|
|
|
|
m_frame( nullptr )
|
2019-07-16 19:34:07 +00:00
|
|
|
{
|
2021-05-29 15:53:55 +00:00
|
|
|
m_dynamicData = nullptr;
|
2019-07-16 19:34:07 +00:00
|
|
|
}
|
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2020-07-11 01:06:17 +00:00
|
|
|
class NET_CONTEXT_MENU : public ACTION_MENU
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NET_CONTEXT_MENU() : ACTION_MENU( true )
|
|
|
|
{
|
2021-03-08 02:59:07 +00:00
|
|
|
SetIcon( BITMAPS::show_ratsnest );
|
2022-09-03 18:29:02 +00:00
|
|
|
SetTitle( _( "Net Inspection Tools" ) );
|
2020-07-11 01:06:17 +00:00
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
Add( PCB_ACTIONS::showNetInRatsnest );
|
|
|
|
Add( PCB_ACTIONS::hideNetInRatsnest );
|
|
|
|
AppendSeparator();
|
2021-05-29 15:53:55 +00:00
|
|
|
Add( PCB_ACTIONS::highlightNetSelection );
|
|
|
|
Add( PCB_ACTIONS::clearHighlight );
|
2020-07-11 01:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
ACTION_MENU* create() const override
|
|
|
|
{
|
|
|
|
return new NET_CONTEXT_MENU();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
bool BOARD_INSPECTION_TOOL::Init()
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2020-07-11 01:06:17 +00:00
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
std::shared_ptr<NET_CONTEXT_MENU> netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
|
2020-07-11 01:06:17 +00:00
|
|
|
netSubMenu->SetTool( this );
|
|
|
|
|
2023-07-30 19:39:07 +00:00
|
|
|
// Only show the net menu if all items in the selection are connectable
|
|
|
|
auto showNetMenuFunc =
|
|
|
|
[]( const SELECTION& aSelection )
|
|
|
|
{
|
|
|
|
if( aSelection.Empty() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
for( const EDA_ITEM* item : aSelection )
|
|
|
|
{
|
|
|
|
switch( item->Type() )
|
|
|
|
{
|
|
|
|
case PCB_TRACE_T:
|
|
|
|
case PCB_ARC_T:
|
|
|
|
case PCB_VIA_T:
|
|
|
|
case PCB_PAD_T:
|
|
|
|
case PCB_ZONE_T:
|
|
|
|
continue;
|
|
|
|
|
|
|
|
case PCB_SHAPE_T:
|
|
|
|
{
|
|
|
|
if( !static_cast<const PCB_SHAPE*>( item )->IsOnCopperLayer() )
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
};
|
2020-07-11 01:06:17 +00:00
|
|
|
|
|
|
|
CONDITIONAL_MENU& menu = selectionTool->GetToolMenu().GetMenu();
|
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
selectionTool->GetToolMenu().RegisterSubMenu( netSubMenu );
|
2020-09-10 19:58:05 +00:00
|
|
|
|
2023-07-30 19:39:07 +00:00
|
|
|
menu.AddMenu( netSubMenu.get(), showNetMenuFunc, 100 );
|
2020-07-11 01:06:17 +00:00
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::Reset( RESET_REASON aReason )
|
2019-07-16 19:34:07 +00:00
|
|
|
{
|
2019-08-12 14:41:45 +00:00
|
|
|
m_frame = getEditFrame<PCB_EDIT_FRAME>();
|
|
|
|
}
|
|
|
|
|
2019-07-16 19:34:07 +00:00
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::ShowBoardStatistics( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
|
|
|
DIALOG_BOARD_STATISTICS dialog( m_frame );
|
2019-07-16 19:34:07 +00:00
|
|
|
dialog.ShowModal();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2024-03-02 22:44:14 +00:00
|
|
|
std::unique_ptr<DRC_ENGINE> BOARD_INSPECTION_TOOL::makeDRCEngine( bool* aCompileError,
|
2023-12-11 16:27:09 +00:00
|
|
|
bool* aCourtyardError )
|
2021-08-15 15:09:19 +00:00
|
|
|
{
|
2024-03-02 22:44:14 +00:00
|
|
|
auto engine = std::make_unique<DRC_ENGINE>( m_frame->GetBoard(),
|
2023-12-11 16:27:09 +00:00
|
|
|
&m_frame->GetBoard()->GetDesignSettings() );
|
2021-08-15 15:09:19 +00:00
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2023-12-11 16:27:09 +00:00
|
|
|
engine->InitEngine( m_frame->GetDesignRulesPath() );
|
2021-08-15 15:09:19 +00:00
|
|
|
}
|
|
|
|
catch( PARSE_ERROR& )
|
|
|
|
{
|
|
|
|
if( aCompileError )
|
|
|
|
*aCompileError = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
for( ZONE* zone : m_frame->GetBoard()->Zones() )
|
|
|
|
zone->CacheBoundingBox();
|
|
|
|
|
|
|
|
for( FOOTPRINT* footprint : m_frame->GetBoard()->Footprints() )
|
|
|
|
{
|
|
|
|
for( ZONE* zone : footprint->Zones() )
|
|
|
|
zone->CacheBoundingBox();
|
|
|
|
|
2022-07-31 21:14:24 +00:00
|
|
|
footprint->BuildCourtyardCaches();
|
2021-08-15 15:09:19 +00:00
|
|
|
|
|
|
|
if( aCourtyardError && ( footprint->GetFlags() & MALFORMED_COURTYARDS ) != 0 )
|
|
|
|
*aCourtyardError = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return engine;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-08-29 15:30:06 +00:00
|
|
|
bool isNPTHPad( BOARD_ITEM* aItem )
|
|
|
|
{
|
|
|
|
return aItem->Type() == PCB_PAD_T
|
|
|
|
&& static_cast<PAD*>( aItem )->GetAttribute() == PAD_ATTRIB::NPTH;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
wxString BOARD_INSPECTION_TOOL::getItemDescription( BOARD_ITEM* aItem )
|
2020-12-03 23:02:41 +00:00
|
|
|
{
|
2020-12-16 23:54:53 +00:00
|
|
|
// Null items have no description
|
|
|
|
if( !aItem )
|
|
|
|
return wxString();
|
|
|
|
|
2023-01-12 03:27:44 +00:00
|
|
|
wxString msg = aItem->GetItemDescription( m_frame );
|
2020-12-03 23:02:41 +00:00
|
|
|
|
2022-08-29 15:30:06 +00:00
|
|
|
if( aItem->IsConnected() && !isNPTHPad( aItem ) )
|
2020-12-03 23:02:41 +00:00
|
|
|
{
|
|
|
|
BOARD_CONNECTED_ITEM* cItem = static_cast<BOARD_CONNECTED_ITEM*>( aItem );
|
2022-08-29 15:30:06 +00:00
|
|
|
|
2022-09-23 08:56:58 +00:00
|
|
|
msg += wxS( " " ) + wxString::Format( _( "[netclass %s]" ),
|
2022-09-19 16:09:59 +00:00
|
|
|
cItem->GetEffectiveNetClass()->GetName() );
|
2020-12-03 23:02:41 +00:00
|
|
|
}
|
|
|
|
|
2022-09-19 16:09:59 +00:00
|
|
|
return msg;
|
2020-12-03 23:02:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::reportCompileError( REPORTER* r )
|
2020-09-10 19:58:05 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
2023-03-09 11:25:32 +00:00
|
|
|
r->Report( _( "Report incomplete: could not compile custom design rules." )
|
|
|
|
+ wxS( " " )
|
|
|
|
+ wxS( "<a href='$CUSTOM_RULES'>" ) + _( "Show design rules." ) + wxS( "</a>" ) );
|
2020-09-10 19:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::reportHeader( const wxString& aTitle, BOARD_ITEM* a, REPORTER* r )
|
2020-09-10 19:58:05 +00:00
|
|
|
{
|
2022-02-05 13:25:43 +00:00
|
|
|
r->Report( wxT( "<h7>" ) + EscapeHTML( aTitle ) + wxT( "</h7>" ) );
|
|
|
|
r->Report( wxT( "<ul><li>" ) + EscapeHTML( getItemDescription( a ) ) + wxT( "</li></ul>" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
}
|
2020-09-16 20:38:23 +00:00
|
|
|
|
2020-09-11 23:25:10 +00:00
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::reportHeader( const wxString& aTitle, BOARD_ITEM* a, BOARD_ITEM* b,
|
|
|
|
REPORTER* r )
|
|
|
|
{
|
2022-02-05 13:25:43 +00:00
|
|
|
r->Report( wxT( "<h7>" ) + EscapeHTML( aTitle ) + wxT( "</h7>" ) );
|
|
|
|
r->Report( wxT( "<ul><li>" ) + EscapeHTML( getItemDescription( a ) ) + wxT( "</li>" )
|
2023-03-13 16:03:48 +00:00
|
|
|
+ wxT( "<li>" ) + EscapeHTML( getItemDescription( b ) ) + wxT( "</li></ul>" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
}
|
2020-12-04 20:47:29 +00:00
|
|
|
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::reportHeader( const wxString& aTitle, BOARD_ITEM* a, BOARD_ITEM* b,
|
|
|
|
PCB_LAYER_ID aLayer, REPORTER* r )
|
|
|
|
{
|
|
|
|
wxString layerStr = _( "Layer" ) + wxS( " " ) + m_frame->GetBoard()->GetLayerName( aLayer );
|
2020-10-12 17:29:54 +00:00
|
|
|
|
2022-02-05 13:25:43 +00:00
|
|
|
r->Report( wxT( "<h7>" ) + EscapeHTML( aTitle ) + wxT( "</h7>" ) );
|
|
|
|
r->Report( wxT( "<ul><li>" ) + EscapeHTML( layerStr ) + wxT( "</li>" )
|
2023-03-13 16:03:48 +00:00
|
|
|
+ wxT( "<li>" ) + EscapeHTML( getItemDescription( a ) ) + wxT( "</li>" )
|
|
|
|
+ wxT( "<li>" ) + EscapeHTML( getItemDescription( b ) ) + wxT( "</li></ul>" ) );
|
2020-09-10 19:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-19 09:25:20 +00:00
|
|
|
wxString reportMin( PCB_BASE_FRAME* aFrame, DRC_CONSTRAINT& aConstraint )
|
2021-05-20 22:59:23 +00:00
|
|
|
{
|
2022-04-15 21:09:35 +00:00
|
|
|
if( aConstraint.m_Value.HasMin() )
|
2022-09-19 09:25:20 +00:00
|
|
|
return aFrame->StringFromValue( aConstraint.m_Value.Min(), true );
|
2022-04-15 21:09:35 +00:00
|
|
|
else
|
|
|
|
return wxT( "<i>" ) + _( "undefined" ) + wxT( "</i>" );
|
|
|
|
}
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2022-04-15 21:09:35 +00:00
|
|
|
|
2022-09-19 09:25:20 +00:00
|
|
|
wxString reportOpt( PCB_BASE_FRAME* aFrame, DRC_CONSTRAINT& aConstraint )
|
2022-04-15 21:09:35 +00:00
|
|
|
{
|
|
|
|
if( aConstraint.m_Value.HasOpt() )
|
2022-09-19 09:25:20 +00:00
|
|
|
return aFrame->StringFromValue( aConstraint.m_Value.Opt(), true );
|
2022-04-15 21:09:35 +00:00
|
|
|
else
|
|
|
|
return wxT( "<i>" ) + _( "undefined" ) + wxT( "</i>" );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-19 09:25:20 +00:00
|
|
|
wxString reportMax( PCB_BASE_FRAME* aFrame, DRC_CONSTRAINT& aConstraint )
|
2022-04-15 21:09:35 +00:00
|
|
|
{
|
|
|
|
if( aConstraint.m_Value.HasMax() )
|
2022-09-19 09:25:20 +00:00
|
|
|
return aFrame->StringFromValue( aConstraint.m_Value.Max(), true );
|
2022-04-15 21:09:35 +00:00
|
|
|
else
|
|
|
|
return wxT( "<i>" ) + _( "undefined" ) + wxT( "</i>" );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void BOARD_INSPECTION_TOOL::InspectDRCError( const std::shared_ptr<RC_ITEM>& aDRCItem )
|
|
|
|
{
|
|
|
|
BOARD_ITEM* a = m_frame->GetBoard()->GetItem( aDRCItem->GetMainItemID() );
|
|
|
|
BOARD_ITEM* b = m_frame->GetBoard()->GetItem( aDRCItem->GetAuxItemID() );
|
|
|
|
BOARD_CONNECTED_ITEM* ac = dynamic_cast<BOARD_CONNECTED_ITEM*>( a );
|
|
|
|
BOARD_CONNECTED_ITEM* bc = dynamic_cast<BOARD_CONNECTED_ITEM*>( b );
|
|
|
|
PCB_LAYER_ID layer = m_frame->GetActiveLayer();
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( m_frame, /* void */ );
|
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
if( aDRCItem->GetErrorCode() == DRCE_LIB_FOOTPRINT_MISMATCH )
|
|
|
|
{
|
|
|
|
if( FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( a ) )
|
|
|
|
DiffFootprint( footprint );
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
DIALOG_BOOK_REPORTER* dialog = m_frame->GetInspectDrcErrorDialog();
|
|
|
|
wxCHECK( dialog, /* void */ );
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2023-09-30 11:39:44 +00:00
|
|
|
dialog->DeleteAllPages();
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
bool compileError = false;
|
|
|
|
bool courtyardError = false;
|
|
|
|
std::unique_ptr<DRC_ENGINE> drcEngine = makeDRCEngine( &compileError, &courtyardError );
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
WX_HTML_REPORT_BOX* r = nullptr;
|
|
|
|
DRC_CONSTRAINT constraint;
|
|
|
|
int clearance = 0;
|
|
|
|
wxString clearanceStr;
|
2021-05-20 22:59:23 +00:00
|
|
|
|
|
|
|
switch( aDRCItem->GetErrorCode() )
|
|
|
|
{
|
2022-04-15 21:09:35 +00:00
|
|
|
case DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG:
|
|
|
|
{
|
|
|
|
for( KIID id : aDRCItem->GetIDs() )
|
|
|
|
{
|
|
|
|
bc = dynamic_cast<BOARD_CONNECTED_ITEM*>( m_frame->GetBoard()->GetItem( id ) );
|
|
|
|
|
|
|
|
if( ac && bc && ac->GetNetCode() != bc->GetNetCode() )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Uncoupled Length" ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
reportHeader( _( "Diff pair uncoupled length resolution for:" ), ac, bc, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( MAX_UNCOUPLED_CONSTRAINT, a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( wxString::Format( _( "Resolved max uncoupled length: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case DRCE_TEXT_HEIGHT:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Text Height" ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
reportHeader( _( "Text height resolution for:" ), a, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( TEXT_HEIGHT_CONSTRAINT, a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2022-04-15 23:57:08 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved height constraints: min %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRCE_TEXT_THICKNESS:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Text Thickness" ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
reportHeader( _( "Text thickness resolution for:" ), a, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( TEXT_THICKNESS_CONSTRAINT, a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2022-04-15 23:57:08 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved thickness constraints: min %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRCE_TRACK_WIDTH:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Track Width" ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
reportHeader( _( "Track width resolution for:" ), a, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( TRACK_WIDTH_CONSTRAINT, a, b, layer, r );
|
2022-04-15 23:57:08 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( wxString::Format( _( "Resolved width constraints: min %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
break;
|
|
|
|
|
2022-07-31 15:02:04 +00:00
|
|
|
case DRCE_CONNECTION_WIDTH:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Connection Width" ) );
|
2022-07-31 15:02:04 +00:00
|
|
|
reportHeader( _( "Connection width resolution for:" ), a, b, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( CONNECTION_WIDTH_CONSTRAINT, a, b, layer, r );
|
2022-07-31 15:02:04 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min connection width: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ) ) );
|
2022-07-31 15:02:04 +00:00
|
|
|
break;
|
|
|
|
|
2022-04-15 23:57:08 +00:00
|
|
|
case DRCE_VIA_DIAMETER:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Via Diameter" ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
reportHeader( _( "Via diameter resolution for:" ), a, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( VIA_DIAMETER_CONSTRAINT, a, b, layer, r );
|
2022-04-15 23:57:08 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( wxString::Format( _( "Resolved diameter constraints: min %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRCE_ANNULAR_WIDTH:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Via Annulus" ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
reportHeader( _( "Via annular width resolution for:" ), a, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( ANNULAR_WIDTH_CONSTRAINT, a, b, layer, r );
|
2022-04-15 23:57:08 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( wxString::Format( _( "Resolved annular width constraints: min %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 23:57:08 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRCE_DRILL_OUT_OF_RANGE:
|
|
|
|
case DRCE_MICROVIA_DRILL_OUT_OF_RANGE:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Hole Size" ) );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Hole size resolution for:" ), a, r );
|
2022-04-15 23:57:08 +00:00
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( HOLE_SIZE_CONSTRAINT, a, b, layer, r );
|
2022-04-15 23:57:08 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved hole size constraints: min %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRCE_HOLE_CLEARANCE:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Hole Clearance" ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
reportHeader( _( "Hole clearance resolution for:" ), a, b, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
if( ac && bc && ac->GetNetCode() == bc->GetNetCode() )
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( _( "Items belong to the same net. Clearance is 0." ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-09-19 09:25:20 +00:00
|
|
|
clearanceStr = m_frame->StringFromValue( clearance, true );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ), clearanceStr ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
2022-05-06 13:46:24 +00:00
|
|
|
reportHeader( _( "Physical hole clearance resolution for:" ), a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-09-19 09:25:20 +00:00
|
|
|
clearanceStr = m_frame->StringFromValue( clearance, true );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
if( !drcEngine->HasRulesForConstraintType( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT ) )
|
2022-04-15 21:09:35 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
2022-05-06 13:46:24 +00:00
|
|
|
r->Report( _( "No 'physical_hole_clearance' constraints defined." ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ), clearanceStr ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2022-08-29 15:30:06 +00:00
|
|
|
case DRCE_DRILLED_HOLES_TOO_CLOSE:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Hole to Hole" ) );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Hole-to-hole clearance resolution for:" ), a, b, r );
|
2022-08-29 15:30:06 +00:00
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( HOLE_TO_HOLE_CONSTRAINT, a, b, UNDEFINED_LAYER, r );
|
2022-08-29 15:30:06 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-09-19 09:25:20 +00:00
|
|
|
clearanceStr = m_frame->StringFromValue( clearance, true );
|
2022-08-29 15:30:06 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ), clearanceStr ) );
|
2022-08-29 15:30:06 +00:00
|
|
|
break;
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
case DRCE_EDGE_CLEARANCE:
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Edge Clearance" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Edge clearance resolution for:" ), a, b, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( EDGE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 15:09:19 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-09-19 09:25:20 +00:00
|
|
|
clearanceStr = m_frame->StringFromValue( clearance, true );
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ), clearanceStr ) );
|
2021-05-20 22:59:23 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRCE_CLEARANCE:
|
|
|
|
if( a->Type() == PCB_TRACE_T || a->Type() == PCB_ARC_T )
|
|
|
|
{
|
|
|
|
layer = a->GetLayer();
|
|
|
|
}
|
|
|
|
else if( b->Type() == PCB_TRACE_T || b->Type() == PCB_ARC_T )
|
|
|
|
{
|
|
|
|
layer = b->GetLayer();
|
|
|
|
}
|
2023-03-13 16:03:48 +00:00
|
|
|
else if( a->Type() == PCB_PAD_T
|
|
|
|
&& static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB::SMD )
|
2021-05-20 22:59:23 +00:00
|
|
|
{
|
|
|
|
PAD* pad = static_cast<PAD*>( a );
|
|
|
|
|
|
|
|
if( pad->IsOnLayer( F_Cu ) )
|
|
|
|
layer = F_Cu;
|
|
|
|
else
|
|
|
|
layer = B_Cu;
|
|
|
|
}
|
2023-03-13 16:03:48 +00:00
|
|
|
else if( b->Type() == PCB_PAD_T
|
|
|
|
&& static_cast<PAD*>( a )->GetAttribute() == PAD_ATTRIB::SMD )
|
2021-05-20 22:59:23 +00:00
|
|
|
{
|
|
|
|
PAD* pad = static_cast<PAD*>( b );
|
|
|
|
|
|
|
|
if( pad->IsOnLayer( F_Cu ) )
|
|
|
|
layer = F_Cu;
|
|
|
|
else
|
|
|
|
layer = B_Cu;
|
|
|
|
}
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Clearance" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Clearance resolution for:" ), a, b, layer, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2022-04-15 21:09:35 +00:00
|
|
|
if( ac && bc && ac->GetNetCode() == bc->GetNetCode() )
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( _( "Items belong to the same net. Clearance is 0." ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-09-19 09:25:20 +00:00
|
|
|
clearanceStr = m_frame->StringFromValue( clearance, true );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ), clearanceStr ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
2022-05-06 13:46:24 +00:00
|
|
|
reportHeader( _( "Physical clearance resolution for:" ), a, b, layer, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 15:09:19 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-09-19 09:25:20 +00:00
|
|
|
clearanceStr = m_frame->StringFromValue( clearance, true );
|
2021-05-20 22:59:23 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
if( !drcEngine->HasRulesForConstraintType( PHYSICAL_CLEARANCE_CONSTRAINT ) )
|
2022-04-15 21:09:35 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
2022-05-06 13:46:24 +00:00
|
|
|
r->Report( _( "No 'physical_clearance' constraints defined." ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ), clearanceStr ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
|
2021-05-20 22:59:23 +00:00
|
|
|
break;
|
|
|
|
|
2023-04-12 12:53:43 +00:00
|
|
|
case DRCE_ASSERTION_FAILURE:
|
|
|
|
r = dialog->AddHTMLPage( _( "Assertions" ) );
|
|
|
|
reportHeader( _( "Assertions for:" ), a, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
drcEngine->ProcessAssertions( a, []( const DRC_CONSTRAINT* c ){}, r );
|
2023-04-12 12:53:43 +00:00
|
|
|
break;
|
|
|
|
|
2021-05-20 22:59:23 +00:00
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->Raise();
|
|
|
|
dialog->Show( true );
|
2021-05-20 22:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
2020-09-10 19:58:05 +00:00
|
|
|
{
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( m_frame, 0 );
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2023-03-13 16:03:48 +00:00
|
|
|
|
|
|
|
wxCHECK( selTool, 0 );
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
const PCB_SELECTION& selection = selTool->GetSelection();
|
2020-09-10 19:58:05 +00:00
|
|
|
|
|
|
|
if( selection.Size() != 2 )
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Select two items for a clearance resolution report." ) );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-07-13 10:24:33 +00:00
|
|
|
BOARD_ITEM* a = dynamic_cast<BOARD_ITEM*>( selection.GetItem( 0 ) );
|
|
|
|
BOARD_ITEM* b = dynamic_cast<BOARD_ITEM*>( selection.GetItem( 1 ) );
|
2020-09-10 19:58:05 +00:00
|
|
|
|
2020-12-20 18:23:50 +00:00
|
|
|
wxCHECK( a && b, 0 );
|
|
|
|
|
2020-12-04 20:47:29 +00:00
|
|
|
if( a->Type() == PCB_GROUP_T )
|
|
|
|
{
|
|
|
|
PCB_GROUP* ag = static_cast<PCB_GROUP*>( a );
|
|
|
|
|
|
|
|
if( ag->GetItems().empty() )
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Cannot generate clearance report on empty group." ) );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
a = *ag->GetItems().begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( b->Type() == PCB_GROUP_T )
|
|
|
|
{
|
2020-12-16 23:54:53 +00:00
|
|
|
PCB_GROUP* bg = static_cast<PCB_GROUP*>( b );
|
2020-12-04 20:47:29 +00:00
|
|
|
|
|
|
|
if( bg->GetItems().empty() )
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Cannot generate clearance report on empty group." ) );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-12-16 23:54:53 +00:00
|
|
|
b = *bg->GetItems().begin();
|
2020-12-04 20:47:29 +00:00
|
|
|
}
|
|
|
|
|
2023-04-02 17:52:58 +00:00
|
|
|
// a or b could be null after group tests above.
|
|
|
|
wxCHECK( a && b, 0 );
|
|
|
|
|
|
|
|
auto checkFootprint =
|
|
|
|
[&]( FOOTPRINT* footprint ) -> BOARD_ITEM*
|
|
|
|
{
|
|
|
|
if( footprint->Pads().empty() )
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Cannot generate clearance report on footprint "
|
|
|
|
"with no pads." ) );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
PAD* foundPad = nullptr;
|
|
|
|
|
|
|
|
for( PAD* pad : footprint->Pads() )
|
|
|
|
{
|
|
|
|
if( !foundPad || pad->SameLogicalPadAs( foundPad ) )
|
|
|
|
{
|
|
|
|
foundPad = pad;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Cannot generate clearance report on footprint "
|
|
|
|
"with multiple pads. Select a single pad." ) );
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return foundPad;
|
|
|
|
};
|
|
|
|
|
|
|
|
if( a->Type() == PCB_FOOTPRINT_T )
|
|
|
|
a = checkFootprint( static_cast<FOOTPRINT*>( a ) );
|
|
|
|
|
|
|
|
if( b->Type() == PCB_FOOTPRINT_T )
|
|
|
|
b = checkFootprint( static_cast<FOOTPRINT*>( b ) );
|
|
|
|
|
|
|
|
// a or b could be null after footprint tests above.
|
2021-03-02 13:10:37 +00:00
|
|
|
wxCHECK( a && b, 0 );
|
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
DIALOG_BOOK_REPORTER* dialog = m_frame->GetInspectClearanceDialog();
|
2020-10-15 19:18:49 +00:00
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( dialog, 0 );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->DeleteAllPages();
|
2020-10-15 19:18:49 +00:00
|
|
|
|
2020-11-11 23:05:59 +00:00
|
|
|
if( a->Type() != PCB_ZONE_T && b->Type() == PCB_ZONE_T )
|
2020-09-10 19:58:05 +00:00
|
|
|
std::swap( a, b );
|
|
|
|
else if( !a->IsConnected() && b->IsConnected() )
|
|
|
|
std::swap( a, b );
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
WX_HTML_REPORT_BOX* r = nullptr;
|
2021-08-15 17:23:54 +00:00
|
|
|
PCB_LAYER_ID active = m_frame->GetActiveLayer();
|
|
|
|
LSET layerIntersection = a->GetLayerSet() & b->GetLayerSet();
|
|
|
|
LSET copperIntersection = layerIntersection & LSET::AllCuMask();
|
|
|
|
BOARD_CONNECTED_ITEM* ac = dynamic_cast<BOARD_CONNECTED_ITEM*>( a );
|
|
|
|
BOARD_CONNECTED_ITEM* bc = dynamic_cast<BOARD_CONNECTED_ITEM*>( b );
|
|
|
|
ZONE* zone = dynamic_cast<ZONE*>( a );
|
|
|
|
PAD* pad = dynamic_cast<PAD*>( b );
|
|
|
|
FOOTPRINT* aFP = dynamic_cast<FOOTPRINT*>( a );
|
|
|
|
FOOTPRINT* bFP = dynamic_cast<FOOTPRINT*>( b );
|
2021-08-15 15:09:19 +00:00
|
|
|
DRC_CONSTRAINT constraint;
|
|
|
|
int clearance = 0;
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
bool compileError = false;
|
|
|
|
bool courtyardError = false;
|
|
|
|
std::unique_ptr<DRC_ENGINE> drcEngine = makeDRCEngine( &compileError, &courtyardError );
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
if( copperIntersection.any() && zone && pad && zone->GetNetCode() == pad->GetNetCode() )
|
|
|
|
{
|
2022-03-21 18:18:39 +00:00
|
|
|
PCB_LAYER_ID layer = UNDEFINED_LAYER;
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2022-03-21 18:18:39 +00:00
|
|
|
if( zone->IsOnLayer( active ) )
|
|
|
|
layer = active;
|
|
|
|
else if( zone->GetLayerSet().count() > 0 )
|
2021-08-15 17:23:54 +00:00
|
|
|
layer = zone->GetLayerSet().Seq().front();
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Zone" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Zone connection resolution for:" ), a, b, layer, r );
|
2020-10-11 13:15:22 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalZoneConnection( pad, zone, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2021-08-08 13:37:14 +00:00
|
|
|
if( constraint.m_ZoneConnection == ZONE_CONNECTION::THERMAL )
|
2021-01-31 00:30:40 +00:00
|
|
|
{
|
2022-05-02 23:47:36 +00:00
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Thermal-relief gap resolution for:" ), a, b, layer, r );
|
2022-05-02 23:47:36 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( THERMAL_RELIEF_GAP_CONSTRAINT, pad, zone, layer, r );
|
2021-08-08 13:37:14 +00:00
|
|
|
int gap = constraint.m_Value.Min();
|
2021-01-31 00:30:40 +00:00
|
|
|
|
2022-05-02 23:47:36 +00:00
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2021-08-08 13:37:14 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved thermal relief gap: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( gap, true ) ) );
|
2021-01-31 00:30:40 +00:00
|
|
|
|
2022-05-02 23:47:36 +00:00
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Thermal-relief spoke width resolution for:" ), a, b, layer, r );
|
2022-05-02 23:47:36 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( THERMAL_SPOKE_WIDTH_CONSTRAINT, pad, zone, layer, r );
|
2021-08-08 13:37:14 +00:00
|
|
|
int width = constraint.m_Value.Opt();
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2022-05-02 23:47:36 +00:00
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
2022-02-02 12:41:30 +00:00
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved spoke width: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( width, true ) ) );
|
2022-02-02 12:41:30 +00:00
|
|
|
|
2022-05-02 23:47:36 +00:00
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Thermal-relief min spoke count resolution for:" ), a, b, layer, r );
|
2022-05-02 23:47:36 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( MIN_RESOLVED_SPOKES_CONSTRAINT, pad, zone, layer, r );
|
2022-02-02 12:41:30 +00:00
|
|
|
int minSpokes = constraint.m_Value.Min();
|
|
|
|
|
2021-08-08 13:37:14 +00:00
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min spoke count: %d." ),
|
2022-02-07 16:32:19 +00:00
|
|
|
minSpokes ) );
|
2022-02-02 12:41:30 +00:00
|
|
|
|
|
|
|
std::shared_ptr<CONNECTIVITY_DATA> connectivity = pad->GetBoard()->GetConnectivity();
|
2021-01-31 00:30:40 +00:00
|
|
|
}
|
2021-08-08 13:37:14 +00:00
|
|
|
else if( constraint.m_ZoneConnection == ZONE_CONNECTION::NONE )
|
2021-01-31 00:30:40 +00:00
|
|
|
{
|
2022-05-02 23:47:36 +00:00
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
reportHeader( _( "Zone clearance resolution for:" ), a, b, layer, r );
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
clearance = zone->GetLocalClearance();
|
2022-05-02 23:47:36 +00:00
|
|
|
r->Report( "" );
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( wxString::Format( _( "Zone clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-08 13:37:14 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, pad, zone, layer, r );
|
2021-01-31 00:30:40 +00:00
|
|
|
|
2021-08-08 13:37:14 +00:00
|
|
|
if( constraint.m_Value.Min() > clearance )
|
2021-08-15 17:23:54 +00:00
|
|
|
{
|
2021-08-08 13:37:14 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
2022-05-02 23:47:36 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
2022-05-06 13:46:24 +00:00
|
|
|
r->Report( wxString::Format( _( "Overridden by larger physical clearance from %s;"
|
2021-08-08 13:37:14 +00:00
|
|
|
"clearance: %s." ),
|
|
|
|
EscapeHTML( constraint.GetName() ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-15 17:23:54 +00:00
|
|
|
}
|
|
|
|
|
2022-05-02 23:47:36 +00:00
|
|
|
if( !pad->FlashLayer( layer ) )
|
|
|
|
{
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, pad, zone,
|
2022-05-02 23:47:36 +00:00
|
|
|
layer, r );
|
|
|
|
|
|
|
|
if( constraint.m_Value.Min() > clearance )
|
|
|
|
{
|
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-03-13 16:03:48 +00:00
|
|
|
r->Report( wxString::Format( _( "Overridden by larger physical hole clearance "
|
|
|
|
"from %s; clearance: %s." ),
|
2022-05-02 23:47:36 +00:00
|
|
|
EscapeHTML( constraint.GetName() ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2022-05-02 23:47:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-01-31 00:30:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-05-02 23:47:36 +00:00
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
reportHeader( _( "Zone clearance resolution for:" ), a, b, layer, r );
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
// Report a 0 clearance for solid connections
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( 0, true ) ) );
|
2021-01-31 00:30:40 +00:00
|
|
|
}
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
r->Flush();
|
2020-09-10 19:58:05 +00:00
|
|
|
}
|
2021-08-15 17:23:54 +00:00
|
|
|
else if( copperIntersection.any() && !aFP && !bFP )
|
2021-01-09 16:43:13 +00:00
|
|
|
{
|
2021-08-15 17:23:54 +00:00
|
|
|
PCB_LAYER_ID layer = active;
|
2021-01-09 16:43:13 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
if( !copperIntersection.test( layer ) )
|
|
|
|
layer = copperIntersection.Seq().front();
|
2021-01-09 16:43:13 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( m_frame->GetBoard()->GetLayerName( layer ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Clearance resolution for:" ), a, b, layer, r );
|
2020-09-10 19:58:05 +00:00
|
|
|
|
|
|
|
if( ac && bc && ac->GetNetCode() > 0 && ac->GetNetCode() == bc->GetNetCode() )
|
|
|
|
{
|
|
|
|
// Same nets....
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( _( "Items belong to the same net. Min clearance is 0." ) );
|
2020-09-10 19:58:05 +00:00
|
|
|
}
|
2020-10-12 17:29:54 +00:00
|
|
|
else
|
2020-09-10 19:58:05 +00:00
|
|
|
{
|
2020-10-12 17:29:54 +00:00
|
|
|
// Different nets (or one or both unconnected)....
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-02-16 17:39:47 +00:00
|
|
|
|
2023-03-26 19:56:18 +00:00
|
|
|
if( constraint.IsNull() )
|
|
|
|
{
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( _( "Min clearance is 0." ) );
|
2023-03-26 19:56:18 +00:00
|
|
|
}
|
|
|
|
else if( clearance < 0 )
|
2023-02-16 17:39:47 +00:00
|
|
|
{
|
2023-03-13 16:03:48 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved clearance: %s; clearance will not be "
|
|
|
|
"tested." ),
|
2023-02-16 17:39:47 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2023-02-16 17:39:47 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
|
|
|
}
|
2020-09-10 19:58:05 +00:00
|
|
|
}
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
r->Flush();
|
2020-09-10 19:58:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-15 21:09:35 +00:00
|
|
|
if( ac && bc )
|
|
|
|
{
|
|
|
|
NETINFO_ITEM* refNet = ac->GetNet();
|
|
|
|
wxString coupledNet;
|
|
|
|
wxString dummy;
|
|
|
|
|
|
|
|
if( DRC_ENGINE::MatchDpSuffix( refNet->GetNetname(), coupledNet, dummy )
|
|
|
|
&& bc->GetNetname() == coupledNet )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Diff Pair" ) );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Diff-pair gap resolution for:" ), ac, bc, active, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( DIFF_PAIR_GAP_CONSTRAINT, ac, bc, active, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( wxString::Format( _( "Resolved gap constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Diff-pair max uncoupled length resolution for:" ), ac, bc,
|
2023-03-13 16:03:48 +00:00
|
|
|
active, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
if( !drcEngine->HasRulesForConstraintType( MAX_UNCOUPLED_CONSTRAINT ) )
|
2022-04-15 21:09:35 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( _( "No 'diff_pair_uncoupled' constraints defined." ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( MAX_UNCOUPLED_CONSTRAINT, ac, bc, active, r );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( wxString::Format( _( "Resolved max uncoupled length: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
}
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-07 21:27:29 +00:00
|
|
|
auto isOnCorrespondingLayer=
|
|
|
|
[&]( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, wxString* aWarning )
|
|
|
|
{
|
|
|
|
if( aItem->IsOnLayer( aLayer ) )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
PCB_LAYER_ID correspondingMask = IsFrontLayer( aLayer ) ? F_Mask : B_Mask;
|
|
|
|
PCB_LAYER_ID correspondingCopper = IsFrontLayer( aLayer ) ? F_Cu : B_Cu;
|
|
|
|
|
|
|
|
if( aItem->IsOnLayer( aLayer ) )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if( aItem->IsOnLayer( correspondingMask ) )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if( aItem->IsTented() && aItem->IsOnLayer( correspondingCopper ) )
|
|
|
|
{
|
|
|
|
*aWarning = wxString::Format( _( "Note: %s is tented; clearance will only be "
|
|
|
|
"applied to holes." ),
|
|
|
|
getItemDescription( aItem ) );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
for( PCB_LAYER_ID layer : { F_SilkS, B_SilkS } )
|
|
|
|
{
|
2022-07-07 21:27:29 +00:00
|
|
|
wxString warning;
|
2021-08-17 14:37:33 +00:00
|
|
|
|
2022-07-07 21:27:29 +00:00
|
|
|
if( ( a->IsOnLayer( layer ) && isOnCorrespondingLayer( b, layer, &warning ) )
|
|
|
|
|| ( b->IsOnLayer( layer ) && isOnCorrespondingLayer( a, layer, &warning ) ) )
|
2021-08-15 17:23:54 +00:00
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( m_frame->GetBoard()->GetLayerName( layer ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Silkscreen clearance resolution for:" ), a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( SILK_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2022-07-07 21:27:29 +00:00
|
|
|
|
|
|
|
if( !warning.IsEmpty() )
|
|
|
|
r->Report( warning );
|
|
|
|
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for( PCB_LAYER_ID layer : { F_CrtYd, B_CrtYd } )
|
|
|
|
{
|
2022-07-31 21:14:24 +00:00
|
|
|
bool aCourtyard = aFP && !aFP->GetCourtyard( layer ).IsEmpty();
|
|
|
|
bool bCourtyard = bFP && !bFP->GetCourtyard( layer ).IsEmpty();
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
if( aCourtyard && bCourtyard )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( m_frame->GetBoard()->GetLayerName( layer ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Courtyard clearance resolution for:" ), a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( COURTYARD_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-15 15:14:11 +00:00
|
|
|
if( a->HasHole() || b->HasHole() )
|
2021-08-15 17:23:54 +00:00
|
|
|
{
|
|
|
|
PCB_LAYER_ID layer = UNDEFINED_LAYER;
|
2022-08-29 15:30:06 +00:00
|
|
|
bool pageAdded = false;
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2022-07-15 15:14:11 +00:00
|
|
|
if( a->HasHole() && b->IsOnLayer( active ) && IsCopperLayer( active ) )
|
2021-08-15 17:23:54 +00:00
|
|
|
layer = active;
|
2022-07-15 15:14:11 +00:00
|
|
|
else if( b->HasHole() && a->IsOnLayer( active ) && IsCopperLayer( active ) )
|
2021-08-15 17:23:54 +00:00
|
|
|
layer = active;
|
2022-07-15 15:14:11 +00:00
|
|
|
else if( a->HasHole() && b->IsOnCopperLayer() )
|
2021-08-15 17:23:54 +00:00
|
|
|
layer = b->GetLayer();
|
2022-07-15 15:14:11 +00:00
|
|
|
else if( b->HasHole() && b->IsOnCopperLayer() )
|
2021-08-15 17:23:54 +00:00
|
|
|
layer = a->GetLayer();
|
|
|
|
|
|
|
|
if( layer >= 0 )
|
|
|
|
{
|
2022-08-29 15:30:06 +00:00
|
|
|
if( !pageAdded )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Hole" ) );
|
2022-08-29 15:30:06 +00:00
|
|
|
pageAdded = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
}
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Hole clearance resolution for:" ), a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
2022-08-29 15:30:06 +00:00
|
|
|
|
|
|
|
if( a->HasHole() && b->HasHole() )
|
|
|
|
{
|
|
|
|
if( !pageAdded )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Hole" ) );
|
2022-08-29 15:30:06 +00:00
|
|
|
pageAdded = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
}
|
|
|
|
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Hole-to-hole clearance resolution for:" ), a, b, r );
|
2022-08-29 15:30:06 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( HOLE_TO_HOLE_CONSTRAINT, a, b, UNDEFINED_LAYER, r );
|
2022-08-29 15:30:06 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2022-08-29 15:30:06 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
2021-08-15 17:23:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for( PCB_LAYER_ID edgeLayer : { Edge_Cuts, Margin } )
|
|
|
|
{
|
|
|
|
PCB_LAYER_ID layer = UNDEFINED_LAYER;
|
|
|
|
|
2022-05-10 22:01:25 +00:00
|
|
|
if( a->IsOnLayer( edgeLayer ) && b->Type() != PCB_FOOTPRINT_T )
|
|
|
|
{
|
|
|
|
if( b->IsOnLayer( active ) && IsCopperLayer( active ) )
|
|
|
|
layer = active;
|
|
|
|
else if( IsCopperLayer( b->GetLayer() ) )
|
|
|
|
layer = b->GetLayer();
|
|
|
|
}
|
|
|
|
else if( b->IsOnLayer( edgeLayer ) && a->Type() != PCB_FOOTPRINT_T )
|
|
|
|
{
|
|
|
|
if( a->IsOnLayer( active ) && IsCopperLayer( active ) )
|
|
|
|
layer = active;
|
|
|
|
else if( IsCopperLayer( a->GetLayer() ) )
|
|
|
|
layer = a->GetLayer();
|
|
|
|
}
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
if( layer >= 0 )
|
|
|
|
{
|
|
|
|
wxString layerName = m_frame->GetBoard()->GetLayerName( edgeLayer );
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( layerName + wxS( " " ) + _( "Clearance" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Edge clearance resolution for:" ), a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( EDGE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 17:23:54 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-15 17:23:54 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
}
|
2020-09-10 19:58:05 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Physical Clearances" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
|
2022-05-10 22:01:25 +00:00
|
|
|
auto reportPhysicalClearance =
|
|
|
|
[&]( PCB_LAYER_ID aLayer )
|
|
|
|
{
|
|
|
|
reportHeader( _( "Physical clearance resolution for:" ), a, b, aLayer, r );
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, a, b, aLayer, r );
|
2022-05-10 22:01:25 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
{
|
|
|
|
reportCompileError( r );
|
|
|
|
}
|
2023-12-11 16:27:09 +00:00
|
|
|
else if( !drcEngine->HasRulesForConstraintType( PHYSICAL_CLEARANCE_CONSTRAINT ) )
|
2022-05-10 22:01:25 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( _( "No 'physical_clearance' constraints defined." ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2022-05-10 22:01:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
};
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
if( layerIntersection.any() )
|
2021-08-17 14:37:33 +00:00
|
|
|
{
|
2021-08-15 15:09:19 +00:00
|
|
|
PCB_LAYER_ID layer = active;
|
|
|
|
|
|
|
|
if( !layerIntersection.test( layer ) )
|
|
|
|
layer = layerIntersection.Seq().front();
|
|
|
|
|
2022-05-10 22:01:25 +00:00
|
|
|
reportPhysicalClearance( layer );
|
|
|
|
}
|
2021-08-15 15:09:19 +00:00
|
|
|
|
2022-05-10 22:01:25 +00:00
|
|
|
if( aFP && b->IsOnLayer( Edge_Cuts ) )
|
|
|
|
{
|
2022-07-31 21:14:24 +00:00
|
|
|
if( !aFP->GetCourtyard( F_CrtYd ).IsEmpty() )
|
2022-05-10 22:01:25 +00:00
|
|
|
reportPhysicalClearance( F_CrtYd );
|
2021-08-15 15:09:19 +00:00
|
|
|
|
2022-07-31 21:14:24 +00:00
|
|
|
if( !aFP->GetCourtyard( B_CrtYd ).IsEmpty() )
|
2022-05-10 22:01:25 +00:00
|
|
|
reportPhysicalClearance( B_CrtYd );
|
|
|
|
}
|
|
|
|
else if( bFP && a->IsOnLayer( Edge_Cuts ) )
|
|
|
|
{
|
2022-07-31 21:14:24 +00:00
|
|
|
if( !bFP->GetCourtyard( F_CrtYd ).IsEmpty() )
|
2022-05-10 22:01:25 +00:00
|
|
|
reportPhysicalClearance( F_CrtYd );
|
2021-08-15 15:09:19 +00:00
|
|
|
|
2022-07-31 21:14:24 +00:00
|
|
|
if( !bFP->GetCourtyard( B_CrtYd ).IsEmpty() )
|
2022-05-10 22:01:25 +00:00
|
|
|
reportPhysicalClearance( B_CrtYd );
|
2021-08-15 15:09:19 +00:00
|
|
|
}
|
|
|
|
|
2022-07-15 15:14:11 +00:00
|
|
|
if( a->HasHole() || b->HasHole() )
|
2021-08-15 15:09:19 +00:00
|
|
|
{
|
|
|
|
PCB_LAYER_ID layer;
|
|
|
|
|
2022-07-15 15:14:11 +00:00
|
|
|
if( a->HasHole() && b->IsOnLayer( active ) )
|
2021-08-15 15:09:19 +00:00
|
|
|
layer = active;
|
2022-07-15 15:14:11 +00:00
|
|
|
else if( b->HasHole() && a->IsOnLayer( active ) )
|
2021-08-15 15:09:19 +00:00
|
|
|
layer = active;
|
2022-07-15 15:14:11 +00:00
|
|
|
else if( a->HasHole() )
|
2021-08-15 15:09:19 +00:00
|
|
|
layer = b->GetLayer();
|
|
|
|
else
|
|
|
|
layer = a->GetLayer();
|
|
|
|
|
2022-05-06 13:46:24 +00:00
|
|
|
reportHeader( _( "Physical hole clearance resolution for:" ), a, b, layer, r );
|
2021-08-15 15:09:19 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
constraint = drcEngine->EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
2021-08-15 15:09:19 +00:00
|
|
|
clearance = constraint.m_Value.Min();
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
{
|
|
|
|
reportCompileError( r );
|
|
|
|
}
|
2023-12-11 16:27:09 +00:00
|
|
|
else if( !drcEngine->HasRulesForConstraintType( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT ) )
|
2021-08-15 15:09:19 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
2022-05-06 13:46:24 +00:00
|
|
|
r->Report( _( "No 'physical_hole_clearance' constraints defined." ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved min clearance: %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
m_frame->StringFromValue( clearance, true ) ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
}
|
2021-08-17 14:37:33 +00:00
|
|
|
}
|
|
|
|
|
2021-08-15 15:09:19 +00:00
|
|
|
r->Flush();
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->Raise();
|
|
|
|
dialog->Show( true );
|
2020-09-10 19:58:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
|
2020-09-22 23:16:02 +00:00
|
|
|
{
|
2023-12-11 16:27:09 +00:00
|
|
|
#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
|
2021-08-15 17:23:54 +00:00
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( m_frame, 0 );
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2023-03-13 16:03:48 +00:00
|
|
|
|
|
|
|
wxCHECK( selTool, 0 );
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
const PCB_SELECTION& selection = selTool->GetSelection();
|
2020-09-22 23:16:02 +00:00
|
|
|
|
|
|
|
if( selection.Size() != 1 )
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Select an item for a constraints resolution report." ) );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
DIALOG_BOOK_REPORTER* dialog = m_frame->GetInspectConstraintsDialog();
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( dialog, 0 );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->DeleteAllPages();
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2023-07-13 10:24:33 +00:00
|
|
|
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( selection.GetItem( 0 ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
DRC_CONSTRAINT constraint;
|
2020-10-25 15:02:13 +00:00
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
bool compileError = false;
|
|
|
|
bool courtyardError = false;
|
|
|
|
std::unique_ptr<DRC_ENGINE> drcEngine = makeDRCEngine( &compileError, &courtyardError );
|
|
|
|
|
2023-07-13 10:24:33 +00:00
|
|
|
wxCHECK( item, 0 );
|
|
|
|
|
2020-11-30 12:14:22 +00:00
|
|
|
WX_HTML_REPORT_BOX* r = nullptr;
|
2022-01-02 02:06:40 +00:00
|
|
|
|
2020-09-22 23:16:02 +00:00
|
|
|
if( item->Type() == PCB_TRACE_T )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Track Width" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Track width resolution for:" ), item, r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
constraint = EVAL_RULES( TRACK_WIDTH_CONSTRAINT, item, nullptr, item->GetLayer(), r );
|
|
|
|
|
2020-10-16 23:15:44 +00:00
|
|
|
if( compileError )
|
2021-08-15 17:23:54 +00:00
|
|
|
reportCompileError( r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved width constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( item->Type() == PCB_VIA_T )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Via Diameter" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Via diameter resolution for:" ), item, r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
// PADSTACKS TODO: once we have padstacks we'll need to run this per-layer....
|
|
|
|
constraint = EVAL_RULES( VIA_DIAMETER_CONSTRAINT, item, nullptr, UNDEFINED_LAYER, r );
|
|
|
|
|
2020-10-16 23:15:44 +00:00
|
|
|
if( compileError )
|
2021-08-15 17:23:54 +00:00
|
|
|
reportCompileError( r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved diameter constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2020-10-16 23:15:44 +00:00
|
|
|
r->Flush();
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Via Annular Width" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Via annular width resolution for:" ), item, r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
// PADSTACKS TODO: once we have padstacks we'll need to run this per-layer....
|
|
|
|
constraint = EVAL_RULES( ANNULAR_WIDTH_CONSTRAINT, item, nullptr, UNDEFINED_LAYER, r );
|
|
|
|
|
2020-10-16 23:15:44 +00:00
|
|
|
if( compileError )
|
2021-08-15 17:23:54 +00:00
|
|
|
reportCompileError( r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved annular width constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
|
2020-11-12 22:30:02 +00:00
|
|
|
if( ( item->Type() == PCB_PAD_T && static_cast<PAD*>( item )->GetDrillSize().x > 0 )
|
2020-09-22 23:16:02 +00:00
|
|
|
|| item->Type() == PCB_VIA_T )
|
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Hole Size" ) );
|
2023-10-02 10:11:49 +00:00
|
|
|
reportHeader( _( "Hole size resolution for:" ), item, r );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
// PADSTACKS TODO: once we have padstacks we'll need to run this per-layer....
|
|
|
|
constraint = EVAL_RULES( HOLE_SIZE_CONSTRAINT, item, nullptr, UNDEFINED_LAYER, r );
|
|
|
|
|
2020-10-16 23:15:44 +00:00
|
|
|
if( compileError )
|
2021-08-15 17:23:54 +00:00
|
|
|
reportCompileError( r );
|
2020-10-16 23:15:44 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved hole size constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2020-09-22 23:16:02 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
|
2023-06-06 15:09:34 +00:00
|
|
|
if( item->Type() == PCB_FIELD_T || item->Type() == PCB_TEXT_T || item->Type() == PCB_TEXTBOX_T )
|
2022-04-15 21:09:35 +00:00
|
|
|
{
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Text Size" ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
reportHeader( _( "Text height resolution for:" ), item, r );
|
|
|
|
|
|
|
|
constraint = EVAL_RULES( TEXT_HEIGHT_CONSTRAINT, item, nullptr, UNDEFINED_LAYER, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved height constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( "" );
|
|
|
|
reportHeader( _( "Text thickness resolution for:" ), item, r );
|
|
|
|
|
|
|
|
constraint = EVAL_RULES( TEXT_THICKNESS_CONSTRAINT, item, nullptr, UNDEFINED_LAYER, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
r->Report( "" );
|
2023-10-02 10:11:49 +00:00
|
|
|
r->Report( wxString::Format( _( "Resolved thickness constraints: min %s; opt %s; max %s." ),
|
2022-09-19 09:25:20 +00:00
|
|
|
reportMin( m_frame, constraint ),
|
|
|
|
reportOpt( m_frame, constraint ),
|
|
|
|
reportMax( m_frame, constraint ) ) );
|
2022-04-15 21:09:35 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
}
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Keepouts" ) );
|
2021-08-15 15:09:19 +00:00
|
|
|
reportHeader( _( "Keepout resolution for:" ), item, r );
|
2020-10-25 15:02:13 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
constraint = EVAL_RULES( DISALLOW_CONSTRAINT, item, nullptr, item->GetLayer(), r );
|
|
|
|
|
2020-10-25 15:02:13 +00:00
|
|
|
if( compileError )
|
2021-08-15 17:23:54 +00:00
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
if( courtyardError )
|
2020-10-25 15:02:13 +00:00
|
|
|
{
|
|
|
|
r->Report( "" );
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( _( "Report may be incomplete: some footprint courtyards are malformed." )
|
2023-03-09 11:25:32 +00:00
|
|
|
+ wxS( " " )
|
2023-03-13 16:03:48 +00:00
|
|
|
+ wxS( "<a href='$DRC'>" ) + _( "Run DRC for a full analysis." )
|
|
|
|
+ wxS( "</a>" ) );
|
2020-10-25 15:02:13 +00:00
|
|
|
}
|
2020-11-20 13:55:10 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
r->Report( "" );
|
2020-10-25 15:02:13 +00:00
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
if( constraint.m_DisallowFlags )
|
|
|
|
r->Report( _( "Item <b>disallowed</b> at current location." ) );
|
|
|
|
else
|
|
|
|
r->Report( _( "Item allowed at current location." ) );
|
2020-10-25 15:02:13 +00:00
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Assertions" ) );
|
2021-09-22 21:20:18 +00:00
|
|
|
reportHeader( _( "Assertions for:" ), item, r );
|
|
|
|
|
|
|
|
if( compileError )
|
|
|
|
reportCompileError( r );
|
|
|
|
|
|
|
|
if( courtyardError )
|
|
|
|
{
|
|
|
|
r->Report( "" );
|
|
|
|
r->Report( _( "Report may be incomplete: some footprint courtyards are malformed." )
|
2023-03-09 11:25:32 +00:00
|
|
|
+ wxS( " " )
|
2023-03-13 16:03:48 +00:00
|
|
|
+ wxS( "<a href='$DRC'>" ) + _( "Run DRC for a full analysis." )
|
|
|
|
+ wxS( "</a>" ) );
|
2021-09-22 21:20:18 +00:00
|
|
|
}
|
|
|
|
|
2023-12-11 16:27:09 +00:00
|
|
|
drcEngine->ProcessAssertions( item, []( const DRC_CONSTRAINT* c ){}, r );
|
2021-09-22 21:20:18 +00:00
|
|
|
r->Flush();
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->Raise();
|
|
|
|
dialog->Show( true );
|
2020-09-22 23:16:02 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-09 17:41:18 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::DiffFootprint( const TOOL_EVENT& aEvent )
|
2023-03-06 23:05:44 +00:00
|
|
|
{
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( m_frame, 0 );
|
|
|
|
|
2023-03-06 23:05:44 +00:00
|
|
|
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2023-03-13 16:03:48 +00:00
|
|
|
|
|
|
|
wxCHECK( selTool, 0 );
|
|
|
|
|
2023-03-06 23:05:44 +00:00
|
|
|
const PCB_SELECTION& selection = selTool->RequestSelection(
|
|
|
|
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool )
|
|
|
|
{
|
|
|
|
// Iterate from the back so we don't have to worry about removals.
|
|
|
|
for( int i = aCollector.GetCount() - 1; i >= 0; --i )
|
|
|
|
{
|
|
|
|
BOARD_ITEM* item = aCollector[ i ];
|
|
|
|
|
|
|
|
if( !dynamic_cast<FOOTPRINT*>( item ) )
|
|
|
|
aCollector.Remove( item );
|
|
|
|
}
|
|
|
|
},
|
|
|
|
false /* ignore locked flag */ );
|
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
if( selection.Size() == 1 )
|
|
|
|
DiffFootprint( static_cast<FOOTPRINT*>( selection.GetItem( 0 ) ) );
|
|
|
|
else
|
|
|
|
m_frame->ShowInfoBarError( _( "Select a footprint to diff with its library equivalent." ) );
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-03-06 23:05:44 +00:00
|
|
|
|
2023-07-11 13:05:39 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::ShowFootprintLinks( const TOOL_EVENT& aEvent )
|
|
|
|
{
|
|
|
|
wxCHECK( m_frame, 0 );
|
|
|
|
|
|
|
|
PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
|
|
|
|
|
|
|
wxCHECK( selTool, 0 );
|
|
|
|
|
|
|
|
const PCB_SELECTION& selection = selTool->GetSelection();
|
|
|
|
|
|
|
|
if( selection.Size() != 1 || selection.Front()->Type() != PCB_FOOTPRINT_T )
|
|
|
|
{
|
|
|
|
m_frame->ShowInfoBarError( _( "Select a footprint for a footprint associations report." ) );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
DIALOG_FOOTPRINT_ASSOCIATIONS dlg( m_frame, static_cast<FOOTPRINT*>( selection.Front() ) );
|
|
|
|
|
|
|
|
dlg.ShowModal();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::DiffFootprint( FOOTPRINT* aFootprint )
|
|
|
|
{
|
2023-03-13 16:03:48 +00:00
|
|
|
DIALOG_BOOK_REPORTER* dialog = m_frame->GetFootprintDiffDialog();
|
2023-03-06 23:05:44 +00:00
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
wxCHECK( dialog, /* void */ );
|
2023-03-06 23:05:44 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->DeleteAllPages();
|
2023-03-06 23:05:44 +00:00
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
LIB_ID fpID = aFootprint->GetFPID();
|
2023-03-06 23:05:44 +00:00
|
|
|
wxString libName = fpID.GetLibNickname();
|
|
|
|
wxString fpName = fpID.GetLibItemName();
|
|
|
|
WX_HTML_REPORT_BOX* r = nullptr;
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
r = dialog->AddHTMLPage( _( "Summary" ) );
|
2023-03-06 23:05:44 +00:00
|
|
|
|
2023-03-09 11:25:32 +00:00
|
|
|
r->Report( wxS( "<h7>" ) + _( "Board vs library diff for:" ) + wxS( "</h7>" ) );
|
2023-03-13 23:35:07 +00:00
|
|
|
r->Report( wxS( "<ul><li>" ) + EscapeHTML( getItemDescription( aFootprint ) ) + wxS( "</li>" )
|
2023-03-09 11:25:32 +00:00
|
|
|
+ wxS( "<li>" ) + _( "Library: " ) + EscapeHTML( libName ) + wxS( "</li>" )
|
|
|
|
+ wxS( "<li>" ) + _( "Library item: " ) + EscapeHTML( fpName ) + wxS( "</li></ul>" ) );
|
2023-03-06 23:05:44 +00:00
|
|
|
|
|
|
|
r->Report( "" );
|
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
PROJECT* project = aFootprint->GetBoard()->GetProject();
|
2023-09-28 03:15:54 +00:00
|
|
|
FP_LIB_TABLE* libTable = PROJECT_PCB::PcbFootprintLibs( project );
|
2023-03-06 23:05:44 +00:00
|
|
|
const LIB_TABLE_ROW* libTableRow = nullptr;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
libTableRow = libTable->FindRow( libName );
|
|
|
|
}
|
|
|
|
catch( const IO_ERROR& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !libTableRow )
|
|
|
|
{
|
2023-03-09 11:25:32 +00:00
|
|
|
r->Report( _( "The library is not included in the current configuration." )
|
|
|
|
+ wxS( "  " )
|
2023-03-13 16:03:48 +00:00
|
|
|
+ wxS( "<a href='$CONFIG'>" ) + _( "Manage Footprint Libraries" )
|
|
|
|
+ wxS( "</a>" ) );
|
2023-03-09 11:25:32 +00:00
|
|
|
|
2023-03-06 23:05:44 +00:00
|
|
|
}
|
|
|
|
else if( !libTable->HasLibrary( libName, true ) )
|
|
|
|
{
|
2023-03-09 11:25:32 +00:00
|
|
|
r->Report( _( "The library is not enabled in the current configuration." )
|
|
|
|
+ wxS( "  " )
|
2023-03-13 16:03:48 +00:00
|
|
|
+ wxS( "<a href='$CONFIG'>" ) + _( "Manage Footprint Libraries" )
|
|
|
|
+ wxS( "</a>" ) );
|
2023-03-09 11:25:32 +00:00
|
|
|
|
2023-03-06 23:05:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::shared_ptr<FOOTPRINT> libFootprint;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
libFootprint.reset( libTable->FootprintLoad( libName, fpName, true ) );
|
|
|
|
}
|
|
|
|
catch( const IO_ERROR& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !libFootprint )
|
|
|
|
{
|
|
|
|
r->Report( wxString::Format( _( "The library no longer contains the item %s." ),
|
|
|
|
fpName) );
|
|
|
|
}
|
2023-03-10 17:15:40 +00:00
|
|
|
else
|
2023-03-06 23:05:44 +00:00
|
|
|
{
|
2024-04-28 22:05:14 +00:00
|
|
|
if( !aFootprint->FootprintNeedsUpdate( libFootprint.get(), 0, r ) )
|
2023-03-10 17:15:40 +00:00
|
|
|
r->Report( _( "No relevant differences detected." ) );
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
wxPanel* panel = dialog->AddBlankPage( _( "Visual" ) );
|
2023-03-10 17:15:40 +00:00
|
|
|
FOOTPRINT_DIFF_WIDGET* diff = constructDiffPanel( panel );
|
|
|
|
|
2023-03-13 23:35:07 +00:00
|
|
|
diff->DisplayDiff( aFootprint, libFootprint );
|
2023-03-06 23:05:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
r->Flush();
|
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->Raise();
|
|
|
|
dialog->Show( true );
|
2023-03-06 23:05:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-10 17:15:40 +00:00
|
|
|
FOOTPRINT_DIFF_WIDGET* BOARD_INSPECTION_TOOL::constructDiffPanel( wxPanel* aParentPanel )
|
|
|
|
{
|
|
|
|
wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
FOOTPRINT_DIFF_WIDGET* diffWidget = new FOOTPRINT_DIFF_WIDGET( aParentPanel, m_frame->Kiway() );
|
|
|
|
|
|
|
|
sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
|
|
|
|
aParentPanel->SetSizer( sizer );
|
|
|
|
aParentPanel->Layout();
|
|
|
|
|
|
|
|
return diffWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
|
|
|
BOARD_ITEM* item = aEvent.Parameter<BOARD_ITEM*>();
|
|
|
|
|
2022-07-19 15:00:35 +00:00
|
|
|
m_frame->m_probingSchToPcb = true; // recursion guard
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2023-06-26 22:16:51 +00:00
|
|
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
if( item )
|
2023-06-26 22:16:51 +00:00
|
|
|
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, item );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
2022-07-19 15:00:35 +00:00
|
|
|
m_frame->m_probingSchToPcb = false;
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2022-07-24 15:49:46 +00:00
|
|
|
bool request3DviewRedraw = frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
|
2020-09-02 17:16:36 +00:00
|
|
|
|
2020-11-13 12:21:02 +00:00
|
|
|
if( item && item->Type() != PCB_FOOTPRINT_T )
|
|
|
|
request3DviewRedraw = false;
|
2020-09-02 17:16:36 +00:00
|
|
|
|
2021-04-09 02:09:06 +00:00
|
|
|
// Update 3D viewer highlighting
|
2020-09-02 17:16:36 +00:00
|
|
|
if( request3DviewRedraw )
|
2021-04-09 02:09:06 +00:00
|
|
|
m_frame->Update3DView( false, true );
|
2020-09-02 17:16:36 +00:00
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
bool BOARD_INSPECTION_TOOL::highlightNet( const VECTOR2D& aPosition, bool aUseSelection )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-10-13 01:07:57 +00:00
|
|
|
BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
|
|
|
|
KIGFX::RENDER_SETTINGS* settings = getView()->GetPainter()->GetSettings();
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
int net = -1;
|
|
|
|
bool enableHighlight = false;
|
|
|
|
|
|
|
|
if( aUseSelection )
|
|
|
|
{
|
2020-12-16 13:31:32 +00:00
|
|
|
const PCB_SELECTION& selection = selectionTool->GetSelection();
|
2021-05-29 15:53:55 +00:00
|
|
|
std::set<int> netcodes;
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2021-09-26 18:25:49 +00:00
|
|
|
for( EDA_ITEM* item : selection )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2021-09-26 18:25:49 +00:00
|
|
|
if( BOARD_CONNECTED_ITEM* ci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
|
2021-05-29 15:53:55 +00:00
|
|
|
netcodes.insert( ci->GetNetCode() );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
|
2021-05-29 15:53:55 +00:00
|
|
|
enableHighlight = !netcodes.empty();
|
|
|
|
|
|
|
|
if( enableHighlight && netcodes.size() > 1 )
|
|
|
|
{
|
|
|
|
// If we are doing a multi-highlight, cross-probing back and other stuff is not
|
|
|
|
// yet supported
|
|
|
|
settings->SetHighlight( netcodes );
|
|
|
|
board->ResetNetHighLight();
|
|
|
|
|
|
|
|
for( int multiNet : netcodes )
|
|
|
|
board->SetHighLightNet( multiNet, true );
|
|
|
|
|
|
|
|
board->HighLightON();
|
|
|
|
m_toolMgr->GetView()->UpdateAllLayersColor();
|
|
|
|
m_currentlyHighlighted = netcodes;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if( enableHighlight )
|
|
|
|
{
|
|
|
|
net = *netcodes.begin();
|
|
|
|
}
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// If we didn't get a net to highlight from the selection, use the cursor
|
|
|
|
if( net < 0 )
|
|
|
|
{
|
2020-10-13 01:07:57 +00:00
|
|
|
GENERAL_COLLECTORS_GUIDE guide = m_frame->GetCollectorsGuide();
|
2021-09-26 18:25:49 +00:00
|
|
|
guide.SetIgnoreZoneFills( false );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2020-10-13 01:07:57 +00:00
|
|
|
PCB_LAYER_ID activeLayer = static_cast<PCB_LAYER_ID>( view()->GetTopLayer() );
|
|
|
|
guide.SetPreferredLayer( activeLayer );
|
|
|
|
|
2021-09-26 18:25:49 +00:00
|
|
|
GENERAL_COLLECTOR collector;
|
2023-07-30 19:39:07 +00:00
|
|
|
collector.Collect( board, { PCB_PAD_T, PCB_VIA_T, PCB_TRACE_T, PCB_ARC_T, PCB_SHAPE_T }, aPosition,
|
2022-08-20 09:27:35 +00:00
|
|
|
guide );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
if( collector.GetCount() == 0 )
|
2023-03-30 11:49:23 +00:00
|
|
|
collector.Collect( board, { PCB_ZONE_T }, aPosition, guide );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2020-12-20 16:24:19 +00:00
|
|
|
// Apply the active selection filter, except we want to allow picking locked items for
|
|
|
|
// highlighting even if the user has disabled them for selection
|
|
|
|
SELECTION_FILTER_OPTIONS& filter = selectionTool->GetFilter();
|
|
|
|
|
|
|
|
bool saved = filter.lockedItems;
|
|
|
|
filter.lockedItems = true;
|
|
|
|
|
2021-09-24 17:57:22 +00:00
|
|
|
selectionTool->FilterCollectedItems( collector, true );
|
2020-10-13 01:07:57 +00:00
|
|
|
|
2020-12-20 16:24:19 +00:00
|
|
|
filter.lockedItems = saved;
|
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
// Clear the previous highlight
|
2022-07-19 15:00:35 +00:00
|
|
|
//m_frame->SendMessageToEESCHEMA( nullptr );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2020-10-13 01:07:57 +00:00
|
|
|
bool highContrast = settings->GetHighContrast();
|
|
|
|
PCB_LAYER_ID contrastLayer = settings->GetPrimaryHighContrastLayer();
|
|
|
|
|
2020-10-14 01:45:09 +00:00
|
|
|
for( int i = collector.GetCount() - 1; i >= 0; i-- )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-10-13 01:07:57 +00:00
|
|
|
LSET itemLayers = collector[i]->GetLayerSet();
|
|
|
|
|
2020-10-14 01:45:09 +00:00
|
|
|
if( ( itemLayers & LSET::AllCuMask() ).none() ||
|
|
|
|
( highContrast && !itemLayers.Contains( contrastLayer ) ) )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-10-14 01:45:09 +00:00
|
|
|
collector.Remove( i );
|
|
|
|
continue;
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
enableHighlight = ( collector.GetCount() > 0 );
|
|
|
|
|
|
|
|
// Obtain net code for the clicked item
|
|
|
|
if( enableHighlight )
|
2020-10-14 01:45:09 +00:00
|
|
|
{
|
|
|
|
BOARD_CONNECTED_ITEM* targetItem = static_cast<BOARD_CONNECTED_ITEM*>( collector[0] );
|
|
|
|
|
|
|
|
if( targetItem->Type() == PCB_PAD_T )
|
2022-07-19 15:00:35 +00:00
|
|
|
m_frame->SendCrossProbeItem( targetItem );
|
2020-10-14 01:45:09 +00:00
|
|
|
|
|
|
|
net = targetItem->GetNetCode();
|
|
|
|
}
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
|
2022-04-13 23:14:46 +00:00
|
|
|
const std::set<int>& netcodes = settings->GetHighlightNetCodes();
|
2020-06-24 03:36:05 +00:00
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
// Toggle highlight when the same net was picked
|
2022-04-13 23:14:46 +00:00
|
|
|
if( netcodes.count( net ) )
|
2019-08-12 14:41:45 +00:00
|
|
|
enableHighlight = !settings->IsHighlightEnabled();
|
|
|
|
|
2021-03-02 13:10:37 +00:00
|
|
|
if( enableHighlight != settings->IsHighlightEnabled() || !netcodes.count( net ) )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-06-24 03:36:05 +00:00
|
|
|
if( !netcodes.empty() )
|
2021-05-29 15:53:55 +00:00
|
|
|
m_lastHighlighted = netcodes;
|
2020-06-24 03:36:05 +00:00
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
settings->SetHighlight( enableHighlight, net );
|
|
|
|
m_toolMgr->GetView()->UpdateAllLayersColor();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Store the highlighted netcode in the current board (for dialogs for instance)
|
|
|
|
if( enableHighlight && net >= 0 )
|
|
|
|
{
|
2021-05-29 15:53:55 +00:00
|
|
|
m_currentlyHighlighted = netcodes;
|
2019-08-12 14:41:45 +00:00
|
|
|
board->SetHighLightNet( net );
|
2020-04-13 11:37:42 +00:00
|
|
|
board->HighLightON();
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
NETINFO_ITEM* netinfo = board->FindNet( net );
|
|
|
|
|
|
|
|
if( netinfo )
|
|
|
|
{
|
2021-09-26 23:22:32 +00:00
|
|
|
std::vector<MSG_PANEL_ITEM> items;
|
2020-04-24 13:36:10 +00:00
|
|
|
netinfo->GetMsgPanelInfo( m_frame, items );
|
2019-08-12 14:41:45 +00:00
|
|
|
m_frame->SetMsgPanel( items );
|
|
|
|
m_frame->SendCrossProbeNetName( netinfo->GetNetname() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-05-29 15:53:55 +00:00
|
|
|
m_currentlyHighlighted.clear();
|
2019-08-12 14:41:45 +00:00
|
|
|
board->ResetNetHighLight();
|
|
|
|
m_frame->SetMsgPanel( board );
|
|
|
|
m_frame->SendCrossProbeNetName( "" );
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::HighlightNet( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-09-28 01:15:19 +00:00
|
|
|
int netcode = aEvent.Parameter<int>();
|
2020-07-11 17:42:00 +00:00
|
|
|
KIGFX::RENDER_SETTINGS* settings = m_toolMgr->GetView()->GetPainter()->GetSettings();
|
|
|
|
const std::set<int>& highlighted = settings->GetHighlightNetCodes();
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
if( netcode > 0 )
|
|
|
|
{
|
2021-05-29 15:53:55 +00:00
|
|
|
m_lastHighlighted = highlighted;
|
2019-08-12 14:41:45 +00:00
|
|
|
settings->SetHighlight( true, netcode );
|
|
|
|
m_toolMgr->GetView()->UpdateAllLayersColor();
|
2021-05-29 15:53:55 +00:00
|
|
|
m_currentlyHighlighted.clear();
|
|
|
|
m_currentlyHighlighted.insert( netcode );
|
|
|
|
}
|
|
|
|
else if( aEvent.IsAction( &PCB_ACTIONS::highlightNetSelection ) )
|
|
|
|
{
|
|
|
|
// Highlight selection (cursor position will be ignored)
|
|
|
|
highlightNet( getViewControls()->GetMousePosition(), true );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
else if( aEvent.IsAction( &PCB_ACTIONS::toggleLastNetHighlight ) )
|
|
|
|
{
|
2021-05-29 15:53:55 +00:00
|
|
|
std::set<int> temp = highlighted;
|
|
|
|
settings->SetHighlight( m_lastHighlighted );
|
|
|
|
m_toolMgr->GetView()->UpdateAllLayersColor();
|
|
|
|
m_currentlyHighlighted = m_lastHighlighted;
|
2023-12-18 17:39:29 +00:00
|
|
|
m_lastHighlighted = std::move( temp );
|
2021-05-29 15:53:55 +00:00
|
|
|
}
|
|
|
|
else if( aEvent.IsAction( &PCB_ACTIONS::toggleNetHighlight ) )
|
|
|
|
{
|
|
|
|
bool turnOn = highlighted.empty() && !m_currentlyHighlighted.empty();
|
|
|
|
settings->SetHighlight( m_currentlyHighlighted, turnOn );
|
2019-08-12 14:41:45 +00:00
|
|
|
m_toolMgr->GetView()->UpdateAllLayersColor();
|
|
|
|
}
|
|
|
|
else // Highlight the net belonging to the item under the cursor
|
|
|
|
{
|
|
|
|
highlightNet( getViewControls()->GetMousePosition(), false );
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::ClearHighlight( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
|
|
|
BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
|
|
|
|
KIGFX::RENDER_SETTINGS* settings = m_toolMgr->GetView()->GetPainter()->GetSettings();
|
|
|
|
|
2021-05-29 15:53:55 +00:00
|
|
|
m_currentlyHighlighted.clear();
|
|
|
|
m_lastHighlighted.clear();
|
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
board->ResetNetHighLight();
|
|
|
|
settings->SetHighlight( false );
|
|
|
|
m_toolMgr->GetView()->UpdateAllLayersColor();
|
|
|
|
m_frame->SetMsgPanel( board );
|
|
|
|
m_frame->SendCrossProbeNetName( "" );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-04-15 23:57:08 +00:00
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_PICKER_TOOL* picker = m_toolMgr->GetTool<PCB_PICKER_TOOL>();
|
|
|
|
BOARD* board = getModel<BOARD>();
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
// Deactivate other tools; particularly important if another PICKER is currently running
|
|
|
|
Activate();
|
|
|
|
|
2022-10-12 09:20:47 +00:00
|
|
|
picker->SetCursor( KICURSOR::BULLSEYE );
|
|
|
|
|
2019-08-12 14:41:45 +00:00
|
|
|
picker->SetClickHandler(
|
2022-04-15 23:57:08 +00:00
|
|
|
[this, board]( const VECTOR2D& pt ) -> bool
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2023-06-26 22:16:51 +00:00
|
|
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear );
|
|
|
|
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor,
|
2023-06-16 20:15:29 +00:00
|
|
|
EDIT_TOOL::PadFilter );
|
|
|
|
|
2022-04-15 23:57:08 +00:00
|
|
|
PCB_SELECTION& selection = selectionTool->GetSelection();
|
|
|
|
|
|
|
|
if( selection.Empty() )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2023-06-26 22:16:51 +00:00
|
|
|
m_toolMgr->RunAction<CLIENT_SELECTION_FILTER>( PCB_ACTIONS::selectionCursor,
|
2023-06-16 20:15:29 +00:00
|
|
|
EDIT_TOOL::FootprintFilter );
|
2022-04-15 23:57:08 +00:00
|
|
|
selection = selectionTool->GetSelection();
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
2022-04-15 23:57:08 +00:00
|
|
|
|
|
|
|
if( selection.Empty() )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
// Clear the previous local ratsnest if we click off all items
|
|
|
|
for( FOOTPRINT* fp : board->Footprints() )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
for( PAD* pad : fp->Pads() )
|
|
|
|
pad->SetLocalRatsnestVisible( displayOptions().m_ShowGlobalRatsnest );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
2022-04-15 23:57:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for( EDA_ITEM* item : selection )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
if( PAD* pad = dyn_cast<PAD*>( item) )
|
2020-06-01 07:09:40 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
pad->SetLocalRatsnestVisible( !pad->GetLocalRatsnestVisible() );
|
|
|
|
}
|
|
|
|
else if( FOOTPRINT* fp = dyn_cast<FOOTPRINT*>( item) )
|
|
|
|
{
|
|
|
|
if( !fp->Pads().empty() )
|
|
|
|
{
|
|
|
|
bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2022-04-15 23:57:08 +00:00
|
|
|
for( PAD* childPad : fp->Pads() )
|
|
|
|
childPad->SetLocalRatsnestVisible( enable );
|
|
|
|
}
|
2020-06-01 07:09:40 +00:00
|
|
|
}
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-15 23:57:08 +00:00
|
|
|
m_toolMgr->GetView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2022-04-15 23:57:08 +00:00
|
|
|
return true;
|
|
|
|
} );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
picker->SetFinalizeHandler(
|
2022-04-15 23:57:08 +00:00
|
|
|
[this, board]( int aCondition )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
if( aCondition != PCB_PICKER_TOOL::END_ACTIVATE )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-04-15 23:57:08 +00:00
|
|
|
for( FOOTPRINT* fp : board->Footprints() )
|
|
|
|
{
|
|
|
|
for( PAD* pad : fp->Pads() )
|
|
|
|
pad->SetLocalRatsnestVisible( displayOptions().m_ShowGlobalRatsnest );
|
|
|
|
}
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
2022-04-15 23:57:08 +00:00
|
|
|
} );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2023-06-26 22:16:51 +00:00
|
|
|
m_toolMgr->RunAction( ACTIONS::pickerTool, &aEvent );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::UpdateLocalRatsnest( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2023-06-27 15:52:50 +00:00
|
|
|
VECTOR2I delta = aEvent.Parameter<VECTOR2I>();
|
2020-08-16 20:30:05 +00:00
|
|
|
|
2023-06-27 15:52:50 +00:00
|
|
|
if( delta == VECTOR2I() )
|
2020-08-16 20:30:05 +00:00
|
|
|
{
|
|
|
|
// We can delete the existing map to force a recalculation
|
|
|
|
delete m_dynamicData;
|
|
|
|
m_dynamicData = nullptr;
|
|
|
|
}
|
2020-08-15 00:33:27 +00:00
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
auto selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
2019-08-12 14:41:45 +00:00
|
|
|
auto& selection = selectionTool->GetSelection();
|
|
|
|
auto connectivity = getModel<BOARD>()->GetConnectivity();
|
|
|
|
|
|
|
|
if( selection.Empty() )
|
|
|
|
{
|
2022-09-03 18:29:02 +00:00
|
|
|
connectivity->ClearLocalRatsnest();
|
2020-08-15 00:33:27 +00:00
|
|
|
delete m_dynamicData;
|
|
|
|
m_dynamicData = nullptr;
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-16 20:30:05 +00:00
|
|
|
calculateSelectionRatsnest( delta );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::HideLocalRatsnest( const TOOL_EVENT& aEvent )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2022-09-03 18:29:02 +00:00
|
|
|
getModel<BOARD>()->GetConnectivity()->ClearLocalRatsnest();
|
2020-08-15 00:33:27 +00:00
|
|
|
delete m_dynamicData;
|
|
|
|
m_dynamicData = nullptr;
|
2020-06-25 00:16:07 +00:00
|
|
|
|
2020-08-15 00:33:27 +00:00
|
|
|
return 0;
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
|
|
|
SELECTION& selection = selectionTool->GetSelection();
|
2019-08-12 14:41:45 +00:00
|
|
|
std::shared_ptr<CONNECTIVITY_DATA> connectivity = board()->GetConnectivity();
|
|
|
|
std::vector<BOARD_ITEM*> items;
|
2020-12-16 13:31:32 +00:00
|
|
|
std::deque<EDA_ITEM*> queued_items( selection.begin(), selection.end() );
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2020-08-15 02:45:56 +00:00
|
|
|
for( std::size_t i = 0; i < queued_items.size(); ++i )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2023-07-13 10:24:33 +00:00
|
|
|
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( queued_items[i] );
|
|
|
|
|
|
|
|
wxCHECK2( item, continue );
|
2020-08-15 02:45:56 +00:00
|
|
|
|
2020-11-13 12:21:02 +00:00
|
|
|
if( item->Type() == PCB_FOOTPRINT_T )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-11-13 15:15:52 +00:00
|
|
|
for( PAD* pad : static_cast<FOOTPRINT*>( item )->Pads() )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2019-11-07 14:23:09 +00:00
|
|
|
if( pad->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest )
|
2019-08-12 14:41:45 +00:00
|
|
|
items.push_back( pad );
|
|
|
|
}
|
|
|
|
}
|
2023-11-09 13:55:00 +00:00
|
|
|
else if( item->Type() == PCB_GROUP_T || item->Type() == PCB_GENERATOR_T )
|
2020-08-15 02:45:56 +00:00
|
|
|
{
|
2023-11-09 13:55:00 +00:00
|
|
|
item->RunOnDescendants( [ &queued_items ]( BOARD_ITEM *aItem )
|
|
|
|
{
|
|
|
|
queued_items.push_back( aItem );
|
|
|
|
} );
|
2020-08-15 02:45:56 +00:00
|
|
|
}
|
2020-08-10 17:59:23 +00:00
|
|
|
else if( BOARD_CONNECTED_ITEM* boardItem = dyn_cast<BOARD_CONNECTED_ITEM*>( item ) )
|
2019-08-12 14:41:45 +00:00
|
|
|
{
|
2020-08-10 17:59:23 +00:00
|
|
|
if( boardItem->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest )
|
|
|
|
items.push_back( boardItem );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-31 17:25:08 +00:00
|
|
|
if( items.empty() || std::none_of( items.begin(), items.end(),
|
|
|
|
[]( const BOARD_ITEM* aItem )
|
|
|
|
{
|
|
|
|
return( aItem->Type() == PCB_TRACE_T
|
|
|
|
|| aItem->Type() == PCB_PAD_T
|
|
|
|
|| aItem->Type() == PCB_ARC_T
|
2020-11-11 23:05:59 +00:00
|
|
|
|| aItem->Type() == PCB_ZONE_T
|
2020-11-13 12:21:02 +00:00
|
|
|
|| aItem->Type() == PCB_FOOTPRINT_T
|
2023-07-30 19:39:07 +00:00
|
|
|
|| aItem->Type() == PCB_VIA_T
|
|
|
|
|| aItem->Type() == PCB_SHAPE_T );
|
2020-10-31 17:25:08 +00:00
|
|
|
} ) )
|
2020-08-15 00:33:27 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( !m_dynamicData )
|
|
|
|
{
|
2023-11-01 12:47:42 +00:00
|
|
|
m_dynamicData = new CONNECTIVITY_DATA( board()->GetConnectivity(), items, true );
|
2020-08-15 00:33:27 +00:00
|
|
|
connectivity->BlockRatsnestItems( items );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_dynamicData->Move( aDelta );
|
|
|
|
}
|
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
connectivity->ComputeLocalRatsnest( items, m_dynamicData );
|
2019-08-12 14:41:45 +00:00
|
|
|
}
|
|
|
|
|
2020-07-11 01:06:17 +00:00
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::ListNets( const TOOL_EVENT& aEvent )
|
2020-04-12 19:20:30 +00:00
|
|
|
{
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( m_frame, 0 );
|
|
|
|
|
|
|
|
DIALOG_NET_INSPECTOR* dialog = m_frame->GetNetInspectorDialog();
|
2020-04-13 11:54:35 +00:00
|
|
|
|
2023-03-13 16:03:48 +00:00
|
|
|
wxCHECK( dialog, 0 );
|
2020-04-12 19:20:30 +00:00
|
|
|
|
2023-03-11 19:35:13 +00:00
|
|
|
dialog->Raise();
|
|
|
|
dialog->Show( true );
|
2020-04-12 19:20:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2019-08-12 14:41:45 +00:00
|
|
|
|
2020-07-11 01:06:17 +00:00
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::HideNetInRatsnest( const TOOL_EVENT& aEvent )
|
2020-07-11 01:06:17 +00:00
|
|
|
{
|
2022-09-28 01:15:19 +00:00
|
|
|
doHideRatsnestNet( aEvent.Parameter<int>(), true );
|
2020-07-11 01:06:17 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
int BOARD_INSPECTION_TOOL::ShowNetInRatsnest( const TOOL_EVENT& aEvent )
|
2020-07-11 01:06:17 +00:00
|
|
|
{
|
2022-09-28 01:15:19 +00:00
|
|
|
doHideRatsnestNet( aEvent.Parameter<int>(), false );
|
2020-07-11 01:06:17 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-03 18:29:02 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::doHideRatsnestNet( int aNetCode, bool aHide )
|
2020-07-11 01:06:17 +00:00
|
|
|
{
|
|
|
|
KIGFX::PCB_RENDER_SETTINGS* rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
|
|
|
|
m_toolMgr->GetView()->GetPainter()->GetSettings() );
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
|
|
|
|
SELECTION& selection = selectionTool->GetSelection();
|
2020-07-11 01:06:17 +00:00
|
|
|
|
|
|
|
if( aNetCode <= 0 && !selection.Empty() )
|
|
|
|
{
|
|
|
|
for( EDA_ITEM* item : selection )
|
|
|
|
{
|
|
|
|
if( BOARD_CONNECTED_ITEM* bci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
|
|
|
|
{
|
|
|
|
if( bci->GetNetCode() > 0 )
|
2022-09-03 18:29:02 +00:00
|
|
|
doHideRatsnestNet( bci->GetNetCode(), aHide );
|
2020-07-11 01:06:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( aHide )
|
|
|
|
rs->GetHiddenNets().insert( aNetCode );
|
|
|
|
else
|
|
|
|
rs->GetHiddenNets().erase( aNetCode );
|
|
|
|
|
2024-03-02 22:44:14 +00:00
|
|
|
if( !m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
|
|
|
|
{
|
|
|
|
m_frame->GetCanvas()->RedrawRatsnest();
|
|
|
|
m_frame->GetCanvas()->Refresh();
|
2021-01-14 09:37:08 +00:00
|
|
|
|
2024-03-02 22:44:14 +00:00
|
|
|
m_frame->GetAppearancePanel()->OnNetVisibilityChanged( aNetCode, !aHide );
|
|
|
|
}
|
2020-07-11 01:06:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-12-16 13:31:32 +00:00
|
|
|
void BOARD_INSPECTION_TOOL::setTransitions()
|
2019-07-16 19:34:07 +00:00
|
|
|
{
|
2022-09-03 18:29:02 +00:00
|
|
|
Go( &BOARD_INSPECTION_TOOL::LocalRatsnestTool, PCB_ACTIONS::localRatsnestTool.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HideLocalRatsnest, PCB_ACTIONS::hideLocalRatsnest.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::UpdateLocalRatsnest, PCB_ACTIONS::updateLocalRatsnest.MakeEvent() );
|
|
|
|
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::ListNets, PCB_ACTIONS::listNets.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::ShowBoardStatistics, PCB_ACTIONS::boardStatistics.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::InspectClearance, PCB_ACTIONS::inspectClearance.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::InspectConstraints, PCB_ACTIONS::inspectConstraints.MakeEvent() );
|
2023-03-09 17:41:18 +00:00
|
|
|
Go( &BOARD_INSPECTION_TOOL::DiffFootprint, PCB_ACTIONS::diffFootprint.MakeEvent() );
|
2023-07-11 13:05:39 +00:00
|
|
|
Go( &BOARD_INSPECTION_TOOL::ShowFootprintLinks, PCB_ACTIONS::showFootprintAssociations.MakeEvent() );
|
2022-09-03 18:29:02 +00:00
|
|
|
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::highlightNet.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::highlightNetSelection.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::toggleLastNetHighlight.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::ClearHighlight, PCB_ACTIONS::clearHighlight.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::toggleNetHighlight.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HighlightItem, PCB_ACTIONS::highlightItem.MakeEvent() );
|
|
|
|
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::HideNetInRatsnest, PCB_ACTIONS::hideNetInRatsnest.MakeEvent() );
|
|
|
|
Go( &BOARD_INSPECTION_TOOL::ShowNetInRatsnest, PCB_ACTIONS::showNetInRatsnest.MakeEvent() );
|
2019-07-16 19:34:07 +00:00
|
|
|
}
|