1
0
Fork 0
mirror of https://github.com/gwm17/Specter.git synced 2024-11-22 18:28:52 -05:00

Added coinicdence window to the PhysicsStartEvent

This commit is contained in:
Gordon McCann 2022-01-04 11:47:28 -05:00
parent 120c8895dc
commit b7bd2da5ca
3 changed files with 8 additions and 5 deletions

View File

@ -35,7 +35,10 @@ namespace Navigator {
m_physThread->join(); m_physThread->join();
if(m_physThread != nullptr) if(m_physThread != nullptr)
{
delete m_physThread; delete m_physThread;
m_physThread = nullptr;
}
} }
void Application::OnEvent(Event& event) void Application::OnEvent(Event& event)
@ -68,6 +71,7 @@ namespace Navigator {
DestroyPhysThread(); DestroyPhysThread();
} }
PhysicsEventBuilder::Get().AttachDataSource(event.GetSourceLocation(), event.GetSourceType()); PhysicsEventBuilder::Get().AttachDataSource(event.GetSourceLocation(), event.GetSourceType());
PhysicsEventBuilder::Get().SetCoincidenceWindow(event.GetCoincidenceWindow());
if(PhysicsEventBuilder::Get().IsRunning()) if(PhysicsEventBuilder::Get().IsRunning())
{ {
NAV_INFO("Starting the event builder..."); NAV_INFO("Starting the event builder...");
@ -98,7 +102,7 @@ namespace Navigator {
void Application::Run() 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); OnEvent(junk);
while(m_runFlag) while(m_runFlag)
{ {

View File

@ -9,12 +9,13 @@ namespace Navigator {
class PhysicsStartEvent : public Event class PhysicsStartEvent : public Event
{ {
public: 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) m_sourceLocation(loc), m_sourceType(type)
{} {}
inline std::string GetSourceLocation() { return m_sourceLocation; } inline std::string GetSourceLocation() { return m_sourceLocation; }
inline DataSource::SourceType GetSourceType() { return m_sourceType; } inline DataSource::SourceType GetSourceType() { return m_sourceType; }
inline uint64_t GetCoincidenceWindow() { return m_coincidenceWindow; }
std::string ToString() const override std::string ToString() const override
{ {
@ -27,6 +28,7 @@ namespace Navigator {
private: private:
std::string m_sourceLocation; std::string m_sourceLocation;
DataSource::SourceType m_sourceType; DataSource::SourceType m_sourceType;
uint64_t m_coincidenceWindow;
}; };
class PhysicsStopEvent : public Event class PhysicsStopEvent : public Event

View File

@ -67,9 +67,6 @@ namespace Navigator {
CompassHit hit; CompassHit hit;
//temp
m_rawSort.SetCoincidenceWindow(2000000);
while(m_runFlag) while(m_runFlag)
{ {