Disallow selection of intersheet references.
This commit is contained in:
parent
4b315b0fda
commit
c1b34b02b5
|
@ -1160,9 +1160,9 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
|
|||
int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
|
||||
{
|
||||
SCHEMATIC_SETTINGS& settings = Schematic().Settings();
|
||||
std::vector<int> pagesNumbers;
|
||||
SCH_GLOBALLABEL* gLabel;
|
||||
SCH_IREF* iref;
|
||||
std::vector<int> pagesNumbers;
|
||||
SCH_GLOBALLABEL* gLabel;
|
||||
SCH_IREF* iref;
|
||||
|
||||
m_labelTable.clear();
|
||||
|
||||
|
@ -1171,21 +1171,17 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
|
|||
/* Iterate over screens */
|
||||
for( SCH_SCREEN* screen = screens.GetFirst(); screen != NULL; screen = screens.GetNext() )
|
||||
{
|
||||
|
||||
pagesNumbers.clear();
|
||||
|
||||
/* Find in which sheets this screen is used */
|
||||
for( const SCH_SHEET_PATH& sheet : Schematic().GetSheets() )
|
||||
{
|
||||
|
||||
if( sheet.LastScreen() == screen )
|
||||
pagesNumbers.push_back( sheet.GetPageNumber() );
|
||||
|
||||
}
|
||||
|
||||
for( SCH_ITEM* item : screen->Items() )
|
||||
{
|
||||
|
||||
if( item->Type() == SCH_GLOBAL_LABEL_T )
|
||||
{
|
||||
gLabel = static_cast<SCH_GLOBALLABEL*>( item );
|
||||
|
@ -1216,7 +1212,6 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
|
|||
iref->GetRefTable()->insert( iref->GetRefTable()->end(),
|
||||
pagesNumbers.begin(),
|
||||
pagesNumbers.end() );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1227,9 +1222,11 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
|
|||
for( SCH_GLOBALLABEL* iter : m_labelTable )
|
||||
{
|
||||
if( iter->GetText().IsSameAs( item->GetText() ) && ( iter != item ) )
|
||||
{
|
||||
iter->GetIref()->GetRefTable()->insert( iter->GetIref()->GetRefTable()->end(),
|
||||
item->GetIref()->GetRefTable()->begin(),
|
||||
item->GetIref()->GetRefTable()->end() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1241,7 +1238,8 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
|
|||
iref = item->GetIref();
|
||||
|
||||
sort( iref->GetRefTable()->begin(), iref->GetRefTable()->end() );
|
||||
iref->GetRefTable()->erase( unique( iref->GetRefTable()->begin(), iref->GetRefTable()->end() ),
|
||||
iref->GetRefTable()->erase( unique( iref->GetRefTable()->begin(),
|
||||
iref->GetRefTable()->end() ),
|
||||
iref->GetRefTable()->end() );
|
||||
|
||||
text.Printf( "%s", settings.m_IntersheetsRefPrefix );
|
||||
|
@ -1253,7 +1251,6 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
for( int ref : *( iref->GetRefTable() ) )
|
||||
{
|
||||
tmp.Printf( "%d,", ref );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019-2020 Franck Jullien, franck.jullien at gmail.com
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -29,8 +29,9 @@
|
|||
#include <tools/sch_editor_control.h>
|
||||
#include <tool/tool_manager.h>
|
||||
|
||||
SCH_IREF::SCH_IREF( const wxPoint& pos, const wxString& text, SCH_GLOBALLABEL* aParent, KICAD_T aType )
|
||||
: SCH_TEXT( pos, text, SCH_IREF_T )
|
||||
SCH_IREF::SCH_IREF( const wxPoint& pos, const wxString& text, SCH_GLOBALLABEL* aParent,
|
||||
KICAD_T aType ) :
|
||||
SCH_TEXT( pos, text, SCH_IREF_T )
|
||||
|
||||
{
|
||||
m_Layer = LAYER_GLOBLABEL;
|
||||
|
|
|
@ -39,7 +39,7 @@ class SCH_IREF : public SCH_TEXT
|
|||
{
|
||||
public:
|
||||
SCH_IREF( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString,
|
||||
SCH_GLOBALLABEL* aParent = nullptr, KICAD_T aType = SCH_IREF_T );
|
||||
SCH_GLOBALLABEL* aParent = nullptr, KICAD_T aType = SCH_IREF_T );
|
||||
|
||||
~SCH_IREF() { }
|
||||
|
||||
|
@ -59,11 +59,6 @@ public:
|
|||
|
||||
bool IsDangling() const override { return false; }
|
||||
|
||||
wxPoint GetSchematicTextOffset() const
|
||||
{
|
||||
return wxPoint(0, 0);
|
||||
}
|
||||
|
||||
void CopyParentStyle();
|
||||
void PlaceAtDefaultPosition();
|
||||
|
||||
|
@ -73,10 +68,6 @@ public:
|
|||
|
||||
void SetParent( SCH_GLOBALLABEL* parent ) { m_parent = parent; }
|
||||
|
||||
int GetOwnPageNumber() { return m_ownPageNumber; }
|
||||
|
||||
void SetOwnPageNumber( int page ) { m_ownPageNumber = page; }
|
||||
|
||||
SCH_SCREEN* GetScreen() { return m_screen; }
|
||||
|
||||
void SetScreen( SCH_SCREEN* screen ) { m_screen = screen; }
|
||||
|
|
|
@ -1462,6 +1462,9 @@ bool EE_SELECTION_TOOL::Selectable( const EDA_ITEM* aItem, bool checkVisibilityO
|
|||
case SCH_MARKER_T: // Always selectable
|
||||
return true;
|
||||
|
||||
case SCH_IREF_T: // Never selectable
|
||||
return false;
|
||||
|
||||
default: // Suppress warnings
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue