Thanks Uwe. I just need to change the labels. For example, if the radio is tuned to a frequency of 7.190 mHz, then the x axis label in the center of the display should be 7.190 The x min would display 7.190 - sample rate/2 and the x max would display 7.190 + sample rate/2
I tried the following code:
{
public:
NewScaleDraw()
{
}
virtual QwtText label
(double value
) const {
float freqLabel = (::centerFreq-(value/2000000));
return strFreqLabel;
}
};
void RtControl
::newScale(QString freq
) {
d_.
view->setAxisScaleDraw
(QwtPlot::xTop,
new NewScaleDraw
());
}
class NewScaleDraw : public QwtScaleDraw
{
public:
NewScaleDraw()
{
}
virtual QwtText label(double value) const
{
float freqLabel = (::centerFreq-(value/2000000));
QString strFreqLabel = QString("%1").arg(freqLabel);
return strFreqLabel;
}
};
void RtControl::newScale(QString freq)
{
d_.view->setAxisScaleDraw(QwtPlot::xTop, new NewScaleDraw());
}
To copy to clipboard, switch view to plain text mode
Where newScale is called each time the radio changes frequency, but the labels are not changing.
Is this the correct approach?
Bookmarks