Default intersheet ref field visibility to off, and show warning
when user tries to edit via Symbol Properties or Field Propeties.
This commit is contained in:
parent
10d8db482e
commit
838bd7292c
|
@ -662,6 +662,18 @@ void DIALOG_SCH_FIELD_PROPERTIES::UpdateField( SCH_FIELD* aField, SCH_SHEET_PATH
|
|||
else if( fieldType == FOOTPRINT_FIELD )
|
||||
symbol->SetFootprint( m_text );
|
||||
}
|
||||
else if( parent && parent->Type() == SCH_GLOBAL_LABEL_T )
|
||||
{
|
||||
if( fieldType == 0 )
|
||||
{
|
||||
if( m_visible->GetValue() != parent->Schematic()->Settings().m_IntersheetRefsShow )
|
||||
{
|
||||
DisplayInfoMessage( this, _( "Intersheet reference visibility is "
|
||||
"controlled globally from "
|
||||
"Schematic Setup > General > Formatting" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool positioningModified = false;
|
||||
|
||||
|
|
|
@ -450,11 +450,24 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
|
|||
field.Offset( m_currentLabel->GetPosition() );
|
||||
|
||||
if( field.GetCanonicalName() == wxT( "Netclass" ) )
|
||||
{
|
||||
field.SetLayer( LAYER_NETCLASS_REFS );
|
||||
}
|
||||
else if( field.GetCanonicalName() == wxT( "Intersheetrefs" ) )
|
||||
{
|
||||
if( field.IsVisible() != m_Parent->Schematic().Settings().m_IntersheetRefsShow )
|
||||
{
|
||||
DisplayInfoMessage( this, _( "Intersheet reference visibility is "
|
||||
"controlled globally from "
|
||||
"Schematic Setup > General > Formatting" ) );
|
||||
}
|
||||
|
||||
field.SetLayer( LAYER_INTERSHEET_REFS );
|
||||
}
|
||||
else
|
||||
{
|
||||
field.SetLayer( LAYER_FIELDS );
|
||||
}
|
||||
}
|
||||
|
||||
if( positioningChanged( m_fields, m_currentLabel->GetFields() ) )
|
||||
|
|
|
@ -485,7 +485,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
initScreenZoom();
|
||||
SetSheetNumberAndCount();
|
||||
|
||||
RecomputeIntersheetRefs();
|
||||
RecomputeIntersheetRefs( true );
|
||||
GetCurrentSheet().UpdateAllScreenReferences();
|
||||
|
||||
// re-create junctions if needed. Eeschema optimizes wires by merging
|
||||
|
|
|
@ -1533,7 +1533,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
|
|||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::RecomputeIntersheetRefs()
|
||||
void SCH_EDIT_FRAME::RecomputeIntersheetRefs( bool autoplaceUninitialized )
|
||||
{
|
||||
std::map<wxString, std::set<int>>& pageRefsMap = Schematic().GetPageRefsMap();
|
||||
|
||||
|
@ -1579,10 +1579,15 @@ void SCH_EDIT_FRAME::RecomputeIntersheetRefs()
|
|||
|
||||
for( SCH_GLOBALLABEL* globalLabel : globalLabels )
|
||||
{
|
||||
globalLabel->GetFields()[0].SetVisible( show );
|
||||
std::vector<SCH_FIELD>& fields = globalLabel->GetFields();
|
||||
|
||||
fields[0].SetVisible( show );
|
||||
|
||||
if( show )
|
||||
{
|
||||
if( fields.size() == 1 && fields[0].GetTextPos() == globalLabel->GetPosition() )
|
||||
globalLabel->AutoplaceFields( GetScreen(), false );
|
||||
|
||||
GetScreen()->Update( globalLabel );
|
||||
GetCanvas()->GetView()->Update( globalLabel );
|
||||
}
|
||||
|
@ -1593,7 +1598,7 @@ void SCH_EDIT_FRAME::RecomputeIntersheetRefs()
|
|||
void SCH_EDIT_FRAME::ShowAllIntersheetRefs( bool aShow )
|
||||
{
|
||||
if( aShow )
|
||||
RecomputeIntersheetRefs();
|
||||
RecomputeIntersheetRefs( true );
|
||||
|
||||
GetCanvas()->GetView()->SetLayerVisible( LAYER_INTERSHEET_REFS, aShow );
|
||||
}
|
||||
|
|
|
@ -804,7 +804,7 @@ public:
|
|||
* Update the schematic's page reference map for all global labels, and refresh the labels
|
||||
* so that they are redrawn with up-to-date references.
|
||||
*/
|
||||
void RecomputeIntersheetRefs();
|
||||
void RecomputeIntersheetRefs( bool autoplaceUninitialized = false );
|
||||
|
||||
void ShowAllIntersheetRefs( bool aShow );
|
||||
|
||||
|
|
|
@ -1233,7 +1233,7 @@ SCH_GLOBALLABEL::SCH_GLOBALLABEL( const VECTOR2I& pos, const wxString& text ) :
|
|||
|
||||
m_fields.emplace_back( SCH_FIELD( pos, 0, this, _( "Sheet References" ) ) );
|
||||
m_fields[0].SetText( wxT( "${INTERSHEET_REFS}" ) );
|
||||
m_fields[0].SetVisible( true );
|
||||
m_fields[0].SetVisible( false );
|
||||
m_fields[0].SetLayer( LAYER_INTERSHEET_REFS );
|
||||
m_fields[0].SetVertJustify( GR_TEXT_V_ALIGN_CENTER );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue