| 
									
										
										
										
											2022-12-04 10:17:02 -05:00
										 |  |  | #include <fftw3.h>
 | 
					
						
							|  |  |  | #ifdef QT5
 | 
					
						
							|  |  |  | #include <QtWidgets>
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #include <QtGui>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #include <QApplication>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "revision_utils.hpp"
 | 
					
						
							|  |  |  | #include "mainwindow.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  |   // Fortran procedures we need
 | 
					
						
							|  |  |  |   void four2a_ (_Complex float *, int * nfft, int * ndim, int * isign, int * iform, int len); | 
					
						
							| 
									
										
										
										
											2022-12-09 19:08:35 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |   void _gfortran_set_args(int argc, char *argv[]); | 
					
						
							|  |  |  |   void _gfortran_set_convert(int conv); | 
					
						
							|  |  |  |   void ftninit_(void); | 
					
						
							| 
									
										
										
										
											2024-01-15 13:10:41 -05:00
										 |  |  |   void fftbig_(float dd[], int* nfft); | 
					
						
							| 
									
										
										
										
											2022-12-04 10:17:02 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int main(int argc, char *argv[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   QApplication a {argc, argv}; | 
					
						
							| 
									
										
										
										
											2022-12-09 19:08:35 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Initialize libgfortran:
 | 
					
						
							|  |  |  |   _gfortran_set_args(argc, argv); | 
					
						
							|  |  |  |   _gfortran_set_convert(0); | 
					
						
							|  |  |  |   ftninit_(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-04 10:17:02 -05:00
										 |  |  |   // Override programs executable basename as application name.
 | 
					
						
							| 
									
										
										
										
											2023-01-24 15:44:53 -05:00
										 |  |  |   a.setApplicationName ("QMAP"); | 
					
						
							| 
									
										
										
										
											2024-01-04 10:05:46 -05:00
										 |  |  |   a.setApplicationVersion ("0.4"); | 
					
						
							| 
									
										
										
										
											2022-12-04 10:17:02 -05:00
										 |  |  |   // switch off as we share an Info.plist file with WSJT-X
 | 
					
						
							|  |  |  |   a.setAttribute (Qt::AA_DontUseNativeMenuBar); | 
					
						
							|  |  |  |   MainWindow w; | 
					
						
							|  |  |  |   w.show (); | 
					
						
							|  |  |  |   QObject::connect (&a, &QApplication::lastWindowClosed, &a, &QApplication::quit); | 
					
						
							|  |  |  |   auto result = a.exec (); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // clean up lazily initialized FFTW3 resources
 | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     int nfft {-1}; | 
					
						
							|  |  |  |     int ndim {1}; | 
					
						
							|  |  |  |     int isign {1}; | 
					
						
							|  |  |  |     int iform {1}; | 
					
						
							|  |  |  |     // free FFT plan resources
 | 
					
						
							|  |  |  |     four2a_ (nullptr, &nfft, &ndim, &isign, &iform, 0); | 
					
						
							| 
									
										
										
										
											2024-01-15 13:10:41 -05:00
										 |  |  |     fftbig_(nullptr, &nfft); | 
					
						
							| 
									
										
										
										
											2022-12-04 10:17:02 -05:00
										 |  |  |   } | 
					
						
							|  |  |  |   fftwf_forget_wisdom (); | 
					
						
							|  |  |  |   fftwf_cleanup (); | 
					
						
							|  |  |  |   return result; | 
					
						
							|  |  |  | } |