summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-05-01 15:13:37 +0200
committer couriersud <couriersud@gmx.org>2020-05-01 15:13:37 +0200
commitbfa908aa3262a75b31c4ca4b3d3e5cc43e616c42 (patch)
treef49bd02512b6f8c54f506b625227110dad4ed6f2
parent516f80e31d3485e242bb0cb2044ab145acbd2f67 (diff)
netlist: Fix a bug introduced by latest nld_log change. (nw)
-rw-r--r--src/lib/netlist/devices/nld_log.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp
index 733dad370e0..0662f3fc5f3 100644
--- a/src/lib/netlist/devices/nld_log.cpp
+++ b/src/lib/netlist/devices/nld_log.cpp
@@ -21,6 +21,7 @@ namespace netlist
, m_I(*this, "I")
, m_strm(plib::filesystem::u8path(plib::pfmt("{1}.log")(this->name())))
, m_writer(&m_strm)
+ , m_reset(false)
{
if (m_strm.fail())
throw plib::file_open_e(plib::pfmt("{1}.log")(this->name()));
@@ -30,7 +31,8 @@ namespace netlist
NETLIB_DESTRUCTOR(log)
{
- m_writer.writeline(plib::pfmt("{1:.9} {2}").e(exec().time().as_fp<nl_fptype>()).e(static_cast<nl_fptype>(m_I())));
+ if (m_reset)
+ m_writer.writeline(plib::pfmt("{1:.9} {2}").e(exec().time().as_fp<nl_fptype>()).e(static_cast<nl_fptype>(m_I())));
}
NETLIB_UPDATEI()
@@ -39,11 +41,12 @@ namespace netlist
m_writer.writeline(plib::pfmt("{1:.9} {2}").e(exec().time().as_fp<nl_fptype>()).e(static_cast<nl_fptype>(m_I())));
}
- NETLIB_RESETI() { }
+ NETLIB_RESETI() { m_reset = true; }
protected:
analog_input_t m_I;
std::ofstream m_strm;
plib::putf8_writer m_writer;
+ bool m_reset;
};
NETLIB_OBJECT_DERIVED(logD, log)