mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-31 13:10:19 -04:00 
			
		
		
		
	JTMS3 now compiles and runs, although most of its functions are still
those of MAP65. Have removed the Astro, BandMap, and Messages windows. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2475 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									c803e38a26
								
							
						
					
					
						commit
						acd3499fad
					
				
							
								
								
									
										103
									
								
								astro.cpp
									
									
									
									
									
								
							
							
						
						
									
										103
									
								
								astro.cpp
									
									
									
									
									
								
							| @ -1,103 +0,0 @@ | ||||
| #include "astro.h" | ||||
| #include "ui_astro.h" | ||||
| #include <QDebug> | ||||
| #include <QFile> | ||||
| #include <QMessageBox> | ||||
| #include <stdio.h> | ||||
| #include "commons.h" | ||||
| 
 | ||||
| Astro::Astro(QWidget *parent) : | ||||
|   QWidget(parent), | ||||
|   ui(new Ui::Astro) | ||||
| { | ||||
|   ui->setupUi(this); | ||||
|   ui->astroTextBrowser->setStyleSheet( | ||||
|         "QTextBrowser { background-color : cyan; color : black; }"); | ||||
|   ui->astroTextBrowser->clear(); | ||||
| } | ||||
| 
 | ||||
| Astro::~Astro() | ||||
| { | ||||
|     delete ui; | ||||
| } | ||||
| 
 | ||||
| void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid, | ||||
|                         int fQSO, int nsetftx, int ntxFreq, QString azelDir) | ||||
| { | ||||
|   static int ntxFreq0=-99; | ||||
|   static bool astroBusy=false; | ||||
|   char cc[300]; | ||||
|   double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx; | ||||
|   double ramoon,decmoon,dgrd,poloffset,xnr; | ||||
|   int ntsky,ndop,ndop00; | ||||
|   QString date = t.date().toString("yyyy MMM dd"); | ||||
|   QString utc = t.time().toString(); | ||||
|   int nyear=t.date().year(); | ||||
|   int month=t.date().month(); | ||||
|   int nday=t.date().day(); | ||||
|   int nhr=t.time().hour(); | ||||
|   int nmin=t.time().minute(); | ||||
|   double sec=t.time().second() + 0.001*t.time().msec(); | ||||
|   int isec=sec; | ||||
|   double uth=nhr + nmin/60.0 + sec/3600.0; | ||||
|   int nfreq=(int)datcom_.fcenter; | ||||
|   if(nfreq<10 or nfreq > 50000) nfreq=144; | ||||
| 
 | ||||
|   if(!astroBusy) { | ||||
|     astroBusy=true; | ||||
|     astrosub_(&nyear, &month, &nday, &uth, &nfreq, mygrid.toAscii(), | ||||
|             hisgrid.toAscii(), &azsun, &elsun, &azmoon, &elmoon, | ||||
|             &azmoondx, &elmoondx, &ntsky, &ndop, &ndop00,&ramoon, &decmoon, | ||||
|             &dgrd, &poloffset, &xnr, 6, 6); | ||||
|     astroBusy=false; | ||||
|   } | ||||
| 
 | ||||
|   sprintf(cc, | ||||
|           "Az:    %6.1f\n" | ||||
|           "El:    %6.1f\n" | ||||
|           "MyDop: %6d\n" | ||||
|           "DxAz:  %6.1f\n" | ||||
|           "DxEl:  %6.1f\n" | ||||
|           "DxDop: %6d\n" | ||||
|           "Dec:   %6.1f\n" | ||||
|           "SunAz: %6.1f\n" | ||||
|           "SunEl: %6.1f\n" | ||||
|           "Tsky:  %6d\n" | ||||
|           "MNR:   %6.1f\n" | ||||
|           "Dgrd:  %6.1f", | ||||
|           azmoon,elmoon,ndop00,azmoondx,elmoondx,ndop,decmoon,azsun,elsun, | ||||
|           ntsky,xnr,dgrd); | ||||
|   ui->astroTextBrowser->setText(" "+ date + "\nUTC: " + utc + "\n" + cc); | ||||
| 
 | ||||
|   QString fname=azelDir+"/azel.dat"; | ||||
|   QFile f(fname); | ||||
|   if(!f.open(QIODevice::WriteOnly | QIODevice::Text)) { | ||||
|     QMessageBox mb; | ||||
|     mb.setText("Cannot open " + fname); | ||||
|     mb.exec(); | ||||
|     return; | ||||
|   } | ||||
|   int ndiff=0; | ||||
|   if(ntxFreq != ntxFreq0) ndiff=1; | ||||
|   ntxFreq0=ntxFreq; | ||||
|   QTextStream out(&f); | ||||
|   sprintf(cc,"%2.2d:%2.2d:%2.2d,%5.1f,%5.1f,Moon\n" | ||||
|           "%2.2d:%2.2d:%2.2d,%5.1f,%5.1f,Sun\n" | ||||
|           "%2.2d:%2.2d:%2.2d,%5.1f,%5.1f,Source\n" | ||||
|           "%4d,%6d,Doppler\n" | ||||
|           "%3d,%1d,fQSO\n" | ||||
|           "%3d,%1d,fQSO2\n", | ||||
|           nhr,nmin,isec,azmoon,elmoon, | ||||
|           nhr,nmin,isec,azsun,elsun, | ||||
|           nhr,nmin,isec,0.0,0.0, | ||||
|           nfreq,ndop, | ||||
|           fQSO,nsetftx, | ||||
|           ntxFreq,ndiff); | ||||
|   out << cc; | ||||
|   f.close(); | ||||
| } | ||||
| 
 | ||||
| void Astro::setFontSize(int n) | ||||
| { | ||||
|   ui->astroTextBrowser->setFontPointSize(n); | ||||
| } | ||||
							
								
								
									
										35
									
								
								astro.h
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								astro.h
									
									
									
									
									
								
							| @ -1,35 +0,0 @@ | ||||
| #ifndef ASTRO_H | ||||
| #define ASTRO_H | ||||
| 
 | ||||
| #include <QWidget> | ||||
| #include <QDateTime> | ||||
| 
 | ||||
| namespace Ui { | ||||
|   class Astro; | ||||
| } | ||||
| 
 | ||||
| class Astro : public QWidget | ||||
| { | ||||
|   Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|   explicit Astro(QWidget *parent = 0); | ||||
|   void astroUpdate(QDateTime t, QString mygrid, QString hisgrid, | ||||
|                    int fQSO, int nsetftx, int ntxFreq, QString azelDir); | ||||
|   void setFontSize(int n); | ||||
|   ~Astro(); | ||||
| 
 | ||||
| private: | ||||
|     Ui::Astro *ui; | ||||
| }; | ||||
| 
 | ||||
| extern "C" { | ||||
|   void astrosub_(int* nyear, int* month, int* nday, double* uth, int* nfreq, | ||||
|      const char* mygrid, const char* hisgrid, double* azsun, | ||||
|      double* elsun, double* azmoon, double* elmoon, double* azmoondx, | ||||
|      double* elmoondx, int* ntsky, int* ndop, int* ndop00, | ||||
|      double* ramoon, double* decmoon, double* dgrd, double* poloffset, | ||||
|      double* xnr, int len1, int len2); | ||||
| } | ||||
| 
 | ||||
| #endif // ASTRO_H
 | ||||
							
								
								
									
										37
									
								
								astro.ui
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								astro.ui
									
									
									
									
									
								
							| @ -1,37 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>Astro</class> | ||||
|  <widget class="QWidget" name="Astro"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>262</width> | ||||
|     <height>427</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Form</string> | ||||
|   </property> | ||||
|   <widget class="QTextBrowser" name="astroTextBrowser"> | ||||
|    <property name="geometry"> | ||||
|     <rect> | ||||
|      <x>0</x> | ||||
|      <y>10</y> | ||||
|      <width>256</width> | ||||
|      <height>411</height> | ||||
|     </rect> | ||||
|    </property> | ||||
|    <property name="font"> | ||||
|     <font> | ||||
|      <family>Courier New</family> | ||||
|      <pointsize>20</pointsize> | ||||
|      <weight>75</weight> | ||||
|      <bold>true</bold> | ||||
|     </font> | ||||
|    </property> | ||||
|   </widget> | ||||
|  </widget> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
| </ui> | ||||
							
								
								
									
										89
									
								
								bandmap.cpp
									
									
									
									
									
								
							
							
						
						
									
										89
									
								
								bandmap.cpp
									
									
									
									
									
								
							| @ -1,89 +0,0 @@ | ||||
| #include "bandmap.h" | ||||
| #include "ui_bandmap.h" | ||||
| #include <QDebug> | ||||
| 
 | ||||
| BandMap::BandMap(QWidget *parent) : | ||||
|   QWidget(parent), | ||||
|   ui(new Ui::BandMap) | ||||
| { | ||||
|   ui->setupUi(this); | ||||
|   ui->bmTextBrowser->setStyleSheet( | ||||
|         "QTextBrowser { background-color : #000066; color : red; }"); | ||||
|   m_bandMapText=""; | ||||
|   ui->bmTextBrowser->clear(); | ||||
| } | ||||
| 
 | ||||
| BandMap::~BandMap() | ||||
| { | ||||
|   delete ui; | ||||
| } | ||||
| 
 | ||||
| void BandMap::setText(QString t) | ||||
| { | ||||
|   m_bandMapText=t; | ||||
|   int w=ui->bmTextBrowser->size().width(); | ||||
|   int ncols=1; | ||||
|   if(w>220) ncols=2; | ||||
|   QString s="QTextBrowser{background-color: "+m_colorBackground+"}"; | ||||
|   ui->bmTextBrowser->setStyleSheet(s); | ||||
|   QString t0="<html style=\" font-family:'Courier New';" | ||||
|       "font-size:9pt; background-color:#000066\">" | ||||
|       "<table border=0 cellspacing=7><tr><td>\n"; | ||||
|   QString tfreq,tspace,tcall; | ||||
|   QString s0,s1,s2,s3,bg; | ||||
|   bg="<span style=color:"+m_colorBackground+";>.</span>"; | ||||
|   s0="<span style=color:"+m_color0+";>"; | ||||
|   s1="<span style=color:"+m_color1+";>"; | ||||
|   s2="<span style=color:"+m_color2+";>"; | ||||
|   s3="<span style=color:"+m_color3+";>"; | ||||
| 
 | ||||
|   ui->bmTextBrowser->clear(); | ||||
|   QStringList lines = t.split( "\n", QString::SkipEmptyParts ); | ||||
|   int nrows=(lines.length()+ncols-1)/ncols; | ||||
| 
 | ||||
|   for(int i=0; i<nrows; i++) { | ||||
|     tfreq=lines[i].mid(0,3); | ||||
|     tspace=lines[i].mid(4,1); | ||||
|     if(tspace==" ") tspace=bg; | ||||
|     tcall=lines[i].mid(5,7); | ||||
|     int n=lines[i].mid(13,1).toInt(); | ||||
|     if(n==0) t0 += s0; | ||||
|     if(n==1) t0 += s1; | ||||
|     if(n==2) t0 += s2; | ||||
|     if(n>=3) t0 += s3; | ||||
|     t0 += (tfreq + tspace + tcall + "</span><br>\n"); | ||||
|   } | ||||
| 
 | ||||
|   if(ncols==2) {                                  //2-column display
 | ||||
|     t0 += "<td><br><td>\n"; | ||||
|     for(int i=nrows; i<lines.length(); i++) { | ||||
|       tfreq=lines[i].mid(0,3); | ||||
|       tspace=lines[i].mid(4,1); | ||||
|       if(tspace=="  ") tspace=bg; | ||||
|       tcall=lines[i].mid(5,7); | ||||
|       int n=lines[i].mid(13,1).toInt(); | ||||
|       if(n==0) t0 += s0; | ||||
|       if(n==1) t0 += s1; | ||||
|       if(n==2) t0 += s2; | ||||
|       if(n>=3) t0 += s3; | ||||
|       t0 += (tfreq + tspace + tcall + "</span><br>\n"); | ||||
|     } | ||||
|     if(2*nrows>lines.length()) t0 += (s0 + "</span><br>\n"); | ||||
|   } | ||||
|   ui->bmTextBrowser->setHtml(t0); | ||||
| } | ||||
| 
 | ||||
| void BandMap::resizeEvent(QResizeEvent* ) | ||||
| { | ||||
|   setText(m_bandMapText); | ||||
| } | ||||
| 
 | ||||
| void BandMap::setColors(QString t) | ||||
| { | ||||
|   m_colorBackground = "#"+t.mid(0,6); | ||||
|   m_color0 = "#"+t.mid(6,6); | ||||
|   m_color1 = "#"+t.mid(12,6); | ||||
|   m_color2 = "#"+t.mid(18,6); | ||||
|   m_color3 = "#"+t.mid(24,6); | ||||
|   setText(m_bandMapText); | ||||
| } | ||||
							
								
								
									
										34
									
								
								bandmap.h
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								bandmap.h
									
									
									
									
									
								
							| @ -1,34 +0,0 @@ | ||||
| #ifndef BANDMAP_H | ||||
| #define BANDMAP_H | ||||
| 
 | ||||
| #include <QWidget> | ||||
| 
 | ||||
| namespace Ui { | ||||
|     class BandMap; | ||||
| } | ||||
| 
 | ||||
| class BandMap : public QWidget | ||||
| { | ||||
|     Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|   explicit BandMap(QWidget *parent = 0); | ||||
|   void setText(QString t); | ||||
|   void setColors(QString t); | ||||
| 
 | ||||
|   ~BandMap(); | ||||
| 
 | ||||
| protected: | ||||
|   void resizeEvent(QResizeEvent* event); | ||||
| 
 | ||||
| private: | ||||
|     Ui::BandMap *ui; | ||||
|     QString m_bandMapText; | ||||
|     QString m_colorBackground; | ||||
|     QString m_color0; | ||||
|     QString m_color1; | ||||
|     QString m_color2; | ||||
|     QString m_color3; | ||||
| }; | ||||
| 
 | ||||
| #endif // BANDMAP_H
 | ||||
							
								
								
									
										43
									
								
								bandmap.ui
									
									
									
									
									
								
							
							
						
						
									
										43
									
								
								bandmap.ui
									
									
									
									
									
								
							| @ -1,43 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>BandMap</class> | ||||
|  <widget class="QWidget" name="BandMap"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>329</width> | ||||
|     <height>379</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="minimumSize"> | ||||
|    <size> | ||||
|     <width>0</width> | ||||
|     <height>0</height> | ||||
|    </size> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Form</string> | ||||
|   </property> | ||||
|   <layout class="QGridLayout" name="gridLayout"> | ||||
|    <item row="0" column="0"> | ||||
|     <widget class="QTextBrowser" name="bmTextBrowser"> | ||||
|      <property name="minimumSize"> | ||||
|       <size> | ||||
|        <width>107</width> | ||||
|        <height>0</height> | ||||
|       </size> | ||||
|      </property> | ||||
|      <property name="font"> | ||||
|       <font> | ||||
|        <family>Courier New</family> | ||||
|        <pointsize>9</pointsize> | ||||
|       </font> | ||||
|      </property> | ||||
|     </widget> | ||||
|    </item> | ||||
|   </layout> | ||||
|  </widget> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
| </ui> | ||||
| @ -8,13 +8,13 @@ QT       += core gui network | ||||
| CONFIG   += qwt thread | ||||
| #CONFIG   += console | ||||
| 
 | ||||
| TARGET = map65 | ||||
| VERSION = 2.3.0 | ||||
| TARGET = jtms3 | ||||
| VERSION = 0.1 | ||||
| TEMPLATE = app | ||||
| 
 | ||||
| win32 { | ||||
| DEFINES = WIN32 | ||||
| DESTDIR = ../map65_install | ||||
| DESTDIR = ../jtms3_install | ||||
| F90 = g95 | ||||
| g95.output = ${QMAKE_FILE_BASE}.o | ||||
| g95.commands = $$F90 -c -O2 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} | ||||
| @ -24,7 +24,7 @@ QMAKE_EXTRA_COMPILERS += g95 | ||||
| 
 | ||||
| unix { | ||||
| DEFINES = UNIX | ||||
| DESTDIR = ../map65_install | ||||
| DESTDIR = ../jtms3_install | ||||
| F90 = gfortran | ||||
| gfortran.output = ${QMAKE_FILE_BASE}.o | ||||
| gfortran.commands = $$F90 -c -O2 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} | ||||
| @ -34,28 +34,27 @@ QMAKE_EXTRA_COMPILERS += gfortran | ||||
| 
 | ||||
| SOURCES += main.cpp mainwindow.cpp plotter.cpp about.cpp \ | ||||
|     soundin.cpp soundout.cpp devsetup.cpp \ | ||||
|     widegraph.cpp getfile.cpp messages.cpp bandmap.cpp \ | ||||
|     astro.cpp displaytext.cpp getdev.cpp | ||||
|     widegraph.cpp getfile.cpp \ | ||||
|     displaytext.cpp getdev.cpp | ||||
| 
 | ||||
| win32 { | ||||
| SOURCES += killbyname.cpp     set570.cpp | ||||
| } | ||||
| 
 | ||||
| HEADERS  += mainwindow.h plotter.h soundin.h soundout.h \ | ||||
|             about.h devsetup.h widegraph.h getfile.h messages.h \ | ||||
|             bandmap.h commons.h sleep.h astro.h displaytext.h \ | ||||
|             about.h devsetup.h widegraph.h getfile.h \ | ||||
|             commons.h sleep.h displaytext.h \ | ||||
| 
 | ||||
| DEFINES += __cplusplus | ||||
| 
 | ||||
| FORMS    += mainwindow.ui about.ui devsetup.ui widegraph.ui \ | ||||
|     messages.ui bandmap.ui astro.ui | ||||
| FORMS    += mainwindow.ui about.ui devsetup.ui widegraph.ui | ||||
| 
 | ||||
| RC_FILE = map65.rc | ||||
| RC_FILE = jtms3.rc | ||||
| 
 | ||||
| unix { | ||||
| INCLUDEPATH += $$quote(/usr/include/qwt-qt4) | ||||
| LIBS += -lfftw3f /usr/lib/libgfortran.so.3 | ||||
| LIBS += ../map65/libm65/libm65.a | ||||
| LIBS += ../jtms3/libm65/libm65.a | ||||
| LIBS += /usr/lib/libqwt-qt4.so | ||||
| LIBS += -lportaudio | ||||
| #LIBS +- -lusb | ||||
| @ -63,8 +62,8 @@ LIBS += -lportaudio | ||||
| 
 | ||||
| win32 { | ||||
| INCLUDEPATH += c:/qwt-6.0.1/include | ||||
| LIBS += ../map65/libm65/libm65.a | ||||
| LIBS += ../map65/libfftw3f_win.a | ||||
| LIBS += ../jtms3/libm65/libm65.a | ||||
| LIBS += ../jtms3/libfftw3f_win.a | ||||
| LIBS += ../QtSupport/palir-02.dll | ||||
| LIBS += libwsock32 | ||||
| LIBS += C:/MinGW/lib/libf95.a | ||||
							
								
								
									
										168
									
								
								mainwindow.cpp
									
									
									
									
									
								
							
							
						
						
									
										168
									
								
								mainwindow.cpp
									
									
									
									
									
								
							| @ -4,10 +4,7 @@ | ||||
| #include "devsetup.h" | ||||
| #include "plotter.h" | ||||
| #include "about.h" | ||||
| #include "astro.h" | ||||
| #include "widegraph.h" | ||||
| #include "messages.h" | ||||
| #include "bandmap.h" | ||||
| #include "sleep.h" | ||||
| #include <portaudio.h> | ||||
| 
 | ||||
| @ -19,14 +16,11 @@ bool btxok;                           //True if OK to transmit | ||||
| double outputLatency;                 //Latency in seconds
 | ||||
| qint16 id[4*60*96000]; | ||||
| 
 | ||||
| Astro*     g_pAstro = NULL; | ||||
| WideGraph* g_pWideGraph = NULL; | ||||
| Messages*  g_pMessages = NULL; | ||||
| BandMap*   g_pBandMap = NULL; | ||||
| QSharedMemory mem_m65("mem_m65"); | ||||
| 
 | ||||
| QString rev="$Rev$"; | ||||
| QString Program_Title_Version="  MAP65   v2.3.0, r" + rev.mid(6,4) + | ||||
| QString Program_Title_Version="  JTMS3   v0.1, r" + rev.mid(6,4) + | ||||
|                               "    by K1JT"; | ||||
| 
 | ||||
| extern const int RxDataFrequency = 96000; | ||||
| @ -115,8 +109,7 @@ MainWindow::MainWindow(QWidget *parent) : | ||||
|   m_myCall="K1JT"; | ||||
|   m_myGrid="FN20qi"; | ||||
|   m_appDir = QApplication::applicationDirPath(); | ||||
|   m_saveDir="/users/joe/map65/install/save"; | ||||
|   m_azelDir="/users/joe/map65/install/"; | ||||
|   m_saveDir="/users/joe/jtms3/install/save"; | ||||
|   m_txFreq=125; | ||||
|   m_setftx=0; | ||||
|   m_loopall=false; | ||||
| @ -126,7 +119,7 @@ MainWindow::MainWindow(QWidget *parent) : | ||||
|   m_sec0=-1; | ||||
|   m_hsym0=-1; | ||||
|   m_palette="CuteSDR"; | ||||
|   m_map65RxLog=1;                     //Write Date and Time to all65.txt
 | ||||
|   m_jtms3RxLog=1;                     //Write Date and Time to RxLog
 | ||||
|   m_nutc0=9999; | ||||
|   m_kb8rq=false; | ||||
|   m_NB=false; | ||||
| @ -173,7 +166,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; \ | ||||
| @ -187,13 +180,7 @@ MainWindow::MainWindow(QWidget *parent) : | ||||
| 
 | ||||
|   genStdMsgs(""); | ||||
| 
 | ||||
|   on_actionAstro_Data_triggered();           //Create the other windows
 | ||||
|   on_actionWide_Waterfall_triggered(); | ||||
|   on_actionMessages_triggered(); | ||||
|   on_actionBand_Map_triggered(); | ||||
|   g_pMessages->setColors(m_colors); | ||||
|   g_pBandMap->setColors(m_colors); | ||||
|   g_pAstro->setFontSize(m_astroFont); | ||||
|   if(m_mode=="JT65A") on_actionJT65A_triggered(); | ||||
|   if(m_mode=="JT65B") on_actionJT65B_triggered(); | ||||
|   if(m_mode=="JT65C") on_actionJT65C_triggered(); | ||||
| @ -276,7 +263,7 @@ MainWindow::~MainWindow() | ||||
| //-------------------------------------------------------- writeSettings()
 | ||||
| void MainWindow::writeSettings() | ||||
| { | ||||
|   QString inifile = m_appDir + "/map65.ini"; | ||||
|   QString inifile = m_appDir + "/jtms3.ini"; | ||||
|   QSettings settings(inifile, QSettings::IniFormat); | ||||
| 
 | ||||
|   settings.beginGroup("MainWindow"); | ||||
| @ -286,23 +273,11 @@ void MainWindow::writeSettings() | ||||
|   settings.setValue("DXcall",ui->dxCallEntry->text()); | ||||
|   settings.setValue("DXgrid",ui->dxGridEntry->text()); | ||||
| 
 | ||||
|   if(g_pAstro->isVisible()) { | ||||
|     m_astroGeom = g_pAstro->geometry(); | ||||
|     settings.setValue("AstroGeom",m_astroGeom); | ||||
|   } | ||||
| 
 | ||||
|   if(g_pWideGraph->isVisible()) { | ||||
|     m_wideGraphGeom = g_pWideGraph->geometry(); | ||||
|     settings.setValue("WideGraphGeom",m_wideGraphGeom); | ||||
|   } | ||||
|   if(g_pMessages->isVisible()) { | ||||
|     m_messagesGeom = g_pMessages->geometry(); | ||||
|     settings.setValue("MessagesGeom",m_messagesGeom); | ||||
|   } | ||||
|   if(g_pBandMap->isVisible()) { | ||||
|     m_bandMapGeom = g_pBandMap->geometry(); | ||||
|     settings.setValue("BandMapGeom",m_bandMapGeom); | ||||
|   } | ||||
| 
 | ||||
|   settings.endGroup(); | ||||
| 
 | ||||
|   settings.beginGroup("Common"); | ||||
| @ -310,7 +285,6 @@ void MainWindow::writeSettings() | ||||
|   settings.setValue("MyGrid",m_myGrid); | ||||
|   settings.setValue("IDint",m_idInt); | ||||
|   settings.setValue("PTTport",m_pttPort); | ||||
|   settings.setValue("AstroFont",m_astroFont); | ||||
|   settings.setValue("Xpol",m_xpol); | ||||
|   settings.setValue("XpolX",m_xpolx); | ||||
|   settings.setValue("SaveDir",m_saveDir); | ||||
| @ -358,21 +332,14 @@ void MainWindow::writeSettings() | ||||
| //---------------------------------------------------------- readSettings()
 | ||||
| void MainWindow::readSettings() | ||||
| { | ||||
|   QString inifile = m_appDir + "/map65.ini"; | ||||
|   QString inifile = m_appDir + "/jtms3.ini"; | ||||
|   QSettings settings(inifile, QSettings::IniFormat); | ||||
|   settings.beginGroup("MainWindow"); | ||||
|   restoreGeometry(settings.value("geometry").toByteArray()); | ||||
|   ui->dxCallEntry->setText(settings.value("DXcall","").toString()); | ||||
|   ui->dxGridEntry->setText(settings.value("DXgrid","").toString()); | ||||
| 
 | ||||
|   m_astroGeom = settings.value("AstroGeom", QRect(71,390,227,403)).toRect(); | ||||
| 
 | ||||
|   m_wideGraphGeom = settings.value("WideGraphGeom", \ | ||||
|                                    QRect(45,30,1023,340)).toRect(); | ||||
|   m_messagesGeom = settings.value("MessagesGeom", \ | ||||
|                                   QRect(800,400,381,400)).toRect(); | ||||
|   m_bandMapGeom = settings.value("BandMapGeom", \ | ||||
|                                   QRect(280,400,142,400)).toRect(); | ||||
|   m_path = settings.value("MRUdir", m_appDir + "/save").toString(); | ||||
|   m_txFirst = settings.value("TxFirst",false).toBool(); | ||||
|   ui->txFirstCheckBox->setChecked(m_txFirst); | ||||
| @ -383,7 +350,6 @@ void MainWindow::readSettings() | ||||
|   m_myGrid=settings.value("MyGrid","").toString(); | ||||
|   m_idInt=settings.value("IDint",0).toInt(); | ||||
|   m_pttPort=settings.value("PTTport",0).toInt(); | ||||
|   m_astroFont=settings.value("AstroFont",20).toInt(); | ||||
|   m_xpol=settings.value("Xpol",false).toBool(); | ||||
|   ui->actionFind_Delta_Phi->setEnabled(m_xpol); | ||||
|   m_xpolx=settings.value("XpolX",false).toBool(); | ||||
| @ -574,7 +540,6 @@ void MainWindow::on_actionDeviceSetup_triggered()               //Setup Dialog | ||||
|   dlg.m_myGrid=m_myGrid; | ||||
|   dlg.m_idInt=m_idInt; | ||||
|   dlg.m_pttPort=m_pttPort; | ||||
|   dlg.m_astroFont=m_astroFont; | ||||
|   dlg.m_xpol=m_xpol; | ||||
|   dlg.m_xpolx=m_xpolx; | ||||
|   dlg.m_saveDir=m_saveDir; | ||||
| @ -602,8 +567,6 @@ void MainWindow::on_actionDeviceSetup_triggered()               //Setup Dialog | ||||
|     m_myGrid=dlg.m_myGrid; | ||||
|     m_idInt=dlg.m_idInt; | ||||
|     m_pttPort=dlg.m_pttPort; | ||||
|     m_astroFont=dlg.m_astroFont; | ||||
|     if(g_pAstro->isVisible()) g_pAstro->setFontSize(m_astroFont); | ||||
|     m_xpol=dlg.m_xpol; | ||||
|     ui->actionFind_Delta_Phi->setEnabled(m_xpol); | ||||
|     m_xpolx=dlg.m_xpolx; | ||||
| @ -626,8 +589,6 @@ void MainWindow::on_actionDeviceSetup_triggered()               //Setup Dialog | ||||
|     m_10db=dlg.m_10db; | ||||
|     m_initIQplus=dlg.m_initIQplus; | ||||
|     m_colors=dlg.m_colors; | ||||
|     g_pMessages->setColors(m_colors); | ||||
|     g_pBandMap->setColors(m_colors); | ||||
|     m_cal570=dlg.m_cal570; | ||||
|     m_mult570=dlg.m_mult570; | ||||
|     g_pWideGraph->m_mult570=m_mult570; | ||||
| @ -875,23 +836,10 @@ void MainWindow::stub()                                        //stub() | ||||
| void MainWindow::on_actionOnline_Users_Guide_triggered()      //Display manual
 | ||||
| { | ||||
|   QDesktopServices::openUrl(QUrl( | ||||
|   "http://www.physics.princeton.edu/pulsar/K1JT/MAP65_Users_Guide.pdf", | ||||
|   "http://www.physics.princeton.edu/pulsar/K1JT/JTMS3_Users_Guide.pdf", | ||||
|                               QUrl::TolerantMode)); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionAstro_Data_triggered()             //Display Astro
 | ||||
| { | ||||
|   if(g_pAstro==NULL) { | ||||
|     g_pAstro = new Astro(0); | ||||
|     g_pAstro->setWindowTitle("Astronomical Data"); | ||||
|     Qt::WindowFlags flags = Qt::Dialog | Qt::WindowCloseButtonHint | | ||||
|         Qt::WindowMinimizeButtonHint; | ||||
|     g_pAstro->setWindowFlags(flags); | ||||
|     g_pAstro->setGeometry(m_astroGeom); | ||||
|   } | ||||
|   g_pAstro->show(); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionWide_Waterfall_triggered()      //Display Waterfalls
 | ||||
| { | ||||
|   if(g_pWideGraph==NULL) { | ||||
| @ -909,46 +857,13 @@ void MainWindow::on_actionWide_Waterfall_triggered()      //Display Waterfalls | ||||
|   g_pWideGraph->show(); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionBand_Map_triggered()              //Display BandMap
 | ||||
| { | ||||
|   if(g_pBandMap==NULL) { | ||||
|     g_pBandMap = new BandMap(0); | ||||
|     g_pBandMap->setWindowTitle("Band Map"); | ||||
|     Qt::WindowFlags flags = Qt::Dialog | Qt::WindowCloseButtonHint | | ||||
|         Qt::WindowMinimizeButtonHint; | ||||
|     g_pBandMap->setWindowFlags(flags); | ||||
|     g_pBandMap->setGeometry(m_bandMapGeom); | ||||
|   } | ||||
|   g_pBandMap->show(); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionMessages_triggered()              //Display Messages
 | ||||
| { | ||||
|   if(g_pMessages==NULL) { | ||||
|     g_pMessages = new Messages(0); | ||||
|     g_pMessages->setWindowTitle("Messages"); | ||||
|     Qt::WindowFlags flags = Qt::Dialog | Qt::WindowCloseButtonHint | | ||||
|         Qt::WindowMinimizeButtonHint; | ||||
|     g_pMessages->setWindowFlags(flags); | ||||
|     g_pMessages->setGeometry(m_messagesGeom); | ||||
|     connect(g_pMessages, SIGNAL(click2OnCallsign(QString, QString)),this, | ||||
|             SLOT(doubleClickOnMessages(QString, QString))); | ||||
|   } | ||||
|   g_pMessages->show(); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionOpen_triggered()                     //Open File
 | ||||
| { | ||||
|   m_monitoring=false; | ||||
|   soundInThread.setMonitoring(m_monitoring); | ||||
|   QString fname; | ||||
|   if(m_xpol) { | ||||
|     fname=QFileDialog::getOpenFileName(this, "Open File", m_path, | ||||
|                                        "MAP65 Files (*.tf2)"); | ||||
|   } else { | ||||
|     fname=QFileDialog::getOpenFileName(this, "Open File", m_path, | ||||
|                                        "MAP65 Files (*.iq)"); | ||||
|   } | ||||
|   fname=QFileDialog::getOpenFileName(this, "Open File", m_path, | ||||
|                                        "JTMS3 Files (*.wav)"); | ||||
|   if(fname != "") { | ||||
|     m_path=fname; | ||||
|     int i; | ||||
| @ -1050,17 +965,10 @@ void MainWindow::on_actionDelete_all_tf2_files_in_SaveDir_triggered() | ||||
|     } | ||||
|   } | ||||
| } | ||||
|                                           //Clear BandMap and Messages windows
 | ||||
| void MainWindow::on_actionErase_Band_Map_and_Messages_triggered() | ||||
| { | ||||
|   g_pBandMap->setText(""); | ||||
|   g_pMessages->setText(""); | ||||
|   m_map65RxLog |= 4; | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionFind_Delta_Phi_triggered()              //Find dPhi
 | ||||
| { | ||||
|   m_map65RxLog |= 8; | ||||
|   m_jtms3RxLog |= 8; | ||||
|   on_DecodeButton_clicked(); | ||||
| } | ||||
| 
 | ||||
| @ -1186,9 +1094,9 @@ void MainWindow::decode()                                       //decode() | ||||
|   datcom_.ntol=m_tol; | ||||
|   datcom_.nxant=0; | ||||
|   if(m_xpolx) datcom_.nxant=1; | ||||
|   if(datcom_.nutc < m_nutc0) m_map65RxLog |= 1;  //Date and Time to all65.txt
 | ||||
|   if(datcom_.nutc < m_nutc0) m_jtms3RxLog |= 1;  //Date and Time to all65.txt
 | ||||
|   m_nutc0=datcom_.nutc; | ||||
|   datcom_.map65RxLog=m_map65RxLog; | ||||
| //  datcom_.jtms3RxLog=m_jtms3RxLog;
 | ||||
|   datcom_.nfsample=96000; | ||||
|   if(!m_fs96000) datcom_.nfsample=95238; | ||||
|   datcom_.nxpol=0; | ||||
| @ -1251,15 +1159,13 @@ void MainWindow::readFromStdout()                             //readFromStdout | ||||
|     QByteArray t=proc_m65.readLine(); | ||||
|     if(t.indexOf("<m65aFinished>") >= 0) { | ||||
|       if(m_widebandDecode) { | ||||
|         g_pMessages->setText(m_messagesText); | ||||
|         g_pBandMap->setText(m_bandmapText); | ||||
|         m_widebandDecode=false; | ||||
|       } | ||||
|       QFile lockFile(m_appDir + "/.lock"); | ||||
|       lockFile.open(QIODevice::ReadWrite); | ||||
|       ui->DecodeButton->setStyleSheet(""); | ||||
|       decodeBusy(false); | ||||
|       m_map65RxLog=0; | ||||
|       m_jtms3RxLog=0; | ||||
|       m_startAnother=m_loopall; | ||||
|       return; | ||||
|     } | ||||
| @ -1270,12 +1176,10 @@ void MainWindow::readFromStdout()                             //readFromStdout | ||||
|       if(n<30) ui->decodedTextBrowser->append(t.mid(1,n-3)); | ||||
|       n=ui->decodedTextBrowser->verticalScrollBar()->maximum(); | ||||
|       ui->decodedTextBrowser->verticalScrollBar()->setValue(n); | ||||
|       m_messagesText=""; | ||||
|       m_bandmapText=""; | ||||
|     } | ||||
| 
 | ||||
|     if(t.indexOf("@") >= 0) { | ||||
|       m_messagesText += t.mid(1); | ||||
| //      m_messagesText += t.mid(1);
 | ||||
|       m_widebandDecode=true; | ||||
|     } | ||||
| 
 | ||||
| @ -1289,7 +1193,7 @@ void MainWindow::readFromStdout()                             //readFromStdout | ||||
|         } else { | ||||
|           q=q.mid(1,4) + " *" + q.mid(5); | ||||
|         } | ||||
|         m_bandmapText += q; | ||||
| //        m_bandmapText += q;
 | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| @ -1373,7 +1277,7 @@ void MainWindow::guiUpdate() | ||||
|     msgsent[22]=0; | ||||
| 
 | ||||
|     if(m_restart) { | ||||
|       QFile f("map65_tx.log"); | ||||
|       QFile f("jtms3_tx.log"); | ||||
|       f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append); | ||||
|       QTextStream out(&f); | ||||
|       out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm") | ||||
| @ -1395,7 +1299,7 @@ void MainWindow::guiUpdate() | ||||
|     btxok=true; | ||||
|     m_transmitting=true; | ||||
| 
 | ||||
|     QFile f("map65_tx.log"); | ||||
|     QFile f("jtms3_tx.log"); | ||||
|     f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append); | ||||
|     QTextStream out(&f); | ||||
|     out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm") | ||||
| @ -1485,8 +1389,6 @@ void MainWindow::guiUpdate() | ||||
| 
 | ||||
|     QDateTime t = QDateTime::currentDateTimeUtc(); | ||||
|     int fQSO=g_pWideGraph->QSOfreq(); | ||||
|     g_pAstro->astroUpdate(t, m_myGrid, m_hisGrid, fQSO, m_setftx, | ||||
|                           m_txFreq, m_azelDir); | ||||
|     m_setftx=0; | ||||
|     QString utc = " " + t.time().toString() + " "; | ||||
|     ui->labUTC->setText(utc); | ||||
| @ -1607,26 +1509,6 @@ void MainWindow::doubleClickOnCall(QString hiscall, bool ctrl) | ||||
|     ui->txrb1->setChecked(true); | ||||
|   } | ||||
| } | ||||
|                                                       //doubleClickOnMessages
 | ||||
| void MainWindow::doubleClickOnMessages(QString hiscall, QString t2) | ||||
| { | ||||
|   if(m_worked[hiscall]) { | ||||
|     msgBox("Possible dupe: " + hiscall + " already in log."); | ||||
|   } | ||||
|   ui->dxCallEntry->setText(hiscall); | ||||
|   int n = 60*t2.mid(13,2).toInt() + t2.mid(15,2).toInt(); | ||||
|   m_txFirst = ((n%2) == 1); | ||||
|   ui->txFirstCheckBox->setChecked(m_txFirst); | ||||
|   lookup(); | ||||
|   genStdMsgs(""); | ||||
|   if(t2.indexOf(m_myCall)>0) { | ||||
|     m_ntx=2; | ||||
|     ui->txrb2->setChecked(true); | ||||
|   } else { | ||||
|     m_ntx=1; | ||||
|     ui->txrb1->setChecked(true); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| void MainWindow::genStdMsgs(QString rpt)                       //genStdMsgs()
 | ||||
| { | ||||
| @ -1894,23 +1776,25 @@ void MainWindow::on_logQSOButton_clicked()                 //Log QSO button | ||||
|   m_worked[m_hisCall]=true; | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionErase_map65_rx_log_triggered()     //Erase Rx log
 | ||||
| /*
 | ||||
| void MainWindow::on_actionErase_jtms3_rx_log_triggered()     //Erase Rx log
 | ||||
| { | ||||
|   int ret = QMessageBox::warning(this, "Confirm Erase", | ||||
|       "Are you sure you want to erase file map65_rx.log ?", | ||||
|       "Are you sure you want to erase file jtms3_rx.log ?", | ||||
|        QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); | ||||
|   if(ret==QMessageBox::Yes) { | ||||
|     m_map65RxLog |= 2;                      // Rewind map65_rx.log
 | ||||
|     m_jtms3RxLog |= 2;                      // Rewind jtms3_rx.log
 | ||||
|   } | ||||
| } | ||||
| */ | ||||
| 
 | ||||
| void MainWindow::on_actionErase_map65_tx_log_triggered()     //Erase Tx log
 | ||||
| void MainWindow::on_actionErase_jtms3_tx_log_triggered()     //Erase Tx log
 | ||||
| { | ||||
|   int ret = QMessageBox::warning(this, "Confirm Erase", | ||||
|       "Are you sure you want to erase file map65_tx.log ?", | ||||
|       "Are you sure you want to erase file jtms3_tx.log ?", | ||||
|        QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); | ||||
|   if(ret==QMessageBox::Yes) { | ||||
|     QFile f("map65_tx.log"); | ||||
|     QFile f("jtms3_tx.log"); | ||||
|     f.remove(); | ||||
|   } | ||||
| } | ||||
|  | ||||
							
								
								
									
										17
									
								
								mainwindow.h
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								mainwindow.h
									
									
									
									
									
								
							| @ -39,7 +39,6 @@ public slots: | ||||
|   void m65_error(); | ||||
|   void guiUpdate(); | ||||
|   void doubleClickOnCall(QString hiscall, bool ctrl); | ||||
|   void doubleClickOnMessages(QString hiscall, QString t2); | ||||
| 
 | ||||
| protected: | ||||
|   virtual void keyPressEvent( QKeyEvent *e ); | ||||
| @ -63,17 +62,13 @@ private slots: | ||||
|   void on_autoButton_clicked(); | ||||
|   void on_stopTxButton_clicked(); | ||||
|   void on_tolSpinBox_valueChanged(int arg1); | ||||
|   void on_actionAstro_Data_triggered(); | ||||
|   void on_stopButton_clicked(); | ||||
|   void on_actionOnline_Users_Guide_triggered(); | ||||
|   void on_actionWide_Waterfall_triggered(); | ||||
|   void on_actionBand_Map_triggered(); | ||||
|   void on_actionMessages_triggered(); | ||||
|   void on_actionOpen_triggered(); | ||||
|   void on_actionOpen_next_in_directory_triggered(); | ||||
|   void on_actionDecode_remaining_files_in_directory_triggered(); | ||||
|   void on_actionDelete_all_tf2_files_in_SaveDir_triggered(); | ||||
|   void on_actionErase_Band_Map_and_Messages_triggered(); | ||||
|   void on_actionFind_Delta_Phi_triggered(); | ||||
|   void on_actionF4_sets_Tx6_triggered(); | ||||
|   void on_actionOnly_EME_calls_triggered(); | ||||
| @ -107,8 +102,8 @@ private slots: | ||||
|   void on_genStdMsgsPushButton_clicked(); | ||||
|   void bumpDF(int n); | ||||
|   void on_logQSOButton_clicked(); | ||||
|   void on_actionErase_map65_rx_log_triggered(); | ||||
|   void on_actionErase_map65_tx_log_triggered(); | ||||
| //  void on_actionErase_jtms3_rx_log_triggered();
 | ||||
|   void on_actionErase_jtms3_tx_log_triggered(); | ||||
|   void on_NBcheckBox_toggled(bool checked); | ||||
|   void on_actionJT65A_triggered(); | ||||
|   void on_actionJT65B_triggered(); | ||||
| @ -134,7 +129,6 @@ private: | ||||
|     qint32  m_QSOfreq0; | ||||
|     qint32  m_ntx; | ||||
|     qint32  m_pttPort; | ||||
|     qint32  m_astroFont; | ||||
|     qint32  m_timeout; | ||||
|     qint32  m_dPhi; | ||||
|     qint32  m_fCal; | ||||
| @ -142,7 +136,7 @@ private: | ||||
|     qint32  m_setftx; | ||||
|     qint32  m_ndepth; | ||||
|     qint32  m_sec0; | ||||
|     qint32  m_map65RxLog; | ||||
|     qint32  m_jtms3RxLog; | ||||
|     qint32  m_nutc0; | ||||
|     qint32  m_mode65; | ||||
|     qint32  m_nrx; | ||||
| @ -190,10 +184,7 @@ private: | ||||
|     float   m_phasey; | ||||
|     float   m_pctZap; | ||||
| 
 | ||||
|     QRect   m_astroGeom; | ||||
|     QRect   m_wideGraphGeom; | ||||
|     QRect   m_messagesGeom; | ||||
|     QRect   m_bandMapGeom; | ||||
| 
 | ||||
|     QLabel* lab1;                            // labels in status bar
 | ||||
|     QLabel* lab2; | ||||
| @ -216,8 +207,6 @@ private: | ||||
|     QString m_pbdecoding_style1; | ||||
|     QString m_pbmonitor_style; | ||||
|     QString m_pbAutoOn_style; | ||||
|     QString m_messagesText; | ||||
|     QString m_bandmapText; | ||||
|     QString m_myCall; | ||||
|     QString m_myGrid; | ||||
|     QString m_hisCall; | ||||
|  | ||||
							
								
								
									
										81
									
								
								messages.cpp
									
									
									
									
									
								
							
							
						
						
									
										81
									
								
								messages.cpp
									
									
									
									
									
								
							| @ -1,81 +0,0 @@ | ||||
| #include "messages.h" | ||||
| #include "ui_messages.h" | ||||
| #include "mainwindow.h" | ||||
| 
 | ||||
| Messages::Messages(QWidget *parent) : | ||||
|   QDialog(parent), | ||||
|   ui(new Ui::Messages) | ||||
| { | ||||
|   ui->setupUi(this); | ||||
|   ui->messagesTextBrowser->setStyleSheet( \ | ||||
|           "QTextBrowser { background-color : #000066; color : red; }"); | ||||
|   ui->messagesTextBrowser->clear(); | ||||
|   m_cqOnly=false; | ||||
|   connect(ui->messagesTextBrowser,SIGNAL(selectCallsign(bool)),this, | ||||
|           SLOT(selectCallsign2(bool))); | ||||
| } | ||||
| 
 | ||||
| Messages::~Messages() | ||||
| { | ||||
|   delete ui; | ||||
| } | ||||
| 
 | ||||
| void Messages::setText(QString t) | ||||
| { | ||||
|   QString cfreq,cfreq0; | ||||
|   m_t=t; | ||||
| 
 | ||||
|   QString s="QTextBrowser{background-color: "+m_colorBackground+"}"; | ||||
|   ui->messagesTextBrowser->setStyleSheet(s); | ||||
| 
 | ||||
|   ui->messagesTextBrowser->clear(); | ||||
|   QStringList lines = t.split( "\n", QString::SkipEmptyParts ); | ||||
|   foreach( QString line, lines ) { | ||||
|     QString t1=line.mid(0,48); | ||||
|     if(m_cqOnly and t1.indexOf(" CQ ") < 0) continue; | ||||
|     int n=line.mid(48,2).toInt(); | ||||
|     if(n==0) ui->messagesTextBrowser->setTextColor(m_color0); | ||||
|     if(n==1) ui->messagesTextBrowser->setTextColor(m_color1); | ||||
|     if(n==2) ui->messagesTextBrowser->setTextColor(m_color2); | ||||
|     if(n>=3) ui->messagesTextBrowser->setTextColor(m_color3); | ||||
|     cfreq=t1.mid(0,3); | ||||
|     if(cfreq == cfreq0) { | ||||
|       t1="   " + t1.mid(3,-1); | ||||
|     } | ||||
|     cfreq0=cfreq; | ||||
|     ui->messagesTextBrowser->append(t1); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| void Messages::selectCallsign2(bool ctrl) | ||||
| { | ||||
|   QString t = ui->messagesTextBrowser->toPlainText();   //Full contents
 | ||||
|   int i=ui->messagesTextBrowser->textCursor().position(); | ||||
|   int i0=t.lastIndexOf(" ",i); | ||||
|   int i1=t.indexOf(" ",i); | ||||
|   QString hiscall=t.mid(i0+1,i1-i0-1); | ||||
|   if(hiscall!="") { | ||||
|     if(hiscall.length() < 13) { | ||||
|       QString t1 = t.mid(0,i);              //contents up to text cursor
 | ||||
|       int i1=t1.lastIndexOf("\n") + 1; | ||||
|       QString t2 = t1.mid(i1,i-i1);         //selected line
 | ||||
|       emit click2OnCallsign(hiscall,t2); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| void Messages::on_checkBox_stateChanged(int n) | ||||
| { | ||||
|   m_cqOnly = (n!=0); | ||||
|   setText(m_t); | ||||
| } | ||||
| 
 | ||||
| void Messages::setColors(QString t) | ||||
| { | ||||
|   m_colorBackground = "#"+t.mid(0,6); | ||||
|   m_color0 = "#"+t.mid(6,6); | ||||
|   m_color1 = "#"+t.mid(12,6); | ||||
|   m_color2 = "#"+t.mid(18,6); | ||||
|   m_color3 = "#"+t.mid(24,6); | ||||
|   setText(m_t); | ||||
| } | ||||
							
								
								
									
										40
									
								
								messages.h
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								messages.h
									
									
									
									
									
								
							| @ -1,40 +0,0 @@ | ||||
| #ifndef MESSAGES_H | ||||
| #define MESSAGES_H | ||||
| 
 | ||||
| #include <QDialog> | ||||
| 
 | ||||
| namespace Ui { | ||||
|   class Messages; | ||||
| } | ||||
| 
 | ||||
| class Messages : public QDialog | ||||
| { | ||||
|   Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|   explicit Messages(QWidget *parent = 0); | ||||
|   void setText(QString t); | ||||
|   void setColors(QString t); | ||||
| 
 | ||||
|     ~Messages(); | ||||
| 
 | ||||
| signals: | ||||
|   void click2OnCallsign(QString hiscall, QString t2); | ||||
| 
 | ||||
| private slots: | ||||
|   void selectCallsign2(bool ctrl); | ||||
|   void on_checkBox_stateChanged(int arg1); | ||||
| 
 | ||||
| private: | ||||
|     Ui::Messages *ui; | ||||
|     QString m_t; | ||||
|     QString m_colorBackground; | ||||
|     QString m_color0; | ||||
|     QString m_color1; | ||||
|     QString m_color2; | ||||
|     QString m_color3; | ||||
| 
 | ||||
|     bool m_cqOnly; | ||||
| }; | ||||
| 
 | ||||
| #endif // MESSAGES_H
 | ||||
							
								
								
									
										100
									
								
								messages.ui
									
									
									
									
									
								
							
							
						
						
									
										100
									
								
								messages.ui
									
									
									
									
									
								
							| @ -1,100 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <ui version="4.0"> | ||||
|  <class>Messages</class> | ||||
|  <widget class="QDialog" name="Messages"> | ||||
|   <property name="geometry"> | ||||
|    <rect> | ||||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>399</width> | ||||
|     <height>595</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="sizePolicy"> | ||||
|    <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> | ||||
|     <horstretch>0</horstretch> | ||||
|     <verstretch>0</verstretch> | ||||
|    </sizepolicy> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|    <string>Dialog</string> | ||||
|   </property> | ||||
|   <layout class="QGridLayout" name="gridLayout"> | ||||
|    <item row="0" column="0"> | ||||
|     <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|      <property name="sizeConstraint"> | ||||
|       <enum>QLayout::SetDefaultConstraint</enum> | ||||
|      </property> | ||||
|      <item> | ||||
|       <layout class="QHBoxLayout" name="horizontalLayout"> | ||||
|        <item> | ||||
|         <widget class="QLabel" name="lab1"> | ||||
|          <property name="sizePolicy"> | ||||
|           <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||||
|            <horstretch>0</horstretch> | ||||
|            <verstretch>0</verstretch> | ||||
|           </sizepolicy> | ||||
|          </property> | ||||
|          <property name="text"> | ||||
|           <string> Freq     DF     Pol     UTC       dB</string> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|        <item> | ||||
|         <spacer name="horizontalSpacer"> | ||||
|          <property name="orientation"> | ||||
|           <enum>Qt::Horizontal</enum> | ||||
|          </property> | ||||
|          <property name="sizeHint" stdset="0"> | ||||
|           <size> | ||||
|            <width>40</width> | ||||
|            <height>20</height> | ||||
|           </size> | ||||
|          </property> | ||||
|         </spacer> | ||||
|        </item> | ||||
|        <item> | ||||
|         <widget class="QCheckBox" name="checkBox"> | ||||
|          <property name="text"> | ||||
|           <string>CQ Only</string> | ||||
|          </property> | ||||
|         </widget> | ||||
|        </item> | ||||
|       </layout> | ||||
|      </item> | ||||
|      <item> | ||||
|       <widget class="DisplayText" name="messagesTextBrowser"> | ||||
|        <property name="sizePolicy"> | ||||
|         <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> | ||||
|          <horstretch>0</horstretch> | ||||
|          <verstretch>0</verstretch> | ||||
|         </sizepolicy> | ||||
|        </property> | ||||
|        <property name="minimumSize"> | ||||
|         <size> | ||||
|          <width>340</width> | ||||
|          <height>0</height> | ||||
|         </size> | ||||
|        </property> | ||||
|        <property name="font"> | ||||
|         <font> | ||||
|          <family>Courier New</family> | ||||
|          <pointsize>9</pointsize> | ||||
|         </font> | ||||
|        </property> | ||||
|       </widget> | ||||
|      </item> | ||||
|     </layout> | ||||
|    </item> | ||||
|   </layout> | ||||
|  </widget> | ||||
|  <customwidgets> | ||||
|   <customwidget> | ||||
|    <class>DisplayText</class> | ||||
|    <extends>QTextBrowser</extends> | ||||
|    <header>displaytext.h</header> | ||||
|   </customwidget> | ||||
|  </customwidgets> | ||||
|  <resources/> | ||||
|  <connections/> | ||||
| </ui> | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user