Is there a way to change the number of output ports in a component at run-time?

StackOverflow https://stackoverflow.com/questions/23093167

  •  04-07-2023
  •  | 
  •  

سؤال

In my application I will not know the number of output ports for the component until a user specifies a configuration file. I attempted to do this by leaving the number of output ports in the .scd.xml file at zero. When I select the configuration file through the IDE on the property change event I call releaseOutPorts() and delete any existing port objects.

In my example component I create N new output ports by creating new bulkio::OutFloatPort objects, and activate them in the same way the custom ports are activated in the USRP_UHD component by calling ossie::corba::RootPOA()->activate_object(port) and calling registerOutPort. I receive no errors when I do this but I cannot see the ports show up in either the sandbox or the IDE. Is it a problem because no port information is supplied in the .scd.xml file? Can anyone shed some insight into how the ports are currently enumerated when a component is dragged into the chalkboard or loaded into the sandbox?

هل كانت مفيدة؟

المحلول

You are correct; the IDE uses the the scd.xml file to display the ports. There isn't a way to programmatically obtain a list of all ports.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top