Merged master 8748
This commit is contained in:
Binary file not shown.
@@ -1,158 +0,0 @@
|
||||
#ifndef FREQUENCY_LIST_HPP__
|
||||
#define FREQUENCY_LIST_HPP__
|
||||
|
||||
#include "pimpl_h.hpp"
|
||||
|
||||
#include <QList>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include "Radio.hpp"
|
||||
#include "IARURegions.hpp"
|
||||
#include "Modes.hpp"
|
||||
|
||||
class Bands;
|
||||
|
||||
//
|
||||
// Class FrequencyList
|
||||
//
|
||||
// Encapsulates a collection of frequencies with associated modes.
|
||||
// The implementation is a table containing the list of IARU region,
|
||||
// Frequency and mode tuples which are editable. A third column is
|
||||
// modeled in the model which is an immutable double representation
|
||||
// of the corresponding Frequency item scaled to mega-Hertz.
|
||||
//
|
||||
// The list is ordered. A filter on IARU region and mode is
|
||||
// available and is set by the filter(Region, Mode) method. The
|
||||
// Region value IARURegions::ALL and the Mode value Modes::ALL may be
|
||||
// optionally given which passes all rows in the filtered column.
|
||||
//
|
||||
// Responsibilities
|
||||
//
|
||||
// Stores internally a list of unique region, frequency mode tuples.
|
||||
// Provides methods to add and delete list elements. Provides range
|
||||
// iterators for a filtered view of the underlying table.
|
||||
//
|
||||
// Collaborations
|
||||
//
|
||||
// Implements the QSortFilterProxyModel interface for a list of spot
|
||||
// frequencies.
|
||||
//
|
||||
class FrequencyList final
|
||||
: public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
using Region = IARURegions::Region;
|
||||
using Frequency = Radio::Frequency;
|
||||
using Mode = Modes::Mode;
|
||||
|
||||
struct Item
|
||||
{
|
||||
Frequency frequency_;
|
||||
Mode mode_;
|
||||
Region region_;
|
||||
};
|
||||
using FrequencyItems = QList<Item>;
|
||||
using BandSet = QSet<QString>;
|
||||
|
||||
enum Column {region_column, mode_column, frequency_column, frequency_mhz_column, SENTINAL};
|
||||
|
||||
// an iterator that meets the requirements of the C++ for range statement
|
||||
class const_iterator
|
||||
{
|
||||
public:
|
||||
const_iterator (FrequencyList const * parent, int row)
|
||||
: parent_ {parent}
|
||||
, row_ {row}
|
||||
{
|
||||
}
|
||||
|
||||
Item const& operator * () const;
|
||||
Item const * operator -> () const;
|
||||
bool operator != (const_iterator const&) const;
|
||||
bool operator == (const_iterator const&) const;
|
||||
const_iterator& operator ++ ();
|
||||
|
||||
private:
|
||||
FrequencyList const * parent_;
|
||||
int row_;
|
||||
};
|
||||
|
||||
explicit FrequencyList (Bands const *, QObject * parent = nullptr);
|
||||
~FrequencyList ();
|
||||
|
||||
// Load and store underlying items
|
||||
FrequencyItems frequency_list (FrequencyItems);
|
||||
FrequencyItems const& frequency_list () const;
|
||||
FrequencyItems frequency_list (QModelIndexList const&) const;
|
||||
void frequency_list_merge (FrequencyItems const&);
|
||||
|
||||
// Iterators for the sorted and filtered items
|
||||
//
|
||||
// Note that these iterators are on the final sorted and filtered
|
||||
// rows, if you need to access the underlying unfiltered and
|
||||
// unsorted frequencies then use the frequency_list() member to
|
||||
// access the underlying list of rows.
|
||||
const_iterator begin () const;
|
||||
const_iterator end () const;
|
||||
|
||||
// Find a row with a given frequency
|
||||
const_iterator find (Frequency) const;
|
||||
|
||||
// Bands of the frequencies
|
||||
BandSet all_bands (Region = IARURegions::ALL, Mode = Modes::ALL) const;
|
||||
BandSet filtered_bands () const;
|
||||
|
||||
// Find the row of the nearest best working frequency given a
|
||||
// frequency. Returns -1 if no suitable working frequency is found
|
||||
// in the list.
|
||||
int best_working_frequency (Frequency) const;
|
||||
|
||||
// Find the row of the nearest best working frequency given a band
|
||||
// name. Returns -1 if no suitable working frequency is found in the
|
||||
// list.
|
||||
int best_working_frequency (QString const& band) const;
|
||||
|
||||
// Set filter
|
||||
Q_SLOT void filter (Region, Mode);
|
||||
|
||||
// Reset
|
||||
Q_SLOT void reset_to_defaults ();
|
||||
|
||||
// Model API
|
||||
QModelIndex add (Item);
|
||||
bool remove (Item);
|
||||
bool removeDisjointRows (QModelIndexList);
|
||||
|
||||
// Proxy API
|
||||
bool filterAcceptsRow (int source_row, QModelIndex const& parent) const override;
|
||||
|
||||
// Custom roles.
|
||||
static int constexpr SortRole = Qt::UserRole;
|
||||
|
||||
private:
|
||||
class impl;
|
||||
pimpl<impl> m_;
|
||||
};
|
||||
|
||||
inline
|
||||
bool operator == (FrequencyList::Item const& lhs, FrequencyList::Item const& rhs)
|
||||
{
|
||||
return
|
||||
lhs.frequency_ == rhs.frequency_
|
||||
&& lhs.region_ == rhs.region_
|
||||
&& lhs.mode_ == rhs.mode_;
|
||||
}
|
||||
|
||||
QDataStream& operator << (QDataStream&, FrequencyList::Item const&);
|
||||
QDataStream& operator >> (QDataStream&, FrequencyList::Item&);
|
||||
|
||||
#if !defined (QT_NO_DEBUG_STREAM)
|
||||
QDebug operator << (QDebug, FrequencyList::Item const&);
|
||||
#endif
|
||||
|
||||
Q_DECLARE_METATYPE (FrequencyList::Item);
|
||||
Q_DECLARE_METATYPE (FrequencyList::FrequencyItems);
|
||||
|
||||
#endif
|
||||
@@ -1,118 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2011-07-07T08:39:24
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += network multimedia
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
CONFIG += thread
|
||||
#CONFIG += console
|
||||
|
||||
TARGET = wsjtx
|
||||
VERSION = "Not for Release"
|
||||
TEMPLATE = app
|
||||
DEFINES = QT5
|
||||
QMAKE_CXXFLAGS += -std=c++11
|
||||
DEFINES += PROJECT_MANUAL="'\"http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main.html\"'"
|
||||
|
||||
isEmpty (DESTDIR) {
|
||||
DESTDIR = ../wsjtx_exp_install
|
||||
}
|
||||
|
||||
isEmpty (HAMLIB_DIR) {
|
||||
HAMLIB_DIR = ../../hamlib3/mingw32
|
||||
}
|
||||
|
||||
isEmpty (FFTW3_DIR) {
|
||||
FFTW3_DIR = .
|
||||
}
|
||||
|
||||
F90 = gfortran
|
||||
gfortran.output = ${QMAKE_FILE_BASE}.o
|
||||
gfortran.commands = $$F90 -c -O2 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME}
|
||||
gfortran.input = F90_SOURCES
|
||||
QMAKE_EXTRA_COMPILERS += gfortran
|
||||
|
||||
win32 {
|
||||
DEFINES += WIN32
|
||||
QT += axcontainer
|
||||
TYPELIBS = $$system(dumpcpp -getfile {4FE359C5-A58F-459D-BE95-CA559FB4F270})
|
||||
}
|
||||
|
||||
unix {
|
||||
DEFINES += UNIX
|
||||
}
|
||||
|
||||
#
|
||||
# Order matters here as the link is in this order so referrers need to be after referred
|
||||
#
|
||||
SOURCES += \
|
||||
logbook/adif.cpp \
|
||||
logbook/countrydat.cpp \
|
||||
logbook/countriesworked.cpp \
|
||||
logbook/logbook.cpp \
|
||||
astro.cpp Radio.cpp NetworkServerLookup.cpp revision_utils.cpp \
|
||||
Transceiver.cpp TransceiverBase.cpp TransceiverFactory.cpp \
|
||||
PollingTransceiver.cpp EmulateSplitTransceiver.cpp LettersSpinBox.cpp \
|
||||
HRDTransceiver.cpp DXLabSuiteCommanderTransceiver.cpp \
|
||||
HamlibTransceiver.cpp FrequencyLineEdit.cpp Bands.cpp \
|
||||
FrequencyList.cpp StationList.cpp ForeignKeyDelegate.cpp \
|
||||
FrequencyItemDelegate.cpp LiveFrequencyValidator.cpp \
|
||||
Configuration.cpp psk_reporter.cpp AudioDevice.cpp \
|
||||
Modulator.cpp Detector.cpp logqso.cpp displaytext.cpp \
|
||||
getfile.cpp soundout.cpp soundin.cpp meterwidget.cpp signalmeter.cpp \
|
||||
WFPalette.cpp plotter.cpp widegraph.cpp about.cpp WsprTxScheduler.cpp mainwindow.cpp \
|
||||
main.cpp decodedtext.cpp wsprnet.cpp messageaveraging.cpp \
|
||||
echoplot.cpp echograph.cpp fastgraph.cpp fastplot.cpp Modes.cpp \
|
||||
WSPRBandHopping.cpp MessageAggregator.cpp SampleDownloader.cpp qt_helpers.cpp\
|
||||
MultiSettings.cpp PhaseEqualizationDialog.cpp IARURegions.cpp MessageBox.cpp
|
||||
|
||||
HEADERS += qt_helpers.hpp \
|
||||
pimpl_h.hpp pimpl_impl.hpp \
|
||||
Radio.hpp NetworkServerLookup.hpp revision_utils.hpp \
|
||||
mainwindow.h plotter.h soundin.h soundout.h astro.h \
|
||||
about.h WFPalette.hpp widegraph.h getfile.h decodedtext.h \
|
||||
commons.h sleep.h displaytext.h logqso.h LettersSpinBox.hpp \
|
||||
Bands.hpp FrequencyList.hpp StationList.hpp ForeignKeyDelegate.hpp FrequencyItemDelegate.hpp LiveFrequencyValidator.hpp \
|
||||
FrequencyLineEdit.hpp AudioDevice.hpp Detector.hpp Modulator.hpp psk_reporter.h \
|
||||
Transceiver.hpp TransceiverBase.hpp TransceiverFactory.hpp PollingTransceiver.hpp \
|
||||
EmulateSplitTransceiver.hpp DXLabSuiteCommanderTransceiver.hpp HamlibTransceiver.hpp \
|
||||
Configuration.hpp wsprnet.h signalmeter.h meterwidget.h \
|
||||
logbook/logbook.h logbook/countrydat.h logbook/countriesworked.h logbook/adif.h \
|
||||
messageaveraging.h echoplot.h echograph.h fastgraph.h fastplot.h Modes.hpp WSPRBandHopping.hpp \
|
||||
WsprTxScheduler.h SampleDownloader.hpp MultiSettings.hpp PhaseEqualizationDialog.hpp \
|
||||
IARURegions.hpp MessageBox.hpp
|
||||
|
||||
INCLUDEPATH += qmake_only
|
||||
|
||||
win32 {
|
||||
SOURCES += killbyname.cpp OmniRigTransceiver.cpp
|
||||
HEADERS += OmniRigTransceiver.hpp
|
||||
}
|
||||
|
||||
FORMS += mainwindow.ui about.ui Configuration.ui widegraph.ui astro.ui \
|
||||
logqso.ui wf_palette_design_dialog.ui messageaveraging.ui echograph.ui \
|
||||
fastgraph.ui
|
||||
|
||||
RC_FILE = wsjtx.rc
|
||||
RESOURCES = wsjtx.qrc
|
||||
|
||||
unix {
|
||||
LIBS += -L lib -ljt9
|
||||
LIBS += -lhamlib
|
||||
LIBS += -lfftw3f $$system($$F90 -print-file-name=libgfortran.so)
|
||||
}
|
||||
|
||||
win32 {
|
||||
INCLUDEPATH += $${HAMLIB_DIR}/include
|
||||
INCLUDEPATH += C:\JTSDK\wsjtx_exp\build\Release
|
||||
INCLUDEPATH += C:\JTSDK\hamlib3\include
|
||||
INCLUDEPATH += C:\JTSDK\qt5\5.2.1\mingw48_32\include\QtSerialPort
|
||||
|
||||
LIBS += -L$${HAMLIB_DIR}/lib -lhamlib
|
||||
LIBS += -L./lib -lastro -ljt9
|
||||
LIBS += -L$${FFTW3_DIR} -lfftw3f-3
|
||||
LIBS += -lws2_32
|
||||
LIBS += $$system($$F90 -print-file-name=libgfortran.a)
|
||||
}
|
||||
Reference in New Issue
Block a user