Clear pin net-name-driving cache when changing annotation.
Also update connectivity after clear annotation, annotate or back annotate. Also update status bar for highlighted nets. Fixes https://gitlab.com/kicad/code/kicad/issues/5170
This commit is contained in:
parent
8c94d88c78
commit
2b0b7a5153
|
@ -230,7 +230,7 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||||
std::vector<PARAM_CFG*> configParams;
|
std::vector<PARAM_CFG*> configParams;
|
||||||
|
|
||||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity,
|
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity,
|
||||||
&m_realTimeConnectivity, false ) );
|
&m_realTimeConnectivity, true ) );
|
||||||
|
|
||||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
|
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
|
||||||
&m_extraClearance, 0.002, 0.0, 1.0 ) );
|
&m_extraClearance, 0.002, 0.0, 1.0 ) );
|
||||||
|
|
|
@ -94,6 +94,9 @@ void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly, bool* aAppendUndo
|
||||||
SyncView();
|
SyncView();
|
||||||
GetCanvas()->Refresh();
|
GetCanvas()->Refresh();
|
||||||
OnModify();
|
OnModify();
|
||||||
|
|
||||||
|
// Must go after OnModify() so the connectivity graph has been updated
|
||||||
|
UpdateNetHighlightStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,6 +258,9 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
||||||
SyncView();
|
SyncView();
|
||||||
GetCanvas()->Refresh();
|
GetCanvas()->Refresh();
|
||||||
OnModify();
|
OnModify();
|
||||||
|
|
||||||
|
// Must go after OnModify() so the connectivity graph has been updated
|
||||||
|
UpdateNetHighlightStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <sch_reference_list.h>
|
#include <sch_reference_list.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
|
#include <tool/tool_manager.h>
|
||||||
|
#include <tool/actions.h>
|
||||||
|
|
||||||
#ifdef KICAD_SPICE
|
#ifdef KICAD_SPICE
|
||||||
#include <dialog_spice_model.h>
|
#include <dialog_spice_model.h>
|
||||||
|
@ -535,6 +537,9 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow()
|
||||||
GetParent()->UpdateItem( m_cmp );
|
GetParent()->UpdateItem( m_cmp );
|
||||||
GetParent()->OnModify();
|
GetParent()->OnModify();
|
||||||
|
|
||||||
|
// This must go after OnModify() so that the connectivity graph will have been updated.
|
||||||
|
GetParent()->GetToolManager()->PostEvent( EVENTS::SelectedItemsModified );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -483,6 +483,9 @@ void SCH_COMPONENT::SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref )
|
||||||
if( notInArray )
|
if( notInArray )
|
||||||
AddHierarchicalReference( path, ref, m_unit );
|
AddHierarchicalReference( path, ref, m_unit );
|
||||||
|
|
||||||
|
for( std::unique_ptr<SCH_PIN>& pin : m_pins )
|
||||||
|
pin->ClearDefaultNetName( sheet );
|
||||||
|
|
||||||
SCH_FIELD* rf = GetField( REFERENCE );
|
SCH_FIELD* rf = GetField( REFERENCE );
|
||||||
|
|
||||||
// @todo Should we really be checking for what is a "reasonable" position?
|
// @todo Should we really be checking for what is a "reasonable" position?
|
||||||
|
@ -871,6 +874,9 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheetPath )
|
||||||
instance.m_Reference = defRef;
|
instance.m_Reference = defRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for( std::unique_ptr<SCH_PIN>& pin : m_pins )
|
||||||
|
pin->ClearDefaultNetName( aSheetPath );
|
||||||
|
|
||||||
// These 2 changes do not work in complex hierarchy.
|
// These 2 changes do not work in complex hierarchy.
|
||||||
// When a clear annotation is made, the calling function must call a
|
// When a clear annotation is made, the calling function must call a
|
||||||
// UpdateAllScreenReferences for the active sheet.
|
// UpdateAllScreenReferences for the active sheet.
|
||||||
|
|
|
@ -1085,6 +1085,20 @@ void SCH_EDIT_FRAME::ShowChangedLanguage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_EDIT_FRAME::UpdateNetHighlightStatus()
|
||||||
|
{
|
||||||
|
if( const SCH_CONNECTION* conn = GetHighlightedConnection() )
|
||||||
|
{
|
||||||
|
SetStatusText( wxString::Format( _( "Highlighted net: %s" ),
|
||||||
|
UnescapeString( conn->Name() ) ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetStatusText( wxT( "" ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen )
|
void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen )
|
||||||
{
|
{
|
||||||
SCH_BASE_FRAME::SetScreen( aScreen );
|
SCH_BASE_FRAME::SetScreen( aScreen );
|
||||||
|
|
|
@ -939,6 +939,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
||||||
|
|
||||||
|
void UpdateNetHighlightStatus();
|
||||||
|
|
||||||
void ShowChangedLanguage() override;
|
void ShowChangedLanguage() override;
|
||||||
|
|
||||||
void SyncToolbars() override;
|
void SyncToolbars() override;
|
||||||
|
|
|
@ -98,6 +98,17 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_PIN::ClearDefaultNetName( const SCH_SHEET_PATH* aPath )
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock( m_netmap_mutex );
|
||||||
|
|
||||||
|
if( aPath )
|
||||||
|
m_net_name_map.erase( *aPath );
|
||||||
|
else
|
||||||
|
m_net_name_map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
|
wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
|
||||||
{
|
{
|
||||||
if( m_libPin->IsPowerConnection() )
|
if( m_libPin->IsPowerConnection() )
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
|
|
||||||
LIB_PIN* GetLibPin() const { return m_libPin; }
|
LIB_PIN* GetLibPin() const { return m_libPin; }
|
||||||
|
|
||||||
|
void ClearDefaultNetName( const SCH_SHEET_PATH* aPath );
|
||||||
wxString GetDefaultNetName( const SCH_SHEET_PATH aPath );
|
wxString GetDefaultNetName( const SCH_SHEET_PATH aPath );
|
||||||
|
|
||||||
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
|
wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;
|
||||||
|
|
|
@ -468,6 +468,12 @@ void BACK_ANNOTATE::applyChangelist()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !m_dryRun )
|
||||||
|
{
|
||||||
|
m_frame->RecalculateConnections( NO_CLEANUP );
|
||||||
|
m_frame->UpdateNetHighlightStatus();
|
||||||
|
}
|
||||||
|
|
||||||
m_reporter.ReportHead( msg, RPT_SEVERITY_INFO );
|
m_reporter.ReportHead( msg, RPT_SEVERITY_INFO );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,9 @@ int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
||||||
m_frame->ClearMsgPanel();
|
m_frame->ClearMsgPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( SCH_EDIT_FRAME* editFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
|
||||||
|
editFrame->UpdateNetHighlightStatus();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1141,9 +1141,11 @@ void SCH_EDIT_TOOL::editFieldText( SCH_FIELD* aField )
|
||||||
if( m_frame->eeconfig()->m_AutoplaceFields.enable || aField->GetParent()->Type() == SCH_SHEET_T )
|
if( m_frame->eeconfig()->m_AutoplaceFields.enable || aField->GetParent()->Type() == SCH_SHEET_T )
|
||||||
static_cast<SCH_ITEM*>( aField->GetParent() )->AutoAutoplaceFields( m_frame->GetScreen() );
|
static_cast<SCH_ITEM*>( aField->GetParent() )->AutoAutoplaceFields( m_frame->GetScreen() );
|
||||||
|
|
||||||
m_toolMgr->PostEvent( EVENTS::SelectedItemsModified );
|
|
||||||
m_frame->UpdateItem( aField );
|
m_frame->UpdateItem( aField );
|
||||||
m_frame->OnModify();
|
m_frame->OnModify();
|
||||||
|
|
||||||
|
// This must go after OnModify() so that the connectivity graph will have been updated.
|
||||||
|
m_toolMgr->PostEvent( EVENTS::SelectedItemsModified );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -870,11 +870,11 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
editFrame->SetCrossProbeConnection( conn );
|
editFrame->SetCrossProbeConnection( conn );
|
||||||
editFrame->SetStatusText( wxString::Format( _( "Highlighted net: %s" ),
|
|
||||||
UnescapeString( conn->Name() ) ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
editFrame->SetHighlightedConnection( conn );
|
editFrame->SetHighlightedConnection( conn );
|
||||||
|
editFrame->UpdateNetHighlightStatus();
|
||||||
|
|
||||||
TOOL_EVENT dummy;
|
TOOL_EVENT dummy;
|
||||||
editorControl->UpdateNetHighlighting( dummy );
|
editorControl->UpdateNetHighlighting( dummy );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue