From b7bd2da5ca12cdb42882f8ba73a6981fa0f06d38 Mon Sep 17 00:00:00 2001 From: Gordon McCann Date: Tue, 4 Jan 2022 11:47:28 -0500 Subject: [PATCH] Added coinicdence window to the PhysicsStartEvent --- Navigator/src/Navigator/Application.cpp | 6 +++++- Navigator/src/Navigator/Events/PhysicsEvent.h | 4 +++- Navigator/src/Navigator/Physics/PhysicsEventBuilder.cpp | 3 --- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Navigator/src/Navigator/Application.cpp b/Navigator/src/Navigator/Application.cpp index 684ffda..76ab60d 100644 --- a/Navigator/src/Navigator/Application.cpp +++ b/Navigator/src/Navigator/Application.cpp @@ -35,7 +35,10 @@ namespace Navigator { m_physThread->join(); if(m_physThread != nullptr) + { delete m_physThread; + m_physThread = nullptr; + } } void Application::OnEvent(Event& event) @@ -68,6 +71,7 @@ namespace Navigator { DestroyPhysThread(); } PhysicsEventBuilder::Get().AttachDataSource(event.GetSourceLocation(), event.GetSourceType()); + PhysicsEventBuilder::Get().SetCoincidenceWindow(event.GetCoincidenceWindow()); if(PhysicsEventBuilder::Get().IsRunning()) { NAV_INFO("Starting the event builder..."); @@ -98,7 +102,7 @@ namespace Navigator { void Application::Run() { - PhysicsStartEvent junk("/media/gordon/GordonData/gwm17/NavTests/data/", DataSource::SourceType::CompassOffline); + PhysicsStartEvent junk("/media/gordon/GordonData/gwm17/NavTests/data/", DataSource::SourceType::CompassOffline, 2000000); OnEvent(junk); while(m_runFlag) { diff --git a/Navigator/src/Navigator/Events/PhysicsEvent.h b/Navigator/src/Navigator/Events/PhysicsEvent.h index 64a839c..cb58512 100644 --- a/Navigator/src/Navigator/Events/PhysicsEvent.h +++ b/Navigator/src/Navigator/Events/PhysicsEvent.h @@ -9,12 +9,13 @@ namespace Navigator { class PhysicsStartEvent : public Event { public: - PhysicsStartEvent(const std::string& loc, DataSource::SourceType type) : + PhysicsStartEvent(const std::string& loc, DataSource::SourceType type, uint64_t window) : m_sourceLocation(loc), m_sourceType(type) {} inline std::string GetSourceLocation() { return m_sourceLocation; } inline DataSource::SourceType GetSourceType() { return m_sourceType; } + inline uint64_t GetCoincidenceWindow() { return m_coincidenceWindow; } std::string ToString() const override { @@ -27,6 +28,7 @@ namespace Navigator { private: std::string m_sourceLocation; DataSource::SourceType m_sourceType; + uint64_t m_coincidenceWindow; }; class PhysicsStopEvent : public Event diff --git a/Navigator/src/Navigator/Physics/PhysicsEventBuilder.cpp b/Navigator/src/Navigator/Physics/PhysicsEventBuilder.cpp index 912e554..9b828fb 100644 --- a/Navigator/src/Navigator/Physics/PhysicsEventBuilder.cpp +++ b/Navigator/src/Navigator/Physics/PhysicsEventBuilder.cpp @@ -67,9 +67,6 @@ namespace Navigator { CompassHit hit; - - //temp - m_rawSort.SetCoincidenceWindow(2000000); while(m_runFlag) {