diff options
| author | Christoph Berg <myon@debian.org> | 2022-09-17 12:51:21 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2022-09-17 12:51:21 +0200 |
| commit | 4d2fac0dafe835b1ed479bebe136c3afe748ecf3 (patch) | |
| tree | efddc4f95ba73f57dcd6518ce31f8e6ea5b0cd15 /widgets | |
| parent | 2d1068e60bce7ae1fff11623454900e8cee956b1 (diff) | |
New upstream version 2.6.0~rc4+repackupstream/2.6.0_rc4+repack
Diffstat (limited to 'widgets')
| -rwxr-xr-x | widgets/astro.cpp | 5 | ||||
| -rwxr-xr-x | widgets/echograph.cpp | 23 | ||||
| -rwxr-xr-x | widgets/echograph.h | 3 | ||||
| -rwxr-xr-x | widgets/echograph.ui | 23 | ||||
| -rwxr-xr-x | widgets/echoplot.cpp | 17 | ||||
| -rwxr-xr-x | widgets/echoplot.h | 2 | ||||
| -rwxr-xr-x | widgets/mainwindow.cpp | 69 | ||||
| -rwxr-xr-x | widgets/mainwindow.h | 5 | ||||
| -rwxr-xr-x | widgets/mainwindow.ui | 8 |
9 files changed, 134 insertions, 21 deletions
diff --git a/widgets/astro.cpp b/widgets/astro.cpp index 05e830c2..a090a519 100755 --- a/widgets/astro.cpp +++ b/widgets/astro.cpp @@ -55,7 +55,6 @@ Astro::Astro(QSettings * settings, Configuration const * configuration, QWidget Astro::~Astro ()
{
- ui_->cbDopplerTracking->setChecked (false);
Q_EMIT tracking_update ();
if (isVisible ()) write_settings ();
}
@@ -69,6 +68,8 @@ void Astro::closeEvent (QCloseEvent * e) void Astro::read_settings ()
{
SettingsGroup g (settings_, "Astro");
+ bool b=settings_->value("DopplerTracking",false).toBool();
+ ui_->cbDopplerTracking->setChecked(b);
ui_->doppler_widget->setVisible (ui_->cbDopplerTracking->isChecked ());
m_DopplerMethod=settings_->value("DopplerMethod",0).toInt();
switch (m_DopplerMethod)
@@ -86,7 +87,7 @@ void Astro::read_settings () void Astro::write_settings ()
{
SettingsGroup g (settings_, "Astro");
- //settings_->setValue ("DopplerTracking", ui_->cbDopplerTracking->isChecked ());
+ settings_->setValue ("DopplerTracking", ui_->cbDopplerTracking->isChecked());
settings_->setValue ("DopplerMethod",m_DopplerMethod);
settings_->setValue ("window/pos", pos ());
}
diff --git a/widgets/echograph.cpp b/widgets/echograph.cpp index 0f6e9232..4f51fa10 100755 --- a/widgets/echograph.cpp +++ b/widgets/echograph.cpp @@ -2,6 +2,7 @@ #include "commons.h"
#include <QSettings>
#include <QApplication>
+#include <QDebug>
#include "echoplot.h"
#include "ui_echograph.h"
#include "moc_echograph.cpp"
@@ -36,6 +37,7 @@ EchoGraph::EchoGraph(QSettings * settings, QWidget *parent) : ui->binsPerPixelSpinBox->setValue(n);
ui->echoPlot->m_blue=m_settings->value("BlueCurve",false).toBool();
m_nColor=m_settings->value("EchoColors",0).toInt();
+ ui->cbBaseline->setChecked(m_settings->value("Baseline",false).toBool());
m_settings->endGroup();
ui->echoPlot->setColors(m_nColor);
}
@@ -62,6 +64,7 @@ void EchoGraph::saveSettings() m_settings->setValue("EchoBPP",ui->echoPlot->m_binsPerPixel);
m_settings->setValue("BlueCurve",ui->echoPlot->m_blue);
m_settings->setValue("EchoColors",m_nColor);
+ m_settings->setValue("Baseline",ui->cbBaseline->isChecked());
m_settings->endGroup();
}
@@ -101,3 +104,23 @@ void EchoGraph::on_pbColors_clicked() m_nColor = (m_nColor+1) % 6;
ui->echoPlot->setColors(m_nColor);
}
+
+void EchoGraph::on_cbBaseline_toggled(bool b)
+{
+ ui->echoPlot->setBaseline(b);
+}
+
+bool EchoGraph::baseline()
+{
+ return ui->cbBaseline->isChecked();
+}
+
+void EchoGraph::clearAvg()
+{
+ for(int i=0; i<4096; i++) {
+ echocom_.blue[i]=0;
+ echocom_.red[i]=0;
+ }
+ echocom_.nsum=0;
+ plotSpec();
+}
diff --git a/widgets/echograph.h b/widgets/echograph.h index cf5caa23..ce6f4b82 100755 --- a/widgets/echograph.h +++ b/widgets/echograph.h @@ -23,6 +23,8 @@ public: void plotSpec();
void saveSettings();
+ void clearAvg();
+ bool baseline();
private slots:
void on_smoothSpinBox_valueChanged(int n);
@@ -30,6 +32,7 @@ private slots: void on_zeroSlider_valueChanged(int value);
void on_binsPerPixelSpinBox_valueChanged(int n);
void on_pbColors_clicked();
+ void on_cbBaseline_toggled(bool b);
private:
QSettings * m_settings;
diff --git a/widgets/echograph.ui b/widgets/echograph.ui index 7def91bd..d9f79bae 100755 --- a/widgets/echograph.ui +++ b/widgets/echograph.ui @@ -190,6 +190,29 @@ </spacer>
</item>
<item>
+ <widget class="QCheckBox" name="cbBaseline">
+ <property name="text">
+ <string>Baseline</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<widget class="QSpinBox" name="smoothSpinBox">
<property name="minimumSize">
<size>
diff --git a/widgets/echoplot.cpp b/widgets/echoplot.cpp index 15c2d8e5..80202c35 100755 --- a/widgets/echoplot.cpp +++ b/widgets/echoplot.cpp @@ -127,7 +127,7 @@ void EPlotter::draw() //draw() painter2D.setPen(penBlue);
j=0;
for(i=0; i<m_w; i++) {
- y = 0.9*m_h2 - gain*(m_h/10.0)*(blue[i0+i]-1.0) - 0.01*m_h2*m_plotZero;
+ y = 0.9*m_h2 - gain*(m_h/10.0)*blue[i0+i] - 0.01*m_h2*m_plotZero;
LineBuf[j].setX(i);
LineBuf[j].setY(y);
j++;
@@ -145,12 +145,19 @@ void EPlotter::draw() //draw() j=0;
for(int i=0; i<m_w; i++) {
- y = 0.9*m_h2 - gain*(m_h/10.0)*(red[i0+i]-1.0) - 0.01*m_h2*m_plotZero;
+ y = 0.9*m_h2 - gain*(m_h/10.0)*red[i0+i] - 0.01*m_h2*m_plotZero;
LineBuf[j].setX(i);
LineBuf[j].setY(y);
j++;
}
painter2D.drawPolyline(LineBuf,j);
+
+ if(m_bBaseline) {
+ // Draw the baseline
+ y = 0.9*m_h2 - 0.01*m_h2*m_plotZero;
+ painter2D.drawLine(0,y,m_w,y);
+ }
+
update(); //trigger a new paintEvent
}
@@ -323,3 +330,9 @@ void EPlotter::setColors(qint32 n) //setSmooth() int EPlotter::plotWidth(){return m_2DPixmap.width();}
void EPlotter::UpdateOverlay() {DrawOverlay();}
+
+void EPlotter::setBaseline(bool b)
+{
+ m_bBaseline=b;
+ draw();
+}
diff --git a/widgets/echoplot.h b/widgets/echoplot.h index 8426252e..e23adfee 100755 --- a/widgets/echoplot.h +++ b/widgets/echoplot.h @@ -36,6 +36,7 @@ public: qint32 m_binsPerPixel;
qint32 m_nColor;
bool m_blue;
+ bool m_bBaseline;
void draw(); //Update the Echo plot
void SetRunningState(bool running);
@@ -49,6 +50,7 @@ public: void setSmooth(int n);
int getSmooth();
void setColors(qint32 n);
+ void setBaseline(bool b);
// void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 643d7e86..de0b2cee 100755 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1061,9 +1061,9 @@ void MainWindow::not_GA_warning_message () MessageBox::critical_message (this,
"This is a pre-release version of WSJT-X 2.6.0 made\n"
"available for testing purposes. By design it will\n"
- "be nonfunctional after Nov 30, 2022.");
+ "be nonfunctional after Dec 31, 2022.");
auto now = QDateTime::currentDateTimeUtc ();
- if (now >= QDateTime {{2022, 11, 30}, {23, 59, 59, 999}, Qt::UTC}) {
+ if (now >= QDateTime {{2022, 12, 31}, {23, 59, 59, 999}, Qt::UTC}) {
Q_EMIT finished ();
}
}
@@ -1617,32 +1617,43 @@ void MainWindow::dataSink(qint64 frames) monitor(false);
m_bEchoTxed=false;
}
+
if(m_monitoring or m_auto or m_diskData) {
- QString t;
- t = t.asprintf("%3d %7.1f %7.1f %7.1f %7.1f %7d %7.1f %3d",echocom_.nsum,xlevel,sigdb,
- dBerr,dfreq,nDopTotal,width,nqual);
QString t0;
if(m_diskData) {
t0=t0.asprintf("%06d ",m_UTCdisk);
} else {
- t0=QDateTime::currentDateTimeUtc().toString("hhmmss ");
+ QDateTime now=QDateTime::currentDateTimeUtc();
+ int ihr=now.toString("hh").toInt();
+ int imin=now.toString("mm").toInt();
+ int isec=now.toString("ss").toInt();
+ if(m_auto) isec=isec - isec%6;
+ if(!m_auto) isec=isec - isec%3;
+ t0=t0.asprintf("%02d%02d%02d ",ihr,imin,isec);
}
+ int n=t0.toInt();
+ int nsec=((n/10000)*3600) + (((n/100)%100)*60) + (n%100);
+ if(!m_echoRunning) m_echoSec0=nsec;
+ n=(nsec-m_echoSec0 + 864000)%86400;
+ m_echoRunning=true;
+ QString t;
+ t = t.asprintf("%6d %5.2f %7d %7.1f %7d %7d %7d %7.1f %7.1f",n,xlevel,
+ nDopTotal,width,echocom_.nsum,nqual,qRound(dfreq),sigdb,dBerr);
t = t0 + t;
if (ui) ui->decodedTextBrowser->appendText(t);
}
+
if(m_echoGraph->isVisible()) m_echoGraph->plotSpec();
- if(m_saveAll) {
+ if(m_saveAll and !m_diskData) {
int idir=1;
save_echo_params_(&m_fDop,&nDop,&nfrit,&f1,&width,dec_data.d2,&idir);
m_fSpread=width;
}
m_nclearave=0;
-
}
- if(m_mode=="FreqCal") {
- return;
- }
- if( m_dialFreqRxWSPR==0) m_dialFreqRxWSPR=m_freqNominal;
+ if(m_mode=="FreqCal") return;
+
+ if(m_dialFreqRxWSPR==0) m_dialFreqRxWSPR=m_freqNominal;
m_dataAvailable=true;
dec_data.params.npts8=(m_ihsym*m_nsps)/16;
dec_data.params.newdat=1;
@@ -1687,6 +1698,7 @@ void MainWindow::dataSink(qint64 frames) if (err!=0) MessageBox::warning_message (this, tr ("Error saving c2 file"), c2name);
}
}
+
if(m_mode=="WSPR") {
QStringList t2;
QStringList depth_args;
@@ -1710,6 +1722,7 @@ void MainWindow::dataSink(qint64 frames) m_decoderBusy = true;
statusUpdate ();
}
+
m_rxDone=true;
}
}
@@ -2011,6 +2024,7 @@ void MainWindow::on_monitorButton_clicked (bool checked) } else {
ui->monitorButton->setChecked (false); // disallow
}
+ if(m_mode=="Echo") m_echoRunning=false;
}
void MainWindow::monitor (bool state)
@@ -2048,6 +2062,7 @@ void MainWindow::on_autoButton_clicked (bool checked) echocom_.nsum=0;
}
m_tAutoOn=QDateTime::currentMSecsSinceEpoch()/1000;
+ if(m_mode=="Echo") m_echoRunning=false;
}
void MainWindow::on_sbTxPercent_valueChanged (int n)
@@ -3150,6 +3165,7 @@ void MainWindow::on_ClrAvgButton_clicked() m_nclearave=1;
if(m_mode=="Echo") {
echocom_.nsum=0;
+ m_echoGraph->clearAvg();
} else {
if(m_msgAvgWidget != NULL) {
if(m_msgAvgWidget->isVisible()) m_msgAvgWidget->displayAvg("");
@@ -4704,6 +4720,7 @@ void MainWindow::guiUpdate() ui->txb1->setEnabled(true);
}
}
+ if(m_mode=="Echo" and !m_monitoring and !m_auto and !m_diskData) m_echoRunning=false;
//Once per second (onesec)
if(nsec != m_sec0) {
@@ -6801,7 +6818,6 @@ void MainWindow::on_actionJT4_triggered() void MainWindow::on_actionJT9_triggered()
{
- QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());});
m_mode="JT9";
bool bVHF=m_config.enable_VHF_features();
m_bFast9=ui->cbFast9->isChecked();
@@ -7105,7 +7121,7 @@ void MainWindow::on_actionEcho_triggered() m_bFastMode=false;
m_bFast9=false;
WSPR_config(true);
- ui->lh_decodes_headings_label->setText(" UTC N Level SNR dBerr DF Doppler Width Q");
+ ui->lh_decodes_headings_label->setText(" UTC Tsec Level Doppler Width N Q DF SNR dBerr");
// 01234567890123456789012345678901234567
displayWidgets(nWidgets("00000000000000000010001000000000000000"));
fast_config(false);
@@ -7689,7 +7705,7 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& if (old_state.online () == false && s.online () == true)
{
// initializing
- on_monitorButton_clicked (!m_config.monitor_off_at_startup ());
+ on_monitorButton_clicked (!(m_config.monitor_off_at_startup() or m_mode=="Echo"));
}
if (s.frequency () != old_state.frequency () || s.split () != m_splitMode)
{
@@ -9999,3 +10015,26 @@ void MainWindow::on_jt65Button_clicked() }
on_actionJT65_triggered();
}
+
+void MainWindow::on_actionCopy_to_WSJTX_txt_triggered()
+{
+ static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("WSJT-X.txt")};
+ if(!f.open(QIODevice::Text | QIODevice::WriteOnly)) {
+ MessageBox::warning_message (this, tr ("WSJT-X.txt file error"),
+ tr ("Cannot open \"%1\" for writing").arg (f.fileName ()),
+ tr ("Error: %1").arg (f.errorString ()));
+ } else {
+ QString t=ui->decodedTextBrowser->toPlainText();
+
+ QTextStream out(&f);
+ out << t <<
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ endl
+#else
+ Qt::endl
+#endif
+ ;
+ f.close();
+ }
+}
+
diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index f87c031b..62c4008e 100755 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -173,6 +173,7 @@ private slots: void on_actionOpen_next_in_directory_triggered();
void on_actionDecode_remaining_files_in_directory_triggered();
void on_actionDelete_all_wav_files_in_SaveDir_triggered();
+ void on_actionCopy_to_WSJTX_txt_triggered();
void on_actionOpen_log_directory_triggered ();
void on_actionNone_triggered();
void on_actionSave_all_triggered();
@@ -506,6 +507,7 @@ private: qint32 m_points=-99;
qint32 m_score=0;
qint32 m_fDop=0;
+ qint32 m_echoSec0=0;
bool m_btxok; //True if OK to transmit
bool m_diskData;
@@ -735,7 +737,8 @@ private: QThread::Priority m_audioThreadPriority;
bool m_bandEdited;
bool m_splitMode;
- bool m_monitoring;
+ bool m_monitoring=false;
+ bool m_echoRunning=false;
bool m_tx_when_ready;
bool m_transmitting;
bool m_tune;
diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index 3068bd73..b7760141 100755 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -3026,6 +3026,8 @@ QLabel[oob="true"] { <addaction name="actionOpen_next_in_directory"/>
<addaction name="actionDecode_remaining_files_in_directory"/>
<addaction name="separator"/>
+ <addaction name="actionCopy_to_WSJTX_txt"/>
+ <addaction name="separator"/>
<addaction name="actionDelete_all_wav_files_in_SaveDir"/>
<addaction name="actionErase_ALL_TXT"/>
<addaction name="actionErase_wsjtx_log_adi"/>
@@ -3036,7 +3038,6 @@ QLabel[oob="true"] { <addaction name="separator"/>
<addaction name="actionSettings"/>
<addaction name="separator"/>
- <addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuView">
@@ -3669,6 +3670,11 @@ QLabel[oob="true"] { <string>Active Stations</string>
</property>
</action>
+ <action name="actionCopy_to_WSJTX_txt">
+ <property name="text">
+ <string>Copy main text window to WSJT-X.txt</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
|
