From 74dcc1b9d5b171a17a2d35078a247f686f91dd4d Mon Sep 17 00:00:00 2001 From: Fabien Corona Date: Mon, 20 Feb 2023 19:12:58 +0100 Subject: [PATCH] sim - Remember the option to save powers Fixes #13978 (cherry picked from commit 2a3b70b7eb3caf32a58b228065f3563d20faf77f) --- eeschema/dialogs/dialog_sim_command.h | 3 +++ qa/unittests/eeschema/sim/test_sim_regressions.cpp | 8 ++++++-- qa/unittests/eeschema/test_netlist_exporter_spice.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eeschema/dialogs/dialog_sim_command.h b/eeschema/dialogs/dialog_sim_command.h index d8ac2e3afb..be441ca579 100644 --- a/eeschema/dialogs/dialog_sim_command.h +++ b/eeschema/dialogs/dialog_sim_command.h @@ -71,6 +71,9 @@ public: if( !m_saveAllCurrents->GetValue() ) options &= ~NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS; + if( !m_saveAllDissipations->GetValue() ) + options &= ~NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS; + return options; } diff --git a/qa/unittests/eeschema/sim/test_sim_regressions.cpp b/qa/unittests/eeschema/sim/test_sim_regressions.cpp index 6600cd98e1..7b3352660a 100644 --- a/qa/unittests/eeschema/sim/test_sim_regressions.cpp +++ b/qa/unittests/eeschema/sim/test_sim_regressions.cpp @@ -75,12 +75,16 @@ public: if( m_SaveVoltages ) options |= NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES; + if( m_SavesDissipations ) + options |= NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS; + return options; } public: - bool m_SaveVoltages = true; - bool m_SaveCurrents = true; + bool m_SavesDissipations = false; + bool m_SaveVoltages = true; + bool m_SaveCurrents = true; }; diff --git a/qa/unittests/eeschema/test_netlist_exporter_spice.h b/qa/unittests/eeschema/test_netlist_exporter_spice.h index dcf4bbf8e1..85188fecaf 100644 --- a/qa/unittests/eeschema/test_netlist_exporter_spice.h +++ b/qa/unittests/eeschema/test_netlist_exporter_spice.h @@ -271,6 +271,7 @@ public: { return NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_VOLTAGES | NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_CURRENTS + | NETLIST_EXPORTER_SPICE::OPTION_SAVE_ALL_DISSIPATIONS | NETLIST_EXPORTER_SPICE::OPTION_ADJUST_INCLUDE_PATHS | NETLIST_EXPORTER_SPICE::OPTION_SIM_COMMAND; }