Getting compilation of map65 working with CMake and Qt 5.15

This commit is contained in:
Bill Somerville 2021-04-09 17:47:49 +01:00
parent 96e8908866
commit 769e00ab88
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
15 changed files with 166 additions and 298 deletions

View File

@ -886,19 +886,6 @@ if (WIN32)
find_package (Qt5AxContainer REQUIRED)
endif (WIN32)
#
# sub-directories
#
if (EXISTS ${CMAKE_SOURCE_DIR}/samples AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/samples)
add_subdirectory (samples)
endif ()
if (WSJT_GENERATE_DOCS)
add_subdirectory (doc)
endif (WSJT_GENERATE_DOCS)
if (EXISTS ${CMAKE_SOURCE_DIR}/tests AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
add_subdirectory (tests)
endif ()
#
# Library building setup
#
@ -1064,6 +1051,19 @@ elseif (CMAKE_HOST_WIN32)
add_definitions (-DWIN32)
endif ()
#
# sub-directories
#
if (EXISTS ${CMAKE_SOURCE_DIR}/samples AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/samples)
add_subdirectory (samples)
endif ()
if (WSJT_GENERATE_DOCS)
add_subdirectory (doc)
endif (WSJT_GENERATE_DOCS)
if (EXISTS ${CMAKE_SOURCE_DIR}/tests AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
add_subdirectory (tests)
endif ()
# build a library of package functionality (without and optionally with OpenMP support)
add_library (wsjt_cxx STATIC ${wsjt_CSRCS} ${wsjt_CXXSRCS})
target_link_libraries (wsjt_cxx ${LIBM_LIBRARIES} Boost::log_setup ${LIBM_LIBRARIES})
@ -1380,6 +1380,9 @@ else (${OPENMP_FOUND} OR APPLE)
target_link_libraries (jt9 wsjt_fort wsjt_cxx fort_qt)
endif (${OPENMP_FOUND} OR APPLE)
# build map65
add_subdirectory (map65)
# build the main application
generate_version_info (wsjtx_VERSION_RESOURCES
NAME wsjtx

View File

@ -34,12 +34,8 @@ void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned fcr,unsigned pri
struct rs *rs;
int i, j, sr,root,iprim;
<<<<<<< HEAD:lib/init_rs.c
/* Check parameter ranges */
if(symsize < 0 || symsize > (int)(8*sizeof(DTYPE)))
=======
if(symsize > 8*sizeof(DTYPE))
>>>>>>> 280c8344cd80339491e9bad1dcc4ac9a1e5f684e:map65/libm65/init_rs.c
return NULL; /* Need version with ints rather than chars */
if(fcr >= (1<<symsize))

View File

@ -1,27 +1,4 @@
cmake_minimum_required (VERSION 2.8.9)
project (map65 C CXX Fortran)
set (MAP65_VERSION_MAJOR 1)
set (MAP65_VERSION_MINOR 3)
if (POLICY CMP0020)
cmake_policy (SET CMP0020 NEW) # link to Qt winmain on Windows
endif (POLICY CMP0020)
# make sure that the default is a RELEASE
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: None Debug Release."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
# C++ setup
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set (CXXSRCS
set (map65_CXXSRCS
about.cpp
astro.cpp
bandmap.cpp
@ -43,17 +20,15 @@ set (CXXSRCS
)
if (WIN32)
set (CXXSRCS ${CXXSRCS} killbyname.cpp)
set (map65_CXXSRCS ${map65_CXXSRCS} killbyname.cpp)
endif (WIN32)
set (CSRCS
set (map65_CSRCS
paInputDevice.c
pa_get_device_info.c
)
set_property (SOURCE ${CXXSRCS} ${CSRCS} APPEND PROPERTY COMPILE_FLAGS "-include map65_config.h")
set (UISRCS
set (map65_UISRCS
about.ui
astro.ui
bandmap.ui
@ -64,102 +39,17 @@ set (UISRCS
widegraph.ui
)
# sort out pre-requisites
# libfftw3 setup
find_path (fftw3f_INCLUDES fftw3.f)
find_library (fftw3f_LIBRARIES NAMES fftw3f fftw3f-3)
include_directories (${fftw3f_INCLUDES})
if (WIN32)
find_library (usb_RUNTIME NAMES usb0 PATH_SUFFIXES bin)
set (CMAKE_INSTALL_PREFIX C:/MAP65)
endif (WIN32)
# Qt5 setup
# Widgets finds its own dependencies.
find_package (Qt5Widgets REQUIRED)
find_package (Qt5Multimedia REQUIRED)
# Tell CMake to run moc when necessary
set (CMAKE_AUTOMOC ON)
# don't use Qt "keywords" signal, slot, emit in generated files to
# avoid compatability issue with other libraries
#ADD_DEFINITIONS (-DQT_NO_KEYWORDS)
# As moc files are generated in the binary dir, tell CMake to always
# look for includes there:
set (CMAKE_INCLUDE_CURRENT_DIR ON)
# project definitions
add_definitions (-DQT5)
if (CMAKE_HOST_UNIX)
add_definitions (-DUNIX)
elseif (CMAKE_HOST_WIN32)
add_definitions (-DWIN32)
endif ()
#set_property (DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT)
set_property (DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_WARNING_OUTPUT)
# build the subdirectories
add_subdirectory (libm65)
# UI generation
qt5_wrap_ui (GENUISRCS ${UISRCS})
add_executable (map65 ${CXXSRCS} ${CSRCS} ${GENUISRCS} map65.rc)
target_link_libraries (map65 m65impl ${fftw3f_LIBRARIES} ${CMAKE_CURRENT_SOURCE_DIR}/palir-02.dll ${CMAKE_CURRENT_SOURCE_DIR}/libusb0.dll ${CMAKE_CURRENT_SOURCE_DIR}/libwsock32.a)
if (WIN32)
target_link_libraries (map65)
# set_target_properties (map65 PROPERTIES LINK_FLAGS_RELEASE "${LINKER_FLAGS_RELEASE} ")
set_target_properties (map65 PROPERTIES LINK_FLAGS_RELEASE "${LINKER_FLAGS_RELEASE} -mwindows")
endif (WIN32)
qt5_use_modules (map65 Widgets Multimedia OpenGL)
qt5_wrap_ui (map65_GENUISRCS ${map65_UISRCS})
add_executable (map65 ${map65_CXXSRCS} ${map65_CSRCS} ${map65_GENUISRCS} map65.rc)
target_link_libraries (map65 m65impl ${FFTW3_LIBRARIES} Qt5::Widgets)
install (
TARGETS map65
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
# install (DIRECTORY Palettes DESTINATION bin PATTERN *.pal)
# install (DIRECTORY samples DESTINATION bin/save)
install (FILES
# CALL3.TXT
# prefixes.txt
DESTINATION bin
)
if (WIN32)
install (
FILES ${fftw3f_LIBRARIES} ${usb_RUNTIME}
DESTINATION bin COMPONENT Runtime
)
endif (WIN32)
# a custom target that is always built
ADD_CUSTOM_TARGET (revisiontag ALL)
# creates svnversion.h using cmake script
ADD_CUSTOM_COMMAND (TARGET revisiontag COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/getsvn.cmake)
# explicitly say that the executable depends on custom target
add_dependencies(map65 revisiontag)
# versioning
configure_file (
"${PROJECT_SOURCE_DIR}/map65_config.h.in"
"${PROJECT_BINARY_DIR}/map65_config.h"
)
include_directories ("${PROJECT_BINARY_DIR}")

View File

@ -38,7 +38,7 @@ void BandMap::setText(QString t)
s3="<span style=color:"+m_color3+";>";
ui->bmTextBrowser->clear();
QStringList lines = t.split( "\n", QString::SkipEmptyParts );
QStringList lines = t.split( "\n", Qt::SkipEmptyParts );
int nrows=(lines.length()+ncols-1)/ncols;
for(int i=0; i<nrows; i++) {

View File

@ -1,5 +1,6 @@
#include "devsetup.h"
#include "mainwindow.h"
#include <QTextStream>
#include <QDebug>
#include <portaudio.h>
@ -110,8 +111,10 @@ void DevSetup::initDlg()
ui.mult570TxSpinBox->setValue(m_mult570Tx);
ui.cal570SpinBox->setValue(m_cal570);
ui.sbTxOffset->setValue(m_TxOffset);
sscanf(m_colors.toLatin1(),"%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x",
&r,&g,&b,&r0,&g0,&b0,&r1,&g1,&b1,&r2,&g2,&b2,&r3,&g3,&b3);
QTextStream its {&m_colors, QIODevice::ReadOnly};
its.setIntegerBase (16);
its.setFieldWidth (2);
its >> r >> g >> b >> r0 >> g0 >> b0 >> r1 >> g1 >> b1 >> r2 >> g2 >> b2 >> r3 >> g3 >> b3;
updateColorLabels();
ui.sbBackgroundRed->setValue(r);
ui.sbBackgroundGreen->setValue(g);
@ -234,95 +237,122 @@ void DevSetup::updateColorLabels()
int b2=ui.sbBlue2->value();
int b3=ui.sbBlue3->value();
t.sprintf("QLabel{background-color: #%2.2x%2.2x%2.2x;"
"color: #%2.2x%2.2x%2.2x}",r,g,b,r0,g0,b0);
ui.lab0->setStyleSheet(t);
t.sprintf("QLabel{background-color: #%2.2x%2.2x%2.2x;"
"color: #%2.2x%2.2x%2.2x}",r,g,b,r1,g1,b1);
ui.lab1->setStyleSheet(t);
t.sprintf("QLabel{background-color: #%2.2x%2.2x%2.2x;"
"color: #%2.2x%2.2x%2.2x}",r,g,b,r2,g2,b2);
ui.lab2->setStyleSheet(t);
t.sprintf("QLabel{background-color: #%2.2x%2.2x%2.2x;"
"color: #%2.2x%2.2x%2.2x}",r,g,b,r3,g3,b3);
ui.lab3->setStyleSheet(t);
ui.lab0->setStyleSheet (
QString {"QLabel{background-color: #%1%2%3; color: #%4%5%6}"}
.arg (r, 2, 16, QLatin1Char {'0'})
.arg (g, 2, 16, QLatin1Char {'0'})
.arg (b, 2, 16, QLatin1Char {'0'})
.arg (r0, 2, 16, QLatin1Char {'0'})
.arg (g0, 2, 16, QLatin1Char {'0'})
.arg (b0, 2, 16, QLatin1Char {'0'})
);
ui.lab1->setStyleSheet(
QString {"QLabel{background-color: #%1%2%3; color: #%4%5%6}"}
.arg (r, 2, 16, QLatin1Char {'0'})
.arg (g, 2, 16, QLatin1Char {'0'})
.arg (b, 2, 16, QLatin1Char {'0'})
.arg (r1, 2, 16, QLatin1Char {'0'})
.arg (g1, 2, 16, QLatin1Char {'0'})
.arg (b1, 2, 16, QLatin1Char {'0'})
);
ui.lab2->setStyleSheet(
QString {"QLabel{background-color: #%1%2%3; color: #%4%5%6}"}
.arg (r, 2, 16, QLatin1Char {'0'})
.arg (g, 2, 16, QLatin1Char {'0'})
.arg (b, 2, 16, QLatin1Char {'0'})
.arg (r2, 2, 16, QLatin1Char {'0'})
.arg (g2, 2, 16, QLatin1Char {'0'})
.arg (b2, 2, 16, QLatin1Char {'0'})
);
ui.lab3->setStyleSheet(
QString {"QLabel{background-color: #%1%2%3; color: #%4%5%6}"}
.arg (r, 2, 16, QLatin1Char {'0'})
.arg (g, 2, 16, QLatin1Char {'0'})
.arg (b, 2, 16, QLatin1Char {'0'})
.arg (r3, 2, 16, QLatin1Char {'0'})
.arg (g3, 2, 16, QLatin1Char {'0'})
.arg (b3, 2, 16, QLatin1Char {'0'})
);
m_colors.sprintf("%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
"%2.2x%2.2x%2.2x",r,g,b,r0,g0,b0,r1,g1,b1,r2,g2,b2,r3,g3,b3);
QTextStream ots {&m_colors, QIODevice::WriteOnly};
ots.setIntegerBase (16);
ots.setFieldWidth (2);
ots.setPadChar ('0');
ots << r << g << b << r0 << g0 << b0 << r1 << g1 << b1 << r2 << g2 << b2 << r3 << g3 << b3;
}
void DevSetup::on_sbBackgroundRed_valueChanged(int r)
void DevSetup::on_sbBackgroundRed_valueChanged(int /*r*/)
{
updateColorLabels();
}
void DevSetup::on_sbBackgroundGreen_valueChanged(int g)
void DevSetup::on_sbBackgroundGreen_valueChanged(int /*g*/)
{
updateColorLabels();
}
void DevSetup::on_sbBackgroundBlue_valueChanged(int b)
void DevSetup::on_sbBackgroundBlue_valueChanged(int /*b*/)
{
updateColorLabels();
}
void DevSetup::on_sbRed0_valueChanged(int arg1)
void DevSetup::on_sbRed0_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbGreen0_valueChanged(int arg1)
void DevSetup::on_sbGreen0_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbBlue0_valueChanged(int arg1)
void DevSetup::on_sbBlue0_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbRed1_valueChanged(int arg1)
void DevSetup::on_sbRed1_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbGreen1_valueChanged(int arg1)
void DevSetup::on_sbGreen1_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbBlue1_valueChanged(int arg1)
void DevSetup::on_sbBlue1_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbRed2_valueChanged(int arg1)
void DevSetup::on_sbRed2_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbGreen2_valueChanged(int arg1)
void DevSetup::on_sbGreen2_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbBlue2_valueChanged(int arg1)
void DevSetup::on_sbBlue2_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbRed3_valueChanged(int arg1)
void DevSetup::on_sbRed3_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbGreen3_valueChanged(int arg1)
void DevSetup::on_sbGreen3_valueChanged(int /*arg1*/)
{
updateColorLabels();
}
void DevSetup::on_sbBlue3_valueChanged(int arg1)
void DevSetup::on_sbBlue3_valueChanged(int /*arg1*/)
{
updateColorLabels();
}

View File

@ -185,7 +185,7 @@ void paInputDevice(int id, char* hostAPI_DeviceName, int* minChan,
int pa_device_min_bytes;
int pa_device_max_channels;
int pa_device_min_channels;
char p2[50];
char p2[256];
char *p,*p1;
static int iret, valid_dev_cnt;

View File

@ -35,7 +35,7 @@ int killbyname(const char *szToTerminate)
HANDLE hProc,hSnapShot,hSnapShotm;
OSVERSIONINFO osvi;
HINSTANCE hInstLib;
int iLen,iLenP,indx;
int iLenP,indx;
HMODULE hMod;
PROCESSENTRY32 procentry;
MODULEENTRY32 modentry;
@ -83,12 +83,12 @@ int killbyname(const char *szToTerminate)
if(hInstLib == NULL) return 605;
// Get procedure addresses.
lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*))
lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*))(void (*)())
GetProcAddress( hInstLib, "EnumProcesses" ) ;
lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *,
DWORD, LPDWORD)) GetProcAddress( hInstLib, "EnumProcessModules" ) ;
DWORD, LPDWORD))(void (*)()) GetProcAddress( hInstLib, "EnumProcessModules" ) ;
lpfGetModuleBaseName =(DWORD (WINAPI *)(HANDLE, HMODULE, LPTSTR,
DWORD )) GetProcAddress( hInstLib, "GetModuleBaseNameA" ) ;
DWORD )) (void (*)())GetProcAddress( hInstLib, "GetModuleBaseNameA" ) ;
if(lpfEnumProcesses == NULL || lpfEnumProcessModules == NULL ||
lpfGetModuleBaseName == NULL) {
@ -116,7 +116,7 @@ int killbyname(const char *szToTerminate)
// Now, get the process name
if(hProc) {
if(lpfEnumProcessModules(hProc,&hMod,sizeof(hMod),&iCbneeded) ) {
iLen=lpfGetModuleBaseName(hProc,hMod,szName,MAX_PATH);
lpfGetModuleBaseName(hProc,hMod,szName,MAX_PATH);
}
}
CloseHandle(hProc);
@ -162,20 +162,20 @@ int killbyname(const char *szToTerminate)
// which does not have the Toolhelp32
// functions in the Kernel 32.
lpfCreateToolhelp32Snapshot=
(HANDLE(WINAPI *)(DWORD,DWORD))
(HANDLE(WINAPI *)(DWORD,DWORD))(void (*)())
GetProcAddress( hInstLib,
"CreateToolhelp32Snapshot" ) ;
lpfProcess32First=
(BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
(BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))(void (*)())
GetProcAddress( hInstLib, "Process32First" ) ;
lpfProcess32Next=
(BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
(BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))(void (*)())
GetProcAddress( hInstLib, "Process32Next" ) ;
lpfModule32First=
(BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32))
(BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32))(void (*)())
GetProcAddress( hInstLib, "Module32First" ) ;
lpfModule32Next=
(BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32))
(BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32))(void (*)())
GetProcAddress( hInstLib, "Module32Next" ) ;
if( lpfProcess32Next == NULL ||
lpfProcess32First == NULL ||

View File

@ -1,61 +1,4 @@
cmake_minimum_required (VERSION 2.8.8)
project (libm65 C CXX Fortran)
if (POLICY CMP0020)
cmake_policy (SET CMP0020 NEW) # link to Qt winmain on Windows
endif (POLICY CMP0020)
# make sure that the default is a RELEASE
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: None Debug Release."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
# Fortran setup
# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
# gfortran
# set (CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2 -fbounds-check")
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g")
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
# ifort (untested)
set (CMAKE_Fortran_FLAGS_RELEASE "-f77rtl -O3")
set (CMAKE_Fortran_FLAGS_DEBUG "-f77rtl -O0 -g")
elseif (Fortran_COMPILER_NAME MATCHES "g77")
# g77
set (CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -m32")
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -m32")
else (Fortran_COMPILER_NAME MATCHES "gfortran.*")
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("Fortran compiler: " ${Fortran_COMPILER_NAME})
message ("No optimized Fortran compiler flags are known, we just try -O2...")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g")
endif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
# C++ setup
if (UNIX)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif (UNIX)
# setup and test Fortran C/C++ interaction
include (FortranCInterface)
FortranCInterface_VERIFY (CXX QUIET)
FortranCInterface_HEADER (FC.h MACRO_NAMESPACE "FC_" SYMBOL_NAMESPACE "FC_"
SYMBOLS )
set (FSRCS
set (libm65_FSRCS
afc65b.f90
astro.f90
astro0.f90
@ -88,7 +31,8 @@ set (FSRCS
four2a.f90
ftninit.f90
ftnquit.f90
gen65.f90
q65b.f90
gen_q65_wave.f90
genqra64a.f90
geocentric.f90
getdphi.f90
@ -136,17 +80,23 @@ set (FSRCS
trimlist.f90
twkfreq.f90
twkfreq_xy.f90
wavhdr.f90
f77_wisdom.f
)
set (CSRCS
set (libm65_ka9q_CSRCS
decode_rs.c
encode_rs.c
init_rs.c
)
set_source_files_properties (${libm65_ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare)
set (libm65_CSRCS
${libm65_ka9q_CSRCS}
ftrsd2.c
gran.c
igray.c
init_rs.c
tmoonsub.c
usleep.c
wrapkarn.c
@ -161,11 +111,12 @@ set (CSRCS
)
if (WIN32)
set (CSRCS ${CSRCS} ptt.c)
else (set (CSRCS ${CSRCS} ptt_unix.c))
endif (WIN32)
set (libm65_CSRCS ${libm65_CSRCS} ptt.c)
else ()
set (libm65_CSRCS ${libm65_CSRCS} ptt_unix.c)
endif ()
set (CXXSRCS
set (libm65_CXXSRCS
ipcomm.cpp
)
@ -175,13 +126,11 @@ set_source_files_properties (sec_midn.f90 PROPERTIES COMPILE_FLAGS -fno-second-u
#
# build our targets
#
add_library (m65impl STATIC ${FSRCS} ${CSRCS} ${CXXSRCS})
qt5_use_modules (m65impl Core)
add_library (m65impl STATIC ${libm65_FSRCS} ${libm65_CSRCS} ${libm65_CXXSRCS})
target_link_libraries (m65impl Qt5::Core)
add_executable (m65 m65.f90 m65a.f90)
target_link_libraries (m65 m65impl ${fftw3f_LIBRARIES})
add_dependencies (m65 fftw3f)
qt5_use_modules (m65 Core)
target_link_libraries (m65 m65impl ${FFTW3_LIBRARIES})
install (
TARGETS m65

View File

@ -34,12 +34,8 @@ void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned fcr,unsigned pri
struct rs *rs;
int i, j, sr,root,iprim;
<<<<<<< HEAD:lib/init_rs.c
/* Check parameter ranges */
if(symsize < 0 || symsize > (int)(8*sizeof(DTYPE)))
=======
if(symsize > 8*sizeof(DTYPE))
>>>>>>> 280c8344cd80339491e9bad1dcc4ac9a1e5f684e:map65/libm65/init_rs.c
return NULL; /* Need version with ints rather than chars */
if(fcr >= (1<<symsize))

View File

@ -202,7 +202,7 @@ MainWindow::MainWindow(QWidget *parent) :
lockFile.open(QIODevice::ReadWrite);
QFile quitFile(m_appDir + "/.lock");
quitFile.remove();
proc_m65.start(QDir::toNativeSeparators(m_appDir + "/m65 -s"));
proc_m65.start(QDir::toNativeSeparators(m_appDir + "/m65"), {"-s", });
m_pbdecoding_style1="QPushButton{background-color: cyan; \
border-style: outset; border-width: 1px; border-radius: 5px; \
@ -564,9 +564,20 @@ void MainWindow::dataSink(int k)
&px, &py, s, &nkhz, &ihsym, &nzap, &slimit, lstrong);
QString t;
m_pctZap=nzap/178.3;
if(m_xpol) t.sprintf(" Rx noise: %5.1f %5.1f %5.1f %% ",px,py,m_pctZap);
if(!m_xpol) t.sprintf(" Rx noise: %5.1f %5.1f %% ",px,m_pctZap);
lab4->setText(t);
if(m_xpol) {
lab4->setText (
QString {" Rx noise: %1 %2 %3 %% "}
.arg (px, 5, 'f', 1)
.arg (py, 5, 'f', 1)
.arg (m_pctZap, 5, 'f', 1)
);
} else {
lab4->setText (
QString {" Rx noise: %1 %2 %% "}
.arg (px, 5, 'f', 1)
.arg (m_pctZap, 5, 'f', 1)
);
}
xSignalMeter->setValue(px); // Update the signal meters
ySignalMeter->setValue(py);
if(m_monitoring || m_diskData) {
@ -575,10 +586,18 @@ void MainWindow::dataSink(int k)
if(nadj == 10) {
if(m_xpol) {
t.sprintf("Amp: %6.4f %6.4f Phase: %6.4f %6.4f",
m_gainx,m_gainy,m_phasex,m_phasey);
ui->decodedTextBrowser->append (
QString {"Amp: %1 %2 Phase: %3 %4"}
.arg (m_gainx, 6, 'f', 4).arg (m_gainy, 6, 'f', 4)
.arg (m_phasex, 6, 'f', 4)
.arg (m_phasey, 6, 'f', 4)
);
} else {
t.sprintf("Amp: %6.4f Phase: %6.4f",m_gainx,m_phasex);
ui->decodedTextBrowser->append(
QString {"Amp: %1 Phase: %1"}
.arg (m_gainx, 6, 'f', 4)
.arg (m_phasex, 6, 'f', 4)
);
}
ui->decodedTextBrowser->append(t);
m_adjustIQ=0;
@ -798,6 +817,7 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
m_ntx=6;
ui->txrb6->setChecked(true);
}
break;
case Qt::Key_F6:
if(e->modifiers() & Qt::ShiftModifier) {
on_actionDecode_remaining_files_in_directory_triggered();
@ -824,8 +844,8 @@ void MainWindow::keyPressEvent( QKeyEvent *e ) //keyPressEvent
case Qt::Key_G:
if(e->modifiers() & Qt::AltModifier) {
genStdMsgs("");
break;
}
break;
case Qt::Key_L:
if(e->modifiers() & Qt::ControlModifier) {
lookup();
@ -1345,9 +1365,7 @@ void MainWindow::readFromStdout() //readFromStdout
if(t.indexOf("<QuickDecodeDone>") >= 0) {
m_nsum=t.mid(17,4).toInt();
m_nsave=t.mid(21,4).toInt();
QString t2;
t2.sprintf("Avg: %d",m_nsum);
lab7->setText(t2);
lab7->setText (QString {"Avg: %1"}.arg (m_nsum));
if(m_modeQ65>0) g_pWideGraph->setDecodeFinished();
}
if(t.indexOf("<DecodeFinished>") >= 0) {
@ -1502,7 +1520,7 @@ void MainWindow::guiUpdate()
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
QTextStream out(&f);
out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm")
<< " Tx message: " << QString::fromLatin1(msgsent) << endl;
<< " Tx message: " << QString::fromLatin1(msgsent) << Qt::endl;
f.close();
}
@ -1525,7 +1543,7 @@ void MainWindow::guiUpdate()
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
QTextStream out(&f);
out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm")
<< " Tx message: " << QString::fromLatin1(msgsent) << endl;
<< " Tx message: " << QString::fromLatin1(msgsent) << Qt::endl;
f.close();
}
@ -1867,7 +1885,7 @@ void MainWindow::on_addButton_clicked() //Add button
if(f1.size()==0) {
QTextStream out(&f1);
out << "ZZZZZZ" << endl;
out << "ZZZZZZ" << Qt::endl;
f1.close();
f1.open(QIODevice::ReadOnly | QIODevice::Text);
}
@ -2192,13 +2210,12 @@ void MainWindow::on_actionApply_IQ_Calibration_triggered()
void MainWindow::on_actionFUNcube_Dongle_triggered()
{
proc_qthid.start(QDir::toNativeSeparators(m_appDir + "/qthid"));
proc_qthid.start (QDir::toNativeSeparators(m_appDir + "/qthid"), QStringList {});
}
void MainWindow::on_actionEdit_wsjt_log_triggered()
{
QString cmnd=m_editorCommand + " " + m_appDir + "/wsjt.log";
proc_editor.start(QDir::toNativeSeparators(cmnd));
proc_editor.start (QDir::toNativeSeparators (m_editorCommand), {QDir::toNativeSeparators (m_appDir + "/wsjt.log"), });
}
void MainWindow::on_actionTx_Tune_triggered()

View File

@ -31,7 +31,7 @@ void Messages::setText(QString t, QString t2)
ui->messagesTextBrowser->setStyleSheet(s);
ui->messagesTextBrowser->clear();
QStringList lines = t.split( "\n", QString::SkipEmptyParts );
QStringList lines = t.split( "\n", Qt::SkipEmptyParts );
foreach( QString line, lines ) {
QString t1=line.mid(0,50);
int ncq=t1.indexOf(" CQ ");
@ -57,7 +57,7 @@ void Messages::setText(QString t, QString t2)
}
}
void Messages::selectCallsign2(bool ctrl)
void Messages::selectCallsign2(bool /*ctrl*/)
{
QString t = ui->messagesTextBrowser->toPlainText(); //Full contents
int i=ui->messagesTextBrowser->textCursor().position();

View File

@ -285,7 +285,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
QRect rect0;
QPainter painter0(&m_ScalePixmap);
painter0.initFrom(this);
painter0.begin (this);
//create Font to use for scales
QFont Font("Arial");
@ -365,7 +365,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
// Now make the zoomed scale, using m_ZoomScalePixmap and painter3
QRect rect1;
QPainter painter3(&m_ZoomScalePixmap);
painter3.initFrom(this);
painter3.begin (this);
painter3.setFont(Font);
painter3.setPen(Qt::black);

View File

@ -24,10 +24,10 @@ typedef struct //Parameters sent to or received from callback function
} paUserData;
//--------------------------------------------------------------- d2aCallback
extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer,
extern "C" int d2aCallback(const void * /*inputBuffer*/, void *outputBuffer,
unsigned long framesToProcess,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
const PaStreamCallbackTimeInfo* /*timeInfo*/,
PaStreamCallbackFlags /*statusFlags*/,
void *userData )
{
paUserData *udata=(paUserData*)userData;

View File

@ -37,44 +37,35 @@ void TxTune::reject()
void TxTune::on_pwrSlider_valueChanged(int n)
{
txPower=n;
QString t;
t.sprintf("%d %%",n);
ui->labPower->setText(t);
ui->labPower->setText (QString {"%1 %"}.arg (n));
}
void TxTune::on_ampSlider_valueChanged(int n)
{
m_iqAmp1=n;
iqAmp=10*m_iqAmp1 + m_iqAmp2;
QString t;
t.sprintf("%.4f",1.0 + 0.0001*iqAmp);
ui->labAmpReal->setText(t);
ui->labAmpReal->setText (QString::number (1.0 + 0.0001 * iqAmp, 'f', 4));
}
void TxTune::on_fineAmpSlider_valueChanged(int n)
{
m_iqAmp2=n;
iqAmp=10*m_iqAmp1 + m_iqAmp2;
QString t;
t.sprintf("%.4f",1.0 + 0.0001*iqAmp);
ui->labAmpReal->setText(t);}
ui->labAmpReal->setText (QString::number (1.0 + 0.0001*iqAmp, 'f', 4));
}
void TxTune::on_phaSlider_valueChanged(int n)
{
m_iqPha1=n;
iqPhase=10*m_iqPha1 + m_iqPha2;
QString t;
t.sprintf("%.2f",0.01*iqPhase);
ui->labPhaReal->setText(t);
ui->labPhaReal->setText (QString::number (0.01*iqPhase, 'f', 2));
}
void TxTune::on_finePhaSlider_valueChanged(int n)
{
m_iqPha2=n;
iqPhase=10*m_iqPha1 + m_iqPha2;
QString t;
t.sprintf("%.2f",0.01*iqPhase);
ui->labPhaReal->setText(t);
ui->labPhaReal->setText (QString::number (0.01*iqPhase, 'f', 2));
}
void TxTune::set_iqAmp(int n)

View File

@ -1,4 +1,5 @@
#include "widegraph.h"
#include <math.h>
#include "ui_widegraph.h"
#define NFFT 32768
@ -380,14 +381,9 @@ void WideGraph::tx570()
void WideGraph::updateFreqLabel()
{
double rxFreq=ui->widePlot->rxFreq();
double txFreq=ui->widePlot->txFreq();
QString t;
t.sprintf("Rx: %10.6f",rxFreq);
QString t1=t.mid(0,12) + "." + t.mid(12,3);
t.sprintf("Tx: %10.6f",txFreq);
QString t2=t.mid(0,12) + "." + t.mid(12,3);
ui->labFreq->setText(t1 + "\n" + t2);
double rxFreq = floor (ui->widePlot->rxFreq () * 1e3) * 1e3;
double txFreq = floor (ui->widePlot->txFreq() * 1e3) * 1e3;
ui->labFreq->setText (QString {"Rx: %1\n%2"}.arg (rxFreq, 7, 'f', 3).arg (txFreq, 7, 'f', 3));
}
void WideGraph::enableSetRxHardware(bool b)