Peak hold submeter

#35
1.4.0
PianetaRadio 2023-03-22 19:43:42 +01:00 zatwierdzone przez GitHub
rodzic b8ce26670e
commit 18994840a5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -42,6 +42,7 @@ void DialogSetup::on_buttonBox_accepted()
guiConf.vfoDisplayMode = ui->radioButton_vfoDispMode_UD->isChecked();
guiConf.darkTheme = ui->radioButton_themeDark->isChecked();
guiConf.peakHold = ui->checkBox_peakHold->isChecked();
guiConf.debugMode = ui->checkBox_debug->isChecked();
//* Save settings in catradio.ini

Wyświetl plik

@ -134,7 +134,7 @@ void SubMeter::drawPeak(QPainter *painter)
if (meterSWR) min = 1; //SWR meter
double length = width()-14;
double increment = length / (max - min);
double increment;
double initX;
if (currentValue>=peakValue) peakValue = currentValue;
@ -144,7 +144,17 @@ void SubMeter::drawPeak(QPainter *painter)
if (peakValue>gate) painter->setBrush(QColor(Qt::red));
else painter->setBrush(progressColor);
initX = (peakValue - min) * increment;
if (meterSWR)
{
increment = length / (10 * log10(maxValue));
initX = 10 * log10(peakValue) * increment;
}
else
{
increment = length / (max - min);
initX = (peakValue - min) * increment;
}
//initX = (peakValue - min) * increment;
QRect rect(initX - 2, height()/3+2+1, 2, height()/3-4-2);
painter->drawRect(rect);