From f04f720cec40703407fbfee0c879297d5a75a0b6 Mon Sep 17 00:00:00 2001 From: matomarss <89415114+matomarss@users.noreply.github.com> Date: Tue, 14 Jun 2022 13:09:17 +0200 Subject: [PATCH 1/2] Added showing frequency to flag time-markers --- pv/views/trace/flag.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pv/views/trace/flag.cpp b/pv/views/trace/flag.cpp index b0518b646..bb1c047c3 100644 --- a/pv/views/trace/flag.cpp +++ b/pv/views/trace/flag.cpp @@ -65,11 +65,21 @@ QString Flag::get_text() const if (!ref_item || (ref_item.get() == this)) s = text_; - else - s = Ruler::format_time_with_distance( + else { + const QString time = Ruler::format_time_with_distance( ref_item->time(), ref_item->delta(time_), view_.tick_prefix(), view_.time_unit(), view_.tick_precision()); + if(view_.time_unit() == pv::util::TimeUnit::Time) { + const QString freq = util::format_value_si(1/abs(ref_item->delta(time_).convert_to()), + pv::util::SIPrefix::unspecified, + 0, "Hz", false); + s = QString("%1 / %2").arg(freq, time); + } + else + s = time; + } + return s; } From 05782f8f43ab1de89c5585c38a5f8d53c4fc90b8 Mon Sep 17 00:00:00 2001 From: matomarss <89415114+matomarss@users.noreply.github.com> Date: Thu, 16 Jun 2022 22:50:13 +0200 Subject: [PATCH 2/2] Add frequency to flags --- pv/views/trace/flag.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pv/views/trace/flag.cpp b/pv/views/trace/flag.cpp index bb1c047c3..520b8740a 100644 --- a/pv/views/trace/flag.cpp +++ b/pv/views/trace/flag.cpp @@ -73,8 +73,8 @@ QString Flag::get_text() const if(view_.time_unit() == pv::util::TimeUnit::Time) { const QString freq = util::format_value_si(1/abs(ref_item->delta(time_).convert_to()), pv::util::SIPrefix::unspecified, - 0, "Hz", false); - s = QString("%1 / %2").arg(freq, time); + 12, "Hz", false); + s = QString("%1 (%2)").arg(time, freq); } else s = time;