Removed selcall and active flag
In effort to simplify the behavior of automatic responses as well as make the software easier to use, I have removed the SELCALL button and the ACTIVE flag. Now, the response to STATUS is one that contains actual status (AUTO ON/OFF, VERSION NUMBER, etc). HBs used this in their transmissions, but it was never really accurate because it relied on the user to toggle the switch. Hazardous really. So, I approached this by simplifying the behavior. If AUTO is on, you will reply to direct queries. If AUTO is off, you wont. Simple. If HB is on, you will heartbeat. If it is off, you wont. Simple. If both AUTO and HB is on, you will automatically reply to heartbeats with ACKs. If not, you wont. Simple. You can remove yourself from the ALLCALL group. This is the same behavior as the previous SELCALL function and now that we have simplified it I can build an actual SELCALL function (to selectively allow stations to call you) instead of a 1/2 SELCALL that it used to be. Bingo.
This commit is contained in:
parent
6ef891af0f
commit
9f2e87c076
@ -644,6 +644,7 @@ private:
|
||||
bool ppfx_;
|
||||
bool clear_callsign_;
|
||||
bool miles_;
|
||||
bool avoid_allcall_;
|
||||
bool quick_call_;
|
||||
bool disable_TX_on_73_;
|
||||
int heartbeat_;
|
||||
@ -775,6 +776,7 @@ bool Configuration::DXCC () const {return m_->DXCC_;}
|
||||
bool Configuration::ppfx() const {return m_->ppfx_;}
|
||||
bool Configuration::clear_callsign () const {return m_->clear_callsign_;}
|
||||
bool Configuration::miles () const {return m_->miles_;}
|
||||
bool Configuration::avoid_allcall () const {return m_->avoid_allcall_;}
|
||||
bool Configuration::quick_call () const {return m_->quick_call_;}
|
||||
bool Configuration::disable_TX_on_73 () const {return m_->disable_TX_on_73_;}
|
||||
int Configuration::heartbeat () const {return m_->heartbeat_;}
|
||||
@ -1385,6 +1387,7 @@ void Configuration::impl::initialize_models ()
|
||||
ui_->prompt_to_log_check_box->setChecked (prompt_to_log_);
|
||||
ui_->clear_callsign_check_box->setChecked (clear_callsign_);
|
||||
ui_->miles_check_box->setChecked (miles_);
|
||||
ui_->avoid_allcall_checkbox->setChecked(avoid_allcall_);
|
||||
ui_->quick_call_check_box->setChecked (quick_call_);
|
||||
ui_->disable_TX_on_73_check_box->setChecked (disable_TX_on_73_);
|
||||
ui_->heartbeat_spin_box->setValue (heartbeat_);
|
||||
@ -1695,6 +1698,7 @@ void Configuration::impl::read_settings ()
|
||||
ppfx_ = settings_->value ("PrincipalPrefix", false).toBool ();
|
||||
clear_callsign_ = settings_->value ("ClearCallGrid", false).toBool ();
|
||||
miles_ = settings_->value ("Miles", false).toBool ();
|
||||
avoid_allcall_ = settings_->value ("AvoidAllcall", false).toBool ();
|
||||
quick_call_ = settings_->value ("QuickCall", false).toBool ();
|
||||
disable_TX_on_73_ = settings_->value ("73TxDisable", false).toBool ();
|
||||
heartbeat_ = settings_->value ("TxBeacon", 30).toInt ();
|
||||
@ -1830,6 +1834,7 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("PrincipalPrefix", ppfx_);
|
||||
settings_->setValue ("ClearCallGrid", clear_callsign_);
|
||||
settings_->setValue ("Miles", miles_);
|
||||
settings_->setValue ("AvoidAllcall", avoid_allcall_);
|
||||
settings_->setValue ("QuickCall", quick_call_);
|
||||
settings_->setValue ("73TxDisable", disable_TX_on_73_);
|
||||
settings_->setValue ("TxBeacon", heartbeat_);
|
||||
@ -2319,6 +2324,7 @@ void Configuration::impl::accept ()
|
||||
prompt_to_log_ = ui_->prompt_to_log_check_box->isChecked ();
|
||||
clear_callsign_ = ui_->clear_callsign_check_box->isChecked ();
|
||||
miles_ = ui_->miles_check_box->isChecked ();
|
||||
avoid_allcall_ = ui_->avoid_allcall_checkbox->isChecked();
|
||||
quick_call_ = ui_->quick_call_check_box->isChecked ();
|
||||
disable_TX_on_73_ = ui_->disable_TX_on_73_check_box->isChecked ();
|
||||
heartbeat_ = ui_->heartbeat_spin_box->value ();
|
||||
|
@ -135,6 +135,7 @@ public:
|
||||
bool ppfx() const;
|
||||
bool clear_callsign () const;
|
||||
bool miles () const;
|
||||
bool avoid_allcall () const;
|
||||
bool quick_call () const;
|
||||
bool disable_TX_on_73 () const;
|
||||
int heartbeat () const;
|
||||
|
120
Configuration.ui
120
Configuration.ui
@ -98,30 +98,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="callsign_line_edit">
|
||||
<property name="toolTip">
|
||||
<string>Station callsign.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="region_combo_box">
|
||||
<property name="toolTip">
|
||||
<string>IARU Region</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>IARU Region:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>region_combo_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="grid_line_edit">
|
||||
<property name="toolTip">
|
||||
@ -132,6 +108,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="groups_line_edit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter a comma separated list of callsign groups (e.g., @GROUP/1, @ARES, @RACES, etc). <br/><br/>Each group behaves similarly to @ALLCALL. Messages that are directed to the group are printed at all participating stations.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>@GROUP1, ...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="callsign_label">
|
||||
<property name="text">
|
||||
@ -143,22 +132,49 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_23">
|
||||
<widget class="QLabel" name="groups_label">
|
||||
<property name="text">
|
||||
<string>Callsign Groups (comma separated):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="groups_line_edit">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="callsign_line_edit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter a comma separated list of callsign groups (e.g., @GROUP/1, @ARES, @RACES, etc). <br/><br/>Each group behaves similarly to @ALLCALL. Messages that are directed to the group are printed at all participating stations.</p></body></html></string>
|
||||
<string>Station callsign.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="avoid_allcall_checkbox">
|
||||
<property name="text">
|
||||
<string>Do not participate in the @ALLCALL group</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QComboBox" name="region_combo_box">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>IARU Region</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="region_label">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>IARU Region:</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>@ALLCALL, ...</string>
|
||||
<property name="buddy">
|
||||
<cstring>region_combo_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -279,8 +295,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>724</width>
|
||||
<height>489</height>
|
||||
<width>654</width>
|
||||
<height>482</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_26">
|
||||
@ -389,11 +405,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="heartbeat_anywhere_check_box">
|
||||
<property name="text">
|
||||
<string>Allow heartbeat transmissions outside of heartbeat sub-channel (500Hz - 1000Hz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="heartbeat_anywhere_check_box">
|
||||
<property name="text">
|
||||
<string>Allow heartbeat transmissions outside of heartbeat sub-channel (500Hz - 1000Hz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
@ -876,7 +892,7 @@ text message.</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>718</width>
|
||||
<width>264</width>
|
||||
<height>435</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1715,8 +1731,8 @@ radio interface behave as expected.</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>502</height>
|
||||
<width>266</width>
|
||||
<height>329</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29">
|
||||
@ -2028,8 +2044,8 @@ both here.</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>746</width>
|
||||
<height>554</height>
|
||||
<width>508</width>
|
||||
<height>525</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_30">
|
||||
@ -2485,8 +2501,8 @@ for assessing propagation and system performance.</string>
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>502</height>
|
||||
<width>487</width>
|
||||
<height>341</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_31">
|
||||
@ -2592,7 +2608,7 @@ for assessing propagation and system performance.</string>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Working Frequencies</string>
|
||||
<string>Frequencies</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
@ -3063,8 +3079,8 @@ QListView::item:hover {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>738</width>
|
||||
<height>378</height>
|
||||
<width>271</width>
|
||||
<height>195</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_15">
|
||||
@ -4065,12 +4081,12 @@ soundcard changes</string>
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
146
mainwindow.cpp
146
mainwindow.cpp
@ -1125,7 +1125,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
return;
|
||||
}
|
||||
|
||||
if(!ensureCallsignSet(true) || !ensureSelcalCallsignSelected(true)){
|
||||
if(!ensureCallsignSet(true)){
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1448,15 +1448,14 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
gridButtonLayout->setColumnMinimumWidth(0, width);
|
||||
gridButtonLayout->setColumnMinimumWidth(1, width);
|
||||
gridButtonLayout->setColumnMinimumWidth(2, width);
|
||||
gridButtonLayout->setColumnMinimumWidth(3, width);
|
||||
gridButtonLayout->setColumnStretch(0, 1);
|
||||
gridButtonLayout->setColumnStretch(1, 1);
|
||||
gridButtonLayout->setColumnStretch(2, 1);
|
||||
gridButtonLayout->setColumnStretch(3, 1);
|
||||
|
||||
pskSetLocal();
|
||||
aprsSetLocal();
|
||||
|
||||
clearActivity();
|
||||
displayActivity(true);
|
||||
|
||||
/*
|
||||
@ -1747,7 +1746,6 @@ void MainWindow::writeSettings()
|
||||
m_settings->setValue("TextVerticalSplitter", ui->textVerticalSplitter->saveState());
|
||||
m_settings->setValue("ShowTimeDrift", ui->driftSyncFrame->isVisible());
|
||||
m_settings->setValue("TimeDrift", ui->driftSpinBox->value());
|
||||
m_settings->setValue("SelCal", ui->selcalButton->isChecked());
|
||||
m_settings->setValue("ShowTooltips", ui->actionShow_Tooltips->isChecked());
|
||||
|
||||
m_settings->endGroup();
|
||||
@ -1862,7 +1860,6 @@ void MainWindow::readSettings()
|
||||
}
|
||||
ui->driftSyncFrame->setVisible(m_settings->value("ShowTimeDrift", false).toBool());
|
||||
ui->driftSpinBox->setValue(m_settings->value("TimeDrift", 0).toInt());
|
||||
ui->selcalButton->setChecked(m_settings->value("SelCal", false).toBool());
|
||||
ui->actionShow_Tooltips->setChecked(m_settings->value("ShowTooltips", true).toBool());
|
||||
|
||||
m_settings->endGroup();
|
||||
@ -2367,9 +2364,7 @@ void rebuildMacQAction(QMenu *menu, QAction *existingAction){
|
||||
|
||||
void MainWindow::on_menuControl_aboutToShow(){
|
||||
ui->actionEnable_Spotting->setChecked(ui->spotButton->isChecked());
|
||||
ui->actionEnable_Active->setChecked(ui->activeButton->isChecked());
|
||||
ui->actionEnable_Auto_Reply->setChecked(ui->autoReplyButton->isChecked());
|
||||
ui->actionEnable_Selcall->setChecked(ui->selcalButton->isChecked());
|
||||
|
||||
QMenu * heartbeatMenu = new QMenu(this->menuBar());
|
||||
buildHeartbeatMenu(heartbeatMenu);
|
||||
@ -2394,14 +2389,6 @@ void MainWindow::on_actionEnable_Auto_Reply_toggled(bool checked){
|
||||
ui->autoReplyButton->setChecked(checked);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEnable_Active_toggled(bool checked){
|
||||
ui->activeButton->setChecked(checked);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEnable_Selcall_toggled(bool checked){
|
||||
ui->selcalButton->setChecked(checked);
|
||||
}
|
||||
|
||||
void MainWindow::on_menuWindow_aboutToShow(){
|
||||
ui->actionShow_Fullscreen->setChecked((windowState() & Qt::WindowFullScreen) == Qt::WindowFullScreen);
|
||||
|
||||
@ -2770,33 +2757,6 @@ void MainWindow::on_monitorTxButton_toggled(bool checked){
|
||||
resetPushButtonToggleText(ui->monitorTxButton);
|
||||
}
|
||||
|
||||
void MainWindow::on_selcalButton_toggled(bool checked){
|
||||
#if SELCAL_SHOULD_HIDE_BAND_ACTIVITY
|
||||
if(checked){
|
||||
if(ui->tableWidgetRXAll->isVisible()){
|
||||
ui->tableWidgetRXAll->setVisible(false);
|
||||
m_bandActivityWasVisible = true;
|
||||
} else {
|
||||
m_bandActivityWasVisible = false;
|
||||
}
|
||||
} else {
|
||||
ui->tableWidgetRXAll->setVisible(m_bandActivityWasVisible);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(checked && callsignSelected() == "@ALLCALL"){
|
||||
clearCallsignSelected();
|
||||
}
|
||||
|
||||
if(checked){
|
||||
resetAutomaticIntervalTransmissions(true, true);
|
||||
}
|
||||
|
||||
resetPushButtonToggleText(ui->selcalButton);
|
||||
|
||||
displayCallActivity();
|
||||
}
|
||||
|
||||
void MainWindow::on_tuneButton_toggled(bool checked){
|
||||
resetPushButtonToggleText(ui->tuneButton);
|
||||
}
|
||||
@ -2805,43 +2765,6 @@ void MainWindow::on_spotButton_toggled(bool checked){
|
||||
resetPushButtonToggleText(ui->spotButton);
|
||||
}
|
||||
|
||||
void MainWindow::on_activeButton_toggled(bool checked){
|
||||
#if 0
|
||||
// clear the ping queue when you toggle the button
|
||||
m_txHeartbeatQueue.clear();
|
||||
displayBandActivity();
|
||||
|
||||
// then process the action
|
||||
if(checked){
|
||||
scheduleHeartbeat(false);
|
||||
} else {
|
||||
pauseHeartbeat();
|
||||
}
|
||||
#endif
|
||||
|
||||
// we call this so hb button disabled state is updated
|
||||
updateButtonDisplay();
|
||||
|
||||
resetPushButtonToggleText(ui->activeButton);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void MainWindow::on_heartbeatButton_toggled(bool checked){
|
||||
// clear the ping queue when you toggle the button
|
||||
m_txHeartbeatQueue.clear();
|
||||
displayBandActivity();
|
||||
|
||||
// then process the action
|
||||
if(checked){
|
||||
scheduleHeartbeat(false);
|
||||
} else {
|
||||
pauseHeartbeat();
|
||||
}
|
||||
|
||||
resetPushButtonToggleText(ui->heartbeatButton);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::auto_tx_mode (bool state)
|
||||
{
|
||||
ui->autoButton->setChecked (state);
|
||||
@ -5433,7 +5356,8 @@ void MainWindow::createAllcallTableRows(QTableWidget *table, QString const &sele
|
||||
|
||||
int startCol = 1;
|
||||
|
||||
if(!ui->selcalButton->isChecked()){
|
||||
if(!m_config.avoid_allcall())
|
||||
{
|
||||
table->insertRow(table->rowCount());
|
||||
|
||||
foreach(auto cd, m_callActivity.values()){
|
||||
@ -5689,19 +5613,6 @@ bool MainWindow::ensureCallsignSet(bool alert){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MainWindow::ensureSelcalCallsignSelected(bool alert){
|
||||
auto selectedCallsign = callsignSelected(true);
|
||||
bool isAllCall = isAllCallIncluded(selectedCallsign);
|
||||
bool missingCall = selectedCallsign.isEmpty();
|
||||
bool blockTransmit = ui->selcalButton->isChecked() && (isAllCall || missingCall);
|
||||
|
||||
if(blockTransmit && alert){
|
||||
MessageBox::warning_message(this, tr ("Please select or enter a callsign to direct this message while SELCALL is enabled."));
|
||||
}
|
||||
|
||||
return !blockTransmit;
|
||||
}
|
||||
|
||||
bool MainWindow::ensureKeyNotStuck(QString const& text){
|
||||
// be annoying and drop messages with all the same character to reduce spam...
|
||||
if(text.length() > 5 && QString(text).replace(text.at(0), "").trimmed().isEmpty()){
|
||||
@ -5730,11 +5641,6 @@ void MainWindow::createMessage(QString const& text){
|
||||
return;
|
||||
}
|
||||
|
||||
if(!ensureSelcalCallsignSelected()){
|
||||
on_stopTxButton_clicked();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!ensureNotIdle()){
|
||||
on_stopTxButton_clicked();
|
||||
return;
|
||||
@ -6797,8 +6703,7 @@ void MainWindow::buildRepeatMenu(QMenu *menu, QPushButton * button, int * interv
|
||||
void MainWindow::sendHeartbeat(){
|
||||
QString mycall = m_config.my_callsign();
|
||||
QString mygrid = m_config.my_grid().left(4);
|
||||
QString status = ui->activeButton->isChecked() ? "ACTIVE" : "IDLE";
|
||||
QString message = QString("%1: HB %2 %3").arg(mycall).arg(status).arg(mygrid).trimmed();
|
||||
QString message = QString("%1: HB %2").arg(mycall).arg(mygrid).trimmed();
|
||||
|
||||
auto f = m_config.heartbeat_anywhere() ? -1 : findFreeFreqOffset(500, 1000, 50);
|
||||
|
||||
@ -7210,7 +7115,7 @@ void MainWindow::buildQueryMenu(QMenu * menu, QString call){
|
||||
if(m_config.transmit_directed()) toggleTx(true);
|
||||
});
|
||||
|
||||
auto stationIdleQueryAction = menu->addAction(QString("%1 STATUS? - Is your station active or inactive?").arg(call).trimmed());
|
||||
auto stationIdleQueryAction = menu->addAction(QString("%1 STATUS? - What is the status of your station (auto, version, etc)?").arg(call).trimmed());
|
||||
stationIdleQueryAction->setDisabled(isAllCall);
|
||||
connect(stationIdleQueryAction, &QAction::triggered, this, [this](){
|
||||
|
||||
@ -7474,8 +7379,7 @@ QMap<QString, QString> MainWindow::buildMacroValues(){
|
||||
{"<MYQTC>", m_config.my_station()},
|
||||
{"<MYQTH>", m_config.my_qth()},
|
||||
{"<MYCQ>", m_config.cq_message()},
|
||||
{"<MYREPLY>", m_config.reply_message()},
|
||||
{"<MYSTATUS>", (ui->activeButton->isChecked() ? "ACTIVE" : "IDLE")},
|
||||
{"<MYREPLY>", m_config.reply_message()}
|
||||
};
|
||||
|
||||
auto selectedCall = callsignSelected();
|
||||
@ -8660,9 +8564,8 @@ void MainWindow::updateRepeatButtonDisplay(){
|
||||
void MainWindow::updateTextDisplay(){
|
||||
bool isTransmitting = m_transmitting || m_txFrameCount > 0;
|
||||
bool emptyText = ui->extFreeTextMsgEdit->toPlainText().isEmpty();
|
||||
bool invalidSelcal = !ensureSelcalCallsignSelected(false);
|
||||
|
||||
ui->startTxButton->setDisabled(isTransmitting || emptyText || invalidSelcal);
|
||||
ui->startTxButton->setDisabled(isTransmitting || emptyText);
|
||||
|
||||
if(m_txTextDirty){
|
||||
// debounce frame and word count
|
||||
@ -8790,7 +8693,7 @@ void MainWindow::updateTxButtonDisplay(){
|
||||
ui->startTxButton->setFlat(true);
|
||||
} else {
|
||||
ui->startTxButton->setText(m_txFrameCountEstimate <= 0 ? QString("Send") : QString("Send (%1)").arg(m_txFrameCountEstimate));
|
||||
ui->startTxButton->setEnabled(m_txFrameCountEstimate > 0 && ensureSelcalCallsignSelected(false));
|
||||
ui->startTxButton->setEnabled(m_txFrameCountEstimate > 0);
|
||||
ui->startTxButton->setFlat(false);
|
||||
}
|
||||
}
|
||||
@ -8944,7 +8847,10 @@ void MainWindow::observeTimeDeltaForAverage(float delta){
|
||||
}
|
||||
|
||||
// display average
|
||||
ui->driftAvgLabel->setText(QString("Avg Time Delta: %1 ms").arg(m_timeDeltaMsMMA));
|
||||
if(m_timeDeltaMsMMA < -15.0F || m_timeDeltaMsMMA > 15.0F){
|
||||
resetTimeDeltaAverage();
|
||||
}
|
||||
ui->driftAvgLabel->setText(QString("Avg Time Delta: %1 ms").arg((int)m_timeDeltaMsMMA));
|
||||
}
|
||||
|
||||
void MainWindow::resetTimeDeltaAverage(){
|
||||
@ -9015,7 +8921,7 @@ void MainWindow::processRxActivity() {
|
||||
int prevOffset = d.freq;
|
||||
if(hasExistingMessageBuffer(d.freq, false, &prevOffset) && (
|
||||
(m_messageBuffer[prevOffset].cmd.to == m_config.my_callsign()) ||
|
||||
// (isAllCallIncluded(m_messageBuffer[prevOffset].cmd.to) && !ui->selcalButton->isChecked()) || // don't incrementally print allcalls
|
||||
// (isAllCallIncluded(m_messageBuffer[prevOffset].cmd.to)) || // uncomment this if we want to incrementally print allcalls
|
||||
(isGroupCallIncluded(m_messageBuffer[prevOffset].cmd.to))
|
||||
)
|
||||
){
|
||||
@ -9042,10 +8948,6 @@ void MainWindow::processRxActivity() {
|
||||
if(d.isDirected && d.text.contains(": HB ")){ // TODO: HEARTBEAT
|
||||
continue;
|
||||
}
|
||||
|
||||
if(ui->selcalButton->isChecked()){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: incremental printing of directed messages
|
||||
@ -9342,8 +9244,9 @@ void MainWindow::processCommandActivity() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if selcal is enabled and this is an allcall, take no action.
|
||||
if (isAllCall && ui->selcalButton->isChecked()) {
|
||||
// we're only responding to allcalls if we are participating in the allcall group
|
||||
// but, don't avoid for heartbeats...those are technically allcalls but are processed differently
|
||||
if(isAllCall && m_config.avoid_allcall() && d.cmd != " HB"){
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -9457,11 +9360,7 @@ void MainWindow::processCommandActivity() {
|
||||
|
||||
// QUERIED ACTIVE
|
||||
else if (d.cmd == " STATUS?" && !isAllCall) {
|
||||
if(ui->activeButton->isChecked()){
|
||||
reply = QString("%1 ACTIVE").arg(d.from);
|
||||
} else {
|
||||
reply = QString("%1 IDLE").arg(d.from);
|
||||
}
|
||||
reply = QString("%1 AUTO:%2 VER:%3").arg(d.from).arg(ui->autoReplyButton->isChecked() ? "ON" : "OFF").arg(version());
|
||||
}
|
||||
|
||||
// QUERIED GRID
|
||||
@ -9585,7 +9484,7 @@ void MainWindow::processCommandActivity() {
|
||||
|
||||
// PROCESS ACTIVE HEARTBEAT
|
||||
// if we have auto reply enabled and we are heartbeating and selcall is not enabled
|
||||
else if (d.cmd == " HB" && ui->autoReplyButton->isChecked() && ui->hbMacroButton->isChecked() && m_hbInterval > 0 && !ui->selcalButton->isChecked()){
|
||||
else if (d.cmd == " HB" && ui->autoReplyButton->isChecked() && ui->hbMacroButton->isChecked() && m_hbInterval > 0){
|
||||
sendHeartbeatAck(d.from, d.snr);
|
||||
|
||||
if(isAllCall){
|
||||
@ -9598,7 +9497,7 @@ void MainWindow::processCommandActivity() {
|
||||
}
|
||||
|
||||
// PROCESS BUFFERED QUERY
|
||||
else if (d.cmd == " QUERY" && ui->autoReplyButton->isChecked() && !ui->selcalButton->isChecked()){
|
||||
else if (d.cmd == " QUERY" && ui->autoReplyButton->isChecked()){
|
||||
auto who = d.text;
|
||||
if(who.isEmpty()){
|
||||
continue;
|
||||
@ -11100,21 +10999,18 @@ void MainWindow::tx_watchdog (bool triggered)
|
||||
|
||||
// if the watchdog is triggered...we're no longer active
|
||||
bool wasAuto = ui->autoReplyButton->isChecked();
|
||||
bool wasActive = ui->activeButton->isChecked();
|
||||
bool wasHB = ui->hbMacroButton->isChecked();
|
||||
bool wasCQ = ui->cqMacroButton->isChecked();
|
||||
|
||||
// save the button states
|
||||
ui->autoReplyButton->setChecked(false);
|
||||
ui->activeButton->setChecked(false);
|
||||
ui->hbMacroButton->setChecked(false);
|
||||
ui->cqMacroButton->setChecked(false);
|
||||
|
||||
MessageBox::warning_message(this, QString("Attempting to transmit, but you have been inactive for more than %1 minutes.").arg(m_config.watchdog()));
|
||||
MessageBox::warning_message(this, QString("You have been inactive for more than %1 minutes.").arg(m_config.watchdog()));
|
||||
|
||||
// restore the button states
|
||||
ui->autoReplyButton->setChecked(wasAuto);
|
||||
ui->activeButton->setChecked(wasActive);
|
||||
ui->hbMacroButton->setChecked(wasHB);
|
||||
ui->cqMacroButton->setChecked(wasCQ);
|
||||
}
|
||||
|
@ -151,7 +151,6 @@ public slots:
|
||||
void restoreMessage();
|
||||
void initializeDummyData();
|
||||
bool ensureCallsignSet(bool alert=true);
|
||||
bool ensureSelcalCallsignSelected(bool alert=true);
|
||||
bool ensureKeyNotStuck(QString const& text);
|
||||
bool ensureNotIdle();
|
||||
void createMessage(QString const& text);
|
||||
@ -174,9 +173,7 @@ private slots:
|
||||
void on_tx6_editingFinished();
|
||||
void on_menuControl_aboutToShow();
|
||||
void on_actionEnable_Spotting_toggled(bool checked);
|
||||
void on_actionEnable_Active_toggled(bool checked);
|
||||
void on_actionEnable_Auto_Reply_toggled(bool checked);
|
||||
void on_actionEnable_Selcall_toggled(bool checked);
|
||||
void on_menuWindow_aboutToShow();
|
||||
void on_actionShow_Fullscreen_triggered(bool checked);
|
||||
void on_actionShow_Frequency_Clock_triggered(bool checked);
|
||||
@ -360,10 +357,8 @@ private slots:
|
||||
void on_autoReplyButton_toggled(bool checked);
|
||||
void on_monitorButton_toggled(bool checked);
|
||||
void on_monitorTxButton_toggled(bool checked);
|
||||
void on_selcalButton_toggled(bool checked);
|
||||
void on_tuneButton_toggled(bool checked);
|
||||
void on_spotButton_toggled(bool checked);
|
||||
void on_activeButton_toggled(bool checked);
|
||||
|
||||
void on_actionMessage_averaging_triggered();
|
||||
void on_actionFox_Log_triggered();
|
||||
|
273
mainwindow.ui
273
mainwindow.ui
@ -476,7 +476,7 @@ QPushButton:checked {
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8" columnstretch="1,1,1,1,0" columnminimumwidth="75,75,75,75,0">
|
||||
<layout class="QGridLayout" name="gridLayout_8" columnstretch="1,1,1,0" columnminimumwidth="75,75,75,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
@ -715,120 +715,39 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="activeButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Register your station as active or idle</p></body></html></string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color:lightgray;
|
||||
padding:0.25em 0.25em; font-weight:normal;
|
||||
border-style:solid;
|
||||
border-width:0px;
|
||||
border-radius:2px;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
background-color:#6699ff;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ACTIVE</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="selcalButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enable or disable selective calling (i.e., only directed messages to you will be displayed in the RX area)</p></body></html></string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color:lightgray;
|
||||
padding:0.25em 0.25em; font-weight:normal;
|
||||
border-style:solid;
|
||||
border-width:0px;
|
||||
border-radius:2px;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
background-color:#6699ff;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SELCALL</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="autoReplyButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -883,7 +802,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="logQSOButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@ -938,87 +857,55 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="turboButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color:lightgray;
|
||||
padding:0.25em 0.25em; font-weight:normal;
|
||||
border-style:solid;
|
||||
border-width:0px;
|
||||
border-radius:2px;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
background-color:#6699ff;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TURBO</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="turboButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color:lightgray;
|
||||
padding:0.25em 0.25em; font-weight:normal;
|
||||
border-style:solid;
|
||||
border-width:0px;
|
||||
border-radius:2px;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
background-color:#6699ff;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TURBO</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
18
varicode.cpp
18
varicode.cpp
@ -71,11 +71,10 @@ QMap<QString, int> directed_cmds = {
|
||||
|
||||
{" TU", 9 }, // thank you
|
||||
|
||||
{" ACTIVE", 10 }, // i am active
|
||||
{" IDLE", 11 }, // i am idle
|
||||
|
||||
{" HB", -1 }, // this is my heartbeat (unused except for faux processing of HBs as directed commands)
|
||||
|
||||
// {" ", 10 }, // unused
|
||||
// {" ", 11 }, // unused
|
||||
// {" ", 12 }, // unused
|
||||
|
||||
{" QUERY", 13 }, // can you transmit a ping to callsign?
|
||||
@ -103,7 +102,7 @@ QMap<QString, int> directed_cmds = {
|
||||
{" ", 31 }, // send freetext
|
||||
};
|
||||
|
||||
QSet<int> allowed_cmds = {-1, 0, 1, 2, 3, 4, 5, 6, /*7,*/ /*8,*/ 9, 10, 11, /*12,*/ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, /*24,*/ 25, 26, 27, 28, 29, 30, 31};
|
||||
QSet<int> allowed_cmds = {-1, 0, 1, 2, 3, 4, 5, 6, /*7,*/ /*8,*/ 9, /*10,*/ /*11,*/ /*12,*/ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, /*24,*/ 25, 26, 27, 28, 29, 30, 31};
|
||||
|
||||
QSet<int> buffered_cmds = {3, 5, /*6,*/ /*7,*/ 13, 14, 15};
|
||||
|
||||
@ -117,7 +116,7 @@ QMap<int, int> checksum_cmds = {
|
||||
};
|
||||
|
||||
QString callsign_pattern = QString("(?<callsign>[@]?[A-Z0-9/]+)");
|
||||
QString optional_cmd_pattern = QString("(?<cmd>\\s?(?:AGN[?]|QSL[?]|HW CPY[?]|APRS[:]|SNR[?]|QTC[?]|QTH[?]|GRID[?]|STATUS[?]|HEARING[?]|(?:(?:QUERY|ACK|73|YES|NO|SNR|QSL|RR|SK|FB|QTH|QTC|GRID|ACTIVE|IDLE|TU)(?=[ ]|$))|[?*^&@$> ]))?");
|
||||
QString optional_cmd_pattern = QString("(?<cmd>\\s?(?:AGN[?]|QSL[?]|HW CPY[?]|APRS[:]|SNR[?]|QTC[?]|QTH[?]|GRID[?]|STATUS[?]|HEARING[?]|(?:(?:QUERY|ACK|73|YES|NO|SNR|QSL|RR|SK|FB|QTH|QTC|GRID|TU)(?=[ ]|$))|[?*^&@$> ]))?");
|
||||
QString optional_grid_pattern = QString("(?<grid>\\s?[A-R]{2}[0-9]{2})?");
|
||||
QString optional_extended_grid_pattern = QString("^(?<grid>\\s?(?:[A-R]{2}[0-9]{2}(?:[A-X]{2}(?:[0-9]{2})?)*))?");
|
||||
QString optional_num_pattern = QString("(?<num>(?<=SNR|ACK)\\s?[-+]?(?:3[01]|[0-2]?[0-9]))?");
|
||||
@ -127,7 +126,7 @@ QRegularExpression directed_re("^" +
|
||||
optional_cmd_pattern +
|
||||
optional_num_pattern);
|
||||
|
||||
QRegularExpression heartbeat_re(R"(^\s*(?<type>CQCQCQ|CQ QRPP?|CQ DX|CQ TEST|CQ( CQ){0,2}|HB (ACTIVE|IDLE))(?:\s(?<grid>[A-R]{2}[0-9]{2}))?\b)");
|
||||
QRegularExpression heartbeat_re(R"(^\s*(?<type>CQCQCQ|CQ QRPP?|CQ DX|CQ TEST|CQ( CQ){0,2}|HB)(?:\s(?<grid>[A-R]{2}[0-9]{2}))?\b)");
|
||||
|
||||
QRegularExpression compound_re("^\\s*[`]" +
|
||||
callsign_pattern +
|
||||
@ -210,8 +209,8 @@ QMap<quint32, QString> cqs = {
|
||||
};
|
||||
|
||||
QMap<quint32, QString> hbs = {
|
||||
{ 0, "HB ACTIVE" },
|
||||
{ 1, "HB IDLE" },
|
||||
{ 0, "HB" }, // HB ACTIVE
|
||||
{ 1, "HB" }, // HB IDLE
|
||||
};
|
||||
|
||||
|
||||
@ -1146,8 +1145,7 @@ bool Varicode::isCompoundCallsign(const QString &callsign){
|
||||
// CQCQCQ EM73
|
||||
// CQ DX EM73
|
||||
// CQ QRP EM73
|
||||
// HB ACTIVE EM73
|
||||
// HB IDLE EM73
|
||||
// HB EM73
|
||||
QString Varicode::packHeartbeatMessage(QString const &text, const QString &callsign, int *n){
|
||||
QString frame;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user