Fill in some missing variant code.

In particular:

Resolving the DNP/InBOM/OnBoard/etc. flags needs to take into account
the variant.

Writing a SPICE netlist needs to take into account the variant.

Updating a simulation tuned value needs to write to the current
variant (this is only partly implemented, with a TODO for the hard
part).

Painting of fields needs to paint the current variant value.

Still missing is reading/writing fields from the simulation model
dialog to/from the current variant.
This commit is contained in:
Jeff Young
2026-01-28 21:32:34 +00:00
parent 1ffc780847
commit daf13adabb
19 changed files with 104 additions and 54 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataToWindow()
m_cbExcludeFromSim->SetValue( m_sheet->GetExcludedFromSim( &instance, variantName ) );
m_cbExcludeFromBom->SetValue( m_sheet->GetExcludedFromBOM( &instance, variantName ) );
m_cbExcludeFromBoard->SetValue( m_sheet->GetExcludedFromBoard() );
m_cbExcludeFromBoard->SetValue( m_sheet->GetExcludedFromBoard( &instance, variantName ) );
m_cbDNP->SetValue( m_sheet->GetDNP( &instance, variantName ) );
instance.push_back( m_sheet );
@@ -628,8 +628,8 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow()
m_cbExcludeFromSim->SetValue( m_symbol->GetExcludedFromSim( &sheetPath, variantName ) );
m_cbExcludeFromBom->SetValue( m_symbol->GetExcludedFromBOM( &sheetPath, variantName ) );
m_cbExcludeFromBoard->SetValue( m_symbol->GetExcludedFromBoard() );
m_cbExcludeFromPosFiles->SetValue( m_symbol->GetExcludedFromPosFiles() );
m_cbExcludeFromBoard->SetValue( m_symbol->GetExcludedFromBoard( &sheetPath, variantName ) );
m_cbExcludeFromPosFiles->SetValue( m_symbol->GetExcludedFromPosFiles( &sheetPath, variantName ) );
m_cbDNP->SetValue( m_symbol->GetDNP( &sheetPath, variantName ) );
if( m_part )
@@ -786,11 +786,11 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
if( !m_pinGrid->CommitPendingChanges() )
return false;
SCH_COMMIT commit( GetParent() );
SCH_SCREEN* currentScreen = GetParent()->GetScreen();
SCH_COMMIT commit( GetParent() );
SCH_SCREEN* currentScreen = GetParent()->GetScreen();
SCH_SHEET_PATH currentSheet = GetParent()->Schematic().CurrentSheet();
wxString currentVariant = GetParent()->Schematic().GetCurrentVariant();
bool replaceOnCurrentScreen;
wxString currentVariant = GetParent()->Schematic().GetCurrentVariant();
bool replaceOnCurrentScreen;
wxCHECK( currentScreen, false );
+3 -2
View File
@@ -1862,10 +1862,11 @@ int ERC_TESTER::TestSimModelIssues()
WX_STRING_REPORTER reporter;
int err_count = 0;
SIM_LIB_MGR libMgr( &m_schematic->Project() );
wxString variant = m_schematic->GetCurrentVariant();
for( SCH_SHEET_PATH& sheet : m_sheetList )
{
if( sheet.GetExcludedFromSim() )
if( sheet.GetExcludedFromSim( variant ) )
continue;
std::vector<SCH_MARKER*> markers;
@@ -1882,7 +1883,7 @@ int ERC_TESTER::TestSimModelIssues()
// Reset for each symbol
reporter.Clear();
SIM_LIBRARY::MODEL model = libMgr.CreateModel( &sheet, *symbol, true, 0, reporter );
SIM_LIBRARY::MODEL model = libMgr.CreateModel( &sheet, *symbol, true, 0, variant, reporter );
if( reporter.HasMessage() )
{
@@ -125,6 +125,7 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
{
std::set<std::string> refNames; // Set of reference names to check for duplication.
int ncCounter = 1;
wxString variant = m_schematic->GetCurrentVariant();
ReadDirectives( aNetlistOptions );
@@ -178,7 +179,7 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
{
SCH_SYMBOL* symbol = findNextSymbol( item, sheet );
if( !symbol || symbol->ResolveExcludedFromSim() )
if( !symbol || symbol->ResolveExcludedFromSim( &sheet, variant ) )
continue;
try
@@ -193,11 +194,11 @@ bool NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries( unsigned aNetlistOptions
if( field.GetId() == FIELD_T::REFERENCE )
spiceItem.fields.back().SetText( symbol->GetRef( &sheet ) );
else
spiceItem.fields.back().SetText( field.GetShownText( &sheet, false ) );
spiceItem.fields.back().SetText( field.GetShownText( &sheet, false, 0, variant ) );
}
readRefName( sheet, *symbol, spiceItem, refNames );
readModel( sheet, *symbol, spiceItem, aReporter );
readModel( sheet, *symbol, spiceItem, variant, aReporter );
readPinNumbers( *symbol, spiceItem, pins );
readPinNetNames( *symbol, spiceItem, pins, ncCounter );
readNodePattern( spiceItem );
@@ -494,14 +495,14 @@ void NETLIST_EXPORTER_SPICE::readRefName( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aS
}
void NETLIST_EXPORTER_SPICE::readModel( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol,
SPICE_ITEM& aItem, REPORTER& aReporter )
void NETLIST_EXPORTER_SPICE::readModel( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem,
const wxString& aVariantName, REPORTER& aReporter )
{
// For multi-unit symbols, collect merged Sim.Pins from all units
wxString mergedSimPins = collectMergedSimPins( aSymbol, aSheet );
const SIM_LIBRARY::MODEL& libModel = m_libMgr.CreateModel( &aSheet, aSymbol, true, 0, aReporter,
mergedSimPins );
const SIM_LIBRARY::MODEL& libModel = m_libMgr.CreateModel( &aSheet, aSymbol, true, 0, aVariantName,
aReporter, mergedSimPins );
aItem.baseModelName = libModel.name;
aItem.model = &libModel.model;
@@ -162,7 +162,7 @@ private:
wxString collectMergedSimPins( SCH_SYMBOL& aSymbol, const SCH_SHEET_PATH& aSheet );
void readModel( SCH_SHEET_PATH& aSheet, SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem,
REPORTER& aReporter );
const wxString& aVariantName, REPORTER& aReporter );
void readPinNumbers( SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem,
const std::vector<PIN_INFO>& aPins );
void readPinNetNames( SCH_SYMBOL& aSymbol, SPICE_ITEM& aItem,
@@ -177,6 +177,7 @@ private:
void writeModels( OUTPUTFORMATTER& aFormatter );
void writeItems( OUTPUTFORMATTER& aFormatter );
private:
SIM_LIB_MGR m_libMgr; ///< Holds libraries and models
NAME_GENERATOR m_modelNameGenerator; ///< Generates unique model names
+8 -6
View File
@@ -1579,6 +1579,8 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
SCHEMATIC_SETTINGS& settings = m_schematic->Settings();
SIM_LIB_MGR simLibMgr( &Prj() );
NULL_REPORTER devnull;
SCH_SHEET_PATH& sheetPath = GetCurrentSheet();
wxString variant = m_schematic->GetCurrentVariant();
// Patch for bug early in V7.99 dev
if( settings.m_OPO_VRange.EndsWith( 'A' ) )
@@ -1623,7 +1625,7 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
//
for( SCH_ITEM* item : GetScreen()->Items() )
{
if( GetCurrentSheet().GetExcludedFromSim() )
if( sheetPath.GetExcludedFromSim( variant ) )
continue;
if( item->Type() == SCH_LINE_T )
@@ -1640,12 +1642,12 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
else if( item->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
wxString ref = symbol->GetRef( &GetCurrentSheet() );
std::vector<SCH_PIN*> pins = symbol->GetPins( &GetCurrentSheet() );
wxString ref = symbol->GetRef( &sheetPath );
std::vector<SCH_PIN*> pins = symbol->GetPins( &sheetPath );
// Power symbols and other symbols which have the reference starting with "#" are
// not included in simulation
if( ref.StartsWith( '#' ) || symbol->ResolveExcludedFromSim() )
if( ref.StartsWith( '#' ) || symbol->ResolveExcludedFromSim( &sheetPath, variant ) )
continue;
for( SCH_PIN* pin : pins )
@@ -1680,7 +1682,7 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
simLibMgr.SetFilesStack( std::move( embeddedFilesStack ) );
SIM_MODEL& model = simLibMgr.CreateModel( &GetCurrentSheet(), *symbol, true, 0, devnull ).model;
SIM_MODEL& model = simLibMgr.CreateModel( &sheetPath, *symbol, true, 0, variant, devnull ).model;
SPICE_ITEM spiceItem;
spiceItem.refName = ref;
@@ -1716,7 +1718,7 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
SCH_LINE* longestWire = nullptr;
double length = 0.0;
if( subgraph->GetSheet().GetExcludedFromSim() )
if( subgraph->GetSheet().GetExcludedFromSim( variant ) )
continue;
for( SCH_ITEM* item : subgraph->GetItems() )
+7 -5
View File
@@ -693,10 +693,11 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks, wxStyl
return;
}
auto textVarRef = [&]( int pt )
{
return pt >= 2 && scintilla->GetCharAt( pt - 2 ) == '$' && scintilla->GetCharAt( pt - 1 ) == '{';
};
auto textVarRef =
[&]( int pt )
{
return pt >= 2 && scintilla->GetCharAt( pt - 2 ) == '$' && scintilla->GetCharAt( pt - 1 ) == '{';
};
// Check for cross-reference
if( start > 1 && scintilla->GetCharAt( start - 1 ) == ':' )
@@ -716,6 +717,7 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks, wxStyl
{
NULL_REPORTER devnull;
SCH_SHEET_PATH& sheet = schematic->CurrentSheet();
wxString variant = schematic->GetCurrentVariant();
SIM_LIB_MGR mgr( &schematic->Project() );
std::vector<EMBEDDED_FILES*> embeddedFilesStack;
@@ -729,7 +731,7 @@ void SCH_FIELD::OnScintillaCharAdded( SCINTILLA_TRICKS* aScintillaTricks, wxStyl
mgr.SetFilesStack( std::move( embeddedFilesStack ) );
SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, true, 0, devnull ).model;
SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, true, 0, variant, devnull ).model;
for( wxString pin : model.GetPinNames() )
{
+20 -4
View File
@@ -2909,7 +2909,16 @@ void SCH_PAINTER::draw( const SCH_FIELD* aField, int aLayer, bool aDimmed )
return;
}
wxString shownText = aField->GetShownText( true );
SCH_SHEET_PATH* sheetPath = nullptr;
wxString variant;
if( m_schematic )
{
sheetPath = &m_schematic->CurrentSheet();
variant = m_schematic->GetCurrentVariant();
}
wxString shownText = aField->GetShownText( sheetPath, true, 0, variant );
if( shownText.IsEmpty() )
return;
@@ -3282,13 +3291,20 @@ void SCH_PAINTER::draw( const SCH_DIRECTIVE_LABEL* aLabel, int aLayer, bool aDim
void SCH_PAINTER::draw( const SCH_SHEET* aSheet, int aLayer )
{
bool DNP = false;
SCH_SHEET_PATH* sheetPath = nullptr;
wxString variant;
bool DNP = false;
if( m_schematic )
DNP = aSheet->GetDNP( &m_schematic->CurrentSheet(), m_schematic->GetCurrentVariant() );
{
sheetPath = &m_schematic->CurrentSheet();
variant = m_schematic->GetCurrentVariant();
DNP = aSheet->GetDNP( sheetPath, variant );
}
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
bool markExclusion = eeconfig()->m_Appearance.mark_sim_exclusions && aSheet->GetExcludedFromSim();
bool markExclusion = eeconfig()->m_Appearance.mark_sim_exclusions
&& aSheet->GetExcludedFromSim( sheetPath, variant );
if( m_schSettings.IsPrinting() && drawingShadows )
return;
+15
View File
@@ -358,6 +358,21 @@ bool SCH_SHEET_PATH::GetExcludedFromBoard() const
}
bool SCH_SHEET_PATH::GetExcludedFromBoard( const wxString& aVariantName ) const
{
if( aVariantName.IsEmpty() )
return GetExcludedFromBoard();
for( SCH_SHEET* sheet : m_sheets )
{
if( sheet->GetExcludedFromBoard( this, aVariantName ) )
return true;
}
return false;
}
bool SCH_SHEET_PATH::GetDNP() const
{
for( SCH_SHEET* sheet : m_sheets )
+1
View File
@@ -365,6 +365,7 @@ public:
bool GetExcludedFromBOM() const;
bool GetExcludedFromBOM( const wxString& aVariantName ) const;
bool GetExcludedFromBoard() const;
bool GetExcludedFromBoard( const wxString& aVariantName ) const;
bool GetDNP() const;
bool GetDNP( const wxString& aVariantName ) const;
+4 -4
View File
@@ -1294,10 +1294,10 @@ void SCH_SYMBOL::SetValueFieldText( const wxString& aValue, const SCH_SHEET_PATH
const wxString SCH_SYMBOL::GetFootprintFieldText( bool aResolve, const SCH_SHEET_PATH* aPath,
bool aAllowExtraText ) const
bool aAllowExtraText, const wxString& aVariantName ) const
{
if( aResolve )
return GetField( FIELD_T::FOOTPRINT )->GetShownText( aPath, aAllowExtraText );
return GetField( FIELD_T::FOOTPRINT )->GetShownText( aPath, aAllowExtraText, 0, aVariantName );
return GetField( FIELD_T::FOOTPRINT )->GetText();
}
@@ -1826,8 +1826,8 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token,
simLibMgr.SetFilesStack( std::move( embeddedFilesStack ) );
NULL_REPORTER devnull;
SIM_MODEL& model =
simLibMgr.CreateModel( aPath, const_cast<SCH_SYMBOL&>( *this ), true, aDepth + 1, devnull ).model;
SIM_MODEL& model = simLibMgr.CreateModel( aPath, const_cast<SCH_SYMBOL&>( *this ), true, aDepth + 1,
aVariantName, devnull ).model;
SPICE_ITEM spiceItem;
spiceItem.refName = GetRef( aPath );
+1 -1
View File
@@ -495,7 +495,7 @@ public:
const wxString& aVariantName = wxEmptyString );
const wxString GetFootprintFieldText( bool aResolve, const SCH_SHEET_PATH* aPath,
bool aAllowExtraText ) const;
bool aAllowExtraText, const wxString& aVariantName = wxEmptyString ) const;
void SetFootprintFieldText( const wxString& aFootprint );
/*
+3 -3
View File
@@ -200,8 +200,8 @@ SIM_MODEL& SIM_LIB_MGR::CreateModel( const SIM_MODEL* aBaseModel, const std::vec
}
SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel( const SCH_SHEET_PATH* aSheetPath, SCH_SYMBOL& aSymbol,
bool aResolve, int aDepth, REPORTER& aReporter,
const wxString& aMergedSimPins )
bool aResolve, int aDepth, const wxString& aVariantName,
REPORTER& aReporter, const wxString& aMergedSimPins )
{
// Note: currently this creates a resolved model (all Kicad variables references are resolved
// before building the model).
@@ -227,7 +227,7 @@ SIM_LIBRARY::MODEL SIM_LIB_MGR::CreateModel( const SCH_SHEET_PATH* aSheetPath, S
if( !aMergedSimPins.IsEmpty() && field.GetName() == SIM_PINS_FIELD )
fields.back().SetText( aMergedSimPins );
else
fields.back().SetText( field.GetShownText( aSheetPath, false, aDepth ) );
fields.back().SetText( field.GetShownText( aSheetPath, false, aDepth, aVariantName ) );
}
}
+2 -2
View File
@@ -66,8 +66,8 @@ public:
// aMergedSimPins is an optional merged Sim.Pins string from all units of a multi-unit symbol.
// If provided (non-empty), it will be used instead of the symbol's Sim.Pins field.
SIM_LIBRARY::MODEL CreateModel( const SCH_SHEET_PATH* aSheetPath, SCH_SYMBOL& aSymbol,
bool aResolve, int aDepth, REPORTER& aReporter,
const wxString& aMergedSimPins = wxEmptyString );
bool aResolve, int aDepth, const wxString& aVariantName,
REPORTER& aReporter, const wxString& aMergedSimPins = wxEmptyString );
SIM_LIBRARY::MODEL CreateModel( const std::vector<SCH_FIELD>& aFields, bool aResolve, int aDepth,
const std::vector<SCH_PIN*>& aPins, REPORTER& aReporter );
+4 -1
View File
@@ -445,7 +445,8 @@ void SIM_MODEL::ReadDataFields( const std::vector<SCH_FIELD>* aFields, bool aRes
}
void SIM_MODEL::WriteFields( std::vector<SCH_FIELD>& aFields ) const
void SIM_MODEL::WriteFields( std::vector<SCH_FIELD>& aFields, const SCH_SHEET_PATH* aSheetPath,
const wxString& aVariantName ) const
{
// Remove duplicate fields: they are at the end of list
for( size_t ii = aFields.size() - 1; ii > 0; ii-- )
@@ -465,6 +466,8 @@ void SIM_MODEL::WriteFields( std::vector<SCH_FIELD>& aFields ) const
aFields.erase( aFields.begin() + ii );
}
// TODO: handle writing to given instance & variant
SetFieldValue( aFields, SIM_DEVICE_FIELD, m_serializer->GenerateDevice(), false );
SetFieldValue( aFields, SIM_DEVICE_SUBTYPE_FIELD, m_serializer->GenerateDeviceSubtype(),
false );
+2 -1
View File
@@ -443,7 +443,8 @@ public:
void ReadDataFields( const std::vector<SCH_FIELD>* aFields, bool aResolve, int aDepth,
const std::vector<SCH_PIN*>& aPins );
void WriteFields( std::vector<SCH_FIELD>& aFields ) const;
void WriteFields( std::vector<SCH_FIELD>& aFields, const SCH_SHEET_PATH* aSheetPath = nullptr,
const wxString& aVariantName = wxEmptyString ) const;
SPICE_INFO GetSpiceInfo() const { return SpiceInfo( GetType() ); }
+4 -2
View File
@@ -1694,6 +1694,8 @@ void SIMULATOR_FRAME_UI::AddTuner( const SCH_SHEET_PATH& aSheetPath, SCH_SYMBOL*
void SIMULATOR_FRAME_UI::UpdateTunerValue( const SCH_SHEET_PATH& aSheetPath, const KIID& aSymbol,
const wxString& aRef, const wxString& aValue )
{
SCHEMATIC& schematic = m_schematicFrame->Schematic();
wxString variant = schematic.GetCurrentVariant();
SCH_ITEM* item = aSheetPath.ResolveItem( aSymbol );
SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( item );
@@ -1718,7 +1720,7 @@ void SIMULATOR_FRAME_UI::UpdateTunerValue( const SCH_SHEET_PATH& aSheetPath, con
mgr.SetFilesStack( std::move( embeddedFilesStack ) );
SIM_MODEL& model = mgr.CreateModel( &aSheetPath, *symbol, true, 0, devnull ).model;
SIM_MODEL& model = mgr.CreateModel( &aSheetPath, *symbol, true, 0, variant, devnull ).model;
const SIM_MODEL::PARAM* tunerParam = model.GetTunerParam();
@@ -1730,7 +1732,7 @@ void SIMULATOR_FRAME_UI::UpdateTunerValue( const SCH_SHEET_PATH& aSheetPath, con
}
model.SetParamValue( tunerParam->info.name, std::string( aValue.ToUTF8() ) );
model.WriteFields( symbol->GetFields() );
model.WriteFields( symbol->GetFields(), &aSheetPath, variant );
m_schematicFrame->UpdateItem( symbol, false, true );
m_schematicFrame->OnModify();
+8 -6
View File
@@ -3292,8 +3292,10 @@ void SCH_EDIT_TOOL::collectUnits( const SCH_SELECTION&
int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent )
{
SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } );
SCH_COMMIT commit( m_toolMgr );
SCH_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_SYMBOL_T } );
SCH_COMMIT commit( m_toolMgr );
SCH_SHEET_PATH* sheet = &m_frame->GetCurrentSheet();
wxString variant = m_frame->Schematic().GetCurrentVariant();
std::set<std::pair<SCH_SYMBOL*, SCH_SCREEN*>> collectedUnits;
@@ -3302,10 +3304,10 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent )
for( const auto& [symbol, _] : collectedUnits )
{
if( ( aEvent.IsAction( &SCH_ACTIONS::setDNP ) && !symbol->GetDNP() )
|| ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromSimulation ) && !symbol->GetExcludedFromSim() )
|| ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBOM ) && !symbol->GetExcludedFromBOM() )
|| ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBoard ) && !symbol->GetExcludedFromBoard() ) )
if( ( aEvent.IsAction( &SCH_ACTIONS::setDNP ) && !symbol->GetDNP( sheet, variant ) )
|| ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromSimulation ) && !symbol->GetExcludedFromSim( sheet, variant ) )
|| ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBOM ) && !symbol->GetExcludedFromBOM( sheet, variant ) )
|| ( aEvent.IsAction( &SCH_ACTIONS::setExcludeFromBoard ) && !symbol->GetExcludedFromBoard( sheet, variant ) ) )
{
new_state = true;
break;
+5 -2
View File
@@ -763,6 +763,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
EDA_ITEM* item = selTool->GetNode( aPosition );
SCH_SHEET_PATH& sheet = m_frame->GetCurrentSheet();
wxString variant = m_frame->Schematic().GetCurrentVariant();
if( !item )
return false;
@@ -789,7 +790,7 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
mgr.SetFilesStack( std::move( embeddedFilesStack ) );
SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, true, 0, reporter ).model;
SIM_MODEL& model = mgr.CreateModel( &sheet, *symbol, true, 0, variant, reporter ).model;
if( reporter.HasMessage() )
THROW_IO_ERROR( reporter.GetMessages() );
@@ -3197,6 +3198,8 @@ int SCH_EDITOR_CONTROL::ToggleERCExclusions( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::MarkSimExclusions( const TOOL_EVENT& aEvent )
{
SCH_SHEET_PATH* sheetPath = &m_frame->GetCurrentSheet();
wxString variant = m_frame->Schematic().GetCurrentVariant();
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
cfg->m_Appearance.mark_sim_exclusions = !cfg->m_Appearance.mark_sim_exclusions;
@@ -3226,7 +3229,7 @@ int SCH_EDITOR_CONTROL::MarkSimExclusions( const TOOL_EVENT& aEvent )
},
RECURSE_MODE::NO_RECURSE );
if( item->GetExcludedFromSim() )
if( item->GetExcludedFromSim( sheetPath, variant ) )
flags |= KIGFX::GEOMETRY | KIGFX::REPAINT;
}