diff --git a/Specter/src/Platform/OpenGL/OpenGLWindow.h b/Specter/src/Platform/OpenGL/OpenGLWindow.h index 831d664..de978eb 100644 --- a/Specter/src/Platform/OpenGL/OpenGLWindow.h +++ b/Specter/src/Platform/OpenGL/OpenGLWindow.h @@ -25,14 +25,14 @@ namespace Specter { void OnUpdate() override; - inline void SetEventCallback(const EventCallbackFunc& function) override { m_data.event_callback_func = function; } - inline unsigned int GetWidth() const override { return m_data.width; } - inline unsigned int GetHeight() const override { return m_data.height; } - inline std::string GetName() const override { return m_data.name; } + void SetEventCallback(const EventCallbackFunc& function) override { m_data.event_callback_func = function; } + unsigned int GetWidth() const override { return m_data.width; } + unsigned int GetHeight() const override { return m_data.height; } + std::string GetName() const override { return m_data.name; } void SetVSync(bool enabled) override; bool IsVSync() const override; - inline virtual void* GetNativeWindow() const override { return m_window; } + virtual void* GetNativeWindow() const override { return m_window; } private: virtual void Init(const WindowProperties& props); virtual void Shutdown(); diff --git a/Specter/src/Specter/Core/Application.h b/Specter/src/Specter/Core/Application.h index d117fd0..729507b 100644 --- a/Specter/src/Specter/Core/Application.h +++ b/Specter/src/Specter/Core/Application.h @@ -38,23 +38,22 @@ namespace Specter { virtual ~Application(); void Run(); - inline void Close() { m_runFlag = false; } + void Close() { m_runFlag = false; } void OnEvent(Event& event); void PushLayer(Layer* layer); - inline void PushAnalysisStage(AnalysisStage* stage) { m_physicsLayer->PushStage(stage); } + void PushAnalysisStage(AnalysisStage* stage) { m_physicsLayer->PushStage(stage); } void PushOverlay(Layer* layer); - inline static Application& Get() { return *s_instance; } + static Application& Get() { return *s_instance; } - inline Window& GetWindow() { return *m_window; } + Window& GetWindow() { return *m_window; } - inline const ApplicationArgs& GetArgs() { return m_args; } + const ApplicationArgs& GetArgs() { return m_args; } private: bool OnWindowCloseEvent(WindowCloseEvent& event); - bool OnManagerBindEvent(const std::shared_ptr& manager); ApplicationArgs m_args; @@ -75,8 +74,7 @@ namespace Specter { /* - This function is left to be defined by the user. In principle we don't need to do this, as the Specter library doesn't handle creation of the application, - but I like it and might be useful for changing to a system with a pre-defined entry point. + This function must be defined by the user. It is called in by the entry point function in EntryPoint.h */ Application* CreateApplication(const ApplicationArgs& args); } diff --git a/Specter/src/Specter/Core/Cut.h b/Specter/src/Specter/Core/Cut.h index 70f9919..efce8df 100644 --- a/Specter/src/Specter/Core/Cut.h +++ b/Specter/src/Specter/Core/Cut.h @@ -64,13 +64,13 @@ namespace Specter { virtual std::vector GetXValues() const = 0; virtual std::vector GetYValues() const = 0; - inline const bool IsValid() const { return m_isValid; } - inline void ResetValidity() { m_isValid = false; } - inline CutType GetType() const { return m_params.type; } - inline const std::string& GetName() const { return m_params.name; } - inline const std::string& GetXParameter() const { return m_params.x_par; } - inline const std::string& GetYParameter() const { return m_params.y_par; } - inline const CutArgs& GetCutArgs() const { return m_params; } + const bool IsValid() const { return m_isValid; } + void ResetValidity() { m_isValid = false; } + CutType GetType() const { return m_params.type; } + const std::string& GetName() const { return m_params.name; } + const std::string& GetXParameter() const { return m_params.x_par; } + const std::string& GetYParameter() const { return m_params.y_par; } + const CutArgs& GetCutArgs() const { return m_params; } protected: CutArgs m_params; bool m_isValid; @@ -115,7 +115,7 @@ namespace Specter { virtual std::vector GetXValues() const override { return std::vector({ m_minVal, m_maxVal }); } virtual std::vector GetYValues() const override { return std::vector(); } - inline const std::vector& GetSubHistograms() const { return m_subhistos; } + const std::vector& GetSubHistograms() const { return m_subhistos; } private: double m_minVal, m_maxVal; diff --git a/Specter/src/Specter/Core/Histogram.cpp b/Specter/src/Specter/Core/Histogram.cpp index 488abe5..137ee40 100644 --- a/Specter/src/Specter/Core/Histogram.cpp +++ b/Specter/src/Specter/Core/Histogram.cpp @@ -8,9 +8,7 @@ HistogramArgs are the underlying data which define a histogram. This is grouped in a struct to easily pass these around for use in contexts like the Editor. Every histogram has a set of histogram parameters. - Histogram is the base class of all histograms. Should not be used in practice. Every histogram contains functions to query what type of underlying histogram it is. If one has - the Histogram object, Is1D() or Is2D() can be called. If one only has the HistogramArgs, the values of x_par and y_par can be inspected. In particular, a 1D histogram will have - y_par set to "None", while a 2D histogram should have a valid parameter name for y_par. + Histogram is the base class of all histograms. Should not be used in practice. In the histogram args is an enum SpectrumType which indicates if it is a 1D, 2D, or Summary spectrum. Histogram1D is a one dimensional (single parameter) histogram. Histogram2D is a two dimensional (two parameter) histogram. The only real difference between these in practice, other than the obvious two vs. one parameter thing, is that a Histogram2D contains methods to set the z-axis range (color scale) which ImPlot does not provide intrinsic access to from the plot itself. @@ -19,6 +17,8 @@ StatResults is a struct containing statistical information about a region of a histogram. + A HistogramSummary is a 2D display of many 1D histograms. That is, a summary back-links to other Histogram1D's already created. It is important to note that the linked sub-histograms should all have the same binning. + GWM -- Feb 2022 */ #include "Histogram.h" diff --git a/Specter/src/Specter/Core/Histogram.h b/Specter/src/Specter/Core/Histogram.h index fe5cb51..ef96722 100644 --- a/Specter/src/Specter/Core/Histogram.h +++ b/Specter/src/Specter/Core/Histogram.h @@ -8,9 +8,7 @@ HistogramArgs are the underlying data which define a histogram. This is grouped in a struct to easily pass these around for use in contexts like the Editor. Every histogram has a set of histogram parameters. - Histogram is the base class of all histograms. Should not be used in practice. Every histogram contains functions to query what type of underlying histogram it is. If one has - the Histogram object, Is1D() or Is2D() can be called. If one only has the HistogramArgs, the values of x_par and y_par can be inspected. In particular, a 1D histogram will have - y_par set to "None", while a 2D histogram should have a valid parameter name for y_par. + Histogram is the base class of all histograms. Should not be used in practice. In the histogram args is an enum SpectrumType which indicates if it is a 1D, 2D, or Summary spectrum. Histogram1D is a one dimensional (single parameter) histogram. Histogram2D is a two dimensional (two parameter) histogram. The only real difference between these in practice, other than the obvious two vs. one parameter thing, is that a Histogram2D contains methods to set the z-axis range (color scale) which ImPlot does not provide intrinsic access to from the plot itself. @@ -19,6 +17,8 @@ StatResults is a struct containing statistical information about a region of a histogram. + A HistogramSummary is a 2D display of many 1D histograms. That is, a summary back-links to other Histogram1D's already created. It is important to note that the linked sub-histograms should all have the same binning. + GWM -- Feb 2022 */ #ifndef HISTOGRAM_H @@ -93,15 +93,16 @@ namespace Specter { virtual void Draw() {} virtual void ClearData() {} virtual StatResults AnalyzeRegion(double x_min, double x_max, double y_min = 0.0, double y_max = 0.0) { return StatResults(); } - inline virtual float* GetColorScaleRange() { return nullptr; } - inline virtual std::vector GetBinData() { return std::vector(); } - inline HistogramArgs& GetParameters() { return m_params; } - inline SpectrumType GetType() { return m_params.type; } - inline const std::string& GetXParam() const { return m_params.x_par; }; - inline const std::string& GetYParam() const { return m_params.y_par; }; - inline const std::string& GetName() const { return m_params.name; } - inline void AddCutToBeDrawn(const std::string& name) { m_params.cutsDrawnUpon.push_back(name); } - inline void AddCutToBeApplied(const std::string& name) { m_params.cutsAppliedTo.push_back(name); } + virtual float* GetColorScaleRange() { return nullptr; } + virtual std::vector GetBinData() { return std::vector(); } + + HistogramArgs& GetParameters() { return m_params; } + SpectrumType GetType() { return m_params.type; } + const std::string& GetXParam() const { return m_params.x_par; }; + const std::string& GetYParam() const { return m_params.y_par; }; + const std::string& GetName() const { return m_params.name; } + void AddCutToBeDrawn(const std::string& name) { m_params.cutsDrawnUpon.push_back(name); } + void AddCutToBeApplied(const std::string& name) { m_params.cutsAppliedTo.push_back(name); } protected: HistogramArgs m_params; @@ -117,7 +118,7 @@ namespace Specter { virtual void Draw() override; virtual void ClearData() override; virtual StatResults AnalyzeRegion(double x_min, double x_max, double y_min = 0.0, double y_max = 0.0) override; - inline virtual std::vector GetBinData() override { return m_binCounts; } + virtual std::vector GetBinData() override { return m_binCounts; } private: void InitBins(); @@ -137,9 +138,9 @@ namespace Specter { virtual void Draw() override; virtual void ClearData() override; virtual StatResults AnalyzeRegion(double x_min, double x_max, double y_min = 0.0, double y_max = 0.0) override; - inline virtual std::vector GetBinData() override { return m_binCounts; } + virtual std::vector GetBinData() override { return m_binCounts; } - inline virtual float* GetColorScaleRange() override { return m_colorScaleRange; } + virtual float* GetColorScaleRange() override { return m_colorScaleRange; } private: void InitBins(); @@ -158,14 +159,14 @@ namespace Specter { HistogramSummary(const HistogramArgs& params, const std::vector& subhistos); ~HistogramSummary(); - inline const std::vector& GetSubHistograms() const { return m_subhistos; } + const std::vector& GetSubHistograms() const { return m_subhistos; } virtual void FillData(double x, double y) override; virtual void ClearData() override; virtual void Draw() override; - inline virtual float* GetColorScaleRange() override { return m_colorScaleRange; } + virtual float* GetColorScaleRange() override { return m_colorScaleRange; } virtual StatResults AnalyzeRegion(double x_min, double x_max, double y_min = 0.0, double y_max = 0.0) override; - inline virtual std::vector GetBinData() override { return m_binCounts; } + virtual std::vector GetBinData() override { return m_binCounts; } private: void InitBins(); diff --git a/Specter/src/Specter/Core/Layer.h b/Specter/src/Specter/Core/Layer.h index 89ef0a1..be4c3e2 100644 --- a/Specter/src/Specter/Core/Layer.h +++ b/Specter/src/Specter/Core/Layer.h @@ -25,7 +25,7 @@ namespace Specter { virtual void OnUpdate(Timestep& step) {} virtual void OnEvent(Event& event) {} - inline const std::string& GetName() { return m_name; } + const std::string& GetName() { return m_name; } private: std::string m_name; diff --git a/Specter/src/Specter/Core/Logger.h b/Specter/src/Specter/Core/Logger.h index 52fbfd0..c99aeec 100644 --- a/Specter/src/Specter/Core/Logger.h +++ b/Specter/src/Specter/Core/Logger.h @@ -23,7 +23,7 @@ namespace Specter { public: static void Init(); - inline static std::shared_ptr GetLogger() { return s_logger; } + static std::shared_ptr GetLogger() { return s_logger; } private: static std::shared_ptr s_logger; diff --git a/Specter/src/Specter/Core/Parameter.cpp b/Specter/src/Specter/Core/Parameter.cpp index c07f8bd..f026cd3 100644 --- a/Specter/src/Specter/Core/Parameter.cpp +++ b/Specter/src/Specter/Core/Parameter.cpp @@ -21,6 +21,10 @@ Credit to nscldaq and in particular NSCLSpecTcl which provided the inspiration for this parameter model. GWM -- Feb 2022 + + Variables added; similar to Parameters, but intend to be an interface with UI feedback. See SpecProject for examples. -- GWM April 2023 + + Scalers added. In nuclear phyiscs, scalers refer to time counters of data, to track the rate of different detector components. -- GWM April 2023 */ #include "Parameter.h" diff --git a/Specter/src/Specter/Core/Parameter.h b/Specter/src/Specter/Core/Parameter.h index 144ff64..dadcb24 100644 --- a/Specter/src/Specter/Core/Parameter.h +++ b/Specter/src/Specter/Core/Parameter.h @@ -21,6 +21,10 @@ Credit to nscldaq and in particular NSCLSpecTcl which provided the inspiration for this parameter model. GWM -- Feb 2022 + + Variables added; similar to Parameters, but intend to be an interface with UI feedback. See SpecProject for examples. -- GWM April 2023 + + Scalers added. In nuclear phyiscs, scalers refer to time counters of data, to track the rate of different detector components. -- GWM April 2023 */ #ifndef PARAMETER_H #define PARAMETER_H @@ -45,11 +49,11 @@ namespace Specter { Parameter(const std::string& name); ~Parameter(); - inline bool IsValid() const { return m_pdata->validFlag; } - inline void Invalidate() { m_pdata->validFlag = false; } - inline void SetValue(double value) { m_pdata->validFlag = true; m_pdata->value = value; } - inline double GetValue() const { return m_pdata->value; } - inline const std::string& GetName() const { return m_name; } + bool IsValid() const { return m_pdata->validFlag; } + void Invalidate() { m_pdata->validFlag = false; } + void SetValue(double value) { m_pdata->validFlag = true; m_pdata->value = value; } + double GetValue() const { return m_pdata->value; } + const std::string& GetName() const { return m_name; } void SetName(const std::string& name); friend class SpectrumManager; @@ -77,9 +81,9 @@ namespace Specter { Variable(const std::string& name); ~Variable(); - inline void SetValue(double value) { m_pdata->value = value; } - inline double GetValue() { return m_pdata->value; } - inline const std::string& GetName() { return m_name; } + void SetValue(double value) { m_pdata->value = value; } + double GetValue() { return m_pdata->value; } + const std::string& GetName() { return m_name; } void SetName(const std::string& name); friend class SpectrumManager; @@ -106,10 +110,9 @@ namespace Specter { Scaler(const std::string& name); ~Scaler(); - inline void Increment() { ++(m_pdata->value); } - - inline const std::string& GetName() { return m_name; } - inline uint64_t GetCounts() { return m_pdata->value; } + void Increment() { ++(m_pdata->value); } + const std::string& GetName() { return m_name; } + uint64_t GetCounts() { return m_pdata->value; } void SetName(const std::string& name); friend class SpectrumManager; diff --git a/Specter/src/Specter/Core/SpectrumSerializer.cpp b/Specter/src/Specter/Core/SpectrumSerializer.cpp index db06390..182c3d1 100644 --- a/Specter/src/Specter/Core/SpectrumSerializer.cpp +++ b/Specter/src/Specter/Core/SpectrumSerializer.cpp @@ -1,6 +1,6 @@ /* SpectrumSerializer.h - SpectrumSerializer class providing method to write/read spectra (histograms and cuts) to/from a .spec file. These are formated text files. + SpectrumSerializer class providing method to write/read spectra (histograms and cuts) to/from a .yaml file. These are YAML files. Note that by virtue of the way that cuts work, they are written first. A couple of notes: diff --git a/Specter/src/Specter/Core/SpectrumSerializer.h b/Specter/src/Specter/Core/SpectrumSerializer.h index f20a09f..e11f384 100644 --- a/Specter/src/Specter/Core/SpectrumSerializer.h +++ b/Specter/src/Specter/Core/SpectrumSerializer.h @@ -1,6 +1,6 @@ /* SpectrumSerializer.h - SpectrumSerializer class providing method to write/read spectra (histograms and cuts) to/from a .nav file. These are formated text files. + SpectrumSerializer class providing method to write/read spectra (histograms and cuts) to/from a .yaml file. These are YAML files. Note that by virtue of the way that cuts work, they are written first. A couple of notes: diff --git a/Specter/src/Specter/Editor/FileDialog.h b/Specter/src/Specter/Editor/FileDialog.h index 38e8391..4fa14d2 100644 --- a/Specter/src/Specter/Editor/FileDialog.h +++ b/Specter/src/Specter/Editor/FileDialog.h @@ -34,7 +34,7 @@ namespace Specter { FileDialog(); ~FileDialog(); - inline void OpenDialog(Type type) { m_type = type; m_openDialogFlag = true; } + void OpenDialog(Type type) { m_type = type; m_openDialogFlag = true; } std::pair RenderFileDialog(const std::string& ext = ""); private: diff --git a/Specter/src/Specter/Editor/SourceDialog.h b/Specter/src/Specter/Editor/SourceDialog.h index 96e7e14..9456102 100644 --- a/Specter/src/Specter/Editor/SourceDialog.h +++ b/Specter/src/Specter/Editor/SourceDialog.h @@ -21,9 +21,9 @@ namespace Specter { bool ImGuiRenderSourceDialog(); - inline const SourceArgs& GetArgs() const { return m_args; } + const SourceArgs& GetArgs() const { return m_args; } - inline void OpenSourceDialog() { m_openFlag = true; } + void OpenSourceDialog() { m_openFlag = true; } private: bool m_openFlag; SourceArgs m_args; diff --git a/Specter/src/Specter/Editor/SpectrumDialog.h b/Specter/src/Specter/Editor/SpectrumDialog.h index 4d9389c..5a2981e 100644 --- a/Specter/src/Specter/Editor/SpectrumDialog.h +++ b/Specter/src/Specter/Editor/SpectrumDialog.h @@ -24,7 +24,7 @@ namespace Specter { bool ImGuiRenderSpectrumDialog(const SpectrumManager::Ref& manager, const std::vector& histoList, const std::vector& cutList, const std::vector& paramList); - inline void SetSpectrumDialog() { m_openFlag = true; } + void SetSpectrumDialog() { m_openFlag = true; } private: void RenderDialog1D(const std::vector& paramList); void RenderDialog2D(const std::vector& paramList); diff --git a/Specter/src/Specter/Editor/SpectrumPanel.h b/Specter/src/Specter/Editor/SpectrumPanel.h index 0e48cf6..6d2361a 100644 --- a/Specter/src/Specter/Editor/SpectrumPanel.h +++ b/Specter/src/Specter/Editor/SpectrumPanel.h @@ -35,8 +35,8 @@ namespace Specter { ~SpectrumPanel(); bool OnImGuiRender(const SpectrumManager::Ref& manager, const std::vector& histoList, const std::vector& cutList, const std::vector& paramList); - inline const std::string& GetZoomedOnHistogram() { return m_zoomedGram.name; } - inline const bool IsZoomed() { return m_zoomedFlag; } + const std::string& GetZoomedOnHistogram() { return m_zoomedGram.name; } + const bool IsZoomed() { return m_zoomedFlag; } private: void HandleCutMode(); diff --git a/Specter/src/Specter/Events/AppEvent.h b/Specter/src/Specter/Events/AppEvent.h index ac03af3..a206e5c 100644 --- a/Specter/src/Specter/Events/AppEvent.h +++ b/Specter/src/Specter/Events/AppEvent.h @@ -29,8 +29,8 @@ namespace Specter { { } - inline int GetXSize() { return m_xSize; } - inline int GetYSize() { return m_ySize; } + int GetXSize() { return m_xSize; } + int GetYSize() { return m_ySize; } std::string ToString() const override { std::stringstream ss; diff --git a/Specter/src/Specter/Events/Event.h b/Specter/src/Specter/Events/Event.h index d2ca7ef..c44af24 100644 --- a/Specter/src/Specter/Events/Event.h +++ b/Specter/src/Specter/Events/Event.h @@ -49,7 +49,7 @@ namespace Specter { virtual const char* GetName() const = 0; virtual int GetCategoryFlags() const = 0; virtual std::string ToString() const { return GetName(); } - inline bool IsCategory(EventCategory cat) const { return GetCategoryFlags() & cat; } + bool IsCategory(EventCategory cat) const { return GetCategoryFlags() & cat; } bool handledFlag = false; }; diff --git a/Specter/src/Specter/Events/KeyEvent.h b/Specter/src/Specter/Events/KeyEvent.h index 2212498..1d1f464 100644 --- a/Specter/src/Specter/Events/KeyEvent.h +++ b/Specter/src/Specter/Events/KeyEvent.h @@ -15,7 +15,7 @@ namespace Specter { class KeyEvent : public Event { public: - inline int GetKeycode() const { return m_keycode; } + int GetKeycode() const { return m_keycode; } EVENT_CATEGORY_SETUP(EventCategoryKey | EventCategoryInput) protected: KeyEvent(int code) : @@ -37,7 +37,7 @@ namespace Specter { EVENT_TYPE_SETUP(KeyPressed) - inline int GetRepeatCount() const { return m_repeatCount; } + int GetRepeatCount() const { return m_repeatCount; } std::string ToString() const override { diff --git a/Specter/src/Specter/Events/MouseEvent.h b/Specter/src/Specter/Events/MouseEvent.h index 76a0a87..82434d1 100644 --- a/Specter/src/Specter/Events/MouseEvent.h +++ b/Specter/src/Specter/Events/MouseEvent.h @@ -19,8 +19,8 @@ namespace Specter { { } - inline float GetXPosition() { return m_xPos; } - inline float GetYPosition() { return m_yPos; } + float GetXPosition() { return m_xPos; } + float GetYPosition() { return m_yPos; } std::string ToString() const override { std::stringstream ss; @@ -43,8 +43,8 @@ namespace Specter { { } - inline float GetXOffset() { return m_xOffset; } - inline float GetYOffset() { return m_yOffset; } + float GetXOffset() { return m_xOffset; } + float GetYOffset() { return m_yOffset; } std::string ToString() const override { std::stringstream ss; @@ -67,7 +67,7 @@ namespace Specter { { } - inline int GetButtonCode() { return m_buttonCode; } + int GetButtonCode() { return m_buttonCode; } std::string ToString() const override { std::stringstream ss; @@ -90,7 +90,7 @@ namespace Specter { { } - inline int GetButtonCode() { return m_buttonCode; } + int GetButtonCode() { return m_buttonCode; } std::string ToString() const override { std::stringstream ss; diff --git a/Specter/src/Specter/ImGui/ImGuiLayer.cpp b/Specter/src/Specter/ImGui/ImGuiLayer.cpp index af7f8fa..5dc301d 100644 --- a/Specter/src/Specter/ImGui/ImGuiLayer.cpp +++ b/Specter/src/Specter/ImGui/ImGuiLayer.cpp @@ -46,8 +46,6 @@ namespace Specter { ImGuiIO& io = ImGui::GetIO(); io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; - //Viewports are real wonky on Linux and sometimes on MacOS - //Can currently cause assertion failure on checking number of monitors in ImGui sanity checks. io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; ImGui::StyleColorsDark(); //Hacker mode @@ -62,9 +60,7 @@ namespace Specter { } //Setup our fonts. We have Roboto for text and FontAwesome for our icons. - //Note the .ttf files are found in NavProject, or in the bin dir. This is because - //the actual program (NavProject) is launched from either the bin/ ... /NaProject or the NavProject directory - //io.Fonts->AddFontDefault(); + //These fonts are embedded in the application for better resource management. Found in FA-Solid.h, Roboto-Regular.h ImFontConfig latin_config; latin_config.RasterizerMultiply = 1.3f; ImFontConfig config; diff --git a/Specter/src/Specter/Physics/AnalysisStage.cpp b/Specter/src/Specter/Physics/AnalysisStage.cpp index 29301a1..3664b3d 100644 --- a/Specter/src/Specter/Physics/AnalysisStage.cpp +++ b/Specter/src/Specter/Physics/AnalysisStage.cpp @@ -1,7 +1,7 @@ /* AnalysisStage.h - Represents a step in a chain of analyses that are run on a NavEvent. These stages are where NavParameters are set and validated. Users should use this base class - to create their own analyses and inject them into their project. See template NavProject for an example of use. + Represents a step in a chain of analyses that are run on a SpecEvent. These stages are where Parameters are set and validated. Users should use this base class + to create their own analyses and inject them into their project. See template SpecProject for an example of use. GWM -- Feb 2022 */ diff --git a/Specter/src/Specter/Physics/AnalysisStage.h b/Specter/src/Specter/Physics/AnalysisStage.h index 182ffc8..d26af92 100644 --- a/Specter/src/Specter/Physics/AnalysisStage.h +++ b/Specter/src/Specter/Physics/AnalysisStage.h @@ -1,7 +1,7 @@ /* AnalysisStage.h - Represents a step in a chain of analyses that are run on a NavEvent. These stages are where Parameters are set and validated. Users should use this base class - to create their own analyses and inject them into their project. See template NavProject for an example of use. + Represents a step in a chain of analyses that are run on a SpecEvent. These stages are where Parameters are set and validated. Users should use this base class + to create their own analyses and inject them into their project. See template SpecProject for an example of use. GWM -- Feb 2022 */ diff --git a/Specter/src/Specter/Physics/PhysicsEventBuilder.cpp b/Specter/src/Specter/Physics/PhysicsEventBuilder.cpp index 131ee99..451bfa0 100644 --- a/Specter/src/Specter/Physics/PhysicsEventBuilder.cpp +++ b/Specter/src/Specter/Physics/PhysicsEventBuilder.cpp @@ -1,12 +1,14 @@ /* PhysicsEventBuilder.h - Class for taking in raw NavData and converting into a NavEvent. NavEvent is just a std::vector of NavData, where - the held NavData all falls within a time window called the coincidence window. As soon as a NavData is given that falls outside - of this window, the current event is shifted to the ready event and the AddDatumToEvent function returns true. The ready event can - then be retrieved. The hit that triggered the end of event then is used to start the new event. The current pattern is strongly associated - with digital electronics concepts for nuclear data aquisition systems. + Class for taking in raw SpecData and converting into a SpecEvent. SpecEvent is just a std::vector of SpecData, where + the held SpecData all falls within a time window called the coincidence window. As soon as a SpecData is given that falls outside + of this window, the current event is shifted to the ready event vector. The ready event can then be retrieved. The hit that triggered the end of + event then is used to start the new event. The current pattern is strongly associated with digital electronics concepts + for nuclear data aquisition systems. GWM -- Feb 2022 + + Added data time sorting, make event building model more compatible with different data sources. -- GWM April 2023 */ #include "PhysicsEventBuilder.h" @@ -36,7 +38,7 @@ namespace Specter { m_bufferIndex++; if (m_bufferIndex < s_maxDataBuffer) //If we haven't filled the buffer keep going return; - else if (m_sortFlag) + else if (m_sortFlag) //do time sorting if needed std::sort(m_dataBuffer.begin(), m_dataBuffer.end(), [](SpecData& i, SpecData& j) { return i.timestamp < j.timestamp; }); //Generate our ready events @@ -58,7 +60,7 @@ namespace Specter { event.push_back(data); } } - m_bufferIndex = 0; + m_bufferIndex = 0; //Reset the buffer without reallocating } std::vector PhysicsEventBuilder::GetReadyEvents() const diff --git a/Specter/src/Specter/Physics/PhysicsEventBuilder.h b/Specter/src/Specter/Physics/PhysicsEventBuilder.h index a7238b3..edb8b34 100644 --- a/Specter/src/Specter/Physics/PhysicsEventBuilder.h +++ b/Specter/src/Specter/Physics/PhysicsEventBuilder.h @@ -1,12 +1,14 @@ /* PhysicsEventBuilder.h - Class for taking in raw NavData and converting into a NavEvent. NavEvent is just a std::vector of NavData, where - the held NavData all falls within a time window called the coincidence window. As soon as a NavData is given that falls outside - of this window, the current event is shifted to the ready event and the AddDatumToEvent function returns true. The ready event can - then be retrieved. The hit that triggered the end of event then is used to start the new event. The current pattern is strongly associated - with digital electronics concepts for nuclear data aquisition systems. + Class for taking in raw SpecData and converting into a SpecEvent. SpecEvent is just a std::vector of SpecData, where + the held SpecData all falls within a time window called the coincidence window. As soon as a SpecData is given that falls outside + of this window, the current event is shifted to the ready event vector. The ready event can then be retrieved. The hit that triggered the end of + event then is used to start the new event. The current pattern is strongly associated with digital electronics concepts + for nuclear data aquisition systems. GWM -- Feb 2022 + + Added data time sorting, make event building model more compatible with different data sources. -- GWM April 2023 */ #ifndef PHYSICS_EVENT_BUILDER_H #define PHYSICS_EVENT_BUILDER_H diff --git a/Specter/src/Specter/Physics/ShiftMap.h b/Specter/src/Specter/Physics/ShiftMap.h index 546d0ce..e7107d6 100644 --- a/Specter/src/Specter/Physics/ShiftMap.h +++ b/Specter/src/Specter/Physics/ShiftMap.h @@ -24,8 +24,8 @@ namespace Specter { ShiftMap(const std::string& filename); ~ShiftMap(); void SetFile(const std::string& filename); - inline bool IsValid() { return m_validFlag; } - inline std::string GetFilename() { return m_filename; } + bool IsValid() { return m_validFlag; } + std::string GetFilename() { return m_filename; } uint64_t GetShift(int gchan); private: diff --git a/Specter/src/Specter/Renderer/RenderCommand.h b/Specter/src/Specter/Renderer/RenderCommand.h index 7a3c069..942ee55 100644 --- a/Specter/src/Specter/Renderer/RenderCommand.h +++ b/Specter/src/Specter/Renderer/RenderCommand.h @@ -16,9 +16,9 @@ namespace Specter { class RenderCommand { public: - inline static void SetClearColor(const glm::vec4& color_array) { s_api->SetClearColor(color_array); } - inline static void Clear() { s_api->Clear(); } - inline static float GetFrameTime() { return s_api->GetFrameTime(); } + static void SetClearColor(const glm::vec4& color_array) { s_api->SetClearColor(color_array); } + static void Clear() { s_api->Clear(); } + static float GetFrameTime() { return s_api->GetFrameTime(); } private: static RendererAPI* s_api; diff --git a/Specter/src/Specter/Renderer/RendererAPI.h b/Specter/src/Specter/Renderer/RendererAPI.h index a09b2c4..8094238 100644 --- a/Specter/src/Specter/Renderer/RendererAPI.h +++ b/Specter/src/Specter/Renderer/RendererAPI.h @@ -26,7 +26,7 @@ namespace Specter { virtual void SetClearColor(const glm::vec4& color) = 0; virtual float GetFrameTime() = 0; - inline static API GetAPI() { return s_api; } + static API GetAPI() { return s_api; } private: static API s_api;