JointMotorControllerConfiguration.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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. #include <AzCore/Serialization/EditContext.h>
  9. #include <ROS2/Manipulation/MotorizedJoints/JointMotorControllerConfiguration.h>
  10. namespace ROS2
  11. {
  12. bool JointMotorControllerConfiguration::IsDebugModeVisible() const
  13. {
  14. return !m_isDebugController;
  15. }
  16. void JointMotorControllerConfiguration::Reflect(AZ::ReflectContext* context)
  17. {
  18. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  19. {
  20. serializeContext->Class<JointMotorControllerConfiguration>()->Version(0)->Field(
  21. "DebugMode", &JointMotorControllerConfiguration::m_debugMode);
  22. if (AZ::EditContext* ec = serializeContext->GetEditContext())
  23. {
  24. ec->Class<JointMotorControllerConfiguration>("Joint Motor Controller Configuration", "Motor Controller Configuration")
  25. ->DataElement(
  26. AZ::Edit::UIHandlers::Default, &JointMotorControllerConfiguration::m_debugMode, "Debug Mode", "Enable Debug Mode")
  27. ->Attribute(AZ::Edit::Attributes::Visibility, &JointMotorControllerConfiguration::IsDebugModeVisible);
  28. }
  29. }
  30. }
  31. } // namespace ROS2