kopia lustrzana https://gitlab.com/eliggett/wfview
Scope recalls floor and ceiling for WF.
Also some new data in meter so that we can debug and determine if new data arrived.creator-widgets
rodzic
b7459b8f0b
commit
40af2c5c5e
|
@ -190,6 +190,7 @@ void meter::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
if(freezeDrawing)
|
if(freezeDrawing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
// This next line sets up a canvis within the
|
// This next line sets up a canvis within the
|
||||||
// space of the widget, and gives it coordinates.
|
// space of the widget, and gives it coordinates.
|
||||||
|
@ -348,6 +349,7 @@ void meter::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
drawLabel(&painter);
|
drawLabel(&painter);
|
||||||
}
|
}
|
||||||
|
haveUpdatedData = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void meter::drawLabel(QPainter *qp)
|
void meter::drawLabel(QPainter *qp)
|
||||||
|
@ -379,6 +381,7 @@ void meter::setLevel(int current)
|
||||||
this->peak = peakLevels.at(i);
|
this->peak = peakLevels.at(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
haveUpdatedData = true;
|
||||||
this->update();
|
this->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +398,8 @@ void meter::setLevels(int current, int peak)
|
||||||
}
|
}
|
||||||
this->average = sum / std::min(avgPosition, (int)avgLevels.size());
|
this->average = sum / std::min(avgPosition, (int)avgLevels.size());
|
||||||
|
|
||||||
this->update();
|
haveUpdatedData = true;
|
||||||
|
this->update(); // place repaint event on the event queue
|
||||||
}
|
}
|
||||||
|
|
||||||
void meter::setLevels(int current, int peak, int average)
|
void meter::setLevels(int current, int peak, int average)
|
||||||
|
@ -404,7 +408,8 @@ void meter::setLevels(int current, int peak, int average)
|
||||||
this->peak = peak;
|
this->peak = peak;
|
||||||
this->average = average;
|
this->average = average;
|
||||||
|
|
||||||
this->update();
|
haveUpdatedData = true;
|
||||||
|
this->update(); // place repaint event on the event queue
|
||||||
}
|
}
|
||||||
|
|
||||||
void meter::updateDrawing(int num)
|
void meter::updateDrawing(int num)
|
||||||
|
|
1
meter.h
1
meter.h
|
@ -52,6 +52,7 @@ private:
|
||||||
QComboBox *combo = NULL;
|
QComboBox *combo = NULL;
|
||||||
meter_t meterType;
|
meter_t meterType;
|
||||||
QString meterShortString;
|
QString meterShortString;
|
||||||
|
bool haveUpdatedData = false;
|
||||||
int fontSize = 10;
|
int fontSize = 10;
|
||||||
int length=30;
|
int length=30;
|
||||||
int current=0;
|
int current=0;
|
||||||
|
|
|
@ -446,6 +446,8 @@ void spectrumScope::setRange(int floor, int ceiling)
|
||||||
{
|
{
|
||||||
plotFloor = floor;
|
plotFloor = floor;
|
||||||
plotCeiling = ceiling;
|
plotCeiling = ceiling;
|
||||||
|
wfFloor = floor;
|
||||||
|
wfCeiling = ceiling;
|
||||||
maxAmp = ceiling;
|
maxAmp = ceiling;
|
||||||
if (spectrum != Q_NULLPTR)
|
if (spectrum != Q_NULLPTR)
|
||||||
spectrum->yAxis->setRange(QCPRange(floor, ceiling));
|
spectrum->yAxis->setRange(QCPRange(floor, ceiling));
|
||||||
|
|
Ładowanie…
Reference in New Issue