From ad4fb2be9d50309fb8a484da8959916fda702194 Mon Sep 17 00:00:00 2001
From: Joe Taylor <joe@princeton.edu>
Date: Wed, 25 Jan 2023 12:31:58 -0500
Subject: [PATCH] Display both frx and fsked, in both QMAP and QSJT-X Active
 Stations window.

---
 qmap/libqmap/q65b.f90      |   4 +-
 qmap/mainwindow.ui         | 176 ++++++++++++++++++-------------------
 widgets/activeStations.cpp |   2 +-
 widgets/mainwindow.cpp     |  24 ++---
 widgets/mainwindow.h       |   1 +
 5 files changed, 105 insertions(+), 102 deletions(-)

diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90
index b5f3ee2e3..84b9485a3 100644
--- a/qmap/libqmap/q65b.f90
+++ b/qmap/libqmap/q65b.f90
@@ -112,8 +112,8 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,          &
      ndecodes=ndecodes+1
      frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal
      fsked=frx - 0.001*ndop00/2.0 - 1.5
-     write(result(ndecodes),1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
-1120 format(i4.4,f9.3,f7.2,i5,2x,a,i6)
+     write(result(ndecodes),1120) nutc,frx,fsked,xdt0,nsnr0,trim(msg0)
+1120 format(i4.4,f9.3,f7.1,f7.2,i5,2x,a)
      write(12,1130) datetime,trim(result(ndecodes)(5:))
 1130 format(a11,1x,a)
      result(ndecodes)=trim(result(ndecodes))//char(0)
diff --git a/qmap/mainwindow.ui b/qmap/mainwindow.ui
index 6fae7b2f2..f9a9b423d 100644
--- a/qmap/mainwindow.ui
+++ b/qmap/mainwindow.ui
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>472</width>
+    <width>550</width>
     <height>431</height>
    </rect>
   </property>
@@ -18,7 +18,7 @@
   </property>
   <property name="minimumSize">
    <size>
-    <width>472</width>
+    <width>550</width>
     <height>0</height>
    </size>
   </property>
@@ -59,7 +59,7 @@
          </size>
         </property>
         <property name="title">
-         <string>     UTC                Freq               DT           dB       Message</string>
+         <string>     UTC               Freq           Fsked             DT            dB       Message</string>
         </property>
         <layout class="QFormLayout" name="formLayout_2">
          <item row="0" column="0">
@@ -72,7 +72,7 @@
            </property>
            <property name="minimumSize">
             <size>
-             <width>421</width>
+             <width>500</width>
              <height>100</height>
             </size>
            </property>
@@ -111,19 +111,79 @@ p, li { white-space: pre-wrap; }
       </item>
       <item row="1" column="0">
        <layout class="QGridLayout" name="gridLayout">
-        <item row="0" column="0" rowspan="3">
-         <widget class="QFrame" name="xMeterFrame">
+        <item row="0" column="3" colspan="2">
+         <widget class="QPushButton" name="EraseButton">
           <property name="minimumSize">
            <size>
             <width>50</width>
-            <height>150</height>
+            <height>0</height>
            </size>
           </property>
-          <property name="frameShape">
-           <enum>QFrame::StyledPanel</enum>
+          <property name="text">
+           <string>&amp;Erase</string>
           </property>
-          <property name="frameShadow">
-           <enum>QFrame::Raised</enum>
+         </widget>
+        </item>
+        <item row="1" column="4" colspan="2">
+         <widget class="QSpinBox" name="sbMaxDrift">
+          <property name="toolTip">
+           <string>Maximum drift rate in units of symbol rate per transmissiion.</string>
+          </property>
+          <property name="alignment">
+           <set>Qt::AlignCenter</set>
+          </property>
+          <property name="prefix">
+           <string>Max Drift  </string>
+          </property>
+          <property name="maximum">
+           <number>50</number>
+          </property>
+          <property name="singleStep">
+           <number>5</number>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QLabel" name="labFreq">
+          <property name="maximumSize">
+           <size>
+            <width>16777215</width>
+            <height>35</height>
+           </size>
+          </property>
+          <property name="font">
+           <font>
+            <pointsize>16</pointsize>
+           </font>
+          </property>
+          <property name="frameShape">
+           <enum>QFrame::Panel</enum>
+          </property>
+          <property name="text">
+           <string>1296.080</string>
+          </property>
+          <property name="alignment">
+           <set>Qt::AlignCenter</set>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="5">
+         <widget class="QPushButton" name="DecodeButton">
+          <property name="minimumSize">
+           <size>
+            <width>50</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text">
+           <string>&amp;Decode</string>
+          </property>
+         </widget>
+        </item>
+        <item row="2" column="3">
+         <widget class="QCheckBox" name="NBcheckBox">
+          <property name="text">
+           <string>NB</string>
           </property>
          </widget>
         </item>
@@ -158,6 +218,22 @@ p, li { white-space: pre-wrap; }
           </property>
          </widget>
         </item>
+        <item row="0" column="0" rowspan="3">
+         <widget class="QFrame" name="xMeterFrame">
+          <property name="minimumSize">
+           <size>
+            <width>50</width>
+            <height>150</height>
+           </size>
+          </property>
+          <property name="frameShape">
+           <enum>QFrame::StyledPanel</enum>
+          </property>
+          <property name="frameShadow">
+           <enum>QFrame::Raised</enum>
+          </property>
+         </widget>
+        </item>
         <item row="0" column="2">
          <widget class="QPushButton" name="monitorButton">
           <property name="sizePolicy">
@@ -183,32 +259,6 @@ p, li { white-space: pre-wrap; }
           </property>
          </widget>
         </item>
-        <item row="0" column="3" colspan="2">
-         <widget class="QPushButton" name="EraseButton">
-          <property name="minimumSize">
-           <size>
-            <width>50</width>
-            <height>0</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>&amp;Erase</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="5">
-         <widget class="QPushButton" name="DecodeButton">
-          <property name="minimumSize">
-           <size>
-            <width>50</width>
-            <height>0</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>&amp;Decode</string>
-          </property>
-         </widget>
-        </item>
         <item row="1" column="2" colspan="2">
          <layout class="QHBoxLayout" name="horizontalLayout">
           <item>
@@ -294,25 +344,6 @@ p, li { white-space: pre-wrap; }
           </item>
          </layout>
         </item>
-        <item row="1" column="4" colspan="2">
-         <widget class="QSpinBox" name="sbMaxDrift">
-          <property name="toolTip">
-           <string>Maximum drift rate in units of symbol rate per transmissiion.</string>
-          </property>
-          <property name="alignment">
-           <set>Qt::AlignCenter</set>
-          </property>
-          <property name="prefix">
-           <string>Max Drift  </string>
-          </property>
-          <property name="maximum">
-           <number>50</number>
-          </property>
-          <property name="singleStep">
-           <number>5</number>
-          </property>
-         </widget>
-        </item>
         <item row="2" column="4" colspan="2">
          <widget class="QSlider" name="NBslider">
           <property name="enabled">
@@ -344,37 +375,6 @@ p, li { white-space: pre-wrap; }
           </property>
          </widget>
         </item>
-        <item row="2" column="3">
-         <widget class="QCheckBox" name="NBcheckBox">
-          <property name="text">
-           <string>NB</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QLabel" name="labFreq">
-          <property name="maximumSize">
-           <size>
-            <width>16777215</width>
-            <height>35</height>
-           </size>
-          </property>
-          <property name="font">
-           <font>
-            <pointsize>16</pointsize>
-           </font>
-          </property>
-          <property name="frameShape">
-           <enum>QFrame::Panel</enum>
-          </property>
-          <property name="text">
-           <string>1296.080</string>
-          </property>
-          <property name="alignment">
-           <set>Qt::AlignCenter</set>
-          </property>
-         </widget>
-        </item>
        </layout>
       </item>
      </layout>
@@ -386,7 +386,7 @@ p, li { white-space: pre-wrap; }
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>472</width>
+     <width>550</width>
      <height>21</height>
     </rect>
    </property>
diff --git a/widgets/activeStations.cpp b/widgets/activeStations.cpp
index 39dbda71e..04e79f477 100644
--- a/widgets/activeStations.cpp
+++ b/widgets/activeStations.cpp
@@ -62,7 +62,7 @@ void ActiveStations::displayRecentStations(QString mode, QString const& t)
   m_mode=mode;
   bool b=(m_mode=="Q65");
   if(b) {
-    ui->header_label2->setText("  N    Freq  S/N   Call     Grid  Tx  Age");
+    ui->header_label2->setText("  N    Frx   Fsked  S/N   Call     Grid  Tx  Age");
     ui->label->setText("QSOs:");
   } else {
     ui->header_label2->setText("  N   Call    Grid   Az  S/N  Freq Tx Age Pts");
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp
index ee9e4b86d..14863ba96 100644
--- a/widgets/mainwindow.cpp
+++ b/widgets/mainwindow.cpp
@@ -3689,12 +3689,12 @@ void MainWindow::callSandP2(int n)
   if(m_mode!="Q65" and m_ready2call[n]=="") return;
   QStringList w=m_ready2call[n].split(' ', SkipEmptyParts);
   if(m_mode=="Q65") {
-    double kHz=w[0].toDouble();
+    double kHz=w[1].toDouble();
     int nMHz=m_freqNominal/1000000;
     m_freqNominal=(nMHz*1000 + kHz)* 1000;
-    m_deCall=w[2];
-    m_deGrid=w[3];
-    m_txFirst=(w[4]=="0");
+    m_deCall=w[3];
+    m_deGrid=w[4];
+    m_txFirst=(w[5]=="0");
 //    ui->TxFreqSpinBox->setValue(1500);
   } else {
     m_deCall=w[0];
@@ -3706,7 +3706,7 @@ void MainWindow::callSandP2(int n)
   ui->dxCallEntry->setText(m_deCall);
   ui->dxGridEntry->setText(m_deGrid);
   if(m_mode=="Q65") {
-    genStdMsgs(w[1]);
+    genStdMsgs(w[2]);
   } else {
     genStdMsgs(w[3]);
   }
@@ -9238,13 +9238,15 @@ void MainWindow::readWidebandDecodes()
     QString line=QString::fromLatin1(qmapcom.result[m_fetched]);
     nhr=line.mid(0,2).toInt();
     nmin=line.mid(2,2).toInt();
-    double fsked=line.mid(4,9).toDouble();
-    QString msg=line.mid(27,-1);
+    double frx=line.mid(4,9).toDouble();
+    double fsked=line.mid(13,7).toDouble();
+    QString msg=line.mid(34,-1);
     int i1=msg.indexOf(" ");
     int i2=i1 +1 + msg.mid(i1+1,-1).indexOf(" ");
     QString dxcall=msg.mid(i1+1,i2-i1-1);
     QString w3=msg.mid(i2+1,-1);
-    nsnr=line.mid(22,3).toInt();
+    nsnr=line.mid(29,3).toInt();
+    m_EMECall[dxcall].frx=frx;
     m_EMECall[dxcall].fsked=fsked;
     m_EMECall[dxcall].nsnr=nsnr;
     m_EMECall[dxcall].t=60*nhr + nmin;
@@ -9289,10 +9291,10 @@ void MainWindow::readWidebandDecodes()
       dxcall=(i.key()+"     ").left(8);
       dxgrid4=(i->grid4+"... ").left(4);
       if(i->worked) {
-        t1=t1.asprintf("%5.1f  %+03d   %8s %4s %3d %3d\n",i->fsked,snr,dxcall.toLatin1().constData(),
+        t1=t1.asprintf("%7.3f %5.1f  %+03d   %8s %4s %3d %3d\n",i->frx,i->fsked,snr,dxcall.toLatin1().constData(),
                        dxgrid4.toLatin1().constData(),odd,age);
       } else {
-        t1=t1.asprintf("%5.1f  %+03d   %8s %4s %3d %3d*\n",i->fsked,snr,dxcall.toLatin1().constData(),
+        t1=t1.asprintf("%7.3f %5.1f  %+03d   %8s %4s %3d %3d*\n",i->frx,i->fsked,snr,dxcall.toLatin1().constData(),
                        dxgrid4.toLatin1().constData(),odd,age);
       }
       f[k]=i->fsked;
@@ -9308,7 +9310,7 @@ void MainWindow::readWidebandDecodes()
     indexx_(f,&kz,indx);
     for(int k=0; k<kz; k++) {
       int j=indx[k]-1;
-      t1=t1.asprintf("%2d.  ",k+1);
+      t1=t1.asprintf("%2d. ",k+1);
       t1+=list[j];
       m_ready2call[k]=list[j];
       t+=t1;
diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h
index ceb64abeb..091188bef 100644
--- a/widgets/mainwindow.h
+++ b/widgets/mainwindow.h
@@ -706,6 +706,7 @@ private:
   struct EMECall
   {
     QString grid4;
+    double frx;
     double fsked;
     qint32 nsnr;
     qint32 t;