Skip to content

Commit

Permalink
apps/radar/Lucid - making Lucid and MetRecord objects QObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dixon committed Jan 1, 2025
1 parent 143f4ff commit 351a82a
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 2 deletions.
145 changes: 143 additions & 2 deletions codebase/apps/radar/src/Lucid/Makefile.qmake
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ DIST = /usr/lib64/qt6/mkspecs/features/spec_pre.prf \
/usr/lib64/qt6/mkspecs/features/qt_config.prf \
/usr/lib64/qt6/mkspecs/linux-g++/qmake.conf \
/usr/lib64/qt6/mkspecs/features/spec_post.prf \
.qmake.stash \
/usr/lib64/qt6/mkspecs/features/exclusive_builds.prf \
/usr/lib64/qt6/mkspecs/features/toolchain.prf \
/usr/lib64/qt6/mkspecs/features/default_pre.prf \
Expand Down Expand Up @@ -692,6 +693,7 @@ Makefile.qmake: qmake.pro /usr/lib64/qt6/mkspecs/linux-g++/qmake.conf /usr/lib64
/usr/lib64/qt6/mkspecs/features/qt_config.prf \
/usr/lib64/qt6/mkspecs/linux-g++/qmake.conf \
/usr/lib64/qt6/mkspecs/features/spec_post.prf \
.qmake.stash \
/usr/lib64/qt6/mkspecs/features/exclusive_builds.prf \
/usr/lib64/qt6/mkspecs/features/toolchain.prf \
/usr/lib64/qt6/mkspecs/features/default_pre.prf \
Expand Down Expand Up @@ -824,6 +826,7 @@ Makefile.qmake: qmake.pro /usr/lib64/qt6/mkspecs/linux-g++/qmake.conf /usr/lib64
/usr/lib64/qt6/mkspecs/features/qt_config.prf:
/usr/lib64/qt6/mkspecs/linux-g++/qmake.conf:
/usr/lib64/qt6/mkspecs/features/spec_post.prf:
.qmake.stash:
/usr/lib64/qt6/mkspecs/features/exclusive_builds.prf:
/usr/lib64/qt6/mkspecs/features/toolchain.prf:
/usr/lib64/qt6/mkspecs/features/default_pre.prf:
Expand Down Expand Up @@ -1422,8 +1425,146 @@ moc_ZoomMenuItem.cpp: ZoomMenuItem.hh \

compiler_moc_objc_header_make_all:
compiler_moc_objc_header_clean:
compiler_moc_source_make_all:
compiler_moc_source_make_all: MetRecord.moc
compiler_moc_source_clean:
-$(DEL_FILE) MetRecord.moc
MetRecord.moc: MetRecord.cc \
$(HOME)/lrose/include/qtplot/ColorMap.hh \
cidd.h \
$(HOME)/lrose/include/dataport/port_types.h \
$(HOME)/lrose/include/dataport/bigend.h \
$(HOME)/lrose/include/dataport/swap.h \
$(HOME)/lrose/include/toolsa/mem.h \
$(HOME)/lrose/include/toolsa/membuf.h \
$(HOME)/lrose/include/toolsa/globals.h \
$(HOME)/lrose/include/toolsa/os_config.h \
$(HOME)/lrose/include/toolsa/str.h \
$(HOME)/lrose/include/toolsa/ansi.h \
$(HOME)/lrose/include/toolsa/pmu.h \
$(HOME)/lrose/include/toolsa/procmap.h \
$(HOME)/lrose/include/toolsa/http.h \
$(HOME)/lrose/include/toolsa/HttpURL.hh \
$(HOME)/lrose/include/toolsa/URL.hh \
$(HOME)/lrose/include/toolsa/pjg.h \
$(HOME)/lrose/include/toolsa/pjg_types.h \
$(HOME)/lrose/include/toolsa/pjg_flat.h \
$(HOME)/lrose/include/toolsa/Path.hh \
$(HOME)/lrose/include/toolsa/DateTime.hh \
$(HOME)/lrose/include/toolsa/DeltaTime.hh \
$(HOME)/lrose/include/toolsa/udatetime.h \
$(HOME)/lrose/include/toolsa/sockutil.h \
$(HOME)/lrose/include/toolsa/servmap.h \
$(HOME)/lrose/include/toolsa/utim.h \
$(HOME)/lrose/include/toolsa/umisc.h \
$(HOME)/lrose/include/toolsa/port.h \
$(HOME)/lrose/include/toolsa/ushmem.h \
$(HOME)/lrose/include/toolsa/uusleep.h \
$(HOME)/lrose/include/toolsa/ucopyright.h \
$(HOME)/lrose/include/toolsa/xdru.h \
$(HOME)/lrose/include/Spdb/StationLoc.hh \
$(HOME)/lrose/include/Mdv/Mdvx_typedefs.hh \
$(HOME)/lrose/include/Mdv/Mdvx_typedefs_32.hh \
$(HOME)/lrose/include/Mdv/Mdvx_typedefs_64.hh \
$(HOME)/lrose/include/Mdv/DsMdvx.hh \
$(HOME)/lrose/include/Mdv/Mdvx.hh \
$(HOME)/lrose/include/toolsa/TaFile.hh \
$(HOME)/lrose/include/toolsa/file_io.h \
$(HOME)/lrose/include/toolsa/heartbeat.h \
$(HOME)/lrose/include/toolsa/MemBuf.hh \
$(HOME)/lrose/include/Mdv/MdvxTimeList.hh \
$(HOME)/lrose/include/Mdv/Mdvx_enums.hh \
$(HOME)/lrose/include/Mdv/Mdvx_constants.hh \
$(HOME)/lrose/include/Mdv/Mdvx_read.hh \
$(HOME)/lrose/include/Mdv/Mdvx_write.hh \
$(HOME)/lrose/include/Mdv/Mdvx_timelist.hh \
$(HOME)/lrose/include/Mdv/Mdvx_print.hh \
$(HOME)/lrose/include/Mdv/Mdvx_BE.hh \
$(HOME)/lrose/include/Mdv/Mdvx_xml.hh \
$(HOME)/lrose/include/Mdv/Mdvx_ncf.hh \
$(HOME)/lrose/include/Mdv/Mdvx_vsect.hh \
$(HOME)/lrose/include/didss/DsURL.hh \
$(HOME)/lrose/include/toolsa/ThreadSocket.hh \
$(HOME)/lrose/include/toolsa/Socket.hh \
$(HOME)/lrose/include/toolsa/SockUtil.hh \
$(HOME)/lrose/include/Mdv/MdvxField.hh \
$(HOME)/lrose/include/Mdv/MdvxVsectLut.hh \
$(HOME)/lrose/include/Mdv/MdvxProj.hh \
$(HOME)/lrose/include/euclid/PjgMath.hh \
$(HOME)/lrose/include/euclid/Pjg.hh \
$(HOME)/lrose/include/euclid/PjgTypes.hh \
$(HOME)/lrose/include/euclid/sincos.h \
$(HOME)/lrose/include/euclid/PjgAzimEquidistMath.hh \
$(HOME)/lrose/include/euclid/PjgPolarRadarMath.hh \
$(HOME)/lrose/include/euclid/PjgAlbersMath.hh \
$(HOME)/lrose/include/euclid/PjgLambertAzimMath.hh \
$(HOME)/lrose/include/euclid/PjgLambertConfMath.hh \
$(HOME)/lrose/include/euclid/PjgLatlonMath.hh \
$(HOME)/lrose/include/euclid/PjgPolarStereoMath.hh \
$(HOME)/lrose/include/euclid/PjgObliqueStereoMath.hh \
$(HOME)/lrose/include/euclid/PjgMercatorMath.hh \
$(HOME)/lrose/include/euclid/PjgTransMercatorMath.hh \
$(HOME)/lrose/include/euclid/PjgVertPerspMath.hh \
$(HOME)/lrose/include/Mdv/MdvxRemapLut.hh \
$(HOME)/lrose/include/Mdv/DsMdvxThreaded.hh \
$(HOME)/lrose/include/Fmq/RemoteUIQueue.hh \
$(HOME)/lrose/include/Fmq/DsFmq.hh \
$(HOME)/lrose/include/Fmq/Fmq.hh \
$(HOME)/lrose/include/toolsa/compress.h \
$(HOME)/lrose/include/Fmq/FmqDeviceFile.hh \
$(HOME)/lrose/include/Fmq/FmqDevice.hh \
$(HOME)/lrose/include/Fmq/FmqDeviceShmem.hh \
$(HOME)/lrose/include/Fmq/DsFmqMsg.hh \
$(HOME)/lrose/include/dsserver/DsServerMsg.hh \
$(HOME)/lrose/include/didss/DsMessage.hh \
$(HOME)/lrose/include/didss/ds_message.h \
Params.hh \
$(HOME)/lrose/include/tdrp/tdrp.h \
$(HOME)/lrose/include/tdrp/tdrp_p.h \
$(HOME)/lrose/include/tdrp/tdrpbuf.h \
$(HOME)/lrose/include/tdrp/tdrp_obsolete.h \
$(HOME)/lrose/include/rapformats/coord_export.h \
cidd_macros.h \
cidd_structs.h \
cidd_colorscales.h \
MetRecord.hh \
ZoomBox.hh \
WayPts.hh \
cidd_data_io.h \
Product.hh \
Csyprod_P.hh \
$(HOME)/lrose/include/Spdb/DsSpdbThreaded.hh \
$(HOME)/lrose/include/Spdb/DsSpdb.hh \
$(HOME)/lrose/include/Spdb/Spdb.hh \
$(HOME)/lrose/include/Spdb/Product_defines.hh \
$(HOME)/lrose/include/Spdb/Spdb_typedefs.hh \
$(HOME)/lrose/include/Spdb/DsSpdbMsg.hh \
SymprodRender.hh \
$(HOME)/lrose/include/Spdb/Symprod.hh \
$(HOME)/lrose/include/Spdb/Symprod_typedefs.hh \
RenderContext.hh \
cidd_winds.h \
cidd_contours.h \
cidd_movies.h \
cidd_maps.h \
cidd_products.h \
cidd_layers.h \
Croutes_P.hh \
cidd_windows.h \
cidd_legend.h \
cidd_funcs.h \
ProductMgr.hh \
$(HOME)/lrose/include/dsserver/DmapAccess.hh \
$(HOME)/lrose/include/dsserver/DmapMessage.hh \
SymprodRenderObj.hh \
$(HOME)/lrose/include/Spdb/SymprodObj.hh \
$(HOME)/lrose/include/rapformats/station_reports.h \
$(HOME)/lrose/include/rapformats/metar_decode.h \
$(HOME)/lrose/include/rapformats/metar.h \
$(HOME)/lrose/include/rapformats/nws_oso_local.h \
moc_predefs.h \
/usr/lib64/qt6/libexec/moc
/usr/lib64/qt6/libexec/moc $(DEFINES) --include /home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/moc_predefs.h -I/usr/lib64/qt6/mkspecs/linux-g++ -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid -I/usr/include/qt6/QtCore -I/usr/include/qt6 -I/usr/lib64/qt6/mkspecs/linux-g++ -I/usr/include/qt6/QtWidgets -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/-DQT_WIDGETS_LIB -I/usr/include/qt6/QtGui -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/-DQT_GUI_LIB -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtQml -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/-DQT_QML_LIB -I/usr/include/qt6/QtQmlIntegration -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/-DQT_QMLINTEGRATION_LIB -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/-DQT_NETWORK_LIB -I/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/-DQT_CORE_LIB -I/usr/local/include -I/usr/local/lrose/include -I'/home/mdtest/git/lrose-core/codebase/apps/radar/src/Lucid/$(HOME)/lrose/include' -I/home/mdtest/lrose/include -I/usr/include/c++/11 -I/usr/include/c++/11/x86_64-redhat-linux -I/usr/include/c++/11/backward -I/usr/lib/gcc/x86_64-redhat-linux/11/include -I/usr/local/include -I/usr/include MetRecord.cc -o MetRecord.moc

compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
Expand All @@ -1432,7 +1573,7 @@ compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_rcc_clean compiler_moc_predefs_clean compiler_moc_header_clean
compiler_clean: compiler_rcc_clean compiler_moc_predefs_clean compiler_moc_header_clean compiler_moc_source_clean

####### Compile

Expand Down
75 changes: 75 additions & 0 deletions codebase/apps/radar/src/Lucid/MetRecord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -884,3 +884,78 @@ void MetRecord::_adjustBoundingBox(double lat, double lon,
}
}

#ifdef JUNK

#include <QCoreApplication>
#include <QThread>
#include <QObject>
#include <QDebug>

// Worker class definition
class Worker : public QObject {
Q_OBJECT

public:
Worker(QObject* parentObject, QObject* parent = nullptr)
: QObject(parent), m_parentObject(parentObject) {}

public slots:
void doWork() {
qDebug() << "Worker thread started. Parent object:" << m_parentObject;
// Simulate some work
for (int i = 0; i < 5; ++i) {
qDebug() << "Working... Step" << i + 1;
QThread::sleep(1); // Simulate time-consuming work
}
qDebug() << "Work completed!";
emit workFinished();
}

signals:
void workFinished();

private:
QObject* m_parentObject;
};

// Main class definition
class MainClass : public QObject {
Q_OBJECT

public:
MainClass(QObject* parent = nullptr) : QObject(parent) {}

void startWorker() {
Worker* worker = new Worker(this); // Pass the current object as reference
QThread* thread = new QThread;

worker->moveToThread(thread);

// Connect signals and slots
connect(thread, &QThread::started, worker, &Worker::doWork);
connect(worker, &Worker::workFinished, this, &MainClass::onWorkFinished);
connect(worker, &Worker::workFinished, thread, &QThread::quit);
connect(thread, &QThread::finished, worker, &Worker::deleteLater);
connect(thread, &QThread::finished, thread, &QThread::deleteLater);

thread->start();
}

public slots:
void onWorkFinished() {
qDebug() << "Work finished in worker thread!";
}
};

// Main function
int main(int argc, char* argv[]) {
QCoreApplication app(argc, argv);

MainClass mainObj;
mainObj.startWorker();

return app.exec();
}

#include "main.moc"
#endif

0 comments on commit 351a82a

Please sign in to comment.