Skip to content

Commit a844dfc

Browse files
fix: TurbineGovernorType1 initialization attributes (sogno-platform#493)
## Summary - The `explicit TurbineGovernorType1(const String &name)` constructor called `SimSignalComp(name, name)` directly, bypassing the member-initializer list for `mXg1`, `mXg2`, `mXg3`, and `mTm` - The Python binding `py::init<std::string>()` resolves to this constructor, so any Python-side `TurbineGovernorType1('name')` call produced an object that segfaulted in `initializeStates()` on `**mXg1 = TmRef` - Fix: initialize with a default value turning logger off
2 parents d5e4f89 + acf1c52 commit a844dfc

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

dpsim-models/include/dpsim-models/Signal/TurbineGovernorType1.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ class TurbineGovernorType1 : public SimSignalComp,
5555
const Attribute<Real>::Ptr mTm;
5656

5757
public:
58-
///
59-
explicit TurbineGovernorType1(const String &name)
60-
: SimSignalComp(name, name) {}
61-
62-
/// Constructor with log level
63-
TurbineGovernorType1(const String &name, CPS::Logger::Level logLevel);
58+
TurbineGovernorType1(const String &name,
59+
Logger::Level logLevel = Logger::Level::off);
6460

6561
/// Initializes exciter parameters
6662
void setParameters(Real T3, Real T4, Real T5, Real Tc, Real Ts, Real R,

0 commit comments

Comments
 (0)