Changeset 130:9fde47d5dec3 in finroc_plugins_structure
- Timestamp:
- 25.02.2020 07:23:05 (2 years ago)
- Branch:
- 17.03
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tComponent.cpp
r123 r130 210 210 } 211 211 212 bool tComponent::IsComponent(const core::tFrameworkElement* element) 213 { 214 return core::tFrameworkElementTags::IsTagged(*element, "group") || core::tFrameworkElementTags::IsTagged(*element, "module"); 215 } 216 217 void tComponent::SetParameterConfigEntries(const std::string& prefix) 218 { 219 for (auto parameter_interface = this->ChildrenBegin(); parameter_interface != this->ChildrenEnd(); ++parameter_interface) 220 { 221 if ((!parameter_interface->IsPort()) && parameter_interface->GetFlag(tFlag::PARAMETER_INTERFACE)) 222 { 223 auto parameter_interface_path = parameter_interface->GetPath(); 224 for (auto parameter = parameter_interface->SubElementsBegin(); parameter != parameter_interface->SubElementsEnd(); ++parameter) 225 { 226 auto info = parameter->GetAnnotation<parameters::internal::tParameterInfo>(); 227 if (info) 228 { 229 auto parameter_path = parameter->GetPath(); 230 rrlib::uri::tPath relative(false, parameter_path.Begin() + parameter_interface_path.Size(), parameter_path.End()); 231 std::stringstream stream; 232 stream << prefix << relative; 233 info->SetConfigEntry(stream.str()); 234 } 235 } 236 return; 237 } 238 } 239 } 240 212 241 void tComponent::SetComponentVisualizationEnabled(bool enabled) 213 242 { -
tComponent.h
r129 r130 161 161 162 162 /*! 163 * \param element Element to check 164 * \return Returns whether provided element is a component 165 */ 166 static bool IsComponent(const core::tFrameworkElement* element); 167 168 /*! 163 169 * Components may have a std::vector of ports in their interfaces. 164 170 * This is a convenience method for adjusting the number of ports in such vectors. … … 199 205 parameters::tConfigNode::SetConfigNode(*this, node); 200 206 } 207 208 /*! 209 * Sets config entries for all of the component's parameters to prefix + name 210 * (convenience function) 211 * 212 * \param prefix Prefix to use 213 */ 214 void SetParameterConfigEntries(const std::string& prefix); 201 215 202 216 /*!
Note: See TracChangeset
for help on using the changeset viewer.