Update heartbeat to allow on demand only. Add AUTO requirement for ACKs
This commit is contained in:
parent
6f648d5a60
commit
33446297fa
@ -633,23 +633,26 @@ text message.</string>
|
|||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><html><head/><body><p>Number of minutes between unattended heartbeat transmissions.</p></body></html></string>
|
<string><html><head/><body><p>Number of minutes between unattended heartbeat transmissions.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="specialValueText">
|
||||||
|
<string>Disabled</string>
|
||||||
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> minutes</string>
|
<string> minutes</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="prefix">
|
<property name="prefix">
|
||||||
<string/>
|
<string>every </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>5</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>1440</number>
|
<number>1440</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>1</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>15</number>
|
<number>30</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -676,7 +679,7 @@ text message.</string>
|
|||||||
<string> minutes</string>
|
<string> minutes</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="prefix">
|
<property name="prefix">
|
||||||
<string/>
|
<string>after </string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
@ -4381,7 +4381,22 @@ void MainWindow::guiUpdate()
|
|||||||
ui->labUTC->setText(utc);
|
ui->labUTC->setText(utc);
|
||||||
|
|
||||||
auto delta = t.secsTo(m_nextHeartbeat);
|
auto delta = t.secsTo(m_nextHeartbeat);
|
||||||
auto ping = ui->heartbeatButton->isChecked() ? delta > 0 ? QString("%1 s").arg(delta) : "queued!" : m_nextHeartPaused ? "paused" : "disabled";
|
QString ping;
|
||||||
|
if(ui->heartbeatButton->isChecked()){
|
||||||
|
if(heartbeatTimer.isActive()){
|
||||||
|
if(delta > 0){
|
||||||
|
ping = QString("%1 s").arg(delta);
|
||||||
|
} else {
|
||||||
|
ping = "queued!";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ping = "on demand";
|
||||||
|
}
|
||||||
|
} else if (m_nextHeartPaused) {
|
||||||
|
ping = "paused";
|
||||||
|
} else {
|
||||||
|
ping = "disabled";
|
||||||
|
}
|
||||||
ui->labHeartbeat->setText(QString("Next Heartbeat: %1").arg(ping));
|
ui->labHeartbeat->setText(QString("Next Heartbeat: %1").arg(ping));
|
||||||
|
|
||||||
auto callLabel = m_config.my_callsign();
|
auto callLabel = m_config.my_callsign();
|
||||||
@ -5498,6 +5513,12 @@ void MainWindow::scheduleHeartbeat(bool first){
|
|||||||
auto timestamp = DriftingDateTime::currentDateTimeUtc();
|
auto timestamp = DriftingDateTime::currentDateTimeUtc();
|
||||||
auto orig = timestamp;
|
auto orig = timestamp;
|
||||||
|
|
||||||
|
// if we have the heartbeat interval disabled, return early, unless this is a "heartbeat now"
|
||||||
|
if(!m_config.heartbeat() && !first){
|
||||||
|
heartbeatTimer.stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// remove milliseconds
|
// remove milliseconds
|
||||||
auto t = timestamp.time();
|
auto t = timestamp.time();
|
||||||
t.setHMS(t.hour(), t.minute(), t.second());
|
t.setHMS(t.hour(), t.minute(), t.second());
|
||||||
@ -8838,7 +8859,7 @@ void MainWindow::processCommandActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PROCESS HEARTBEAT
|
// PROCESS HEARTBEAT
|
||||||
else if (d.cmd == " HEARTBEAT" && ui->heartbeatButton->isChecked()){
|
else if (d.cmd == " HEARTBEAT" && ui->heartbeatButton->isChecked() && ui->autoReplyButton->isChecked()){
|
||||||
reply = QString("%1 HEARTBEAT ACK %2").arg(d.from).arg(Varicode::formatSNR(d.snr));
|
reply = QString("%1 HEARTBEAT ACK %2").arg(d.from).arg(Varicode::formatSNR(d.snr));
|
||||||
|
|
||||||
enqueueHeartbeat(reply);
|
enqueueHeartbeat(reply);
|
||||||
|
Loading…
Reference in New Issue
Block a user