From 851b658298afb9bafeda98ffbfa2ade612c656be Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sun, 2 Jun 2019 22:17:11 +0200 Subject: New upstream version 2.1.0~rc6+repack --- widgets/CabrilloLogWindow.cpp | 12 +-- widgets/CabrilloLogWindow.ui | 3 + widgets/DateTimeEdit.hpp | 23 ++++ widgets/FoxLogWindow.cpp | 2 - widgets/FrequencyDeltaLineEdit.cpp | 54 ++++++++++ widgets/FrequencyDeltaLineEdit.hpp | 29 +++++ widgets/FrequencyLineEdit.cpp | 18 ---- widgets/FrequencyLineEdit.hpp | 18 +--- widgets/astro.cpp | 7 +- widgets/astro.h | 2 +- widgets/displaytext.cpp | 2 +- widgets/displaytext.h | 2 - widgets/fastgraph.cpp | 4 +- widgets/fastgraph.h | 6 +- widgets/fastplot.cpp | 6 +- widgets/fastplot.h | 4 +- widgets/logqso.cpp | 54 ++-------- widgets/logqso.h | 11 +- widgets/logqso.ui | 44 +++++++- widgets/mainwindow.cpp | 211 +++++++++++++++++++------------------ widgets/mainwindow.h | 6 +- widgets/mainwindow.ui | 128 ++++++++++++++++++++-- widgets/plotter.cpp | 10 +- widgets/plotter.h | 4 +- widgets/widegraph.cpp | 16 +-- widgets/widegraph.h | 7 +- widgets/widgets.pri | 6 +- 27 files changed, 437 insertions(+), 252 deletions(-) create mode 100644 widgets/DateTimeEdit.hpp create mode 100644 widgets/FrequencyDeltaLineEdit.cpp create mode 100644 widgets/FrequencyDeltaLineEdit.hpp (limited to 'widgets') diff --git a/widgets/CabrilloLogWindow.cpp b/widgets/CabrilloLogWindow.cpp index 44a52cc6..6fd75313 100644 --- a/widgets/CabrilloLogWindow.cpp +++ b/widgets/CabrilloLogWindow.cpp @@ -1,12 +1,13 @@ #include "CabrilloLogWindow.hpp" +#include #include #include #include #include "Configuration.hpp" #include "models/Bands.hpp" +#include "item_delegates/FrequencyDelegate.hpp" #include "item_delegates/ForeignKeyDelegate.hpp" -#include "item_delegates/DateTimeAsSecsSinceEpochDelegate.hpp" #include "item_delegates/CallsignDelegate.hpp" #include "pimpl_impl.hpp" @@ -30,7 +31,7 @@ namespace switch (index.column ()) { case 1: - case 6: + case 7: return Qt::AlignRight + Qt::AlignVCenter; default: break; @@ -64,11 +65,10 @@ CabrilloLogWindow::CabrilloLogWindow (QSettings * settings, Configuration const m_->format_model_.setSourceModel (m_->log_model_); m_->ui_.log_table_view->setModel (&m_->format_model_); set_log_view (m_->ui_.log_table_view); - m_->ui_.log_table_view->setItemDelegateForColumn (2, new DateTimeAsSecsSinceEpochDelegate {this}); - m_->ui_.log_table_view->setItemDelegateForColumn (3, new CallsignDelegate {this}); - m_->ui_.log_table_view->setItemDelegateForColumn (6, new ForeignKeyDelegate {configuration->bands (), 0, this}); + m_->ui_.log_table_view->setItemDelegateForColumn (1, new FrequencyDelegate {this}); + m_->ui_.log_table_view->setItemDelegateForColumn (4, new CallsignDelegate {this}); auto h_header = m_->ui_.log_table_view->horizontalHeader (); - h_header->moveSection (6, 1); // band to first column + h_header->moveSection (7, 1); // band to first column } CabrilloLogWindow::~CabrilloLogWindow () diff --git a/widgets/CabrilloLogWindow.ui b/widgets/CabrilloLogWindow.ui index efefe5d3..35b4d597 100644 --- a/widgets/CabrilloLogWindow.ui +++ b/widgets/CabrilloLogWindow.ui @@ -19,6 +19,9 @@ <html><head/><body><p>Right-click here for available actions.</p></body></html> + + Right-click here for available actions. + true diff --git a/widgets/DateTimeEdit.hpp b/widgets/DateTimeEdit.hpp new file mode 100644 index 00000000..ad767a55 --- /dev/null +++ b/widgets/DateTimeEdit.hpp @@ -0,0 +1,23 @@ +#ifndef DATE_TIME_EDIT_HPP_ +#define DATE_TIME_EDIT_HPP_ + +#include + +class QWidget; + +// +// DateTimeEdit - format includes seconds +// +class DateTimeEdit final + : public QDateTimeEdit +{ +public: + explicit DateTimeEdit (QWidget * parent = nullptr) + : QDateTimeEdit {parent} + { + setDisplayFormat (locale ().dateFormat (QLocale::ShortFormat) + " hh:mm:ss"); + setTimeSpec (Qt::UTC); + } +}; + +#endif diff --git a/widgets/FoxLogWindow.cpp b/widgets/FoxLogWindow.cpp index 36f20b85..9c29a30a 100644 --- a/widgets/FoxLogWindow.cpp +++ b/widgets/FoxLogWindow.cpp @@ -13,7 +13,6 @@ #include "models/Bands.hpp" #include "models/FoxLog.hpp" #include "item_delegates/ForeignKeyDelegate.hpp" -#include "item_delegates/DateTimeAsSecsSinceEpochDelegate.hpp" #include "item_delegates/CallsignDelegate.hpp" #include "item_delegates/MaidenheadLocatorDelegate.hpp" #include "pimpl_impl.hpp" @@ -42,7 +41,6 @@ FoxLogWindow::FoxLogWindow (QSettings * settings, Configuration const * configur m_->ui_.setupUi (this); m_->ui_.log_table_view->setModel (m_->log_->model ()); set_log_view (m_->ui_.log_table_view); - m_->ui_.log_table_view->setItemDelegateForColumn (1, new DateTimeAsSecsSinceEpochDelegate {this}); m_->ui_.log_table_view->setItemDelegateForColumn (2, new CallsignDelegate {this}); m_->ui_.log_table_view->setItemDelegateForColumn (3, new MaidenheadLocatorDelegate {this}); m_->ui_.log_table_view->setItemDelegateForColumn (6, new ForeignKeyDelegate {configuration->bands (), 0, this}); diff --git a/widgets/FrequencyDeltaLineEdit.cpp b/widgets/FrequencyDeltaLineEdit.cpp new file mode 100644 index 00000000..b7ed144b --- /dev/null +++ b/widgets/FrequencyDeltaLineEdit.cpp @@ -0,0 +1,54 @@ +#include "FrequencyDeltaLineEdit.hpp" + +#include + +#include +#include +#include + +#include "moc_FrequencyDeltaLineEdit.cpp" + +namespace +{ + class MHzValidator + : public QDoubleValidator + { + public: + MHzValidator (double bottom, double top, QObject * parent = nullptr) + : QDoubleValidator {bottom, top, 6, parent} + { + } + + State validate (QString& input, int& pos) const override + { + State result = QDoubleValidator::validate (input, pos); + if (Acceptable == result) + { + bool ok; + (void)QLocale {}.toDouble (input, &ok); + if (!ok) + { + result = Intermediate; + } + } + return result; + } + }; +} + +FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent) + : QLineEdit (parent) +{ + setValidator (new MHzValidator {-std::numeric_limits::max () / 10.e6, + std::numeric_limits::max () / 10.e6, this}); +} + +auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta +{ + return Radio::frequency_delta (text (), 6); +} + +void FrequencyDeltaLineEdit::frequency_delta (FrequencyDelta d) +{ + setText (Radio::frequency_MHz_string (d)); +} diff --git a/widgets/FrequencyDeltaLineEdit.hpp b/widgets/FrequencyDeltaLineEdit.hpp new file mode 100644 index 00000000..caa00ecb --- /dev/null +++ b/widgets/FrequencyDeltaLineEdit.hpp @@ -0,0 +1,29 @@ +#ifndef FREQUENCY_DELTA_LINE_EDIT_HPP_ +#define FREQUENCY_DELTA_LINE_EDIT_HPP_ + +#include + +#include "Radio.hpp" + +class QWidget; + +// +// MHz frequency delta line edit with validation +// +class FrequencyDeltaLineEdit final + : public QLineEdit +{ + Q_OBJECT; + Q_PROPERTY (FrequencyDelta frequency_delta READ frequency_delta WRITE frequency_delta USER true); + +public: + using FrequencyDelta = Radio::FrequencyDelta; + + explicit FrequencyDeltaLineEdit (QWidget * parent = nullptr); + + // Property frequency_delta implementation + FrequencyDelta frequency_delta () const; + void frequency_delta (FrequencyDelta); +}; + +#endif diff --git a/widgets/FrequencyLineEdit.cpp b/widgets/FrequencyLineEdit.cpp index 78f8b2e1..1ca2ba20 100644 --- a/widgets/FrequencyLineEdit.cpp +++ b/widgets/FrequencyLineEdit.cpp @@ -51,21 +51,3 @@ void FrequencyLineEdit::frequency (Frequency f) { setText (Radio::frequency_MHz_string (f)); } - - -FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent) - : QLineEdit (parent) -{ - setValidator (new MHzValidator {-std::numeric_limits::max () / 10.e6, - std::numeric_limits::max () / 10.e6, this}); -} - -auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta -{ - return Radio::frequency_delta (text (), 6); -} - -void FrequencyDeltaLineEdit::frequency_delta (FrequencyDelta d) -{ - setText (Radio::frequency_MHz_string (d)); -} diff --git a/widgets/FrequencyLineEdit.hpp b/widgets/FrequencyLineEdit.hpp index dec0feb0..7e535f5a 100644 --- a/widgets/FrequencyLineEdit.hpp +++ b/widgets/FrequencyLineEdit.hpp @@ -8,7 +8,7 @@ class QWidget; // -// MHz frequency line edits with validation +// MHz frequency line edit with validation // class FrequencyLineEdit final : public QLineEdit @@ -26,20 +26,4 @@ public: void frequency (Frequency); }; -class FrequencyDeltaLineEdit final - : public QLineEdit -{ - Q_OBJECT; - Q_PROPERTY (FrequencyDelta frequency_delta READ frequency_delta WRITE frequency_delta USER true); - -public: - using FrequencyDelta = Radio::FrequencyDelta; - - explicit FrequencyDeltaLineEdit (QWidget * parent = nullptr); - - // Property frequency_delta implementation - FrequencyDelta frequency_delta () const; - void frequency_delta (FrequencyDelta); -}; - #endif diff --git a/widgets/astro.cpp b/widgets/astro.cpp index 4ee55da4..c1eee015 100644 --- a/widgets/astro.cpp +++ b/widgets/astro.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "commons.h" #include "MessageBox.hpp" @@ -90,7 +91,7 @@ void Astro::write_settings () } auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const& hisgrid, Frequency freq, - bool dx_is_self, bool bTx, bool no_tx_QSY, int TR_period) -> Correction + bool dx_is_self, bool bTx, bool no_tx_QSY, double TR_period) -> Correction { Frequency freq_moon {freq}; double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx; @@ -211,8 +212,8 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const // // use a base time of (secs-since-epoch + 2) so as to be sure // we do the next period if we calculate just before it starts - auto sec_since_epoch = t.toMSecsSinceEpoch () / 1000 + 2; - auto target_sec = sec_since_epoch - sec_since_epoch % TR_period + TR_period / 2; + auto sec_since_epoch = t.toMSecsSinceEpoch ()/1000 + 2; + auto target_sec = sec_since_epoch - fmod(double(sec_since_epoch),TR_period) + 0.5*TR_period; auto target_date_time = QDateTime::fromMSecsSinceEpoch (target_sec * 1000, Qt::UTC); QString date {target_date_time.date().toString("yyyy MMM dd").trimmed ()}; QString utc {target_date_time.time().toString().trimmed ()}; diff --git a/widgets/astro.h b/widgets/astro.h index 03d8c66c..4f7f71d5 100644 --- a/widgets/astro.h +++ b/widgets/astro.h @@ -44,7 +44,7 @@ public: bool dx_is_self, bool bTx, bool no_tx_QSY, - int TR_period); + double TR_period); bool doppler_tracking () const; Q_SLOT void nominal_frequency (Frequency rx, Frequency tx); diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index c0bcd412..53d7cd5c 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -271,7 +271,7 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons if(call.length()<3) return message; if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message; - auto const& looked_up = logBook.countries ().lookup (call); + auto const& looked_up = logBook.countries ()->lookup (call); logBook.match (call, currentMode, grid, looked_up, callB4, countryB4, gridB4, continentB4, CQZoneB4, ITUZoneB4); logBook.match (call, currentMode, grid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, currentBand); diff --git a/widgets/displaytext.h b/widgets/displaytext.h index 7f308bef..8b580b8a 100644 --- a/widgets/displaytext.h +++ b/widgets/displaytext.h @@ -65,6 +65,4 @@ private: int modified_vertical_scrollbar_max_; }; - extern QHash m_LoTW; - #endif // DISPLAYTEXT_H diff --git a/widgets/fastgraph.cpp b/widgets/fastgraph.cpp index e599138f..9efe5fc6 100644 --- a/widgets/fastgraph.cpp +++ b/widgets/fastgraph.cpp @@ -86,9 +86,9 @@ void FastGraph::on_greenZeroSlider_valueChanged(int value) ui->fastPlot->draw(); } -void FastGraph::setTRPeriod(int n) +void FastGraph::setTRPeriod(double p) { - m_TRperiod=n; + m_TRperiod=p; ui->fastPlot->setTRperiod(m_TRperiod); } diff --git a/widgets/fastgraph.h b/widgets/fastgraph.h index 7ed32671..b5f7c0b8 100644 --- a/widgets/fastgraph.h +++ b/widgets/fastgraph.h @@ -22,7 +22,7 @@ public: void plotSpec(bool diskData, int UTCdisk); void saveSettings(); - void setTRPeriod(int n); + void setTRPeriod(double p); void setMode(QString mode); signals: @@ -40,8 +40,8 @@ protected: private: QSettings * m_settings; - float m_ave; - qint32 m_TRperiod; + float m_ave; + double m_TRperiod; QScopedPointer ui; }; diff --git a/widgets/fastplot.cpp b/widgets/fastplot.cpp index 1437834d..a388f0ac 100644 --- a/widgets/fastplot.cpp +++ b/widgets/fastplot.cpp @@ -135,11 +135,11 @@ void FPlotter::setGreenZero(int n) m_bPaint2=true; } -void FPlotter::setTRperiod(int n) +void FPlotter::setTRperiod(double p) { - m_TRperiod=n; + m_TRperiod=p; m_pixPerSecond=12000.0/512.0; - if(m_TRperiod<30) m_pixPerSecond=12000.0/256.0; + if(m_TRperiod<30.0) m_pixPerSecond=12000.0/256.0; drawScale(); update(); } diff --git a/widgets/fastplot.h b/widgets/fastplot.h index b1391338..f24fcc24 100644 --- a/widgets/fastplot.h +++ b/widgets/fastplot.h @@ -37,7 +37,7 @@ public: void setPlotZero(int plotZero); void setPlotGain(int plotGain); void setGreenZero(int n); - void setTRperiod(int n); + void setTRperiod(double p); void drawScale(); void setMode(QString mode); @@ -68,6 +68,7 @@ private: QString m_mode; double m_pixPerSecond; + double m_TRperiod; qint32 m_hdivs; qint32 m_h; @@ -75,7 +76,6 @@ private: qint32 m_h2; QPixmap m_HorizPixmap; qint32 m_jh0; - qint32 m_TRperiod; bool m_bPaint2; }; diff --git a/widgets/logqso.cpp b/widgets/logqso.cpp index eae82aac..2eaedf11 100644 --- a/widgets/logqso.cpp +++ b/widgets/logqso.cpp @@ -1,12 +1,9 @@ #include "logqso.h" -#include -#include #include #include #include #include -#include #include "logbook/logbook.h" #include "MessageBox.hpp" @@ -18,40 +15,18 @@ #include "ui_logqso.h" #include "moc_logqso.cpp" -namespace -{ - using dist_type = std::uniform_int_distribution; - std::random_device rd; - std::mt19937 twister (rd ()); - dist_type int_distribution; -} - LogQSO::LogQSO(QString const& programTitle, QSettings * settings - , Configuration const * config, QWidget *parent) + , Configuration const * config, LogBook * log, QWidget *parent) : QDialog {parent, Qt::WindowStaysOnTopHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint} , ui(new Ui::LogQSO) - , ok_ {new QPushButton {"OK", this}} - , cancel_ {new QPushButton {"Cancel", this}} , m_settings (settings) , m_config {config} + , m_log {log} { ui->setupUi(this); setWindowTitle(programTitle + " - Log QSO"); - ui->grid->setValidator (new MaidenheadLocatorValidator {this}); - - ok_->setAutoDefault (false); - ok_->setFocusPolicy (Qt::ClickFocus); - cancel_->setAutoDefault (false); - ui->button_layout->addStretch (); - ui->button_layout->addWidget (ok_); - ui->button_layout->addStretch (); - ui->button_layout->addWidget (cancel_); - ui->button_layout->addStretch (); - loadSettings (); - - connect (ok_, &QAbstractButton::clicked, [this] (bool) {accept ();}); - connect (cancel_, &QAbstractButton::clicked, [this] (bool) {reject ();}); + ui->grid->setValidator (new MaidenheadLocatorValidator {this}); } LogQSO::~LogQSO () @@ -83,8 +58,7 @@ void LogQSO::storeSettings () const void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString mode, QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, QDateTime const& dateTimeOff, - Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd, - CabrilloLog * cabrillo_log) + Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd) { if(!isHidden()) return; ui->call->setText (hisCall); @@ -126,7 +100,6 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString ui->loggedOperator->setText(m_config->opCall()); ui->exchSent->setText (xSent); ui->exchRcvd->setText (xRcvd); - m_cabrilloLog = cabrillo_log; using SpOp = Configuration::SpecialOperatingActivity; auto special_op = m_config->special_op_id (); @@ -139,22 +112,7 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString } else { - // randomize accessible name of buttons - ok_->setAccessibleName (QString::number (int_distribution (twister))); - cancel_->setAccessibleName (QString::number (int_distribution (twister))); - // random sibling order of buttons - if (int_distribution (twister, dist_type::param_type {0, 1})) ok_->stackUnder (cancel_); else cancel_->stackUnder (ok_); - // random shuffle of layout items - for (int item = ui->button_layout->count () - 1; item > 0; --item) - { - auto other_item = int_distribution (twister, dist_type::param_type {0, item}); - if (item != other_item) - { - ui->button_layout->insertItem (other_item, ui->button_layout->takeAt (item)); - ui->button_layout->insertItem (item, ui->button_layout->takeAt (other_item + 1)); - } - } - show (); + show(); } } @@ -199,7 +157,7 @@ void LogQSO::accept() return; // without accepting } - if (!m_cabrilloLog->add_QSO (m_dialFreq, dateTimeOff, hisCall, xsent, xrcvd)) + if (!m_log->contest_log ()->add_QSO (m_dialFreq, mode, dateTimeOff, hisCall, xsent, xrcvd)) { show (); MessageBox::warning_message (this, tr ("Invalid QSO Data"), diff --git a/widgets/logqso.h b/widgets/logqso.h index 5cbb2044..739a601f 100644 --- a/widgets/logqso.h +++ b/widgets/logqso.h @@ -17,20 +17,19 @@ namespace Ui { class QSettings; class Configuration; class QByteArray; -class CabrilloLog; -class QPushButton; +class LogBook; class LogQSO : public QDialog { Q_OBJECT public: - explicit LogQSO(QString const& programTitle, QSettings *, Configuration const *, QWidget *parent = 0); + explicit LogQSO(QString const& programTitle, QSettings *, Configuration const *, LogBook *, QWidget *parent = 0); ~LogQSO(); void initLogQSO(QString const& hisCall, QString const& hisGrid, QString mode, QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, QDateTime const& dateTimeOff, Radio::Frequency dialFreq, - bool noSuffix, QString xSent, QString xRcvd, CabrilloLog *); + bool noSuffix, QString xSent, QString xRcvd); public slots: void accept(); @@ -53,16 +52,14 @@ private: void storeSettings () const; QScopedPointer ui; - QPushButton * ok_; - QPushButton * cancel_; QSettings * m_settings; Configuration const * m_config; + LogBook * m_log; QString m_txPower; QString m_comments; Radio::Frequency m_dialFreq; QString m_myCall; QString m_myGrid; - CabrilloLog * m_cabrilloLog; }; #endif // LogQSO_H diff --git a/widgets/logqso.ui b/widgets/logqso.ui index 7d249677..a03a3028 100644 --- a/widgets/logqso.ui +++ b/widgets/logqso.ui @@ -461,7 +461,14 @@ - + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + @@ -481,5 +488,38 @@ cbComments - + + + buttonBox + accepted() + LogQSO + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + LogQSO + reject() + + + 316 + 260 + + + 286 + 274 + + + + diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index b96240cb..277dbfdd 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include "revision_utils.hpp" #include "qt_helpers.hpp" @@ -243,10 +244,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_echoGraph (new EchoGraph(m_settings)), m_fastGraph (new FastGraph(m_settings)), // no parent so that it has a taskbar icon - m_logDlg (new LogQSO (program_title (), m_settings, &m_config, nullptr)), + m_logDlg (new LogQSO (program_title (), m_settings, &m_config, &m_logBook, nullptr)), m_lastDialFreq {0}, m_dialFreqRxWSPR {0}, - m_detector {new Detector {RX_SAMPLE_RATE, NTMAX, downSampleFactor}}, + m_detector {new Detector {RX_SAMPLE_RATE, double(NTMAX), downSampleFactor}}, m_FFTSize {6192 / 2}, // conservative value to avoid buffer overruns m_soundInput {new SoundInput}, m_modulator {new Modulator {TX_SAMPLE_RATE, NTMAX}}, @@ -257,6 +258,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_freqTxNominal {0}, m_s6 {0.}, m_tRemaining {0.}, + m_TRperiod {60.0}, m_DTtol {3.0}, m_waterfallAvg {1}, m_ntx {1}, @@ -268,7 +270,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_nutc0 {999999}, m_ntr {0}, m_tx {0}, - m_TRperiod {60}, m_inGain {0}, m_secID {0}, m_idleMinutes {0}, @@ -877,7 +878,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, connect (&m_wav_future_watcher, &QFutureWatcher::finished, this, &MainWindow::diskDat); connect(&watcher3, SIGNAL(finished()),this,SLOT(fast_decode_done())); -// Q_EMIT startAudioInputStream (m_config.audio_input_device (), m_framesAudioInputBuffered, &m_detector, m_downSampleFactor, m_config.audio_input_channel ()); Q_EMIT startAudioInputStream (m_config.audio_input_device (), m_framesAudioInputBuffered, m_detector, m_downSampleFactor, m_config.audio_input_channel ()); Q_EMIT initializeAudioOutputStream (m_config.audio_output_device (), AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2, m_msAudioOutputBuffered); Q_EMIT transmitFrequency (ui->TxFreqSpinBox->value () - m_XIT); @@ -993,11 +993,17 @@ void MainWindow::not_GA_warning_message () MessageBox::critical_message (this, "

" "This is a pre-release version of WSJT-X 2.1.0 made " - "available for testing purposes. It will become nonfunctional " - "after June 7, 2019."); - QDateTime now=QDateTime::currentDateTime(); - QDateTime timeout=QDateTime(QDate(2019,6,7)); - if(now.daysTo(timeout) < 0) Q_EMIT finished(); + "available for testing purposes. By design it will " + "be nonfunctional during the 2019 ARRL June VHF contest " + "(June 8-10) and Field Day (June 22-23) weekends. It " + "will be permanently nonfunctional after July 21, 2019."); + auto now = QDateTime::currentDateTimeUtc (); + if ((QDateTime {{2019, 6, 8}, {18, 0}, Qt::UTC} <= now + && now < QDateTime {{2019, 6, 10}, {3, 0}, Qt::UTC}) + || now >= QDateTime {{2019, 7, 21}, {0, 0}, Qt::UTC}) + { + Q_EMIT finished (); + } } void MainWindow::initialize_fonts () @@ -1323,7 +1329,7 @@ void MainWindow::fixStop() } else if (m_mode=="FT8") { m_hsymStop=50; } else if (m_mode=="FT4") { - m_hsymStop=18; + m_hsymStop=21; } } @@ -1355,7 +1361,7 @@ void MainWindow::dataSink(qint64 frames) } // Get power, spectrum, and ihsym - int trmin=m_TRperiod/60; + int trmin=m_TRperiod/60.0; // int k (frames - 1); dec_data.params.nfa=m_wideGraph->nStartFreq(); dec_data.params.nfb=m_wideGraph->Fmax(); @@ -1452,19 +1458,20 @@ void MainWindow::dataSink(qint64 frames) if(!m_mode.startsWith ("WSPR")) decode(); //Start decoder if(!m_diskData) { //Always save; may delete later - if(m_mode=="FT8" or m_mode=="FT4") { - int n=now.time().second() % m_TRperiod; + int n=fmod(double(now.time().second()),m_TRperiod); if(n<(m_TRperiod/2)) n=n+m_TRperiod; auto const& period_start=now.addSecs(-n); m_fnameWE=m_config.save_directory().absoluteFilePath (period_start.toString("yyMMdd_hhmmss")); +// qDebug() << "datasink 2" << QDateTime::currentDateTimeUtc().toString("ss.zzz") +// << n << period_start.toString("ss.zzz"); } else { - auto const& period_start = now.addSecs (-(now.time ().minute () % (m_TRperiod / 60)) * 60); + auto const& period_start = now.addSecs (-(now.time ().minute () % (int(m_TRperiod) / 60)) * 60); m_fnameWE=m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmm")); } m_fileToSave.clear (); int samples=m_TRperiod*12000; - if(m_mode=="FT4") samples=18*3456; + if(m_mode=="FT4") samples=21*3456; // the following is potential a threading hazard - not a good // idea to pass pointer to be processed in another thread @@ -1589,7 +1596,7 @@ void MainWindow::fastSink(qint64 frames) int ihr=tnow.toString("hh").toInt(); int imin=tnow.toString("mm").toInt(); int isec=tnow.toString("ss").toInt(); - isec=isec - isec%m_TRperiod; + isec=isec - fmod(double(isec),m_TRperiod); int nutc0=10000*ihr + 100*imin + isec; if(m_diskData) nutc0=m_UTCdisk; char line[80]; @@ -1669,7 +1676,7 @@ void MainWindow::fastSink(qint64 frames) if(decodeNow or m_bFastDone) { if(!m_diskData) { QDateTime now {QDateTime::currentDateTimeUtc()}; - int n=now.time().second() % m_TRperiod; + int n=fmod(double(now.time().second()),m_TRperiod); if(n<(m_TRperiod/2)) n=n+m_TRperiod; auto const& period_start = now.addSecs (-n); m_fnameWE = m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmmss")); @@ -1679,11 +1686,11 @@ void MainWindow::fastSink(qint64 frames) // the following is potential a threading hazard - not a good // idea to pass pointer to be processed in another thread m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file, - this, m_fnameWE, &dec_data.d2[0], m_TRperiod*12000, m_config.my_callsign(), + this, m_fnameWE, &dec_data.d2[0], int(m_TRperiod*12000.0), m_config.my_callsign(), m_config.my_grid(), m_mode, m_nSubMode, m_freqNominal, m_hisCall, m_hisGrid))); } if(m_mode!="MSK144") { - killFileTimer.start (3*1000*m_TRperiod/4); //Kill 3/4 period from now + killFileTimer.start (int(750.0*m_TRperiod)); //Kill 3/4 period from now } } m_bFastDone=false; @@ -1751,7 +1758,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog bool b = vhf && (m_mode=="JT4" or m_mode=="JT65" or m_mode=="ISCAT" or m_mode=="JT9" or m_mode=="MSK144" or m_mode=="QRA64"); if(b) VHF_features_enabled(b); - if(m_mode=="FT4") on_actionFT8_triggered(); + if(m_mode=="FT4") on_actionFT4_triggered(); if(m_mode=="FT8") on_actionFT8_triggered(); if(m_mode=="JT4") on_actionJT4_triggered(); if(m_mode=="JT9") on_actionJT9_triggered(); @@ -1984,7 +1991,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) if(e->modifiers() & Qt::ControlModifier) n+=100; if(e->modifiers() & Qt::ShiftModifier) { int offset=60; - if(m_mode=="FT4") offset=120; + if(m_mode=="FT4") offset=100; ui->TxFreqSpinBox->setValue(ui->TxFreqSpinBox->value()-offset); } else{ bumpFqso(n); @@ -2000,7 +2007,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) if(e->modifiers() & Qt::ControlModifier) n+=100; if(e->modifiers() & Qt::ShiftModifier) { int offset=60; - if(m_mode=="FT4") offset=120; + if(m_mode=="FT4") offset=100; ui->TxFreqSpinBox->setValue(ui->TxFreqSpinBox->value()+offset); } else { bumpFqso(n); @@ -2060,6 +2067,15 @@ void MainWindow::keyPressEvent (QKeyEvent * e) on_actionOpen_triggered(); return; } + else if(e->modifiers() & Qt::AltModifier) { + bool ok; + auto call = QInputDialog::getText (this, tr ("Change Operator"), tr ("New operator:"), + QLineEdit::Normal, m_config.opCall (), &ok); + if (ok) { + m_config.opCall (call); + } + return; + } break; case Qt::Key_V: if(e->modifiers() & Qt::AltModifier) { @@ -2218,7 +2234,6 @@ void MainWindow::createStatusBar() //createStatusBar statusBar()->addPermanentWidget(&progressBar); progressBar.setMinimumSize (QSize {150, 18}); - progressBar.setFormat ("%v/%m"); statusBar ()->addPermanentWidget (&watchdog_label); update_watchdog_label (); @@ -2529,16 +2544,14 @@ void MainWindow::on_actionAstronomical_data_toggled (bool checked) void MainWindow::on_fox_log_action_triggered() { - if (!m_foxLog) m_foxLog.reset (new FoxLog {&m_config}); if (!m_foxLogWindow) { - m_foxLogWindow.reset (new FoxLogWindow {m_settings, &m_config, m_foxLog.data ()}); + m_foxLogWindow.reset (new FoxLogWindow {m_settings, &m_config, m_logBook.fox_log ()}); // Connect signals from fox log window connect (this, &MainWindow::finished, m_foxLogWindow.data (), &FoxLogWindow::close); connect (m_foxLogWindow.data (), &FoxLogWindow::reset_log_model, [this] () { - if (!m_foxLog) m_foxLog.reset (new FoxLog {&m_config}); - m_foxLog->reset (); + m_logBook.fox_log ()->reset (); }); } m_foxLogWindow->showNormal (); @@ -2548,10 +2561,9 @@ void MainWindow::on_fox_log_action_triggered() void MainWindow::on_contest_log_action_triggered() { - if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config}); if (!m_contestLogWindow) { - m_contestLogWindow.reset (new CabrilloLogWindow {m_settings, &m_config, m_cabrilloLog->model ()}); + m_contestLogWindow.reset (new CabrilloLogWindow {m_settings, &m_config, m_logBook.contest_log ()->model ()}); // Connect signals from contest log window connect (this, &MainWindow::finished, m_contestLogWindow.data (), &CabrilloLogWindow::close); @@ -2631,7 +2643,8 @@ void MainWindow::read_wav_file (QString const& fname) bool ok=file.open (BWFFile::ReadOnly); if(ok) { auto bytes_per_frame = file.format ().bytesPerFrame (); - qint64 max_bytes = std::min (std::size_t (m_TRperiod * RX_SAMPLE_RATE), + int nsamples=m_TRperiod * RX_SAMPLE_RATE; + qint64 max_bytes = std::min (std::size_t (nsamples), sizeof (dec_data.d2) / sizeof (dec_data.d2[0]))* bytes_per_frame; auto n = file.read (reinterpret_cast (dec_data.d2), std::min (max_bytes, file.size ())); @@ -2822,7 +2835,7 @@ void MainWindow::decode() //decode() } m_msec0=QDateTime::currentMSecsSinceEpoch(); - if(!m_dataAvailable or m_TRperiod==0) return; + if(!m_dataAvailable or m_TRperiod==0.0) return; ui->DecodeButton->setChecked (true); if(!dec_data.params.nagain && m_diskData && !m_bFastMode && m_mode!="FT8" && m_mode!="FT4") { dec_data.params.nutc=dec_data.params.nutc/100; @@ -2832,14 +2845,16 @@ void MainWindow::decode() //decode() int imin=ms/60000; int ihr=imin/60; imin=imin % 60; - if(m_TRperiod>=60) imin=imin - (imin % (m_TRperiod/60)); + if(m_TRperiod>=60) imin=imin - (imin % (int(m_TRperiod)/60)); dec_data.params.nutc=100*ihr + imin; if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9 or m_mode=="FT8" or m_mode=="FT4") { - QDateTime t=QDateTime::currentDateTimeUtc().addSecs(2-m_TRperiod); + qint64 ms=1000.0*(2.0-m_TRperiod); + if(m_mode=="FT4") ms=1000.0*(2.0-m_TRperiod); + QDateTime t=QDateTime::currentDateTimeUtc().addMSecs(ms); ihr=t.toString("hh").toInt(); imin=t.toString("mm").toInt(); int isec=t.toString("ss").toInt(); - isec=isec - isec%m_TRperiod; + isec=isec - fmod(double(isec),m_TRperiod); dec_data.params.nutc=10000*ihr + 100*imin + isec; } } @@ -2849,7 +2864,7 @@ void MainWindow::decode() //decode() int ihr=t.toString("hh").toInt(); int imin=t.toString("mm").toInt(); int isec=t.toString("ss").toInt(); - isec=isec - isec%m_TRperiod; + isec=isec - fmod(double(isec),m_TRperiod); dec_data.params.nutc=10000*ihr + 100*imin + isec; } if(m_nPick==2) dec_data.params.nutc=m_nutc0; @@ -2948,8 +2963,8 @@ void MainWindow::decode() //decode() } static short int d2b[360000]; narg[0]=dec_data.params.nutc; - if(m_kdone>12000*m_TRperiod) { - m_kdone=12000*m_TRperiod; + if(m_kdone>int(12000.0*m_TRperiod)) { + m_kdone=int(12000.0*m_TRperiod); } narg[1]=m_kdone; narg[2]=m_nSubMode; @@ -2968,9 +2983,10 @@ void MainWindow::decode() //decode() narg[12]=0; narg[13]=-1; narg[14]=m_config.aggressive(); + int nTRperiod=m_TRperiod; memcpy(d2b,dec_data.d2,2*360000); watcher3.setFuture (QtConcurrent::run (std::bind (fast_decode_,&d2b[0], - &narg[0],&m_TRperiod,&m_msg[0][0], + &narg[0],&nTRperiod,&m_msg[0][0], dec_data.params.mycall,dec_data.params.hiscall,8000,12,12))); } else { memcpy(to, from, qMin(mem_jt9->size(), size)); @@ -3055,7 +3071,7 @@ void MainWindow::readFromStdout() //readFromStdout if(line_read.indexOf("") >= 0) { if(m_mode=="QRA64") m_wideGraph->drawRed(0,0); m_bDecoded = line_read.mid(20).trimmed().toInt() > 0; - int mswait=3*1000*m_TRperiod/4; + int mswait=750.0*m_TRperiod; if(!m_diskData) killFileTimer.start(mswait); //Kill in 3/4 period decodeDone (); m_startAnother=m_loopall; @@ -3065,7 +3081,7 @@ void MainWindow::readFromStdout() //readFromStdout } return; } else { - if(m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64" or m_mode=="FT8" or m_mode=="FT4") { + if(m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64") { int n=line_read.indexOf("f"); if(n<0) n=line_read.indexOf("d"); if(n>0) { @@ -3081,7 +3097,7 @@ void MainWindow::readFromStdout() //readFromStdout write_all("Rx",line_read.trimmed()); if (m_config.insert_blank () && m_blankLine && SpecOp::FOX != m_config.special_op_id()) { QString band; - if((QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*m_TRperiod/4) { + if((QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*int(m_TRperiod)/4) { band = ' ' + m_config.bands ()->find (m_freqNominal); } ui->decodedTextBrowser->insertLineSpacer (band.rightJustified (40, '-')); @@ -3241,7 +3257,7 @@ void MainWindow::readFromStdout() //readFromStdout } // extract details and send to PSKreporter int nsec=QDateTime::currentMSecsSinceEpoch()/1000-m_secBandChanged; - bool okToPost=(nsec>(4*m_TRperiod)/5); + bool okToPost=(nsec > int(4*m_TRperiod)/5); if (stdMsg && okToPost) pskPost(decodedtext); if((m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64") and m_msgAvgWidget!=NULL) { @@ -3341,7 +3357,7 @@ void MainWindow::pskPost (DecodedText const& decodedtext) QString grid; decodedtext.deCallAndGrid(/*out*/deCall,grid); int audioFrequency = decodedtext.frequencyOffset(); - if(m_mode=="FT8" or m_mode=="MSK144") { + if(m_mode=="FT8" or m_mode=="MSK144" or m_mode=="FT4") { audioFrequency=decodedtext.string().mid(16,4).toInt(); } int snr = decodedtext.snr(); @@ -3421,9 +3437,9 @@ void MainWindow::guiUpdate() double txDuration; QString rt; - if(m_TRperiod==0) m_TRperiod=60; + if(m_TRperiod==0) m_TRperiod=60.0; txDuration=0.0; - if(m_modeTx=="FT4") txDuration=0.35 + 105*512/12000.0; // FT4 + if(m_modeTx=="FT4") txDuration=1.0 + 105*576/12000.0; // FT4 if(m_modeTx=="FT8") txDuration=1.0 + 79*1920/12000.0; // FT8 if(m_modeTx=="JT4") txDuration=1.0 + 207.0*2520/11025.0; // JT4 if(m_modeTx=="JT9") txDuration=1.0 + 85.0*m_nsps/12000.0; // JT9 @@ -3451,8 +3467,8 @@ void MainWindow::guiUpdate() double tsec=0.001*ms; double t2p=fmod(tsec,2*m_TRperiod); m_s6=fmod(tsec,6.0); - m_nseq = nsec % m_TRperiod; - m_tRemaining=m_TRperiod - fmod(tsec,double(m_TRperiod)); + m_nseq = fmod(double(nsec),m_TRperiod); + m_tRemaining=m_TRperiod - fmod(tsec,m_TRperiod); if(m_mode=="Echo") { txDuration=2.4; @@ -3493,10 +3509,9 @@ void MainWindow::guiUpdate() if(m_transmitting or m_auto or m_tune) { m_dateTimeLastTX = QDateTime::currentDateTimeUtc (); -// Check for "txboth" (testing purposes only) +// Check for "txboth" (FT4 testing purposes only) QFile f(m_appDir + "/txboth"); - if(f.exists() and - fmod(tsec,m_TRperiod)<(1.0 + 85.0*m_nsps/12000.0)) m_bTxTime=true; + if(f.exists() and fmod(tsec,m_TRperiod) < (0.5 + 105.0*576.0/12000.0)) m_bTxTime=true; // Don't transmit another mode in the 30 m WSPR sub-band Frequency onAirFreq = m_freqNominal + ui->TxFreqSpinBox->value(); @@ -3539,7 +3554,7 @@ void MainWindow::guiUpdate() tx_watchdog (true); // disable transmit } - float fTR=float((ms%(1000*m_TRperiod)))/(1000*m_TRperiod); + float fTR=float((ms%int(1000.0*m_TRperiod)))/int(1000.0*m_TRperiod); QString txMsg; if(m_ntx == 1) txMsg=ui->tx1->text(); @@ -3744,7 +3759,7 @@ void MainWindow::guiUpdate() genft4_(message, &ichk, msgsent, const_cast (ft4msgbits), const_cast(itone), 37, 37); int nsym=103; - int nsps=4*512; + int nsps=4*576; float fsample=48000.0; float f0=ui->TxFreqSpinBox->value() - m_XIT; int nwave=(nsym+2)*nsps; @@ -3943,7 +3958,7 @@ void MainWindow::guiUpdate() //Once per second: if(nsec != m_sec0) { -// qDebug() << "cc onesec" << (SpecOp::RTTY == m_config.special_op_id()); +// qDebug() << "onesec" << m_config.force_call_1st(); // if((!m_msgAvgWidget or (m_msgAvgWidget and !m_msgAvgWidget->isVisible())) // and (SpecOp::NONE < m_config.special_op_id()) and (SpecOp::HOUND > m_config.special_op_id())) on_actionFox_Log_triggered(); if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) { @@ -3959,17 +3974,21 @@ void MainWindow::guiUpdate() if(tHound >= 120 and m_ntx==1) auto_tx_mode(false); } -// progressBar.setVisible(!(m_mode=="FT4")); progressBar.setVisible(true); + progressBar.setFormat ("%v/%m"); if(m_auto and m_mode=="Echo" and m_bEchoTxOK) { - progressBar.setMaximum(6); + progressBar.setMaximum(3); progressBar.setValue(int(m_s6)); } -// if(m_mode!="Echo" and m_mode!="FT4") { if(m_mode!="Echo") { if(m_monitoring or m_transmitting) { progressBar.setMaximum(m_TRperiod); int isec=int(fmod(tsec,m_TRperiod)); + if(m_TRperiod-int(m_TRperiod)>0.0) { + QString progBarLabel; + progBarLabel.sprintf("%d/%3.1f",isec,m_TRperiod); + progressBar.setFormat (progBarLabel); + } progressBar.setValue(isec); } else { progressBar.setValue(0); @@ -4068,6 +4087,10 @@ void MainWindow::startTx2() t=ui->tx6->text(); if(t.mid(0,1)=="#") snr=t.mid(1,5).toDouble(); if(snr>0.0 or snr < -50.0) snr=99.0; + if((m_ntx==6 or m_ntx==7) and m_config.force_call_1st()) { + ui->cbAutoSeq->setChecked(true); + ui->cbFirst->setChecked(true); + } transmit (snr); ui->signal_meter_widget->setValue(0,0); if(m_mode=="Echo" and !m_tune) m_bTransmittedEcho=true; @@ -4108,8 +4131,7 @@ void MainWindow::stopTx2() on_stopTxButton_clicked (); m_nTx73 = 0; } - if(((m_mode.startsWith("WSPR") and m_ntr==-1) or m_mode=="FT4") and - !m_tuneup) { + if((m_mode.startsWith("WSPR") and m_ntr==-1) and !m_tuneup) { m_wideGraph->setWSPRtransmitted(); WSPR_scheduling (); m_ntr=0; @@ -4153,7 +4175,8 @@ void MainWindow::set_dateTimeQSO(int m_ntx) } else { // we also take of m_TRperiod/2 to allow for late clicks auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 2) * m_TRperiod - (now.time ().second () % m_TRperiod)); + m_dateTimeQSOOn = now.addSecs (-(m_ntx - 2) * int(m_TRperiod) - + int(fmod(double(now.time().second()),m_TRperiod))); } } @@ -4219,7 +4242,7 @@ void MainWindow::on_txrb4_doubleClicked () auto const& my_callsign = m_config.my_callsign (); auto is_compound = my_callsign != m_baseCall; m_send_RR73 = !((is_compound && !shortList (my_callsign)) || m_send_RR73); - if(m_mode=="FT4") m_send_RR73=true; + if(m_mode=="FT4" and (m_config.special_op_id()==SpecOp::RTTY)) m_send_RR73=true; genStdMsgs (m_rpt); } @@ -4406,7 +4429,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie } } - int nmod = message.timeInSeconds () % (2*m_TRperiod); + int nmod = fmod(double(message.timeInSeconds()),2.0*m_TRperiod); m_txFirst=(nmod!=0); if( SpecOp::HOUND == m_config.special_op_id() ) m_txFirst=false; //Hound must not transmit first if( SpecOp::FOX == m_config.special_op_id() ) m_txFirst=true; //Fox must always transmit first @@ -4599,7 +4622,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie logQSOTimer.start(0); m_ntx=6; ui->txrb6->setChecked(true); - ui->cbFirst->setChecked(false); } else { m_ntx=5; ui->txrb5->setChecked(true); @@ -5066,7 +5088,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) msgtype(t, ui->tx4); t=t0 + "73"; - if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8") { + if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8" or m_mode=="FT4") { if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> 73"; if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " 73"; } @@ -5082,7 +5104,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) } } - if(m_mode=="FT8" or m_mode=="MSK144") return; + if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="MSK144") return; if (is_compound) { if (is_type_one) { @@ -5496,15 +5518,9 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button default: break; } - auto special_op = m_config.special_op_id (); - if (SpecOp::NONE < special_op && special_op < SpecOp::FOX) - { - if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config}); - } m_logDlg->initLogQSO (m_hisCall, grid, m_modeTx, m_rptSent, m_rptRcvd, m_dateTimeQSOOn, dateTimeQSOOff, m_freqNominal + - ui->TxFreqSpinBox->value(), m_noSuffix, m_xSent, m_xRcvd, - m_cabrilloLog.data ()); + ui->TxFreqSpinBox->value(), m_noSuffix, m_xSent, m_xRcvd); m_inQSOwith=""; } @@ -5633,7 +5649,7 @@ void MainWindow::on_actionFT4_triggered() { m_mode="FT4"; m_modeTx="FT4"; - m_TRperiod=6; + m_TRperiod=7.5; bool bVHF=m_config.enable_VHF_features(); m_bFast9=false; m_bFastMode=false; @@ -5642,9 +5658,9 @@ void MainWindow::on_actionFT4_triggered() m_nsps=6912; m_FFTSize = m_nsps/2; Q_EMIT FFTSize (m_FFTSize); - m_hsymStop=18; + m_hsymStop=21; setup_status_bar (bVHF); - m_toneSpacing=12000.0/512.0; + m_toneSpacing=12000.0/576.0; ui->actionFT4->setChecked(true); m_wideGraph->setMode(m_mode); m_wideGraph->setModeTx(m_modeTx); @@ -5694,7 +5710,7 @@ void MainWindow::on_actionFT8_triggered() m_wideGraph->setModeTx(m_modeTx); VHF_features_enabled(bVHF); ui->cbAutoSeq->setChecked(true); - m_TRperiod=15; + m_TRperiod=15.0; m_fastGraph->hide(); m_wideGraph->show(); ui->decodedTextLabel2->setText(" UTC dB DT Freq Message"); @@ -5783,7 +5799,7 @@ void MainWindow::on_actionJT4_triggered() WSPR_config(false); switch_mode (Modes::JT4); m_modeTx="JT4"; - m_TRperiod=60; + m_TRperiod=60.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe m_nsps=6912; //For symspec only @@ -5856,7 +5872,7 @@ void MainWindow::on_actionJT9_triggered() ui->decodedTextLabel2->setText("UTC dB T Freq Message"); } else { ui->cbAutoSeq->setChecked(false); - m_TRperiod=60; + m_TRperiod=60.0; ui->decodedTextLabel->setText("UTC dB DT Freq Message"); ui->decodedTextLabel2->setText("UTC dB DT Freq Message"); } @@ -5885,7 +5901,7 @@ void MainWindow::on_actionJT9_JT65_triggered() m_modeTx="JT9"; } m_nSubMode=0; //Dual-mode always means JT9 and JT65A - m_TRperiod=60; + m_TRperiod=60.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe m_nsps=6912; @@ -5927,7 +5943,7 @@ void MainWindow::on_actionJT65_triggered() WSPR_config(false); switch_mode (Modes::JT65); if(m_modeTx!="JT65") on_pbTxMode_clicked(); - m_TRperiod=60; + m_TRperiod=60.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe m_nsps=6912; //For symspec only @@ -6103,7 +6119,7 @@ void MainWindow::on_actionWSPR_triggered() WSPR_config(true); switch_mode (Modes::WSPR); m_modeTx="WSPR"; - m_TRperiod=120; + m_TRperiod=120.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe m_nsps=6912; //For symspec only @@ -6131,7 +6147,7 @@ void MainWindow::on_actionWSPR_LF_triggered() m_mode="WSPR-LF"; switch_mode (Modes::WSPR); m_modeTx="WSPR-LF"; - m_TRperiod=240; + m_TRperiod=240.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe m_hsymStop=813; @@ -6147,7 +6163,7 @@ void MainWindow::on_actionEcho_triggered() on_actionJT4_triggered(); m_mode="Echo"; ui->actionEcho->setChecked(true); - m_TRperiod=3; + m_TRperiod=3.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe m_nsps=6912; //For symspec only @@ -6344,15 +6360,13 @@ void MainWindow::on_reset_cabrillo_log_action_triggered () "for export in your Cabrillo log."))) { if(m_config.RTTY_Exchange()!="SCC") ui->sbSerialNumber->setValue(1); - if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config}); - m_cabrilloLog->reset (); + m_logBook.contest_log ()->reset (); } } void MainWindow::on_actionExport_Cabrillo_log_triggered() { - if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config}); - if (QDialog::Accepted == ExportCabrillo {m_settings, &m_config, m_cabrilloLog.data ()}.exec()) + if (QDialog::Accepted == ExportCabrillo {m_settings, &m_config, m_logBook.contest_log ()}.exec()) { MessageBox::information_message (this, tr ("Cabrillo Log saved")); } @@ -6426,7 +6440,6 @@ void MainWindow::on_bandComboBox_activated (int index) void MainWindow::band_changed (Frequency f) { -// bool monitor_off=!m_monitoring; // Set the attenuation value if options are checked QString curBand = ui->bandComboBox->currentText(); if (m_config.pwrBandTxMemory() && !m_tune) { @@ -6462,7 +6475,6 @@ void MainWindow::band_changed (Frequency f) if(r<0.9 or r>1.1) m_bVHFwarned=false; setRig (f); setXIT (ui->TxFreqSpinBox->value ()); -// if(monitor_off) monitor(false); } } @@ -6943,7 +6955,7 @@ void MainWindow::transmit (double snr) m_dateTimeSentTx3=QDateTime::currentDateTimeUtc(); toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform. Q_EMIT sendMessage (NUM_FT4_SYMBOLS, - 512.0, ui->TxFreqSpinBox->value() - m_XIT, + 576.0, ui->TxFreqSpinBox->value() - m_XIT, toneSpacing, m_soundOutput, m_config.audio_output_channel(), true, false, snr, m_TRperiod); } @@ -7246,7 +7258,7 @@ void MainWindow::on_sbSubmode_valueChanged(int n) on_cbFast9_clicked(false); ui->cbFast9->setEnabled(false); ui->sbTR->setVisible(false); - m_TRperiod=60; + m_TRperiod=60.0; } else { ui->cbFast9->setEnabled(true); } @@ -7268,9 +7280,9 @@ void MainWindow::on_cbFast9_clicked(bool b) if(b) { m_TRperiod = ui->sbTR->value (); } else { - m_TRperiod=60; + m_TRperiod=60.0; } - progressBar.setMaximum(m_TRperiod); + progressBar.setMaximum(int(m_TRperiod)); m_wideGraph->setPeriod(m_TRperiod,m_nsps); fast_config(b); statusChanged (); @@ -7550,8 +7562,8 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout if(grid!="") { double utch=0.0; int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; - azdist_(const_cast (m_config.my_grid ().toLatin1().constData()), - const_cast (grid.toLatin1().constData()),&utch, + azdist_(const_cast ((m_config.my_grid () + " ").left (6).toLatin1 ().constData ()), + const_cast ((grid + " ").left (6).toLatin1 ().constData ()),&utch, &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,6,6); QString t1; if(m_config.miles()) { @@ -7814,7 +7826,7 @@ void MainWindow::setRig (Frequency f) void MainWindow::fastPick(int x0, int x1, int y) { float pixPerSecond=12000.0/512.0; - if(m_TRperiod<30) pixPerSecond=12000.0/256.0; + if(m_TRperiod<30.0) pixPerSecond=12000.0/256.0; if(m_mode!="ISCAT" and m_mode!="MSK144") return; if(!m_decoderBusy) { dec_data.params.newdat=0; @@ -8015,7 +8027,7 @@ void MainWindow::write_transmit_entry (QString const& file_name) { QTextStream out(&f); auto time = QDateTime::currentDateTimeUtc (); - time = time.addSecs (-(time.time ().second () % m_TRperiod)); + time = time.addSecs (-fmod(double(time.time().second()),m_TRperiod)); out << time.toString("yyMMdd_hhmmss") << " Transmitting " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) << " MHz " << m_modeTx @@ -8255,7 +8267,7 @@ void MainWindow::houndCallers() if(!ui->textBrowser4->toPlainText().contains(paddedHoundCall)) { if(m_loggedByFox[houndCall].contains(m_lastBand)) continue; //already logged on this band if(m_foxQSO.contains(houndCall)) continue; //still in the QSO map - auto const& entity = m_logBook.countries ().lookup (houndCall); + auto const& entity = m_logBook.countries ()->lookup (houndCall); auto const& continent = AD1CCty::continent (entity.continent); //If we are using a directed CQ, ignore Hound calls that do not comply. @@ -8436,9 +8448,8 @@ list2Done: m_hisGrid=m_foxQSO[hc1].grid; m_rptSent=m_foxQSO[hc1].sent; m_rptRcvd=m_foxQSO[hc1].rcvd; - if (!m_foxLog) m_foxLog.reset (new FoxLog {&m_config}); if (!m_foxLogWindow) on_fox_log_action_triggered (); - if (m_foxLog->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand)) + if (m_logBook.fox_log ()->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand)) { writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid) .arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand)); @@ -8678,7 +8689,7 @@ void MainWindow::write_all(QString txRx, QString message) t.sprintf("%5d",ui->TxFreqSpinBox->value()); if (txRx=="Tx") msg=" 0 0.0" + t + " " + message; auto time = QDateTime::currentDateTimeUtc (); - time = time.addSecs(-(time.time().second() % m_TRperiod)); + time = time.addSecs(-fmod(double(time.time().second()),m_TRperiod)); t.sprintf("%10.3f ",m_freqNominal/1.e6); if (m_diskData) { if (m_fileDateTime.size()==11) { diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index eada752b..03d009a7 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -72,9 +72,7 @@ class WideGraph; class LogQSO; class Transceiver; class MessageAveraging; -class FoxLog; class FoxLogWindow; -class CabrilloLog; class CabrilloLogWindow; class ColorHighlighting; class MessageClient; @@ -376,9 +374,7 @@ private: QScopedPointer m_prefixes; QScopedPointer m_mouseCmnds; QScopedPointer m_msgAvgWidget; - QScopedPointer m_foxLog; QScopedPointer m_foxLogWindow; - QScopedPointer m_cabrilloLog; QScopedPointer m_contestLogWindow; QScopedPointer m_colorHighlighting; Transceiver::TransceiverState m_rigState; @@ -406,6 +402,7 @@ private: double m_s6; double m_tRemaining; + double m_TRperiod; float m_DTtol; float m_t0; @@ -428,7 +425,6 @@ private: qint32 m_ntr; qint32 m_tx; qint32 m_hsym; - qint32 m_TRperiod; qint32 m_nsps; qint32 m_hsymStop; qint32 m_inGain; diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 0942dc75..75be401d 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -340,7 +340,7 @@ - <html><head/><body><p>Enter this QSO in log</p></body></html> + Enter this QSO in log Log &QSO @@ -372,7 +372,7 @@ - <html><head/><body><p>Toggle monitoring On/Off</p></body></html> + Toggle monitoring On/Off QPushButton:checked { @@ -407,6 +407,9 @@ <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + + Erase right window. Double-click to erase both windows. + &Erase @@ -420,6 +423,9 @@ <html><head/><body><p>Clear the accumulating message average.</p></body></html> + + Clear the accumulating message average. + Clear Avg @@ -436,6 +442,9 @@ <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + + Decode most recent Rx period at QSO Frequency + QPushButton:checked { background-color: cyan; @@ -466,6 +475,9 @@ <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + + Toggle Auto-Tx On/Off + QPushButton:checked { background-color: red; @@ -506,6 +518,9 @@ <html><head/><body><p>Toggle a pure Tx tone On/Off</p></body></html> + + Toggle a pure Tx tone On/Off + QPushButton:checked { background-color: red; @@ -590,6 +605,15 @@ QLabel[oob="true"] { <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + + Rx Signal + + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low + QFrame::Panel @@ -706,6 +730,9 @@ QLabel[oob="true"] { 2 + + dxCallEntry + @@ -795,6 +822,9 @@ QLabel[oob="true"] { 2 + + dxGridEntry + @@ -883,6 +913,9 @@ QLabel[oob="true"] { <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + QPushButton { font-family: helvetica; @@ -947,6 +980,12 @@ QPushButton[state="ok"] { <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + + Frequncy entry + + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. + true @@ -1038,6 +1077,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + + Check to keep Tx frequency fixed when double-clicking on decoded text. + Hold Tx Freq @@ -1155,6 +1197,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + + Synchronizing threshold. Lower numbers accept weaker sync signals. + Qt::AlignCenter @@ -1179,6 +1224,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to use short-format messages.</p></body></html> + + Check to use short-format messages. + Sh @@ -1189,6 +1237,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + + Check to enable JT9 fast modes + Fast @@ -1199,6 +1250,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + + Check to enable automatic sequencing of Tx messages based on received messages. + Auto Seq @@ -1209,6 +1263,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to call the first decoded responder to my CQ.</p></body></html> + + Check to call the first decoded responder to my CQ. + Call 1st @@ -1234,6 +1291,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html> + + Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. + Tx even/1st @@ -1249,6 +1309,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + + Frequency to call CQ on in kHz above the current MHz + Tx CQ @@ -1271,6 +1334,10 @@ QPushButton[state="ok"] { <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. + @@ -1290,6 +1357,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + + Submode determines tone spacing; A is narrowest. + Qt::AlignCenter @@ -1333,6 +1403,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + + Check to monitor Sh messages. + SWL @@ -1364,6 +1437,11 @@ QPushButton[state="ok"] { <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. + Measure @@ -1376,6 +1454,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + Qt::AlignCenter @@ -1398,6 +1479,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + + Tx/Rx or Frequency calibration sequence length + Qt::AlignCenter @@ -1496,6 +1580,9 @@ QPushButton[state="ok"] { <html><head/><body><p>Double-click on another caller to queue that call for your next QSO.</p></body></html> + + Double-click on another caller to queue that call for your next QSO. + Next Call @@ -1551,6 +1638,10 @@ QPushButton[state="ok"] { <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + margin-left: 10%; margin-right: 0% @@ -1586,6 +1677,10 @@ QPushButton[state="ok"] { <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Qt::LeftToRight @@ -1627,6 +1722,10 @@ QPushButton[state="ok"] { <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + + Send this message in next Tx interval +Double-click to reset to the standard 73 message + margin-left: 10%; margin-right: 0% @@ -1675,6 +1774,11 @@ QPushButton[state="ok"] { <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + margin-left: 10%; margin-right: 0% @@ -1691,6 +1795,11 @@ QPushButton[state="ok"] { <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% @@ -1707,6 +1816,10 @@ QPushButton[state="ok"] { <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p></body></html> + + Switch to this Tx message NOW +Double-click to reset to the standard 73 message + padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% @@ -2524,6 +2637,9 @@ list. The list can be maintained in Settings (F2). <html><head/><body><p>6 digit locators cause 2 different mesages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + + 6 digit locators cause 2 different mesages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + Prefer type 1 messages @@ -3306,14 +3422,6 @@ list. The list can be maintained in Settings (F2). Fox log - - - Reset Fox log ... - - - <html><head/><body><p>Ths will erase the file FoxQSO.txt and delete the Fox log file which is used for dupe detection.</p></body></html> - - FT8 DXpedition Mode User Guide diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index 98c1af16..badeff57 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -241,9 +241,9 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) painter1.setPen(Qt::white); QString t; qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; - int n=(ms/1000) % m_TRperiod; + int n = fmod(0.001*ms,m_TRperiod); QDateTime t1=QDateTime::currentDateTimeUtc().addSecs(-n); - if(m_TRperiod < 60 or m_mode=="FT4") { + if(m_TRperiod<60.0) { t=t1.toString("hh:mm:ss") + " " + m_rxBand; } else { t=t1.toString("hh:mm") + " " + m_rxBand; @@ -411,7 +411,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() } float bw=9.0*12000.0/m_nsps; //JT9 - if(m_mode=="FT4") bw=3*12000.0/512.0; //FT4 ### (3x, or 4x???) ### + if(m_mode=="FT4") bw=3*12000.0/576.0; //FT4 ### (3x, or 4x???) ### if(m_mode=="FT8") bw=7*12000.0/1920.0; //FT8 if(m_mode=="JT4") { //JT4 @@ -721,9 +721,9 @@ void CPlotter::mouseDoubleClickEvent (QMouseEvent * event) } } -void CPlotter::setNsps(int ntrperiod, int nsps) //setNsps +void CPlotter::setNsps(double trperiod, int nsps) //setNsps { - m_TRperiod=ntrperiod; + m_TRperiod=trperiod; m_nsps=nsps; m_fftBinWidth=1500.0/2048.0; if(m_nsps==15360) m_fftBinWidth=1500.0/2048.0; diff --git a/widgets/plotter.h b/widgets/plotter.h index e243c177..2cbfd202 100644 --- a/widgets/plotter.h +++ b/widgets/plotter.h @@ -56,7 +56,7 @@ public: void DrawOverlay(); int rxFreq(); void setFsample(int n); - void setNsps(int ntrperiod, int nsps); + void setNsps(double trperiod, int nsps); void setTxFreq(int n); void setMode(QString mode); void setSubMode(int n); @@ -145,6 +145,7 @@ private: double m_fftBinWidth; double m_dialFreq; double m_xOffset; + double m_TRperiod; float m_sum[2048]; @@ -161,7 +162,6 @@ private: qint32 m_h; qint32 m_h1; qint32 m_h2; - qint32 m_TRperiod; qint32 m_rxFreq; qint32 m_txFreq; qint32 m_fMin; diff --git a/widgets/widegraph.cpp b/widgets/widegraph.cpp index 1f3110ce..6234f731 100644 --- a/widgets/widegraph.cpp +++ b/widgets/widegraph.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "ui_widegraph.h" #include "commons.h" #include "Configuration.hpp" @@ -23,7 +24,7 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : ui(new Ui::WideGraph), m_settings (settings), m_palettes_path {":/Palettes"}, - m_ntr0 {0}, + m_tr0 {0.0}, m_n {0}, m_bHaveTransmitted {false} { @@ -186,9 +187,8 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata) //dat // Time according to this computer qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; - int ntr = (ms/1000) % m_TRperiod; - if((ndiskdata && ihsym <= m_waterfallAvg) || (!ndiskdata && - (ntrwidePlot->draw(swide,true,false); } } @@ -278,11 +278,11 @@ int WideGraph::fSpan() return ui->widePlot->fSpan (); } -void WideGraph::setPeriod(int ntrperiod, int nsps) //SetPeriod +void WideGraph::setPeriod(double trperiod, int nsps) //SetPeriod { - m_TRperiod=ntrperiod; + m_TRperiod=trperiod; m_nsps=nsps; - ui->widePlot->setNsps(ntrperiod, nsps); + ui->widePlot->setNsps(trperiod, nsps); } void WideGraph::setTxFreq(int n) //setTxFreq diff --git a/widgets/widegraph.h b/widgets/widegraph.h index 2b172ef7..c87bab05 100644 --- a/widgets/widegraph.h +++ b/widgets/widegraph.h @@ -35,7 +35,7 @@ public: int fSpan(); void saveSettings(); void setFsample(int n); - void setPeriod(int ntrperiod, int nsps); + void setPeriod(double trperiod, int nsps); void setTxFreq(int n); void setMode(QString mode); void setSubMode(int n); @@ -95,10 +95,11 @@ private: WFPalette m_userPalette; QHash m_fMinPerBand; + double m_tr0; + double m_TRperiod; + qint32 m_waterfallAvg; - qint32 m_TRperiod; qint32 m_nsps; - qint32 m_ntr0; qint32 m_fMax; qint32 m_nSubMode; qint32 m_nsmo; diff --git a/widgets/widgets.pri b/widgets/widgets.pri index 24ddd5a3..3c2cb244 100644 --- a/widgets/widgets.pri +++ b/widgets/widgets.pri @@ -8,18 +8,20 @@ SOURCES += \ widgets/fastplot.cpp widgets/MessageBox.cpp \ widgets/colorhighlighting.cpp widgets/ExportCabrillo.cpp \ widgets/AbstractLogWindow.cpp \ + widgets/FrequencyLineEdit.cpp widgets/FrequencyDeltaLineEdit.cpp \ widgets/FoxLogWindow.cpp widgets/CabrilloLogWindow.cpp HEADERS += \ widgets/mainwindow.h widgets/plotter.h \ widgets/about.h widgets/widegraph.h \ widgets/displaytext.h widgets/logqso.h widgets/LettersSpinBox.hpp \ - widgets/FrequencyLineEdit.hpp widgets/signalmeter.h \ + widgets/FrequencyLineEdit.hpp widgets/FrequencyDeltaLineEdit.hpp widgets/signalmeter.h \ widgets/meterwidget.h widgets/messageaveraging.h \ widgets/echoplot.h widgets/echograph.h widgets/fastgraph.h \ widgets/fastplot.h widgets/MessageBox.hpp widgets/colorhighlighting.h \ widgets/ExportCabrillo.h widgets/AbstractLogWindow.hpp \ - widgets/FoxLogWindow.hpp widgets/CabrilloLogWindow.hpp + widgets/FoxLogWindow.hpp widgets/CabrilloLogWindow.hpp \ + widgets/DateTimeEdit.hpp FORMS += \ widgets/mainwindow.ui widgets/about.ui \ -- cgit v1.2.3