mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-25 05:29:16 -04:00
Finish removing Band Map window.
This commit is contained in:
parent
de841889b5
commit
9ba8ae0b9b
100
q65w/bandmap.cpp
100
q65w/bandmap.cpp
@ -1,100 +0,0 @@
|
||||
#include "bandmap.h"
|
||||
#include <QSettings>
|
||||
#include "ui_bandmap.h"
|
||||
#include "qt_helpers.hpp"
|
||||
#include "SettingsGroup.hpp"
|
||||
#include <QDebug>
|
||||
|
||||
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="<html style=\" font-family:'Courier New';"
|
||||
"font-size:9pt; background-color:#000066\">"
|
||||
"<table border=0 cellspacing=7><tr><td>\n";
|
||||
QString tfreq,tspace,tcall;
|
||||
QString s0,s1,s2,s3,bg;
|
||||
bg="<span style=color:"+m_colorBackground+";>.</span>";
|
||||
s0="<span style=color:"+m_color0+";>";
|
||||
s1="<span style=color:"+m_color1+";>";
|
||||
s2="<span style=color:"+m_color2+";>";
|
||||
s3="<span style=color:"+m_color3+";>";
|
||||
|
||||
ui->bmTextBrowser->clear();
|
||||
QStringList lines = t.split( "\n", SkipEmptyParts );
|
||||
int nrows=(lines.length()+ncols-1)/ncols;
|
||||
|
||||
for(int i=0; i<nrows; i++) {
|
||||
tfreq=lines[i].mid(0,3);
|
||||
tspace=lines[i].mid(4,1);
|
||||
if(tspace==" ") tspace=bg;
|
||||
tcall=lines[i].mid(5,7);
|
||||
int n=lines[i].mid(13,1).toInt();
|
||||
if(n==0) t0 += s0;
|
||||
if(n==1) t0 += s1;
|
||||
if(n==2) t0 += s2;
|
||||
if(n>=3) t0 += s3;
|
||||
t0 += (tfreq + tspace + tcall + "</span><br>\n");
|
||||
}
|
||||
|
||||
if(ncols==2) { //2-column display
|
||||
t0 += "<td><br><td>\n";
|
||||
for(int i=nrows; i<lines.length(); i++) {
|
||||
tfreq=lines[i].mid(0,3);
|
||||
tspace=lines[i].mid(4,1);
|
||||
if(tspace==" ") tspace=bg;
|
||||
tcall=lines[i].mid(5,7);
|
||||
int n=lines[i].mid(13,1).toInt();
|
||||
if(n==0) t0 += s0;
|
||||
if(n==1) t0 += s1;
|
||||
if(n==2) t0 += s2;
|
||||
if(n>=3) t0 += s3;
|
||||
t0 += (tfreq + tspace + tcall + "</span><br>\n");
|
||||
}
|
||||
if(2*nrows>lines.length()) t0 += (s0 + "</span><br>\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);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
#ifndef BANDMAP_H
|
||||
#define BANDMAP_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
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
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BandMap</class>
|
||||
<widget class="QWidget" name="BandMap">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>329</width>
|
||||
<height>379</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextBrowser" name="bmTextBrowser">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>107</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -15,7 +15,6 @@
|
||||
#include "about.h"
|
||||
#include "astro.h"
|
||||
#include "widegraph.h"
|
||||
#include "bandmap.h"
|
||||
#include "txtune.h"
|
||||
#include "sleep.h"
|
||||
#include <portaudio.h>
|
||||
@ -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("<EarlyFinished>") >= 0) or (t.indexOf("<DecodeFinished>") >= 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) {
|
||||
|
@ -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<Astro> m_astro_window;
|
||||
QScopedPointer<BandMap> m_band_map_window;
|
||||
QScopedPointer<WideGraph> m_wide_graph_window;
|
||||
QPointer<QTimer> 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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user