updateDisplay();
}
+ void SetUnitType(const std::string &type)
+ {
+ _unitType = type;
+ }
+
protected:
virtual QwtText trackerText( const QwtDoublePoint& p ) const
{
- QString strunits = (GetFrequencyPrecision() == 0) ? "Hz" : "kHz";
QwtText t(QString("%1 %2, %3 dB").arg(p.x(), 0, 'f',
- GetFrequencyPrecision()).arg(strunits).arg(p.y(), 0, 'f', 2));
+ GetFrequencyPrecision()).arg(_unitType.c_str()).arg(p.y(), 0, 'f', 2));
return t;
}
+
+private:
+ std::string _unitType;
};
FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
timespec_reset(&_lastReplot);
resize(parent->width(), parent->height());
-
+
_displayIntervalTime = (1.0/10.0); // 1/10 of a second between updates
_useCenterFrequencyFlag = false;
setAxisScaleDraw(QwtPlot::xBottom, new FreqDisplayScaleDraw(display_units));
setAxisTitle(QwtPlot::xBottom, QString("Frequency (%1)").arg(strunits.c_str()));
((FreqDisplayZoomer*)_zoomer)->SetFrequencyPrecision(display_units);
+ ((FreqDisplayZoomer*)_zoomer)->SetUnitType(strunits);
// Load up the new base zoom settings
_zoomer->setZoomBase();
_displayIntervalTime = differenceTime;
}
}
+
+void
+FrequencyDisplayPlot::resizeSlot( QSize *s )
+{
+ resize(s->width(), s->height());
+}
void
FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDataPoints,