adding a port with port_clone_conn

hi,

It seems the addPort(porthandle, portname, portdescription)
is ignoring the last two when used with port_clone_conn, instead using the description of the cloned port (name and description)
is this a bug?

an example:
in my component:
commonEventOutPort = rttlib.port_clone_conn(supervisor:getPort("common_events_in"))
tc:addPort(commonEventOutPort, "commonEventOut", "commonEvent output port")

in my task browser:
my_component:stat()
common_events_in (string) =

OR

>return my_component:getPort("common_events_in")
common_events_in [out, string, conn, local] // common event to supervisor
>return event_firer:getPort("commonEventOut")
stdin:1: TaskContext.getPort: no port commonEventOut for taskcontext my_component

nick

adding a port with port_clone_conn

On Wed, Dec 12, 2012 at 06:20:17PM +0100, Dominick Vanthienen wrote:
> hi,
>
> It seems the addPort(porthandle, portname, portdescription)
> is ignoring the last two when used with port_clone_conn, instead using the description of the cloned port (name and description)
> is this a bug?
>
> an example:
> in my component:
> commonEventOutPort = rttlib.port_clone_conn(supervisor:getPort("common_events_in"))
> tc:addPort(commonEventOutPort, "commonEventOut", "commonEvent output port")
>
> in my task browser:
> my_component:stat()
> common_events_in (string) =
>
> OR
>
> >return my_component:getPort("common_events_in")
> common_events_in [out, string, conn, local] // common event to supervisor
> >return event_firer:getPort("commonEventOut")
> stdin:1: TaskContext.getPort: no port commonEventOut for taskcontext my_component

Changing port names is not permitted in RTT once it is
connected. Changing the description should work fine.

You should be able to provide the desired port name as a third
argument to to port_clone_conn as below:

commonEventOutPort =
rttlib.port_clone_conn(supervisor:getPort("common_events_in"), nil, "commonEventOut")

however a bug (meanwhile fixed on my dev branch) prevents this with
current versions.

Markus

adding a port with port_clone_conn

On Thu, Dec 13, 2012 at 10:21 AM, Markus Klotzbuecher
<markus [dot] klotzbuecher [..] ...> wrote:
> On Wed, Dec 12, 2012 at 06:20:17PM +0100, Dominick Vanthienen wrote:
>> hi,
>>
>> It seems the addPort(porthandle, portname, portdescription)
>> is ignoring the last two when used with port_clone_conn, instead using the description of the cloned port (name and description)
>> is this a bug?
>>
>> an example:
>> in my component:
>> commonEventOutPort = rttlib.port_clone_conn(supervisor:getPort("common_events_in"))
>> tc:addPort(commonEventOutPort, "commonEventOut", "commonEvent output port")
>>
>> in my task browser:
>> my_component:stat()
>> common_events_in (string) =
>>
>> OR
>>
>> >return my_component:getPort("common_events_in")
>> common_events_in [out, string, conn, local] // common event to supervisor
>> >return event_firer:getPort("commonEventOut")
>> stdin:1: TaskContext.getPort: no port commonEventOut for taskcontext my_component
>
> Changing port names is not permitted in RTT once it is
> connected. Changing the description should work fine.

It isn't ? I wasn't aware of such a restriction. I recall user stories
of renaming ports in the past using properties etc.

Peter

adding a port with port_clone_conn

On Thu, Dec 13, 2012 at 10:31:34AM +0100, Peter Soetens wrote:
> On Thu, Dec 13, 2012 at 10:21 AM, Markus Klotzbuecher
> <markus [dot] klotzbuecher [..] ...> wrote:
> > On Wed, Dec 12, 2012 at 06:20:17PM +0100, Dominick Vanthienen wrote:
> >> hi,
> >>
> >> It seems the addPort(porthandle, portname, portdescription)
> >> is ignoring the last two when used with port_clone_conn, instead using the description of the cloned port (name and description)
> >> is this a bug?
> >>
> >> an example:
> >> in my component:
> >> commonEventOutPort = rttlib.port_clone_conn(supervisor:getPort("common_events_in"))
> >> tc:addPort(commonEventOutPort, "commonEventOut", "commonEvent output port")
> >>
> >> in my task browser:
> >> my_component:stat()
> >> common_events_in (string) =
> >>
> >> OR
> >>
> >> >return my_component:getPort("common_events_in")
> >> common_events_in [out, string, conn, local] // common event to supervisor
> >> >return event_firer:getPort("commonEventOut")
> >> stdin:1: TaskContext.getPort: no port commonEventOut for taskcontext my_component
> >
> > Changing port names is not permitted in RTT once it is
> > connected. Changing the description should work fine.
>
> It isn't ? I wasn't aware of such a restriction. I recall user stories

Nope.

> of renaming ports in the past using properties etc.

But for sure not after being connected.

However I don't know where this restriction comes from, do you
remember?

Markus