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) find_package (Qt5AxContainer REQUIRED)
endif (WIN32) 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 # Library building setup
# #
@ -1064,6 +1051,19 @@ elseif (CMAKE_HOST_WIN32)
add_definitions (-DWIN32) add_definitions (-DWIN32)
endif () 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) # build a library of package functionality (without and optionally with OpenMP support)
add_library (wsjt_cxx STATIC ${wsjt_CSRCS} ${wsjt_CXXSRCS}) add_library (wsjt_cxx STATIC ${wsjt_CSRCS} ${wsjt_CXXSRCS})
target_link_libraries (wsjt_cxx ${LIBM_LIBRARIES} Boost::log_setup ${LIBM_LIBRARIES}) 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) target_link_libraries (jt9 wsjt_fort wsjt_cxx fort_qt)
endif (${OPENMP_FOUND} OR APPLE) endif (${OPENMP_FOUND} OR APPLE)
# build map65
add_subdirectory (map65)
# build the main application # build the main application
generate_version_info (wsjtx_VERSION_RESOURCES generate_version_info (wsjtx_VERSION_RESOURCES
NAME wsjtx NAME wsjtx

View File

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

View File

@ -1,27 +1,4 @@
cmake_minimum_required (VERSION 2.8.9) set (map65_CXXSRCS
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
about.cpp about.cpp
astro.cpp astro.cpp
bandmap.cpp bandmap.cpp
@ -43,17 +20,15 @@ set (CXXSRCS
) )
if (WIN32) if (WIN32)
set (CXXSRCS ${CXXSRCS} killbyname.cpp) set (map65_CXXSRCS ${map65_CXXSRCS} killbyname.cpp)
endif (WIN32) endif (WIN32)
set (CSRCS set (map65_CSRCS
paInputDevice.c paInputDevice.c
pa_get_device_info.c pa_get_device_info.c
) )
set_property (SOURCE ${CXXSRCS} ${CSRCS} APPEND PROPERTY COMPILE_FLAGS "-include map65_config.h") set (map65_UISRCS
set (UISRCS
about.ui about.ui
astro.ui astro.ui
bandmap.ui bandmap.ui
@ -64,102 +39,17 @@ set (UISRCS
widegraph.ui 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 # build the subdirectories
add_subdirectory (libm65) add_subdirectory (libm65)
# UI generation # UI generation
qt5_wrap_ui (GENUISRCS ${UISRCS}) qt5_wrap_ui (map65_GENUISRCS ${map65_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)
add_executable (map65 ${map65_CXXSRCS} ${map65_CSRCS} ${map65_GENUISRCS} map65.rc)
target_link_libraries (map65 m65impl ${FFTW3_LIBRARIES} Qt5::Widgets)
install ( install (
TARGETS map65 TARGETS map65
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib 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+";>"; s3="<span style=color:"+m_color3+";>";
ui->bmTextBrowser->clear(); ui->bmTextBrowser->clear();
QStringList lines = t.split( "\n", QString::SkipEmptyParts ); QStringList lines = t.split( "\n", Qt::SkipEmptyParts );
int nrows=(lines.length()+ncols-1)/ncols; int nrows=(lines.length()+ncols-1)/ncols;
for(int i=0; i<nrows; i++) { for(int i=0; i<nrows; i++) {

View File

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

View File

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

View File

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

View File

@ -1,61 +1,4 @@
cmake_minimum_required (VERSION 2.8.8) set (libm65_FSRCS
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
afc65b.f90 afc65b.f90
astro.f90 astro.f90
astro0.f90 astro0.f90
@ -88,7 +31,8 @@ set (FSRCS
four2a.f90 four2a.f90
ftninit.f90 ftninit.f90
ftnquit.f90 ftnquit.f90
gen65.f90 q65b.f90
gen_q65_wave.f90
genqra64a.f90 genqra64a.f90
geocentric.f90 geocentric.f90
getdphi.f90 getdphi.f90
@ -136,17 +80,23 @@ set (FSRCS
trimlist.f90 trimlist.f90
twkfreq.f90 twkfreq.f90
twkfreq_xy.f90 twkfreq_xy.f90
wavhdr.f90
f77_wisdom.f f77_wisdom.f
) )
set (CSRCS set (libm65_ka9q_CSRCS
decode_rs.c decode_rs.c
encode_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 ftrsd2.c
gran.c gran.c
igray.c igray.c
init_rs.c
tmoonsub.c tmoonsub.c
usleep.c usleep.c
wrapkarn.c wrapkarn.c
@ -161,11 +111,12 @@ set (CSRCS
) )
if (WIN32) if (WIN32)
set (CSRCS ${CSRCS} ptt.c) set (libm65_CSRCS ${libm65_CSRCS} ptt.c)
else (set (CSRCS ${CSRCS} ptt_unix.c)) else ()
endif (WIN32) set (libm65_CSRCS ${libm65_CSRCS} ptt_unix.c)
endif ()
set (CXXSRCS set (libm65_CXXSRCS
ipcomm.cpp ipcomm.cpp
) )
@ -175,13 +126,11 @@ set_source_files_properties (sec_midn.f90 PROPERTIES COMPILE_FLAGS -fno-second-u
# #
# build our targets # build our targets
# #
add_library (m65impl STATIC ${FSRCS} ${CSRCS} ${CXXSRCS}) add_library (m65impl STATIC ${libm65_FSRCS} ${libm65_CSRCS} ${libm65_CXXSRCS})
qt5_use_modules (m65impl Core) target_link_libraries (m65impl Qt5::Core)
add_executable (m65 m65.f90 m65a.f90) add_executable (m65 m65.f90 m65a.f90)
target_link_libraries (m65 m65impl ${fftw3f_LIBRARIES}) target_link_libraries (m65 m65impl ${FFTW3_LIBRARIES})
add_dependencies (m65 fftw3f)
qt5_use_modules (m65 Core)
install ( install (
TARGETS m65 TARGETS m65

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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