From 9ba8ae0b9bae57fc28e9ca7473d9553e7add050b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 4 Dec 2022 17:11:51 -0500 Subject: [PATCH] Finish removing Band Map window. --- q65w/bandmap.cpp | 100 -------------------------------------------- q65w/bandmap.h | 35 ---------------- q65w/bandmap.ui | 43 ------------------- q65w/mainwindow.cpp | 19 --------- q65w/mainwindow.h | 5 --- q65w/map65.pro | 7 ++-- 6 files changed, 3 insertions(+), 206 deletions(-) delete mode 100644 q65w/bandmap.cpp delete mode 100644 q65w/bandmap.h delete mode 100644 q65w/bandmap.ui diff --git a/q65w/bandmap.cpp b/q65w/bandmap.cpp deleted file mode 100644 index 3c4daecb3..000000000 --- a/q65w/bandmap.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "bandmap.h" -#include -#include "ui_bandmap.h" -#include "qt_helpers.hpp" -#include "SettingsGroup.hpp" -#include - -BandMap::BandMap (QString const& settings_filename, QWidget * parent) - : QWidget {parent}, - ui {new Ui::BandMap}, - m_settings_filename {settings_filename} -{ - ui->setupUi (this); - setWindowTitle ("Band Map"); - setWindowFlags (Qt::Dialog | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint); - QSettings settings {m_settings_filename, QSettings::IniFormat}; - SettingsGroup g {&settings, "MainWindow"}; // MainWindow group for - // historical reasons - setGeometry (settings.value ("BandMapGeom", QRect {280, 400, 142, 400}).toRect ()); - ui->bmTextBrowser->setStyleSheet( - "QTextBrowser { background-color : #000066; color : red; }"); -} - -BandMap::~BandMap () -{ - QSettings settings {m_settings_filename, QSettings::IniFormat}; - SettingsGroup g {&settings, "MainWindow"}; - settings.setValue ("BandMapGeom", geometry ()); - delete ui; -} - -void BandMap::setText(QString t) -{ - m_bandMapText=t; - int w=ui->bmTextBrowser->size().width(); - int ncols=1; - if(w>220) ncols=2; - QString s="QTextBrowser{background-color: "+m_colorBackground+"}"; - ui->bmTextBrowser->setStyleSheet(s); - QString t0="" - "
\n"; - QString tfreq,tspace,tcall; - QString s0,s1,s2,s3,bg; - bg="."; - s0=""; - s1=""; - s2=""; - s3=""; - - ui->bmTextBrowser->clear(); - QStringList lines = t.split( "\n", SkipEmptyParts ); - int nrows=(lines.length()+ncols-1)/ncols; - - for(int i=0; i=3) t0 += s3; - t0 += (tfreq + tspace + tcall + "
\n"); - } - - if(ncols==2) { //2-column display - t0 += "

\n"; - for(int i=nrows; i=3) t0 += s3; - t0 += (tfreq + tspace + tcall + "
\n"); - } - if(2*nrows>lines.length()) t0 += (s0 + "
\n"); - } - ui->bmTextBrowser->setHtml(t0); -} - -void BandMap::resizeEvent(QResizeEvent* ) -{ - setText(m_bandMapText); -} - -void BandMap::setColors(QString t) -{ - m_colorBackground = "#"+t.mid(0,6); - m_color0 = "#"+t.mid(6,6); - m_color1 = "#"+t.mid(12,6); - m_color2 = "#"+t.mid(18,6); - m_color3 = "#"+t.mid(24,6); - setText(m_bandMapText); -} diff --git a/q65w/bandmap.h b/q65w/bandmap.h deleted file mode 100644 index 857925800..000000000 --- a/q65w/bandmap.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef BANDMAP_H -#define BANDMAP_H - -#include - -namespace Ui { - class BandMap; -} - -class BandMap : public QWidget -{ - Q_OBJECT - -public: - explicit BandMap (QString const& settings_filename, QWidget *parent = 0); - void setText(QString t); - void setColors(QString t); - - ~BandMap(); - -protected: - void resizeEvent(QResizeEvent* event); - -private: - Ui::BandMap *ui; - QString m_settings_filename; - QString m_bandMapText; - QString m_colorBackground; - QString m_color0; - QString m_color1; - QString m_color2; - QString m_color3; -}; - -#endif diff --git a/q65w/bandmap.ui b/q65w/bandmap.ui deleted file mode 100644 index cd87a41dd..000000000 --- a/q65w/bandmap.ui +++ /dev/null @@ -1,43 +0,0 @@ - - - BandMap - - - - 0 - 0 - 329 - 379 - - - - - 0 - 0 - - - - Form - - - - - - - 107 - 0 - - - - - Courier New - 9 - - - - - - - - - diff --git a/q65w/mainwindow.cpp b/q65w/mainwindow.cpp index f8d181bb2..fea906cac 100644 --- a/q65w/mainwindow.cpp +++ b/q65w/mainwindow.cpp @@ -15,7 +15,6 @@ #include "about.h" #include "astro.h" #include "widegraph.h" -#include "bandmap.h" #include "txtune.h" #include "sleep.h" #include @@ -223,8 +222,6 @@ MainWindow::MainWindow(QWidget *parent) : on_actionAstro_Data_triggered(); //Create the other windows on_actionWide_Waterfall_triggered(); -// on_actionBand_Map_triggered(); -// m_band_map_window->setColors(m_colors); if (m_astro_window) m_astro_window->setFontSize (m_astroFont); if(m_modeQ65==0) on_actionNoQ65_triggered(); @@ -722,7 +719,6 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog m_initIQplus=dlg.m_initIQplus; m_bIQxt=dlg.m_bIQxt; m_colors=dlg.m_colors; -// m_band_map_window->setColors(m_colors); m_cal570=dlg.m_cal570; m_TxOffset=dlg.m_TxOffset; m_mult570Tx=dlg.m_mult570Tx; @@ -968,7 +964,6 @@ void MainWindow::closeEvent (QCloseEvent * e) quitFile.remove(); mem_m65.detach(); if (m_astro_window) m_astro_window->close (); -// if (m_band_map_window) m_band_map_window->close (); if (m_wide_graph_window) m_wide_graph_window->close (); QMainWindow::closeEvent (e); } @@ -1030,11 +1025,6 @@ void MainWindow::on_actionWide_Waterfall_triggered() //Display Waterfalls m_wide_graph_window->show(); } -void MainWindow::on_actionBand_Map_triggered() //Display BandMap -{ -// m_band_map_window->show (); -} - void MainWindow::on_actionOpen_triggered() //Open File { m_monitoring=false; @@ -1150,12 +1140,6 @@ void MainWindow::on_actionDelete_all_tf2_files_in_SaveDir_triggered() } } } - //Clear BandMap and Messages windows -void MainWindow::on_actionErase_Band_Map_and_Messages_triggered() -{ -// m_band_map_window->setText(""); - m_map65RxLog |= 4; -} void MainWindow::on_actionFind_Delta_Phi_triggered() //Find dPhi { @@ -1401,7 +1385,6 @@ void MainWindow::readFromStdout() //readFromStdout if((t.indexOf("") >= 0) or (t.indexOf("") >= 0)) { if(m_widebandDecode) { -// m_band_map_window->setText(m_bandmapText); m_widebandDecode=false; } QFile lockFile(m_appDir + "/.lock"); @@ -1428,7 +1411,6 @@ void MainWindow::readFromStdout() //readFromStdout if(n>=30 or t.indexOf("Best-fit")>=0) ui->decodedTextBrowser->append(t.mid(1,n-m-4).trimmed()); n=ui->decodedTextBrowser->verticalScrollBar()->maximum(); ui->decodedTextBrowser->verticalScrollBar()->setValue(n); -// m_bandmapText=""; m_widebandDecode=true; } @@ -1442,7 +1424,6 @@ void MainWindow::readFromStdout() //readFromStdout } else { q=q.mid(1,4) + " *" + q.mid(5); } -// m_bandmapText += q; } } if(t.indexOf("=") >= 0) { diff --git a/q65w/mainwindow.h b/q65w/mainwindow.h index 26c551cdb..df9f5e3e9 100644 --- a/q65w/mainwindow.h +++ b/q65w/mainwindow.h @@ -26,7 +26,6 @@ namespace Ui { class QTimer; class Astro; -class BandMap; class WideGraph; class MainWindow : public QMainWindow @@ -80,12 +79,10 @@ private slots: void on_actionQSG_MAP65_v3_triggered(); void on_actionQ65_Sensitivity_in_MAP65_3_0_triggered(); void on_actionWide_Waterfall_triggered(); - void on_actionBand_Map_triggered(); void on_actionOpen_triggered(); void on_actionOpen_next_in_directory_triggered(); void on_actionDecode_remaining_files_in_directory_triggered(); void on_actionDelete_all_tf2_files_in_SaveDir_triggered(); - void on_actionErase_Band_Map_and_Messages_triggered(); void on_actionFind_Delta_Phi_triggered(); void on_actionF4_sets_Tx6_triggered(); void on_actionOnly_EME_calls_triggered(); @@ -148,7 +145,6 @@ private: QString m_appDir; QString m_settings_filename; QScopedPointer m_astro_window; - QScopedPointer m_band_map_window; QScopedPointer m_wide_graph_window; QPointer m_gui_timer; qint64 m_msErase; @@ -252,7 +248,6 @@ private: QString m_pbdecoding_style1; QString m_pbmonitor_style; QString m_pbAutoOn_style; - QString m_bandmapText; QString m_myCall; QString m_myGrid; QString m_hisCall; diff --git a/q65w/map65.pro b/q65w/map65.pro index 951828b63..e51c56a47 100644 --- a/q65w/map65.pro +++ b/q65w/map65.pro @@ -31,7 +31,7 @@ DEFINES = UNIX SOURCES += main.cpp mainwindow.cpp plotter.cpp about.cpp \ soundin.cpp soundout.cpp devsetup.cpp \ - widegraph.cpp getfile.cpp bandmap.cpp \ + widegraph.cpp getfile.cpp \ astro.cpp displaytext.cpp getdev.cpp \ txtune.cpp meterwidget.cpp signalmeter.cpp @@ -41,12 +41,11 @@ SOURCES += killbyname.cpp set570.cpp HEADERS += mainwindow.h plotter.h soundin.h soundout.h \ about.h devsetup.h widegraph.h getfile.h \ - bandmap.h commons.h sleep.h astro.h displaytext.h \ + commons.h sleep.h astro.h displaytext.h \ txtune.h meterwidget.h signalmeter.h FORMS += mainwindow.ui about.ui devsetup.ui widegraph.ui \ - bandmap.ui astro.ui \ - txtune.ui + astro.ui txtune.ui RC_FILE = map65.rc