@@ -19,7 +19,6 @@ namespace ROS2
19
19
PublisherConfiguration::Reflect (context);
20
20
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
21
21
{
22
- serializeContext->RegisterGenericType <AZStd::vector<PublisherConfiguration>>();
23
22
serializeContext->Class <SensorConfiguration>()
24
23
->Version (1 )
25
24
->Field (" Visualise" , &SensorConfiguration::m_visualise)
@@ -31,15 +30,24 @@ namespace ROS2
31
30
if (AZ::EditContext* ec = serializeContext->GetEditContext ())
32
31
{
33
32
ec->Class <SensorConfiguration>(" ROS2 Sensor Component" , " [Base component for sensors]" )
33
+ ->ClassElement (AZ::Edit::ClassElements::EditorData, " " )
34
34
->DataElement (AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_visualise, " Visualise" , " Visualise" )
35
35
->DataElement (AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_publishingEnabled, " Publishing Enabled" , " Toggle publishing for topic" )
36
36
->DataElement (AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_frequency, " Frequency" , " Frequency of publishing" )
37
37
->Attribute (AZ::Edit::Attributes::Min, 1 )
38
38
->Attribute (AZ::Edit::Attributes::Max, 100 )
39
+ ->Attribute (AZ::Edit::Attributes::Step, 1 )
39
40
->DataElement (AZ::Edit::UIHandlers::Default, &SensorConfiguration::m_publishersConfigurations, " Publishers" , " Publishers" )
40
41
->Attribute (AZ::Edit::Attributes::ContainerCanBeModified, false )
42
+ ->Attribute (AZ::Edit::Attributes::AutoExpand, true )
43
+ ->Attribute (AZ::Edit::Attributes::IndexedChildNameLabelOverride, &SensorConfiguration::GetPublisherLabel)
41
44
;
42
45
}
43
46
}
44
47
}
48
+
49
+ AZStd::string SensorConfiguration::GetPublisherLabel (int index) const
50
+ {
51
+ return m_publishersConfigurations[index].m_type ;
52
+ }
45
53
} // namespace ROS2
0 commit comments