From fc806ce5d72807a47d479aecaddb2239722d5fb0 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 23 Jan 2011 12:52:07 -0500 Subject: Removing YYYY-mmm-DD from time displayed on Waterfall plot. --- gr-qtgui/src/lib/WaterfallDisplayPlot.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gr-qtgui/src/lib/WaterfallDisplayPlot.cc') diff --git a/gr-qtgui/src/lib/WaterfallDisplayPlot.cc b/gr-qtgui/src/lib/WaterfallDisplayPlot.cc index 694dc86d8..d7421f06e 100644 --- a/gr-qtgui/src/lib/WaterfallDisplayPlot.cc +++ b/gr-qtgui/src/lib/WaterfallDisplayPlot.cc @@ -140,6 +140,11 @@ public: { timespec lineTime = timespec_add(GetZeroTime(), (-value) * GetSecondsPerLine()); std::string time_str = pt::to_simple_string(pt::from_time_t(lineTime.tv_sec)); + + // lops off the YYYY-mmm-DD part of the string + int ind = time_str.find(" "); + if(ind != std::string::npos) + time_str = time_str.substr(ind); return QwtText(QString("").sprintf("%s.%03ld", time_str.c_str(), lineTime.tv_nsec/1000000)); } @@ -187,6 +192,11 @@ protected: { timespec lineTime = timespec_add(GetZeroTime(), (-p.y()) * GetSecondsPerLine()); std::string time_str = pt::to_simple_string(pt::from_time_t(lineTime.tv_sec)); + + // lops off the YYYY-mmm-DD part of the string + int ind = time_str.find(" "); + if(ind != std::string::npos) + time_str = time_str.substr(ind); QString yLabel(QString("").sprintf("%s.%03ld", time_str.c_str(), lineTime.tv_nsec/1000000)); QwtText t(QString("%1 %2, %3"). -- cgit