Merge branch 'ft9_refactor' into feat-refactor

# Conflicts:
#	CMakeLists.txt
#	lib/ft4/getcandidates4.f90
#	lib/ft4/sync4d.f90
This commit is contained in:
sirhc808 2019-07-02 12:06:14 -05:00
commit 27d4471cde
60 changed files with 377 additions and 341 deletions

4
.gitignore vendored
View File

@ -7,4 +7,6 @@ jnq*
*.exe *.exe
*.o *.o
*.mod *.mod
*.pro.user *.pro.user
cmake-build-debug
cmake-build-release

View File

@ -226,7 +226,7 @@ set (wsjt_qt_CXXSRCS
qt_helpers.cpp qt_helpers.cpp
widgets/MessageBox.cpp widgets/MessageBox.cpp
MetaDataRegistry.cpp MetaDataRegistry.cpp
NetworkServerLookup.cpp Network/NetworkServerLookup.cpp
revision_utils.cpp revision_utils.cpp
WFPalette.cpp WFPalette.cpp
Radio.cpp Radio.cpp
@ -244,16 +244,16 @@ set (wsjt_qt_CXXSRCS
GetUserId.cpp GetUserId.cpp
TraceFile.cpp TraceFile.cpp
AudioDevice.cpp AudioDevice.cpp
Transceiver.cpp Transceiver/Transceiver.cpp
TransceiverBase.cpp Transceiver/TransceiverBase.cpp
EmulateSplitTransceiver.cpp Transceiver/EmulateSplitTransceiver.cpp
TransceiverFactory.cpp Transceiver/TransceiverFactory.cpp
PollingTransceiver.cpp Transceiver/PollingTransceiver.cpp
HamlibTransceiver.cpp Transceiver/HamlibTransceiver.cpp
HRDTransceiver.cpp Transceiver/HRDTransceiver.cpp
DXLabSuiteCommanderTransceiver.cpp Transceiver/DXLabSuiteCommanderTransceiver.cpp
NetworkMessage.cpp Network/NetworkMessage.cpp
MessageClient.cpp Network/MessageClient.cpp
widgets/LettersSpinBox.cpp widgets/LettersSpinBox.cpp
widgets/HintedSpinBox.cpp widgets/HintedSpinBox.cpp
widgets/RestrictedSpinBox.cpp widgets/RestrictedSpinBox.cpp
@ -268,7 +268,7 @@ set (wsjt_qt_CXXSRCS
validators/MaidenheadLocatorValidator.cpp validators/MaidenheadLocatorValidator.cpp
validators/CallsignValidator.cpp validators/CallsignValidator.cpp
widgets/SplashScreen.cpp widgets/SplashScreen.cpp
EqualizationToolsDialog.cpp Transceiver/EqualizationToolsDialog.cpp
widgets/DoubleClickablePushButton.cpp widgets/DoubleClickablePushButton.cpp
widgets/DoubleClickableRadioButton.cpp widgets/DoubleClickableRadioButton.cpp
LotWUsers.cpp LotWUsers.cpp
@ -303,9 +303,9 @@ set (jt9_CXXSRCS
set (wsjtx_CXXSRCS set (wsjtx_CXXSRCS
logbook/logbook.cpp logbook/logbook.cpp
psk_reporter.cpp Network/psk_reporter.cpp
Modulator.cpp Modulator.cpp
Detector.cpp Detector/Detector.cpp
widgets/logqso.cpp widgets/logqso.cpp
widgets/displaytext.cpp widgets/displaytext.cpp
decodedtext.cpp decodedtext.cpp
@ -353,7 +353,7 @@ if (WIN32)
set (wsjt_qt_CXXSRCS set (wsjt_qt_CXXSRCS
${wsjt_qt_CXXSRCS} ${wsjt_qt_CXXSRCS}
OmniRigTransceiver.cpp Transceiver/OmniRigTransceiver.cpp
) )
endif (WIN32) endif (WIN32)
@ -683,13 +683,13 @@ set (wsjtx_UISRCS
set (UDP_library_CXXSRCS set (UDP_library_CXXSRCS
Radio.cpp Radio.cpp
RadioMetaType.cpp RadioMetaType.cpp
NetworkMessage.cpp Network/NetworkMessage.cpp
MessageServer.cpp Network/MessageServer.cpp
) )
set (UDP_library_HEADERS set (UDP_library_HEADERS
Radio.hpp Radio.hpp
MessageServer.hpp Network/MessageServer.hpp
${PROJECT_BINARY_DIR}/udp_export.h ${PROJECT_BINARY_DIR}/udp_export.h
) )
@ -920,7 +920,7 @@ set (CMAKE_VISIBILITY_INLINES_HIDDEN ON)
# #
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fexceptions -frtti") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -fexceptions -frtti")
if (NOT APPLE) if (NOT APPLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas")
@ -1100,7 +1100,7 @@ set (LANGUAGES
foreach (lang_ ${LANGUAGES}) foreach (lang_ ${LANGUAGES})
file (TO_NATIVE_PATH translations/wsjtx_${lang_}.ts ts_) file (TO_NATIVE_PATH translations/wsjtx_${lang_}.ts ts_)
list (APPEND TS_FILES ${ts_}) list (APPEND TS_FILES ${ts_})
endforeach () endforeach ()
if (UPDATE_TRANSLATIONS) if (UPDATE_TRANSLATIONS)
message (STATUS "UPDATE_TRANSLATIONS option is set.") message (STATUS "UPDATE_TRANSLATIONS option is set.")
qt5_create_translation ( qt5_create_translation (

View File

@ -172,14 +172,14 @@
#include "item_delegates/ForeignKeyDelegate.hpp" #include "item_delegates/ForeignKeyDelegate.hpp"
#include "item_delegates/FrequencyDelegate.hpp" #include "item_delegates/FrequencyDelegate.hpp"
#include "item_delegates/FrequencyDeltaDelegate.hpp" #include "item_delegates/FrequencyDeltaDelegate.hpp"
#include "TransceiverFactory.hpp" #include "Transceiver/TransceiverFactory.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "models/Bands.hpp" #include "models/Bands.hpp"
#include "models/IARURegions.hpp" #include "models/IARURegions.hpp"
#include "models/Modes.hpp" #include "models/Modes.hpp"
#include "models/FrequencyList.hpp" #include "models/FrequencyList.hpp"
#include "models/StationList.hpp" #include "models/StationList.hpp"
#include "NetworkServerLookup.hpp" #include "Network/NetworkServerLookup.hpp"
#include "widgets/MessageBox.hpp" #include "widgets/MessageBox.hpp"
#include "validators/MaidenheadLocatorValidator.hpp" #include "validators/MaidenheadLocatorValidator.hpp"
#include "validators/CallsignValidator.hpp" #include "validators/CallsignValidator.hpp"

View File

@ -7,7 +7,7 @@
#include "Radio.hpp" #include "Radio.hpp"
#include "models/IARURegions.hpp" #include "models/IARURegions.hpp"
#include "AudioDevice.hpp" #include "AudioDevice.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "pimpl_h.hpp" #include "pimpl_h.hpp"

View File

@ -18,7 +18,6 @@ Detector::Detector (unsigned frameRate, double periodLengthInSeconds,
, m_period (periodLengthInSeconds) , m_period (periodLengthInSeconds)
, m_downSampleFactor (downSampleFactor) , m_downSampleFactor (downSampleFactor)
, m_samplesPerFFT {max_buffer_size} , m_samplesPerFFT {max_buffer_size}
, m_ns (999)
, m_buffer ((downSampleFactor > 1) ? , m_buffer ((downSampleFactor > 1) ?
new short [max_buffer_size * downSampleFactor] : nullptr) new short [max_buffer_size * downSampleFactor] : nullptr)
, m_bufferPos (0) , m_bufferPos (0)

View File

@ -46,7 +46,6 @@ private:
double m_period; double m_period;
unsigned m_downSampleFactor; unsigned m_downSampleFactor;
qint32 m_samplesPerFFT; // after any down sampling qint32 m_samplesPerFFT; // after any down sampling
qint32 m_ns;
static size_t const max_buffer_size {7 * 512}; static size_t const max_buffer_size {7 * 512};
QScopedArrayPointer<short> m_buffer; // de-interleaved sample buffer QScopedArrayPointer<short> m_buffer; // de-interleaved sample buffer
// big enough for all the // big enough for all the

View File

@ -9,8 +9,8 @@
#include "AudioDevice.hpp" #include "AudioDevice.hpp"
#include "Configuration.hpp" #include "Configuration.hpp"
#include "models/StationList.hpp" #include "models/StationList.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "TransceiverFactory.hpp" #include "Transceiver/TransceiverFactory.hpp"
#include "WFPalette.hpp" #include "WFPalette.hpp"
#include "models/IARURegions.hpp" #include "models/IARURegions.hpp"
#include "models/DecodeHighlightingModel.hpp" #include "models/DecodeHighlightingModel.hpp"

View File

@ -8,7 +8,7 @@
#include <QHostInfo> #include <QHostInfo>
#include <QTimer> #include <QTimer>
#include "MessageClient.hpp" #include "Network/MessageClient.hpp"
#include "moc_psk_reporter.cpp" #include "moc_psk_reporter.cpp"

View File

@ -54,7 +54,7 @@ Directory::Directory (Configuration const * configuration
connect (network_manager_, &QNetworkAccessManager::authenticationRequired connect (network_manager_, &QNetworkAccessManager::authenticationRequired
, this, &Directory::authentication); , this, &Directory::authentication);
connect (this, &Directory::itemChanged, [this] (QTreeWidgetItem * item) { connect (this, &Directory::itemChanged, [] (QTreeWidgetItem * item) {
switch (item->type ()) switch (item->type ())
{ {
case FileNode::Type: case FileNode::Type:

View File

@ -6,7 +6,7 @@
#include <QThread> #include <QThread>
#include <QDateTime> #include <QDateTime>
#include "NetworkServerLookup.hpp" #include "Network/NetworkServerLookup.hpp"
#include "moc_DXLabSuiteCommanderTransceiver.cpp" #include "moc_DXLabSuiteCommanderTransceiver.cpp"

View File

@ -8,7 +8,7 @@
#include <QStandardPaths> #include <QStandardPaths>
#include <QDir> #include <QDir>
#include "NetworkServerLookup.hpp" #include "Network/NetworkServerLookup.hpp"
namespace namespace
{ {
@ -1023,7 +1023,7 @@ QString HRDTransceiver::send_command (QString const& cmd, bool no_debug, bool pr
if (!recurse && prepend_context) if (!recurse && prepend_context)
{ {
auto radio_name = send_command ("get radio", true, current_radio_, true); auto radio_name = send_command ("get radio", true, current_radio_, true);
auto radio_iter = std::find_if (radios_.begin (), radios_.end (), [this, &radio_name] (RadioMap::value_type const& radio) auto radio_iter = std::find_if (radios_.begin (), radios_.end (), [&radio_name] (RadioMap::value_type const& radio)
{ {
return std::get<1> (radio) == radio_name; return std::get<1> (radio) == radio_name;
}); });

View File

@ -6,7 +6,7 @@
#include <QThread> #include <QThread>
#include <QEventLoop> #include <QEventLoop>
#include "qt_helpers.hpP" #include "qt_helpers.hpp"
#include "moc_OmniRigTransceiver.cpp" #include "moc_OmniRigTransceiver.cpp"

View File

@ -3,7 +3,7 @@
#include <QObject> #include <QObject>
#include "TransceiverBase.hpp" #include "Transceiver/TransceiverBase.hpp"
class QTimer; class QTimer;

View File

@ -3,7 +3,7 @@
#include <QStandardItemModel> #include <QStandardItemModel>
#include "MessageServer.hpp" #include "Network/MessageServer.hpp"
using Frequency = MessageServer::Frequency; using Frequency = MessageServer::Frequency;

View File

@ -7,7 +7,7 @@
#include <QString> #include <QString>
#include <QRegularExpression> #include <QRegularExpression>
#include "MessageServer.hpp" #include "Network/MessageServer.hpp"
class QAbstractItemModel; class QAbstractItemModel;
class QModelIndex; class QModelIndex;

View File

@ -3,7 +3,7 @@
#include <QStandardItemModel> #include <QStandardItemModel>
#include "MessageServer.hpp" #include "Network/MessageServer.hpp"
using Frequency = MessageServer::Frequency; using Frequency = MessageServer::Frequency;

View File

@ -5,7 +5,7 @@
#include <QHash> #include <QHash>
#include <QString> #include <QString>
#include "MessageServer.hpp" #include "Network/MessageServer.hpp"
class QDateTime; class QDateTime;
class QStandardItemModel; class QStandardItemModel;

View File

@ -25,7 +25,7 @@
#include <QHash> #include <QHash>
#include <QDebug> #include <QDebug>
#include "MessageServer.hpp" #include "Network/MessageServer.hpp"
#include "Radio.hpp" #include "Radio.hpp"
#include "qt_helpers.hpp" #include "qt_helpers.hpp"
@ -147,7 +147,7 @@ public:
: server_ {new MessageServer {this}} : server_ {new MessageServer {this}}
{ {
// connect up server // connect up server
connect (server_, &MessageServer::error, [this] (QString const& message) { connect (server_, &MessageServer::error, [] (QString const& message) {
std::cerr << tr ("Network Error: %1").arg ( message).toStdString () << std::endl; std::cerr << tr ("Network Error: %1").arg ( message).toStdString () << std::endl;
}); });
connect (server_, &MessageServer::client_opened, this, &Server::add_client); connect (server_, &MessageServer::client_opened, this, &Server::add_client);

View File

@ -77,7 +77,6 @@ private:
QString string_; QString string_;
int padding_; int padding_;
bool contest_mode_;
QString message_; QString message_;
QString message0_; QString message0_;
bool is_standard_; bool is_standard_;

View File

@ -0,0 +1,14 @@
@startuml
interface IProtocol {
encode()
decode()
}
interface IDecoder
interface IEncoder
interface IDecode
class FT8
IProtocol <|-- FT8
@enduml

View File

@ -0,0 +1,31 @@
@startuml
hide footbox
participant Detector
participant MainWindow
participant SHM
participant jt9.f90
participant decoder.f90
participant ft8_decode.f90
Detector -> MainWindow : dataSink()
activate MainWindow
MainWindow -> MainWindow : decode()
MainWindow -> MainWindow : decodeBusy()
MainWindow -> SHM : memcpy()
MainWindow -> jt9.f90 : doorbell
deactivate MainWindow
activate jt9.f90
jt9.f90 -> decoder.f90 : multimode_decoder()
decoder.f90 -> ft8_decode.f90 : decode()
ft8_decode.f90 -> decoder.f90 : ft8_decoded()
decoder.f90 -> jt9.f90
jt9.f90 -> MainWindow : readFromStdout()
@enduml

View File

@ -133,7 +133,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
n30fox(j)=n n30fox(j)=n
m=n30max-n m=n30max-n
if(len(trim(g2fox(j))).eq.4) then if(len(trim(g2fox(j))).eq.4) then
call azdist(mygrid,g2fox(j)//' ',0.d0,nAz,nEl,nDmiles, & call azdist(mygrid,g2fox(j)//' ',0.d0,nAz,nEl,nDmiles, &
nDkm,nHotAz,nHotABetter) nDkm,nHotAz,nHotABetter)
else else
nDkm=9999 nDkm=9999
@ -588,9 +588,7 @@ contains
real, intent(in) :: dt real, intent(in) :: dt
real, intent(in) :: freq real, intent(in) :: freq
character(len=37), intent(in) :: decoded character(len=37), intent(in) :: decoded
character c1*12,c2*12,g2*4,w*4 integer, intent(in) :: nap
integer i0,i1,i2,i3,i4,i5,n30,nwrap
integer, intent(in) :: nap
real, intent(in) :: qual real, intent(in) :: qual
character*2 annot character*2 annot
character*37 decoded0 character*37 decoded0

View File

@ -1,86 +1,85 @@
subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
ncand,sbase) ncand,sbase)
include 'ft4_params.f90' include 'ft4_params.f90'
real s(NH1,NHSYM) real s(NH1,NHSYM)
real savg(NH1),savsm(NH1) real savg(NH1),savsm(NH1)
real sbase(NH1) real sbase(NH1)
real x(NFFT1) real x(NFFT1)
real window(NFFT1) real window(NFFT1)
complex cx(0:NH1) complex cx(0:NH1)
real candidate(2,maxcand),candidatet(2,maxcand) real candidate(2,maxcand),candidatet(2,maxcand)
real dd(NMAX) real dd(NMAX)
integer ipk(1) equivalence (x,cx)
equivalence (x,cx) logical first
logical first data first/.true./
data first/.true./ save first,window
save first,window
if(first) then
if(first) then first=.false.
first=.false. pi=4.0*atan(1.)
pi=4.0*atan(1.) window=0.
window=0. call nuttal_window(window,NFFT1)
call nuttal_window(window,NFFT1) endif
endif
! Compute symbol spectra, stepping by NSTEP steps.
! Compute symbol spectra, stepping by NSTEP steps. savg=0.
savg=0. df=12000.0/NFFT1
df=12000.0/NFFT1 fac=1.0/300.0
fac=1.0/300.0 do j=1,NHSYM
do j=1,NHSYM ia=(j-1)*NSTEP + 1
ia=(j-1)*NSTEP + 1 ib=ia+NFFT1-1
ib=ia+NFFT1-1 if(ib.gt.NMAX) exit
if(ib.gt.NMAX) exit x=fac*dd(ia:ib)*window
x=fac*dd(ia:ib)*window call four2a(x,NFFT1,1,-1,0) !r2c FFT
call four2a(x,NFFT1,1,-1,0) !r2c FFT do i=1,NH1
do i=1,NH1 s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2 enddo
enddo savg=savg + s(1:NH1,j) !Average spectrum
savg=savg + s(1:NH1,j) !Average spectrum enddo
enddo savg=savg/NHSYM
savg=savg/NHSYM savsm=0.
savsm=0. do i=8,NH1-7
do i=8,NH1-7 savsm(i)=sum(savg(i-7:i+7))/15.
savsm(i)=sum(savg(i-7:i+7))/15. enddo
enddo
nfa=fa/df
nfa=fa/df if(nfa.lt.nint(200.0/df)) nfa=nint(200.0/df)
if(nfa.lt.nint(200.0/df)) nfa=nint(200.0/df) nfb=fb/df
nfb=fb/df if(nfb.gt.nint(4910.0/df)) nfb=nint(4910.0/df)
if(nfb.gt.nint(4910.0/df)) nfb=nint(4910.0/df) call ft4_baseline(savg,nfa,nfb,sbase)
call ft4_baseline(savg,nfa,nfb,sbase) if(any(sbase(nfa:nfb).le.0)) return
if(any(sbase(nfa:nfb).le.0)) return savsm(nfa:nfb)=savsm(nfa:nfb)/sbase(nfa:nfb)
savsm(nfa:nfb)=savsm(nfa:nfb)/sbase(nfa:nfb) f_offset = -1.5*12000.0/NSPS
f_offset = -1.5*12000.0/NSPS ncand=0
ncand=0 candidatet=0
candidatet=0 do i=nfa+1,nfb-1
do i=nfa+1,nfb-1 if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. &
if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. & savsm(i).ge.syncmin) then
savsm(i).ge.syncmin) then den=savsm(i-1)-2*savsm(i)+savsm(i+1)
den=savsm(i-1)-2*savsm(i)+savsm(i+1) del=0.
del=0. if(den.ne.0.0) del=0.5*(savsm(i-1)-savsm(i+1))/den
if(den.ne.0.0) del=0.5*(savsm(i-1)-savsm(i+1))/den fpeak=(i+del)*df+f_offset
fpeak=(i+del)*df+f_offset if(fpeak.lt.200.0 .or. fpeak.gt.4910.0) cycle
if(fpeak.lt.200.0 .or. fpeak.gt.4910.0) cycle speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del
speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del ncand=ncand+1
ncand=ncand+1 candidatet(1,ncand)=fpeak
candidatet(1,ncand)=fpeak candidatet(2,ncand)=speak
candidatet(2,ncand)=speak if(ncand.eq.maxcand) exit
if(ncand.eq.maxcand) exit endif
endif enddo
enddo candidate=0
candidate=0 nq=count(abs(candidatet(1,1:ncand)-nfqso).le.20.0)
nq=count(abs(candidatet(1,1:ncand)-nfqso).le.20.0) n1=1
n1=1 n2=nq+1
n2=nq+1 do i=1,ncand
do i=1,ncand if(abs(candidatet(1,i)-nfqso).le.20.0) then
if(abs(candidatet(1,i)-nfqso).le.20.0) then candidate(1:2,n1)=candidatet(1:2,i)
candidate(1:2,n1)=candidatet(1:2,i) n1=n1+1
n1=n1+1 else
else candidate(1:2,n2)=candidatet(1:2,i)
candidate(1:2,n2)=candidatet(1:2,i) n2=n2+1
n2=n2+1 endif
endif enddo
enddo return
return end subroutine getcandidates4
end subroutine getcandidates4

View File

@ -1,96 +1,96 @@
subroutine sync4d(cd0,i0,ctwk,itwk,sync) subroutine sync4d(cd0,i0,ctwk,itwk,sync)
! Compute sync power for a complex, downsampled FT4 signal. ! Compute sync power for a complex, downsampled FT4 signal.
include 'ft4_params.f90' include 'ft4_params.f90'
parameter(NP=NMAX/NDOWN,NSS=NSPS/NDOWN) parameter(NP=NMAX/NDOWN,NSS=NSPS/NDOWN)
complex cd0(0:NP-1) complex cd0(0:NP-1)
complex csynca(2*NSS),csyncb(2*NSS),csyncc(2*NSS),csyncd(2*NSS) complex csynca(2*NSS),csyncb(2*NSS),csyncc(2*NSS),csyncd(2*NSS)
complex csync2(2*NSS) complex csync2(2*NSS)
complex ctwk(2*NSS) complex ctwk(2*NSS)
complex z1,z2,z3,z4 complex z1,z2,z3,z4
logical first logical first
integer icos4a(0:3),icos4b(0:3),icos4c(0:3),icos4d(0:3) integer icos4a(0:3),icos4b(0:3),icos4c(0:3),icos4d(0:3)
data icos4a/0,1,3,2/ data icos4a/0,1,3,2/
data icos4b/1,0,2,3/ data icos4b/1,0,2,3/
data icos4c/2,3,1,0/ data icos4c/2,3,1,0/
data icos4d/3,2,0,1/ data icos4d/3,2,0,1/
data first/.true./ data first/.true./
save first,twopi,csynca,csyncb,csyncc,csyncd,fac save first,twopi,csynca,csyncb,csyncc,csyncd,fac
p(z1)=(real(z1*fac)**2 + aimag(z1*fac)**2)**0.5 !Statement function for power p(z1)=(real(z1*fac)**2 + aimag(z1*fac)**2)**0.5 !Statement function for power
if( first ) then if( first ) then
twopi=8.0*atan(1.0) twopi=8.0*atan(1.0)
k=1 k=1
phia=0.0 phia=0.0
phib=0.0 phib=0.0
phic=0.0 phic=0.0
phid=0.0 phid=0.0
do i=0,3 do i=0,3
dphia=2*twopi*icos4a(i)/real(NSS) dphia=2*twopi*icos4a(i)/real(NSS)
dphib=2*twopi*icos4b(i)/real(NSS) dphib=2*twopi*icos4b(i)/real(NSS)
dphic=2*twopi*icos4c(i)/real(NSS) dphic=2*twopi*icos4c(i)/real(NSS)
dphid=2*twopi*icos4d(i)/real(NSS) dphid=2*twopi*icos4d(i)/real(NSS)
do j=1,NSS/2 do j=1,NSS/2
csynca(k)=cmplx(cos(phia),sin(phia)) csynca(k)=cmplx(cos(phia),sin(phia))
csyncb(k)=cmplx(cos(phib),sin(phib)) csyncb(k)=cmplx(cos(phib),sin(phib))
csyncc(k)=cmplx(cos(phic),sin(phic)) csyncc(k)=cmplx(cos(phic),sin(phic))
csyncd(k)=cmplx(cos(phid),sin(phid)) csyncd(k)=cmplx(cos(phid),sin(phid))
phia=mod(phia+dphia,twopi) phia=mod(phia+dphia,twopi)
phib=mod(phib+dphib,twopi) phib=mod(phib+dphib,twopi)
phic=mod(phic+dphic,twopi) phic=mod(phic+dphic,twopi)
phid=mod(phid+dphid,twopi) phid=mod(phid+dphid,twopi)
k=k+1 k=k+1
enddo enddo
enddo enddo
first=.false. first=.false.
fac=1.0/(2.0*NSS) fac=1.0/(2.0*NSS)
endif endif
i1=i0 !four Costas arrays i1=i0 !four Costas arrays
i2=i0+33*NSS i2=i0+33*NSS
i3=i0+66*NSS i3=i0+66*NSS
i4=i0+99*NSS i4=i0+99*NSS
z1=0. z1=0.
z2=0. z2=0.
z3=0. z3=0.
z4=0. z4=0.
if(itwk.eq.1) csync2=ctwk*csynca !Tweak the frequency if(itwk.eq.1) csync2=ctwk*csynca !Tweak the frequency
z1=0. z1=0.
if(i1.ge.0 .and. i1+4*NSS-1.le.NP-1) then if(i1.ge.0 .and. i1+4*NSS-1.le.NP-1) then
z1=sum(cd0(i1:i1+4*NSS-1:2)*conjg(csync2)) z1=sum(cd0(i1:i1+4*NSS-1:2)*conjg(csync2))
elseif( i1.lt.0 ) then elseif( i1.lt.0 ) then
npts=(i1+4*NSS-1)/2 npts=(i1+4*NSS-1)/2
if(npts.le.16) then if(npts.le.16) then
z1=0. z1=0.
else else
z1=sum(cd0(0:i1+4*NSS-1:2)*conjg(csync2(2*NSS-npts:))) z1=sum(cd0(0:i1+4*NSS-1:2)*conjg(csync2(2*NSS-npts:)))
endif endif
endif endif
if(itwk.eq.1) csync2=ctwk*csyncb !Tweak the frequency if(itwk.eq.1) csync2=ctwk*csyncb !Tweak the frequency
if(i2.ge.0 .and. i2+4*NSS-1.le.NP-1) z2=sum(cd0(i2:i2+4*NSS-1:2)*conjg(csync2)) if(i2.ge.0 .and. i2+4*NSS-1.le.NP-1) z2=sum(cd0(i2:i2+4*NSS-1:2)*conjg(csync2))
if(itwk.eq.1) csync2=ctwk*csyncc !Tweak the frequency if(itwk.eq.1) csync2=ctwk*csyncc !Tweak the frequency
if(i3.ge.0 .and. i3+4*NSS-1.le.NP-1) z3=sum(cd0(i3:i3+4*NSS-1:2)*conjg(csync2)) if(i3.ge.0 .and. i3+4*NSS-1.le.NP-1) z3=sum(cd0(i3:i3+4*NSS-1:2)*conjg(csync2))
if(itwk.eq.1) csync2=ctwk*csyncd !Tweak the frequency if(itwk.eq.1) csync2=ctwk*csyncd !Tweak the frequency
z4=0. z4=0.
if(i4.ge.0 .and. i4+4*NSS-1.le.NP-1) then if(i4.ge.0 .and. i4+4*NSS-1.le.NP-1) then
z4=sum(cd0(i4:i4+4*NSS-1:2)*conjg(csync2)) z4=sum(cd0(i4:i4+4*NSS-1:2)*conjg(csync2))
elseif( i4+4*NSS-1.gt.NP-1 ) then elseif( i4+4*NSS-1.gt.NP-1 ) then
npts=(NP-1-i4+1)/2 npts=(NP-1-i4+1)/2
if(npts.le.16) then if(npts.le.16) then
z4=0. z4=0.
else else
z4=sum(cd0(i4:i4+2*npts-1:2)*conjg(csync2(1:npts))) z4=sum(cd0(i4:i4+2*npts-1:2)*conjg(csync2(1:npts)))
endif endif
endif endif
sync = p(z1) + p(z2) + p(z3) + p(z4) sync = p(z1) + p(z2) + p(z3) + p(z4)
return return
end subroutine sync4d end subroutine sync4d

View File

@ -34,7 +34,6 @@ contains
character message*37,msgsent*37 character message*37,msgsent*37
character c77*77 character c77*77
character*37 decodes(100) character*37 decodes(100)
character*512 data_dir,fname
character*17 cdatetime0 character*17 cdatetime0
character*12 mycall,hiscall character*12 mycall,hiscall
character*12 mycall0,hiscall0 character*12 mycall0,hiscall0

View File

@ -1,82 +1,82 @@
program msk144code program msk144code
! Provides examples of message packing, bit and symbol ordering, ! Provides examples of message packing, bit and symbol ordering,
! LDPC encoding, and other necessary details of the MSK144 protocol. ! LDPC encoding, and other necessary details of the MSK144 protocol.
use packjt77 use packjt77
character*77 c77 character*77 c77
character msg*37,msgsent*37,decoded,bad*1,msgtype*18 character msg*37,msgsent*37,bad*1,msgtype*18
integer*4 i4tone(144) integer*4 i4tone(144)
include 'msk144_testmsg.f90' include 'msk144_testmsg.f90'
nargs=iargc() nargs=iargc()
if(nargs.ne.1) then if(nargs.ne.1) then
print*,'Usage: msk144code "message"' print*,'Usage: msk144code "message"'
print*,' msk144code -t' print*,' msk144code -t'
print*,' ' print*,' '
print*,'Examples:' print*,'Examples:'
print*,' msk144code "KA1ABC WB9XYZ EN37"' print*,' msk144code "KA1ABC WB9XYZ EN37"'
print*,' msk144code "<KA1ABC WB9XYZ> R-03"' print*,' msk144code "<KA1ABC WB9XYZ> R-03"'
print*,' msk144code "KA1ABC WB9XYZ R EN37"' print*,' msk144code "KA1ABC WB9XYZ R EN37"'
go to 999 go to 999
endif endif
call getarg(1,msg) call getarg(1,msg)
nmsg=1 nmsg=1
if(msg(1:2).eq."-t") then if(msg(1:2).eq."-t") then
nmsg=NTEST nmsg=NTEST
endif endif
write(*,1010) write(*,1010)
1010 format(4x,"Message",31x,"Decoded",29x,"Err i3.n3"/100("-")) 1010 format(4x,"Message",31x,"Decoded",29x,"Err i3.n3"/100("-"))
do imsg=1,nmsg do imsg=1,nmsg
if(nmsg.gt.1) msg=testmsg(imsg) if(nmsg.gt.1) msg=testmsg(imsg)
call fmtmsg(msg,iz) !To upper case, collapse multiple blanks call fmtmsg(msg,iz) !To upper case, collapse multiple blanks
call genmsk_128_90(msg,ichk,msgsent,i4tone,itype) call genmsk_128_90(msg,ichk,msgsent,i4tone,itype)
i3=-1 i3=-1
n3=-1 n3=-1
call pack77(msg,i3,n3,c77) call pack77(msg,i3,n3,c77)
msgtype="" msgtype=""
if(i3.eq.0) then if(i3.eq.0) then
if(n3.eq.0) msgtype="Free text" if(n3.eq.0) msgtype="Free text"
if(n3.eq.1) msgtype="DXpedition mode" if(n3.eq.1) msgtype="DXpedition mode"
if(n3.eq.2) msgtype="EU VHF Contest" if(n3.eq.2) msgtype="EU VHF Contest"
if(n3.eq.3) msgtype="ARRL Field Day" if(n3.eq.3) msgtype="ARRL Field Day"
if(n3.eq.4) msgtype="ARRL Field Day" if(n3.eq.4) msgtype="ARRL Field Day"
if(n3.eq.5) msgtype="Telemetry" if(n3.eq.5) msgtype="Telemetry"
if(n3.ge.6) msgtype="Undefined type" if(n3.ge.6) msgtype="Undefined type"
endif endif
if(i3.eq.1) msgtype="Standard msg" if(i3.eq.1) msgtype="Standard msg"
if(i3.eq.2) msgtype="EU VHF Contest" if(i3.eq.2) msgtype="EU VHF Contest"
if(i3.eq.3) msgtype="ARRL RTTY Roundup" if(i3.eq.3) msgtype="ARRL RTTY Roundup"
if(i3.eq.4) msgtype="Nonstandard calls" if(i3.eq.4) msgtype="Nonstandard calls"
if(i3.ge.5) msgtype="Undefined msg type" if(i3.ge.5) msgtype="Undefined msg type"
if(i3.ge.1) n3=-1 if(i3.ge.1) n3=-1
if(i4tone(41).lt.0) then if(i4tone(41).lt.0) then
msgtype="Sh msg" msgtype="Sh msg"
i3=-1 i3=-1
endif endif
bad=" " bad=" "
if(msg.ne.msgsent) bad="*" if(msg.ne.msgsent) bad="*"
if(i3.eq.0.and.n3.ge.0) then if(i3.eq.0.and.n3.ge.0) then
write(*,1020) imsg,msg,msgsent,bad,i3,n3,msgtype write(*,1020) imsg,msg,msgsent,bad,i3,n3,msgtype
1020 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',i1,1x,a18) 1020 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',i1,1x,a18)
elseif(i3.ge.1) then elseif(i3.ge.1) then
write(*,1022) imsg,msg,msgsent,bad,i3,msgtype write(*,1022) imsg,msg,msgsent,bad,i3,msgtype
1022 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',1x,1x,a18) 1022 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',1x,1x,a18)
elseif(i3.lt.0) then elseif(i3.lt.0) then
write(*,1024) imsg,msg,msgsent,bad,msgtype write(*,1024) imsg,msg,msgsent,bad,msgtype
1024 format(i2,'.',1x,a37,1x,a37,1x,a1,6x,a18) 1024 format(i2,'.',1x,a37,1x,a37,1x,a1,6x,a18)
endif endif
enddo enddo
if(nmsg.eq.1) then if(nmsg.eq.1) then
n=144 n=144
if(i4tone(41).lt.0) n=40 if(i4tone(41).lt.0) n=40
write(*,1030) i4tone(1:n) write(*,1030) i4tone(1:n)
1030 format(/'Channel symbols'/(72i1)) 1030 format(/'Channel symbols'/(72i1))
endif endif
999 end program msk144code 999 end program msk144code

View File

@ -5,10 +5,8 @@ program QRA64code
! protocol. ! protocol.
use packjt use packjt
character*22 msg,msg0,msg1,decoded,cok*3,msgtype*10,arg*12 character*22 msg,msg0,msg1,decoded,cok*3,msgtype*10
character*6 mycall integer dgen(12),sent(63)
logical ltext
integer dgen(12),sent(63),dec(12)
integer icos7(0:6) integer icos7(0:6)
data icos7/2,5,6,0,4,1,3/ !Defines a 7x7 Costas array data icos7/2,5,6,0,4,1,3/ !Defines a 7x7 Costas array

View File

@ -45,7 +45,7 @@ QList<DecodeHighlightingModel::HighlightInfo> const DecodeHighlightingModel::imp
, {Highlight::CallBand, false, {}, {{0x99, 0xff, 0xff}}} , {Highlight::CallBand, false, {}, {{0x99, 0xff, 0xff}}}
, {Highlight::LotW, false, {{0x99, 0x00, 0x00}}, {}} , {Highlight::LotW, false, {{0x99, 0x00, 0x00}}, {}}
, {Highlight::CQ, true, {}, {{0x66, 0xff, 0x66}}} , {Highlight::CQ, true, {}, {{0x66, 0xff, 0x66}}}
, {Highlight::Tx, true, {}, {{Qt::yellow}}} , {Highlight::Tx, true, {}, {Qt::yellow}}
}; };
bool operator == (DecodeHighlightingModel::HighlightInfo const& lhs, DecodeHighlightingModel::HighlightInfo const& rhs) bool operator == (DecodeHighlightingModel::HighlightInfo const& lhs, DecodeHighlightingModel::HighlightInfo const& rhs)

View File

@ -3298,7 +3298,7 @@ public:
void setSelectionDecorator(QCPSelectionDecorator *decorator); void setSelectionDecorator(QCPSelectionDecorator *decorator);
// introduced virtual methods: // introduced virtual methods:
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const = 0; virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE = 0;
virtual QCPPlottableInterface1D *interface1D() { return 0; } virtual QCPPlottableInterface1D *interface1D() { return 0; }
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const = 0; virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const = 0;
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const = 0; virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const = 0;
@ -3438,7 +3438,7 @@ public:
QCPAxis *keyAxis() const { return mKeyAxis.data(); } QCPAxis *keyAxis() const { return mKeyAxis.data(); }
QCPAxis *valueAxis() const { return mValueAxis.data(); } QCPAxis *valueAxis() const { return mValueAxis.data(); }
QCPAxisRect *axisRect() const; QCPAxisRect *axisRect() const;
virtual QPointF pixelPosition() const; virtual QPointF pixelPosition() const Q_DECL_OVERRIDE;
// setters: // setters:
void setType(PositionType type); void setType(PositionType type);
@ -5995,16 +5995,16 @@ public:
void addData(double errorMinus, double errorPlus); void addData(double errorMinus, double errorPlus);
// virtual methods of 1d plottable interface: // virtual methods of 1d plottable interface:
virtual int dataCount() const; virtual int dataCount() const Q_DECL_OVERRIDE;
virtual double dataMainKey(int index) const; virtual double dataMainKey(int index) const Q_DECL_OVERRIDE;
virtual double dataSortKey(int index) const; virtual double dataSortKey(int index) const Q_DECL_OVERRIDE;
virtual double dataMainValue(int index) const; virtual double dataMainValue(int index) const Q_DECL_OVERRIDE;
virtual QCPRange dataValueRange(int index) const; virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE;
virtual QPointF dataPixelPosition(int index) const; virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE;
virtual bool sortKeyIsMainKey() const; virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE;
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const; virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE;
virtual int findBegin(double sortKey, bool expandedRange=true) const; virtual int findBegin(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE;
virtual int findEnd(double sortKey, bool expandedRange=true) const; virtual int findEnd(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE;
// reimplemented virtual methods: // reimplemented virtual methods:
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE; virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE;

View File

@ -160,7 +160,6 @@ void EPlotter::DrawOverlay() //DrawOverlay()
// int w = m_WaterfallPixmap.width(); // int w = m_WaterfallPixmap.width();
int x,y; int x,y;
QRect rect;
QPainter painter(&m_OverlayPixmap); QPainter painter(&m_OverlayPixmap);
painter.initFrom(this); painter.initFrom(this);
QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient QLinearGradient gradient(0, 0, 0 ,m_h2); //fill background with gradient

View File

@ -42,11 +42,11 @@
#include "revision_utils.hpp" #include "revision_utils.hpp"
#include "qt_helpers.hpp" #include "qt_helpers.hpp"
#include "NetworkAccessManager.hpp" #include "Network/NetworkAccessManager.hpp"
#include "soundout.h" #include "soundout.h"
#include "soundin.h" #include "soundin.h"
#include "Modulator.hpp" #include "Modulator.hpp"
#include "Detector.hpp" #include "Detector/Detector.hpp"
#include "plotter.h" #include "plotter.h"
#include "echoplot.h" #include "echoplot.h"
#include "echograph.h" #include "echograph.h"
@ -61,10 +61,10 @@
#include "decodedtext.h" #include "decodedtext.h"
#include "Radio.hpp" #include "Radio.hpp"
#include "models/Bands.hpp" #include "models/Bands.hpp"
#include "TransceiverFactory.hpp" #include "Transceiver/TransceiverFactory.hpp"
#include "models/StationList.hpp" #include "models/StationList.hpp"
#include "validators/LiveFrequencyValidator.hpp" #include "validators/LiveFrequencyValidator.hpp"
#include "MessageClient.hpp" #include "Network/MessageClient.hpp"
#include "wsprnet.h" #include "wsprnet.h"
#include "signalmeter.h" #include "signalmeter.h"
#include "HelpTextWindow.hpp" #include "HelpTextWindow.hpp"
@ -73,7 +73,7 @@
#include "MultiSettings.hpp" #include "MultiSettings.hpp"
#include "validators/MaidenheadLocatorValidator.hpp" #include "validators/MaidenheadLocatorValidator.hpp"
#include "validators/CallsignValidator.hpp" #include "validators/CallsignValidator.hpp"
#include "EqualizationToolsDialog.hpp" #include "Transceiver/EqualizationToolsDialog.hpp"
#include "LotWUsers.hpp" #include "LotWUsers.hpp"
#include "logbook/AD1CCty.hpp" #include "logbook/AD1CCty.hpp"
#include "models/FoxLog.hpp" #include "models/FoxLog.hpp"

View File

@ -29,13 +29,13 @@
#include "models/FrequencyList.hpp" #include "models/FrequencyList.hpp"
#include "Configuration.hpp" #include "Configuration.hpp"
#include "WSPRBandHopping.hpp" #include "WSPRBandHopping.hpp"
#include "Transceiver.hpp" #include "Transceiver/Transceiver.hpp"
#include "DisplayManual.hpp" #include "DisplayManual.hpp"
#include "psk_reporter.h" #include "Network/psk_reporter.h"
#include "logbook/logbook.h" #include "logbook/logbook.h"
#include "astro.h" #include "astro.h"
#include "MessageBox.hpp" #include "MessageBox.hpp"
#include "NetworkAccessManager.hpp" #include "Network/NetworkAccessManager.hpp"
#define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync #define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync
#define NUM_JT65_SYMBOLS 126 //63 data + 63 sync #define NUM_JT65_SYMBOLS 126 //63 data + 63 sync

View File

@ -327,7 +327,6 @@ void CPlotter::DrawOverlay() //DrawOverlay()
float pixperdiv; float pixperdiv;
double df = m_binsPerPixel*m_fftBinWidth; double df = m_binsPerPixel*m_fftBinWidth;
QRect rect;
QPen penOrange(QColor(255,165,0),3); QPen penOrange(QColor(255,165,0),3);
QPen penGreen(Qt::green, 3); //Mark Tol range with green line QPen penGreen(Qt::green, 3); //Mark Tol range with green line
QPen penRed(Qt::red, 3); //Mark Tx freq with red QPen penRed(Qt::red, 3); //Mark Tx freq with red

View File

@ -29,8 +29,8 @@ public:
explicit CPlotter(QWidget *parent = 0); explicit CPlotter(QWidget *parent = 0);
~CPlotter(); ~CPlotter();
QSize minimumSizeHint() const; QSize minimumSizeHint() const Q_DECL_OVERRIDE;
QSize sizeHint() const; QSize sizeHint() const Q_DECL_OVERRIDE;
void draw(float swide[], bool bScroll, bool bRed); //Update the waterfall void draw(float swide[], bool bScroll, bool bRed); //Update the waterfall
void replot(); void replot();