Make sure design rules get recompiled after netclass changes.

Fixes https://gitlab.com/kicad/code/kicad/issues/7082
This commit is contained in:
Jeff Young 2021-01-13 12:07:06 +00:00
parent d2d4ffe6d0
commit 0bce280424
7 changed files with 40 additions and 15 deletions

View File

@ -102,7 +102,7 @@ DIALOG_ERC::DIALOG_ERC( SCH_EDIT_FRAME* parent ) :
m_infoBar->RemoveAllButtons();
m_infoBar->AddButton( button );
m_infoBar->ShowMessage( _( "Annotation not complete. ERC cannot be run." ) );
m_infoBar->ShowMessage( _( "Annotation is incomplete. ERC cannot be run." ) );
}
// Now all widgets have the size fixed, call FinishDialogSettings

View File

@ -49,7 +49,7 @@ void DIALOG_CONSTRAINTS_REPORTER::DeleteAllPages()
void DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked( wxHtmlLinkEvent& event )
{
if( event.GetLinkInfo().GetHref() == "boardsetup" )
m_frame->ShowBoardSetupDialog( _( "Rules" ) );
m_frame->ShowBoardSetupDialog( _( "Custom Rules" ) );
else if( event.GetLinkInfo().GetHref() == "drc" )
m_frame->GetToolManager()->RunAction( PCB_ACTIONS::runDRC, true );
}

View File

@ -212,7 +212,7 @@ void DIALOG_DRC::OnRunDRCClick( wxCommandEvent& aEvent )
m_saveReport->Enable( false );
m_messages->Clear();
m_messages->Report( _( "DRC incomplete: could not compile design rules. " )
m_messages->Report( _( "DRC incomplete: could not compile custom design rules. " )
+ wxT( "<a href='boardsetup'>" )
+ _( "Show design rules." )
+ wxT( "</a>" ) );

View File

@ -511,7 +511,7 @@ int PCB_EDIT_FRAME::inferLegacyEdgeClearance( BOARD* aBoard )
{
// If they had different widths then we can't ensure that fills will be the same.
wxMessageBox( _( "If the zones on this board are refilled the Copper Edge Clearance "
"setting will be used (see Board Setup > Design Rules).\n"
"setting will be used (see Board Setup > Design Rules > Constraints).\n"
"This may result in different fills from previous Kicad versions which "
"used the line thicknesses of the board boundary on the Edge Cuts layer." ),
_( "Edge Clearance Warning" ), wxOK|wxICON_WARNING, this );

View File

@ -1639,6 +1639,32 @@ void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
GetAppearancePanel()->OnColorThemeChanged();
// Netclass definitions could have changed, either by us or by Eeschema
DRC_TOOL* drcTool = m_toolManager->GetTool<DRC_TOOL>();
WX_INFOBAR* infobar = GetInfoBar();
try
{
drcTool->GetDRCEngine()->InitEngine( GetDesignRulesPath() );
infobar->Hide();
}
catch( PARSE_ERROR& pe )
{
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, _( "Edit design rules" ),
wxEmptyString );
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
[&]( wxHyperlinkEvent& aEvent )
{
ShowBoardSetupDialog( _( "Custom Rules" ) );
} ) );
infobar->RemoveAllButtons();
infobar->AddButton( button );
infobar->AddCloseButton();
infobar->ShowMessage( _( "Could not compile custom design rules." ), wxICON_ERROR );
}
// Update the environment variables in the Python interpreter
if( aEnvVarsChanged )
PythonSyncEnvironmentVariables();

View File

@ -3103,11 +3103,10 @@ NETINFO_ITEM* CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet( const NET_ID& aCadstarNet
if( !mDoneSpacingClassWarning && !csNet.SpacingClassID.IsEmpty()
&& csNet.SpacingClassID != wxT( "NONE" ) )
{
wxLogWarning( _(
"The CADSTAR design contains nets with a 'Spacing Class' assigned. KiCad does "
"not have an equivalent to CADSTAR's Spacing Class so these elements were not "
"imported. Please review the design rules as copper pours will affected by "
"this." ) );
wxLogWarning( _( "The CADSTAR design contains nets with a 'Spacing Class' assigned. "
"KiCad does not have an equivalent to CADSTAR's Spacing Class so "
"these elements were not imported. Please review the design rules as "
"copper pours will affected by this." ) );
mDoneSpacingClassWarning = true;
}

View File

@ -226,7 +226,7 @@ void BOARD_INSPECTION_TOOL::reportClearance( DRC_CONSTRAINT_T aClearanceType, PC
catch( PARSE_ERROR& pe )
{
r->Report( "" );
r->Report( _( "Report incomplete: could not compile design rules. " )
r->Report( _( "Report incomplete: could not compile custom design rules. " )
+ "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
return;
}
@ -484,7 +484,7 @@ int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
if( compileError )
{
r->Report( "" );
r->Report( _( "Report incomplete: could not compile design rules. " )
r->Report( _( "Report incomplete: could not compile custom design rules. " )
+ "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
}
else
@ -521,7 +521,7 @@ int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
if( compileError )
{
r->Report( "" );
r->Report( _( "Report incomplete: could not compile design rules. " )
r->Report( _( "Report incomplete: could not compile custom design rules. " )
+ "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
}
else
@ -555,7 +555,7 @@ int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
if( compileError )
{
r->Report( "" );
r->Report( _( "Report incomplete: could not compile design rules. " )
r->Report( _( "Report incomplete: could not compile custom design rules. " )
+ "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
}
else
@ -593,7 +593,7 @@ int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
if( compileError )
{
r->Report( "" );
r->Report( _( "Report incomplete: could not compile design rules. " )
r->Report( _( "Report incomplete: could not compile custom design rules. " )
+ "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
}
else
@ -622,7 +622,7 @@ int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent )
if( compileError )
{
r->Report( "" );
r->Report( _( "Report incomplete: could not compile design rules. " )
r->Report( _( "Report incomplete: could not compile custom design rules. " )
+ "<a href='boardsetup'>" + _( "Show design rules." ) + "</a>" );
}
else