diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 7aed621f74..c8cb12b238 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -226,7 +226,9 @@ wxString SCH_FIELD::GetShownText( bool aAllowExtraText, int aDepth ) const return GetShownText( ¤tSheet, aAllowExtraText, aDepth, variantName ); } else + { return GetShownText( nullptr, aAllowExtraText, aDepth ); + } } diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index 020b5b81c7..a5c60057f9 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -794,6 +794,8 @@ bool SCH_LABEL_BASE::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* toke if( !schematic ) return false; + wxString variant = schematic->GetCurrentVariant(); + if( operatingPoint.Matches( *token ) ) { int precision = 3; @@ -865,7 +867,7 @@ bool SCH_LABEL_BASE::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* toke for( SCH_RULE_AREA* ruleArea : directive->GetConnectedRuleAreas() ) { - if( ruleArea->GetExcludedFromBOM() ) + if( ruleArea->GetExcludedFromBOM( aPath, variant ) ) *token = _( "Excluded from BOM" ); } @@ -878,7 +880,7 @@ bool SCH_LABEL_BASE::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* toke for( SCH_RULE_AREA* ruleArea : directive->GetConnectedRuleAreas() ) { - if( ruleArea->GetExcludedFromBoard() ) + if( ruleArea->GetExcludedFromBoard( aPath, variant ) ) *token = _( "Excluded from board" ); } @@ -891,7 +893,7 @@ bool SCH_LABEL_BASE::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* toke for( SCH_RULE_AREA* ruleArea : directive->GetConnectedRuleAreas() ) { - if( ruleArea->GetExcludedFromSim() ) + if( ruleArea->GetExcludedFromSim( aPath, variant ) ) *token = _( "Excluded from simulation" ); } @@ -904,7 +906,7 @@ bool SCH_LABEL_BASE::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* toke for( SCH_RULE_AREA* ruleArea : directive->GetConnectedRuleAreas() ) { - if( ruleArea->GetDNP() ) + if( ruleArea->GetDNP( aPath, variant ) ) *token = _( "DNP" ); } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index b889704b68..1d0411e3d9 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -259,6 +259,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in } PROJECT* project = &schematic->Project(); + wxString variant = schematic->GetCurrentVariant(); // We cannot resolve text variables initially on load as we need to first load the screen and // then parse the hierarchy. So skip the resolution if the screen isn't set yet @@ -286,7 +287,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in { *token = wxEmptyString; - if( aPath->GetExcludedFromBOM() || this->ResolveExcludedFromBOM() ) + if( aPath->GetExcludedFromBOM( variant ) || this->ResolveExcludedFromBOM( aPath, variant ) ) *token = _( "Excluded from BOM" ); return true; @@ -295,7 +296,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in { *token = wxEmptyString; - if( aPath->GetExcludedFromBoard() || this->ResolveExcludedFromBoard() ) + if( aPath->GetExcludedFromBoard( variant ) || this->ResolveExcludedFromBoard( aPath, variant ) ) *token = _( "Excluded from board" ); return true; @@ -304,7 +305,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in { *token = wxEmptyString; - if( aPath->GetExcludedFromSim() || this->ResolveExcludedFromSim() ) + if( aPath->GetExcludedFromSim( variant ) || this->ResolveExcludedFromSim( aPath, variant ) ) *token = _( "Excluded from simulation" ); return true; @@ -313,7 +314,7 @@ bool SCH_SHEET::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, in { *token = wxEmptyString; - if( aPath->GetDNP() || this->ResolveDNP() ) + if( aPath->GetDNP( variant ) || this->ResolveDNP( aPath, variant ) ) *token = _( "DNP" ); return true; diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 04b2f28bd4..af136b4131 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -1797,6 +1797,8 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, if( !schematic ) return false; + wxString variant = aVariantName.IsEmpty() ? schematic->GetCurrentVariant() : aVariantName; + if( operatingPoint.Matches( *token ) ) { wxString pin( operatingPoint.GetMatch( *token, 1 ).Lower() ); @@ -1991,7 +1993,7 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, { *token = wxEmptyString; - if( aPath->GetExcludedFromBOM() || this->ResolveExcludedFromBOM() ) + if( aPath->GetExcludedFromBOM( variant ) || this->ResolveExcludedFromBOM( aPath, variant ) ) *token = _( "Excluded from BOM" ); return true; @@ -2000,7 +2002,7 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, { *token = wxEmptyString; - if( aPath->GetExcludedFromBoard() || this->ResolveExcludedFromBoard() ) + if( aPath->GetExcludedFromBoard( variant ) || this->ResolveExcludedFromBoard( aPath, variant ) ) *token = _( "Excluded from board" ); return true; @@ -2009,7 +2011,7 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, { *token = wxEmptyString; - if( aPath->GetExcludedFromSim() || this->ResolveExcludedFromSim() ) + if( aPath->GetExcludedFromSim( variant ) || this->ResolveExcludedFromSim( aPath, variant ) ) *token = _( "Excluded from simulation" ); return true; @@ -2018,9 +2020,7 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, { *token = wxEmptyString; - wxString variant = aVariantName.IsEmpty() ? schematic->GetCurrentVariant() : aVariantName; - - if( aPath->GetDNP() || this->ResolveDNP( aPath, variant ) ) + if( aPath->GetDNP( variant ) || this->ResolveDNP( aPath, variant ) ) *token = _( "DNP" ); return true;