MachineLearningDebugSystemComponent.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/Component.h>
  10. #include <AzCore/Interface/Interface.h>
  11. #include <MachineLearning/IMachineLearning.h>
  12. #include <Debug/MachineLearningDebugTrainingWindow.h>
  13. #ifdef IMGUI_ENABLED
  14. # include <imgui/imgui.h>
  15. # include <ImGuiBus.h>
  16. #endif
  17. namespace MachineLearning
  18. {
  19. class MachineLearningDebugSystemComponent final
  20. : public AZ::Component
  21. #ifdef IMGUI_ENABLED
  22. , public ImGui::ImGuiUpdateListenerBus::Handler
  23. #endif
  24. {
  25. public:
  26. AZ_COMPONENT(MachineLearningDebugSystemComponent, "{44A3FACE-9808-4BAD-BC9C-6DB6AE0A9707}");
  27. static void Reflect(AZ::ReflectContext* context);
  28. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  29. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  30. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  31. ~MachineLearningDebugSystemComponent() override = default;
  32. //! AZ::Component overrides
  33. //! @{
  34. void Activate() override;
  35. void Deactivate() override;
  36. //! @}
  37. #ifdef IMGUI_ENABLED
  38. void OnModelRegistryDisplay();
  39. void OnModelTrainingDisplay();
  40. //! ImGui::ImGuiUpdateListenerBus overrides
  41. //! @{
  42. void OnImGuiMainMenuUpdate() override;
  43. void OnImGuiUpdate() override;
  44. //! @}
  45. private:
  46. bool m_displayModelRegistry = false;
  47. bool m_displayTrainingWindow = false;
  48. MachineLearningDebugTrainingWindow m_trainingWindow;
  49. #endif
  50. };
  51. }