- _sampleRate = sr/units;
- _resetXAxisPoints();
-
- // While we could change the displayed sigfigs based on the unit being
- // displayed, I think it looks better by just setting it to 4 regardless.
- //double display_units = ceil(log10(units)/2.0);
- double display_units = 4;
- setAxisTitle(QwtPlot::xBottom, QString("Time (%1)").arg(strunits.c_str()));
- ((TimeDomainDisplayZoomer*)_zoomer)->SetTimePrecision(display_units);
- ((TimeDomainDisplayZoomer*)_zoomer)->SetUnitType(strunits);
+ double newsr = sr/units;
+ if(newsr != _sampleRate) {
+ _sampleRate = sr/units;
+ _resetXAxisPoints();
+
+ // While we could change the displayed sigfigs based on the unit being
+ // displayed, I think it looks better by just setting it to 4 regardless.
+ //double display_units = ceil(log10(units)/2.0);
+ double display_units = 4;
+ setAxisTitle(QwtPlot::xBottom, QString("Time (%1)").arg(strunits.c_str()));
+ ((TimeDomainDisplayZoomer*)_zoomer)->SetTimePrecision(display_units);
+ ((TimeDomainDisplayZoomer*)_zoomer)->SetUnitType(strunits);
+ }