Added caching and restoring band/call/rx activity on band change
This commit is contained in:
parent
83b05df312
commit
b5cebe41e8
@ -2390,6 +2390,8 @@ void MainWindow::displayDialFrequency ()
|
|||||||
// lookup band
|
// lookup band
|
||||||
auto const& band_name = m_config.bands ()->find (dial_frequency);
|
auto const& band_name = m_config.bands ()->find (dial_frequency);
|
||||||
if (m_lastBand != band_name){
|
if (m_lastBand != band_name){
|
||||||
|
cacheActivity(m_lastBand);
|
||||||
|
|
||||||
// only change this when necessary as we get called a lot and it
|
// only change this when necessary as we get called a lot and it
|
||||||
// would trash any user input to the band combo box line edit
|
// would trash any user input to the band combo box line edit
|
||||||
ui->bandComboBox->setCurrentText (band_name);
|
ui->bandComboBox->setCurrentText (band_name);
|
||||||
@ -2398,6 +2400,8 @@ void MainWindow::displayDialFrequency ()
|
|||||||
band_changed(dial_frequency);
|
band_changed(dial_frequency);
|
||||||
|
|
||||||
clearActivity();
|
clearActivity();
|
||||||
|
|
||||||
|
restoreActivity(m_lastBand);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: jsherer - this doesn't validate anything else right? we are disabling this because as long as you're in a band, it's valid.
|
// TODO: jsherer - this doesn't validate anything else right? we are disabling this because as long as you're in a band, it's valid.
|
||||||
@ -5725,6 +5729,28 @@ void MainWindow::on_tx6_editingFinished() //tx6 edited
|
|||||||
msgtype(t, ui->tx6);
|
msgtype(t, ui->tx6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::cacheActivity(QString key){
|
||||||
|
m_callActivityCache[key] = m_callActivity;
|
||||||
|
m_bandActivityCache[key] = m_bandActivity;
|
||||||
|
m_rxTextCache[key] = ui->textEditRX->toHtml();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::restoreActivity(QString key){
|
||||||
|
if(m_callActivityCache.contains(key)){
|
||||||
|
m_callActivity = m_callActivityCache[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_bandActivityCache.contains(key)){
|
||||||
|
m_bandActivity = m_bandActivityCache[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_rxTextCache.contains(key)){
|
||||||
|
ui->textEditRX->setHtml(m_rxTextCache[key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
displayActivity(true);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::clearActivity(){
|
void MainWindow::clearActivity(){
|
||||||
m_bandActivity.clear();
|
m_bandActivity.clear();
|
||||||
m_callActivity.clear();
|
m_callActivity.clear();
|
||||||
@ -9258,7 +9284,7 @@ void MainWindow::processTxQueue(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!isFreqOffsetFree(f, 60)){
|
if(!isFreqOffsetFree(f, 60)){
|
||||||
f = findFreeFreqOffset(500, 2500, 60);
|
f = findFreeFreqOffset(500, 2000, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need a valid frequency...
|
// we need a valid frequency...
|
||||||
|
@ -133,6 +133,8 @@ public slots:
|
|||||||
|
|
||||||
void logCallActivity(CallDetail d, bool spot=true);
|
void logCallActivity(CallDetail d, bool spot=true);
|
||||||
QString lookupCallInCompoundCache(QString const &call);
|
QString lookupCallInCompoundCache(QString const &call);
|
||||||
|
void cacheActivity(QString key);
|
||||||
|
void restoreActivity(QString key);
|
||||||
void clearActivity();
|
void clearActivity();
|
||||||
void displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast);
|
void displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast);
|
||||||
void writeNoticeTextToUI(QDateTime date, QString text);
|
void writeNoticeTextToUI(QDateTime date, QString text);
|
||||||
@ -751,6 +753,11 @@ private:
|
|||||||
QMap<int, QList<ActivityDetail>> m_bandActivity; // freq -> [(text, last timestamp), ...]
|
QMap<int, QList<ActivityDetail>> m_bandActivity; // freq -> [(text, last timestamp), ...]
|
||||||
QMap<int, MessageBuffer> m_messageBuffer; // freq -> (cmd, [frames, ...])
|
QMap<int, MessageBuffer> m_messageBuffer; // freq -> (cmd, [frames, ...])
|
||||||
QMap<QString, CallDetail> m_callActivity; // call -> (last freq, last timestamp)
|
QMap<QString, CallDetail> m_callActivity; // call -> (last freq, last timestamp)
|
||||||
|
|
||||||
|
QMap<QString, QMap<QString, CallDetail>> m_callActivityCache; // band -> call activity
|
||||||
|
QMap<QString, QMap<int, QList<ActivityDetail>>> m_bandActivityCache; // band -> band activity
|
||||||
|
QMap<QString, QString> m_rxTextCache; // band -> rx text
|
||||||
|
|
||||||
QSet<QString> m_callSeenBeacon; // call
|
QSet<QString> m_callSeenBeacon; // call
|
||||||
int m_previousFreq;
|
int m_previousFreq;
|
||||||
bool m_shouldRestoreFreq;
|
bool m_shouldRestoreFreq;
|
||||||
|
Loading…
Reference in New Issue
Block a user