kopia lustrzana https://gitlab.com/eliggett/wfview
Fix PBT in CW mode
rodzic
60dbcb6f04
commit
bfe60a7040
|
@ -1636,21 +1636,53 @@ void spectrumScope::wfTheme(int num)
|
|||
configTheme->setCurrentIndex(configTheme->findData(currentTheme));
|
||||
}
|
||||
|
||||
void spectrumScope::setPBTInner (double hz) {
|
||||
PBTInner = hz;
|
||||
double pbFreq = ((double)(this->PBTInner) / this->passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
configPbtInner->setValue(newFreq);
|
||||
void spectrumScope::setPBTInner (uchar val) {
|
||||
qint16 shift = (qint16)(val - 128);
|
||||
double tempVar = ceil((shift / 127.0) * passbandWidth * 20000.0) / 20000.0;
|
||||
// tempVar now contains value to the nearest 50Hz If CW mode, add/remove the cwPitch.
|
||||
double pitch = 0.0;
|
||||
if ((this->mode.mk == modeCW || this->mode.mk == modeCW_R) && this->passbandWidth > 0.0006)
|
||||
{
|
||||
pitch = (600.0 - cwPitch) / 1000000.0;
|
||||
}
|
||||
|
||||
double newPBT = round((tempVar + pitch) * 200000.0) / 200000.0; // Nearest 5Hz.
|
||||
|
||||
if (newPBT != this->PBTInner) {
|
||||
this->PBTInner = newPBT;
|
||||
qInfo(logSystem()) << "New PBT Inner value received" << this->PBTInner << "CW Pitch" << this->cwPitch << "Passband" << this->passbandWidth;
|
||||
double pbFreq = ((double)(this->PBTInner) / this->passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
configPbtInner->blockSignals(true);
|
||||
configPbtInner->setValue(newFreq);
|
||||
configPbtInner->blockSignals(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void spectrumScope::setPBTOuter (double hz) {
|
||||
PBTOuter = hz;
|
||||
double pbFreq = ((double)(this->PBTOuter) / this->passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
configPbtOuter->setValue(newFreq);
|
||||
void spectrumScope::setPBTOuter (uchar val) {
|
||||
qint16 shift = (qint16)(val - 128);
|
||||
double tempVar = ceil((shift / 127.0) * this->passbandWidth * 20000.0) / 20000.0;
|
||||
// tempVar now contains value to the nearest 50Hz If CW mode, add/remove the cwPitch.
|
||||
double pitch = 0.0;
|
||||
if ((this->mode.mk == modeCW || this->mode.mk == modeCW_R) && this->passbandWidth > 0.0006)
|
||||
{
|
||||
pitch = (600.0 - cwPitch) / 1000000.0;
|
||||
}
|
||||
|
||||
double newPBT = round((tempVar + pitch) * 200000.0) / 200000.0; // Nearest 5Hz.
|
||||
|
||||
if (newPBT != this->PBTOuter) {
|
||||
this->PBTOuter = newPBT;
|
||||
qInfo(logSystem()) << "New PBT Outer value received" << this->PBTOuter << "CW Pitch" << this->cwPitch << "Passband" << this->passbandWidth;
|
||||
double pbFreq = ((double)(this->PBTOuter) / this->passbandWidth) * 127.0;
|
||||
qint16 newFreq = pbFreq + 128;
|
||||
if (newFreq >= 0 && newFreq <= 255) {
|
||||
configPbtOuter->blockSignals(true);
|
||||
configPbtOuter->setValue(newFreq);
|
||||
configPbtOuter->blockSignals(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,10 +64,10 @@ public:
|
|||
void receivePassband(quint16 pass);
|
||||
|
||||
double getPBTInner () { return PBTInner;}
|
||||
void setPBTInner (double hz);
|
||||
void setPBTInner (uchar val);
|
||||
|
||||
double getPBTOuter () { return PBTOuter;}
|
||||
void setPBTOuter (double hz);
|
||||
void setPBTOuter (uchar val);
|
||||
|
||||
quint16 getStepSize () { return stepSize;}
|
||||
void setStepSize (quint16 hz) { stepSize = hz;}
|
||||
|
|
20
wfmain.cpp
20
wfmain.cpp
|
@ -5510,25 +5510,11 @@ void wfmain::receiveValue(cacheItem val){
|
|||
receiveAntennaSel(val.value.value<antennaInfo>().antenna,val.value.value<antennaInfo>().rx);
|
||||
break;
|
||||
case funcPBTOuter:
|
||||
vfos[val.vfo]->setPBTOuter(val.value.value<uchar>());
|
||||
break;
|
||||
case funcPBTInner:
|
||||
{
|
||||
uchar level = val.value.value<uchar>();
|
||||
qint16 shift = (qint16)(level - 128);
|
||||
double tempVar = ceil((shift / 127.0) * vfos[val.vfo]->getPassbandWidth() * 20000.0) / 20000.0;
|
||||
// tempVar now contains value to the nearest 50Hz If CW mode, add/remove the cwPitch.
|
||||
double pitch = 0.0;
|
||||
modeInfo mode = vfos[val.vfo]->currentMode();
|
||||
if ((mode.mk == modeCW || mode.mk == modeCW_R) && vfos[val.vfo]->getPassbandWidth() > 0.0006)
|
||||
{
|
||||
pitch = (600.0 - cwPitch) / 1000000.0;
|
||||
}
|
||||
double newVal = round((tempVar + pitch) * 200000.0) / 200000.0; // Nearest 5Hz.
|
||||
|
||||
if (val.command == funcPBTInner) {
|
||||
vfos[val.vfo]->setPBTInner(newVal);
|
||||
} else {
|
||||
vfos[val.vfo]->setPBTOuter(newVal);
|
||||
}
|
||||
vfos[val.vfo]->setPBTInner(val.value.value<uchar>());
|
||||
break;
|
||||
}
|
||||
case funcIFShift:
|
||||
|
|
Ładowanie…
Reference in New Issue