Skip to content

Commit 86a737f

Browse files
committed
Add each variable monitor only if non-empty
1 parent 3bdebf5 commit 86a737f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎GridKit/Model/PhasorDynamics/SystemModel.hpp‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,20 @@ namespace GridKit
436436
{
437437
for (const auto* bus : buses_)
438438
{
439-
monitor_.addMonitor(bus->getMonitor());
439+
auto* mon = bus->getMonitor();
440+
if (mon && !mon->empty())
441+
{
442+
monitor_.addMonitor(mon);
443+
}
440444
}
441445

442446
for (const auto* component : components_)
443447
{
444-
monitor_.addMonitor(component->getMonitor());
448+
auto* mon = component->getMonitor();
449+
if (mon && !mon->empty())
450+
{
451+
monitor_.addMonitor(mon);
452+
}
445453
}
446454
}
447455

0 commit comments

Comments
 (0)