Fixed QSY frequency offset of band and call activity

This commit is contained in:
Jordan Sherer 2018-09-11 23:03:44 -04:00
parent f27d664f61
commit 23e378f977

View File

@ -1417,11 +1417,21 @@ void MainWindow::initializeDummyData(){
CallDetail cd = {};
cd.call = call;
cd.freq = 500 + 100*i;
cd.snr = i++;
cd.snr = i;
cd.utcTimestamp = dt;
logCallActivity(cd, false);
ActivityDetail ad = {};
ad.freq = 500 + 100*i;
ad.text = QString("%1: %2 TEST").arg(call).arg(m_config.my_callsign());
ad.utcTimestamp = dt;
m_bandActivity[500+100*i] = { ad };
i++;
}
displayActivity(true);
QTimer::singleShot(10000, this, [this](){
@ -8187,6 +8197,25 @@ void MainWindow::setXIT(int n, Frequency base)
void MainWindow::qsy(int hzDelta){
setRig(m_freqNominal + hzDelta);
setFreqOffsetForRestore(m_wideGraph->centerFreq(), false);
// adjust band activity frequencies
QMap<int, QList<ActivityDetail>> newActivity;
foreach(auto offset, m_bandActivity.keys()){
if(m_bandActivity[offset].isEmpty()){
continue;
}
newActivity[offset - hzDelta] = m_bandActivity[offset];
newActivity[offset - hzDelta].last().freq -= hzDelta;
}
m_bandActivity.clear();
m_bandActivity.unite(newActivity);
// adjust call activity frequencies
foreach(auto call, m_callActivity.keys()){
m_callActivity[call].freq -= hzDelta;
}
displayActivity(true);
}
void MainWindow::setFreqOffsetForRestore(int freq, bool shouldRestore){