From c72857aa764cc84ee8c63efb0ea7e1420d433e63 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sun, 3 Nov 2019 13:58:34 -0500 Subject: [PATCH] Memory JS8 --- main.cpp | 18 +++++++++--------- mainwindow.h | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index 3a95b66..4d8c7f9 100644 --- a/main.cpp +++ b/main.cpp @@ -95,8 +95,8 @@ int main(int argc, char *argv[]) Radio::register_types (); register_types (); - // Multiple instances communicate with jt9 via this - QSharedMemory mem_jt9; + // Multiple instances communicate with the decoder via this shared memory segment + QSharedMemory mem_js8; QApplication a(argc, argv); try @@ -294,21 +294,21 @@ int main(int argc, char *argv[]) // Create and initialize shared memory segment // Multiple instances: use rig_name as shared memory key - mem_jt9.setKey(a.applicationName ()); + mem_js8.setKey(a.applicationName ()); - if(!mem_jt9.attach()) { - std::cerr << QString("memory attach error: %1").arg(mem_jt9.error()).toLocal8Bit ().data () << std::endl; + if(!mem_js8.attach()) { + std::cerr << QString("memory attach error: %1").arg(mem_js8.error()).toLocal8Bit ().data () << std::endl; - if (!mem_jt9.create(sizeof(struct dec_data))) { + if (!mem_js8.create(sizeof(struct dec_data))) { splash.hide (); - std::cerr << QString("memory create error: %1").arg(mem_jt9.error()).toLocal8Bit ().data () << std::endl; + std::cerr << QString("memory create error: %1").arg(mem_js8.error()).toLocal8Bit ().data () << std::endl; MessageBox::critical_message (nullptr, a.translate ("main", "Shared memory error"), a.translate ("main", "Unable to create shared memory segment")); throw std::runtime_error {"Shared memory error"}; } } - memset(mem_jt9.data(),0,sizeof(struct dec_data)); //Zero all decoding params in shared memory + memset(mem_js8.data(),0,sizeof(struct dec_data)); //Zero all decoding params in shared memory unsigned downSampleFactor; { @@ -328,7 +328,7 @@ int main(int argc, char *argv[]) } // run the application UI - MainWindow w(temp_dir, multiple, &multi_settings, &mem_jt9, downSampleFactor, &splash); + MainWindow w(temp_dir, multiple, &multi_settings, &mem_js8, downSampleFactor, &splash); w.show(); //splash.raise (); QObject::connect (&a, SIGNAL (lastWindowClosed()), &a, SLOT (quit())); diff --git a/mainwindow.h b/mainwindow.h index 22d98ec..5a29ceb 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -877,6 +877,7 @@ private: QDateTime m_dateTimeLastTX; QSharedMemory *mem_js8; + LogBook m_logBook; QString m_QSOText; unsigned m_msAudioOutputBuffered;