Compare commits

..

4 Commits

4 changed files with 59 additions and 16 deletions
+2
View File
@@ -2101,6 +2101,8 @@ void Configuration::impl::accept ()
{
stations_.station_list(next_stations_.station_list ());
stations_.sort (StationList::switch_at_column);
Q_EMIT self_->band_schedule_changed(this->stations_);
}
if (ui_->use_dynamic_grid->isChecked() && !use_dynamic_info_ )
+2
View File
@@ -274,6 +274,8 @@ public:
Q_SIGNAL void udp_server_changed (QString const& udp_server);
Q_SIGNAL void udp_server_port_changed (port_type server_port);
// This signal is emitted when the band schedule changes
Q_SIGNAL void band_schedule_changed (StationList &stations);
//
// These signals are emitted and reflect transceiver state changes
+1 -1
View File
@@ -1,6 +1,6 @@
# Version number components
set (WSJTX_VERSION_MAJOR 0)
set (WSJTX_VERSION_MINOR 4)
set (WSJTX_VERSION_PATCH 1)
set (WSJTX_VERSION_PATCH 2)
set (WSJTX_RC 0) # release candidate number, comment out or zero for development versions
set (WSJTX_VERSION_IS_RELEASE 0) # set to 1 for final release build
+54 -15
View File
@@ -695,6 +695,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
connect (&m_config, &Configuration::transceiver_failure, this, &MainWindow::handle_transceiver_failure);
connect (&m_config, &Configuration::udp_server_changed, m_messageClient, &MessageClient::set_server);
connect (&m_config, &Configuration::udp_server_port_changed, m_messageClient, &MessageClient::set_server_port);
connect (&m_config, &Configuration::band_schedule_changed, this, [this](){
this->m_bandHopped = true;
});
// set up configurations menu
connect (m_multi_settings, &MultiSettings::configurationNameChanged, [this] (QString const& name) {
@@ -1333,15 +1336,33 @@ void MainWindow::tryBandHop(){
QDateTime d = QDateTime::currentDateTimeUtc();
d.setDate(QDate(2000, 1, 1));
QDateTime startOfDay = QDateTime(QDate(2000, 1, 1), QTime(0, 0));
QDateTime endOfDay = QDateTime(QDate(2000, 1, 1), QTime(23, 59));
// see if we can find a needed band switch...
foreach(auto station, stations){
// we can switch to this frequency if we're in the time range, inclusive of switch_at, exclusive of switch_until
// and if we are switching to a different frequency than the last hop. this allows us to switch bands at that time,
// but then later we can later switch to a different band if needed without the automatic band switching to take over
bool inTimeRange = (
(station.switch_at_ <= d && d <= station.switch_until_) || // <- normal range, 12-16 && 6-8, evalued as 12 <= d <= 16 || 6 <= d <= 8
(station.switch_until_ < station.switch_at_ && ( // <- say for a range of 12->2 & 2->12; 12->2,
(station.switch_at_ <= d && d <= endOfDay) || // should be evaluated as 12 <= d <= 23:59 || 00:00 <= d <= 2
(startOfDay <= d && d <= station.switch_until_)
))
);
bool noOverride = (
(m_bandHopped || (!m_bandHopped && station.frequency_ != m_bandHoppedFreq))
);
bool freqIsDifferent = (station.frequency_ != dialFreq);
bool canSwitch = (
(station.switch_at_ <= d || d <= station.switch_until_) &&
(m_bandHopped || (!m_bandHopped && station.frequency_ != m_bandHoppedFreq)) &&
station.frequency_ != dialFreq
inTimeRange &&
noOverride &&
freqIsDifferent
);
//qDebug() << "Can switch to" << station.band_name_ << "=" << canSwitch << station.switch_at_.time().toString("hh:mm") << "<=" << d.time().toString("hh:mm") << "<=" << station.switch_until_.time().toString("hh:mm") << m_bandHopped << m_bandHoppedFreq;
@@ -5635,9 +5656,24 @@ void MainWindow::clearActivity(){
}
void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool isTx, bool isNewLine, bool isLast){
int block = m_rxFrameBlockNumbers.contains(freq) ? m_rxFrameBlockNumbers[freq] : -1;
int lowFreq = freq/10*10;
int highFreq = lowFreq + 10;
int block = -1;
if(m_rxFrameBlockNumbers.contains(freq)){
block =m_rxFrameBlockNumbers[freq];
} else if(m_rxFrameBlockNumbers.contains(lowFreq)){
block = m_rxFrameBlockNumbers[lowFreq];
freq = lowFreq;
} else if(m_rxFrameBlockNumbers.contains(highFreq)){
block = m_rxFrameBlockNumbers[highFreq];
freq = highFreq;
}
if(isNewLine){
m_rxFrameBlockNumbers.remove(freq);
m_rxFrameBlockNumbers.remove(lowFreq);
m_rxFrameBlockNumbers.remove(highFreq);
block = -1;
}
@@ -5646,6 +5682,8 @@ void MainWindow::displayTextForFreq(QString text, int freq, QDateTime date, bool
// never cache tx or last lines
if(!isTx && !isLast){
m_rxFrameBlockNumbers.insert(freq, block);
m_rxFrameBlockNumbers.insert(lowFreq, block);
m_rxFrameBlockNumbers.insert(highFreq, block);
}
}
@@ -8595,7 +8633,18 @@ void MainWindow::processCommandActivity() {
continue;
}
// we're only responding to allcall and our callsign at this point, but we'll log callsigns we've heard
// log call activity...
CallDetail cd;
cd.call = d.from;
cd.grid = d.grid;
cd.snr = d.snr;
cd.freq = d.freq;
cd.bits = d.bits;
cd.utcTimestamp = d.utcTimestamp;
logCallActivity(cd, true);
// we're only responding to allcall and our callsign at this point, so we'll end after logging the callsigns we've heard
if (!isAllCall && d.to != m_config.my_callsign().trimmed() && d.to != Radio::base_callsign(m_config.my_callsign()).trimmed()) {
continue;
}
@@ -8610,16 +8659,6 @@ void MainWindow::processCommandActivity() {
m_txAllcallCommandCache.insert(d.from, new QDateTime(QDateTime::currentDateTimeUtc()), 25);
}
// log call activity...
CallDetail cd;
cd.call = d.from;
cd.grid = d.grid;
cd.snr = d.snr;
cd.freq = d.freq;
cd.bits = d.bits;
cd.utcTimestamp = d.utcTimestamp;
logCallActivity(cd, true);
// display the command activity
ActivityDetail ad;
ad.isLowConfidence = false;