Beaconing
This commit is contained in:
parent
d048f5a2ab
commit
e3a9762179
@ -716,6 +716,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
TxAgainTimer.setSingleShot(true);
|
TxAgainTimer.setSingleShot(true);
|
||||||
connect(&TxAgainTimer, SIGNAL(timeout()), this, SLOT(TxAgain()));
|
connect(&TxAgainTimer, SIGNAL(timeout()), this, SLOT(TxAgain()));
|
||||||
|
|
||||||
|
beaconTimer.setSingleShot(true);
|
||||||
|
connect(&beaconTimer, &QTimer::timeout, this, &MainWindow::prepareBeacon);
|
||||||
|
|
||||||
connect(m_wideGraph.data (), SIGNAL(setFreq3(int,int)),this,
|
connect(m_wideGraph.data (), SIGNAL(setFreq3(int,int)),this,
|
||||||
SLOT(setFreq4(int,int)));
|
SLOT(setFreq4(int,int)));
|
||||||
|
|
||||||
@ -4965,6 +4968,14 @@ void MainWindow::resetMessageUI(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::createMessage(QString const& text){
|
||||||
|
//resetMessage();
|
||||||
|
|
||||||
|
//ui->extFreeTextMsgEdit->setPlainText(text);
|
||||||
|
|
||||||
|
//createMessageTransmitQueue(text);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::createMessageTransmitQueue(QString const& text){
|
void MainWindow::createMessageTransmitQueue(QString const& text){
|
||||||
resetMessageTransmitQueue();
|
resetMessageTransmitQueue();
|
||||||
|
|
||||||
@ -5044,6 +5055,23 @@ void MainWindow::on_extFreeTextMsgEdit_currentTextChanged (QString const& text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_tableWidgetCalls_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected){
|
||||||
|
/*
|
||||||
|
if(selected.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QString selectedCall = ui->tableWidgetCalls->selectedItems().first()->text();
|
||||||
|
int offset = m_callActivity[selectedCall].freq;
|
||||||
|
|
||||||
|
QList<QTableWidgetItem*> items = ui->tableWidgetRXAll->findItems(QString("%1").arg(offset), Qt::MatchExactly);
|
||||||
|
if(items.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->tableWidgetRXAll->setItemSelected(items.first(), true);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
QStringList MainWindow::buildFT8MessageFrames(QString const& text){
|
QStringList MainWindow::buildFT8MessageFrames(QString const& text){
|
||||||
QStringList frames;
|
QStringList frames;
|
||||||
QString input = QString(text).replace("\n", " ").replace(" ", " ");
|
QString input = QString(text).replace("\n", " ").replace(" ", " ");
|
||||||
@ -5142,6 +5170,33 @@ bool MainWindow::prepareNextMessageFrame()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::scheduleBeacon(){
|
||||||
|
int timestamp = QDateTime::currentDateTimeUtc().addSecs(300).toSecsSinceEpoch();
|
||||||
|
m_nextBeacon = QDateTime::fromSecsSinceEpoch(roundUp(timestamp, 15) + 1, QTimeZone::utc());
|
||||||
|
beaconTimer.start(QDateTime::currentDateTimeUtc().msecsTo(m_nextBeacon) - 2*1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::prepareBeacon(){
|
||||||
|
if(!ui->beaconButton->isChecked()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(QDateTime::currentDateTimeUtc().msecsTo(m_nextBeacon) > 15*1000){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!m_txFrameQueue.isEmpty()){
|
||||||
|
beaconTimer.start(15*1000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString message = QString("DE %1 %2\nDE %1 %2").arg(m_config.my_callsign()).arg(m_config.my_grid().mid(0, 4));
|
||||||
|
ui->extFreeTextMsgEdit->setPlainText(message);
|
||||||
|
ui->startTxButton->setChecked(true);
|
||||||
|
|
||||||
|
scheduleBeacon();
|
||||||
|
}
|
||||||
|
|
||||||
// this function is called by auto_tx_mode, which is called by autoButton.clicked
|
// this function is called by auto_tx_mode, which is called by autoButton.clicked
|
||||||
void MainWindow::on_startTxButton_toggled(bool checked)
|
void MainWindow::on_startTxButton_toggled(bool checked)
|
||||||
{
|
{
|
||||||
@ -6320,26 +6375,13 @@ void MainWindow::on_pbT2R_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int roundUp(int numToRound, int multiple)
|
|
||||||
{
|
|
||||||
if(multiple == 0)
|
|
||||||
{
|
|
||||||
return numToRound;
|
|
||||||
}
|
|
||||||
|
|
||||||
int roundDown = ( (int) (numToRound) / multiple) * multiple;
|
|
||||||
return roundDown + multiple;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::on_beaconButton_clicked()
|
void MainWindow::on_beaconButton_clicked()
|
||||||
{
|
{
|
||||||
if(ui->beaconButton->isChecked()){
|
if(ui->beaconButton->isChecked()){
|
||||||
int timestamp = QDateTime::currentDateTimeUtc().addSecs(300).toSecsSinceEpoch();
|
scheduleBeacon();
|
||||||
m_nextBeacon = QDateTime::fromSecsSinceEpoch(roundUp(timestamp, 15) + 1, QTimeZone::utc());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_readFreq_clicked()
|
void MainWindow::on_readFreq_clicked()
|
||||||
{
|
{
|
||||||
if (m_transmitting) return;
|
if (m_transmitting) return;
|
||||||
|
17
mainwindow.h
17
mainwindow.h
@ -121,6 +121,7 @@ public slots:
|
|||||||
|
|
||||||
void resetMessage();
|
void resetMessage();
|
||||||
void resetMessageUI();
|
void resetMessageUI();
|
||||||
|
void createMessage(QString const& text);
|
||||||
void createMessageTransmitQueue(QString const& text);
|
void createMessageTransmitQueue(QString const& text);
|
||||||
void resetMessageTransmitQueue();
|
void resetMessageTransmitQueue();
|
||||||
QString popMessageFrame();
|
QString popMessageFrame();
|
||||||
@ -188,6 +189,7 @@ private slots:
|
|||||||
void on_txb5_clicked();
|
void on_txb5_clicked();
|
||||||
void on_txb5_doubleClicked ();
|
void on_txb5_doubleClicked ();
|
||||||
void on_txb6_clicked();
|
void on_txb6_clicked();
|
||||||
|
void on_tableWidgetCalls_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||||
void on_startTxButton_toggled(bool checked);
|
void on_startTxButton_toggled(bool checked);
|
||||||
void splitAndSendNextMessage();
|
void splitAndSendNextMessage();
|
||||||
void on_rbNextFreeTextMsg_toggled (bool status);
|
void on_rbNextFreeTextMsg_toggled (bool status);
|
||||||
@ -234,6 +236,8 @@ private slots:
|
|||||||
QString parseFT8Message(QString input);
|
QString parseFT8Message(QString input);
|
||||||
int countFreeTextMsgs(QString input);
|
int countFreeTextMsgs(QString input);
|
||||||
bool prepareNextMessageFrame();
|
bool prepareNextMessageFrame();
|
||||||
|
void scheduleBeacon();
|
||||||
|
void prepareBeacon();
|
||||||
void on_rptSpinBox_valueChanged(int n);
|
void on_rptSpinBox_valueChanged(int n);
|
||||||
void killFile();
|
void killFile();
|
||||||
void on_tuneButton_clicked (bool);
|
void on_tuneButton_clicked (bool);
|
||||||
@ -567,6 +571,7 @@ private:
|
|||||||
QTimer minuteTimer;
|
QTimer minuteTimer;
|
||||||
QTimer splashTimer;
|
QTimer splashTimer;
|
||||||
QTimer p1Timer;
|
QTimer p1Timer;
|
||||||
|
QTimer beaconTimer;
|
||||||
|
|
||||||
QString m_path;
|
QString m_path;
|
||||||
QString m_baseCall;
|
QString m_baseCall;
|
||||||
@ -760,6 +765,18 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static int roundUp(int numToRound, int multiple)
|
||||||
|
{
|
||||||
|
if(multiple == 0)
|
||||||
|
{
|
||||||
|
return numToRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
int roundDown = ( (int) (numToRound) / multiple) * multiple;
|
||||||
|
return roundDown + multiple;
|
||||||
|
}
|
||||||
|
|
||||||
extern int killbyname(const char* progName);
|
extern int killbyname(const char* progName);
|
||||||
extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
|
extern void getDev(int* numDevices,char hostAPI_DeviceName[][50],
|
||||||
int minChan[], int maxChan[],
|
int minChan[], int maxChan[],
|
||||||
|
@ -254,6 +254,19 @@ o</string>
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labUTC">
|
<widget class="QLabel" name="labUTC">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -316,6 +329,19 @@ color : white;
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -394,7 +420,7 @@ background-color: #00ff00;
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="logButton">
|
<widget class="QPushButton" name="logQSOButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -836,6 +862,12 @@ QTextEdit[readOnly="true"] {
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTableWidget" name="tableWidgetCalls">
|
<widget class="QTableWidget" name="tableWidgetCalls">
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
|
</property>
|
||||||
|
<property name="showDropIndicator" stdset="0">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -3507,7 +3539,7 @@ list. The list can be maintained in Settings (F2).</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="logQSOButton">
|
<widget class="QPushButton" name="logQSOButton_old">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>50</width>
|
<width>50</width>
|
||||||
|
Loading…
Reference in New Issue
Block a user