More Q65W -> QMAP. I think this may be everything?

This commit is contained in:
Joe Taylor 2023-01-25 10:58:22 -05:00
parent 6979a56d5d
commit fb573ef407
2 changed files with 39 additions and 30 deletions

View File

@ -353,11 +353,20 @@ p, li { white-space: pre-wrap; }
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labFreq"> <widget class="QLabel" name="labFreq">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>35</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>16</pointsize> <pointsize>16</pointsize>
</font> </font>
</property> </property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="text"> <property name="text">
<string>1296.080</string> <string>1296.080</string>
</property> </property>

View File

@ -211,16 +211,16 @@ bool m_displayBand = false;
bool no_a7_decodes = false; bool no_a7_decodes = false;
bool keep_frequency = false; bool keep_frequency = false;
QSharedMemory mem_q65w("mem_q65w"); //Memory segment to be shared (optionally) with Q65W QSharedMemory mem_qmap("mem_qmap"); //Memory segment to be shared (optionally) with QMAP
struct { struct {
int ndecodes; //Number of Q65W decodes available (so far) int ndecodes; //Number of QMAP decodes available (so far)
int ncand; //Number of Q65W candidates considered for decoding int ncand; //Number of QMAP candidates considered for decoding
int nQDecoderDone; //Q65W decoder is finished (0 or 1) int nQDecoderDone; //QMAP decoder is finished (0 or 1)
int nWDecoderBusy; //WSJT-X decoder is busy (0 or 1) int nWDecoderBusy; //WSJT-X decoder is busy (0 or 1)
int nWTransmitting; //WSJT-X is transmitting (0 or 1) int nWTransmitting; //WSJT-X is transmitting (0 or 1)
char result[50][60]; //Decodes as character*60 arrays char result[50][60]; //Decodes as character*60 arrays
} q65wcom; } qmapcom;
int* ipc_q65w; int* ipc_qmap;
namespace namespace
{ {
@ -463,18 +463,18 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_optimizingProgress.setAutoReset (false); m_optimizingProgress.setAutoReset (false);
m_optimizingProgress.setMinimumDuration (15000); // only show after 15s delay m_optimizingProgress.setMinimumDuration (15000); // only show after 15s delay
//Attach or create a memory segment to be shared with Q65W. //Attach or create a memory segment to be shared with QMAP.
int memSize=4096; int memSize=4096;
if(!mem_q65w.attach()) { if(!mem_qmap.attach()) {
if(!mem_q65w.create(memSize)) { if(!mem_qmap.create(memSize)) {
MessageBox::information_message (this, MessageBox::information_message (this,
"Unable to create shared memory segment mem_q65w."); "Unable to create shared memory segment mem_qmap.");
} }
} }
ipc_q65w = (int*)mem_q65w.data(); ipc_qmap = (int*)mem_qmap.data();
mem_q65w.lock(); mem_qmap.lock();
memset(ipc_q65w,0,memSize); //Zero all of Q65W shared memory memset(ipc_qmap,0,memSize); //Zero all of QMAP shared memory
mem_q65w.unlock(); mem_qmap.unlock();
// Closedown. // Closedown.
connect (ui->actionExit, &QAction::triggered, this, &QMainWindow::close); connect (ui->actionExit, &QAction::triggered, this, &QMainWindow::close);
@ -1143,7 +1143,7 @@ MainWindow::~MainWindow()
m_audioThread.quit (); m_audioThread.quit ();
m_audioThread.wait (); m_audioThread.wait ();
remove_child_from_event_filter (this); remove_child_from_event_filter (this);
memset(ipc_q65w,0,4096); //Zero all of Q65W shared memory memset(ipc_qmap,0,4096); //Zero all of QMAP shared memory
} }
//-------------------------------------------------------- writeSettings() //-------------------------------------------------------- writeSettings()
@ -4828,24 +4828,24 @@ void MainWindow::guiUpdate()
if(m_mode=="Echo" and !m_monitoring and !m_auto and !m_diskData) m_echoRunning=false; if(m_mode=="Echo" and !m_monitoring and !m_auto and !m_diskData) m_echoRunning=false;
if(m_mode=="Q65") { if(m_mode=="Q65") {
mem_q65w.lock(); mem_qmap.lock();
int n=0; int n=0;
if(m_decoderBusy) n=1; if(m_decoderBusy) n=1;
ipc_q65w[3]=n; ipc_qmap[3]=n;
n=0; n=0;
if(m_transmitting) n=1; if(m_transmitting) n=1;
ipc_q65w[4]=n; ipc_qmap[4]=n;
if(ipc_q65w[0] > m_fetched) { //ndecodes if(ipc_qmap[0] > m_fetched) { //ndecodes
memcpy(&q65wcom, (char*)ipc_q65w, sizeof(q65wcom)); //Fetch the new decode(s) memcpy(&qmapcom, (char*)ipc_qmap, sizeof(qmapcom)); //Fetch the new decode(s)
readWidebandDecodes(); readWidebandDecodes();
} }
mem_q65w.unlock(); mem_qmap.unlock();
} }
//Once per second (onesec) //Once per second (onesec)
if(nsec != m_sec0) { if(nsec != m_sec0) {
// qDebug() << "AAA" << nsec << ipc_q65w[0] << ipc_q65w[1] << ipc_q65w[2] // qDebug() << "AAA" << nsec << ipc_qmap[0] << ipc_qmap[1] << ipc_qmap[2]
// << ipc_q65w[3] << ipc_q65w[4] << m_fetched; // << ipc_qmap[3] << ipc_qmap[4] << m_fetched;
if(m_mode=="FST4") chk_FST4_freq_range(); if(m_mode=="FST4") chk_FST4_freq_range();
m_currentBand=m_config.bands()->find(m_freqNominal); m_currentBand=m_config.bands()->find(m_freqNominal);
@ -9234,8 +9234,8 @@ void MainWindow::readWidebandDecodes()
int nhr=0; int nhr=0;
int nmin=0; int nmin=0;
int nsnr=0; int nsnr=0;
while(m_fetched < q65wcom.ndecodes) { while(m_fetched < qmapcom.ndecodes) {
QString line=QString::fromLatin1(q65wcom.result[m_fetched]); QString line=QString::fromLatin1(qmapcom.result[m_fetched]);
nhr=line.mid(0,2).toInt(); nhr=line.mid(0,2).toInt();
nmin=line.mid(2,2).toInt(); nmin=line.mid(2,2).toInt();
double fsked=line.mid(4,9).toDouble(); double fsked=line.mid(4,9).toDouble();
@ -9254,7 +9254,7 @@ void MainWindow::readWidebandDecodes()
Frequency frequency = (m_freqNominal/1000000) * 1000000 + int(fsked*1000.0); Frequency frequency = (m_freqNominal/1000000) * 1000000 + int(fsked*1000.0);
bool bCQ=line.contains(" CQ "); bool bCQ=line.contains(" CQ ");
bool bFromDisk=q65wcom.nQDecoderDone==2; bool bFromDisk=qmapcom.nQDecoderDone==2;
if(!bFromDisk and (m_EMECall[dxcall].grid4.contains(grid_regexp) or bCQ)) { if(!bFromDisk and (m_EMECall[dxcall].grid4.contains(grid_regexp) or bCQ)) {
qDebug() << "To PSKreporter:" << dxcall << m_EMECall[dxcall].grid4 << frequency << m_mode << nsnr; qDebug() << "To PSKreporter:" << dxcall << m_EMECall[dxcall].grid4 << frequency << m_mode << nsnr;
if (!m_psk_Reporter.addRemoteStation (dxcall, m_EMECall[dxcall].grid4, frequency, m_mode, nsnr)) { if (!m_psk_Reporter.addRemoteStation (dxcall, m_EMECall[dxcall].grid4, frequency, m_mode, nsnr)) {
@ -9267,7 +9267,7 @@ void MainWindow::readWidebandDecodes()
m_psk_Reporter.sendReport(); // Upload any queued spots m_psk_Reporter.sendReport(); // Upload any queued spots
} }
// Update "m_wEMECall" by reading q65w_decodes.txt // Update "m_wEMECall" by reading qmap_decodes.txt
QMap<QString,EMECall>::iterator i; QMap<QString,EMECall>::iterator i;
QString t=""; QString t="";
QString t1; QString t1;
@ -9320,10 +9320,10 @@ void MainWindow::readWidebandDecodes()
m_ActiveStationsWidget->displayRecentStations(m_mode,t); m_ActiveStationsWidget->displayRecentStations(m_mode,t);
m_ActiveStationsWidget->setClickOK(true); m_ActiveStationsWidget->setClickOK(true);
} }
if(ipc_q65w[2]==1) { if(ipc_qmap[2]==1) {
m_fetched=0; m_fetched=0;
ipc_q65w[0]=0; ipc_qmap[0]=0;
ipc_q65w[2]=0; ipc_qmap[2]=0;
} }
} }