Bug #3593
closed
exporting an actor to kar does not save portparameters that have been defined
Added by Derik Barseghian about 16 years ago.
Updated over 15 years ago.
Description
If you configure an actor's portparameter by right clicking on it, and filling in the portparam's dialog, and then Export Archive (KAR), the actor loses its port parameter setting -- there seems to be a problem in the export code, as the moml identifies port parameters as PortAttributes.
----
If you want an example:
instantiate org.kepler.data.datasource.rbnb.DataTurbine
Configure Actor and fill in Start Time
Export KAR
The moml in the kar for this port param looks like:
<property name="kepler:Start Time (for Request or Subscribe modes)" class="org.kepler.moml.PortAttribute">
<property name="direction" value="input" class="ptolemy.kernel.util.StringAttribute"/>
<property name="dataType" value="unknown" class="ptolemy.kernel.util.StringAttribute"/>
<property name="isMultiport" value="false" class="ptolemy.kernel.util.StringAttribute"/>
</property>
This is still a bug. I haven't looked into it yet.
I note that when I set a portparameter in an actor within a composite, and then export the composite, the value is saved in the moml...I'll see if I can do something similar.
Side-note: In the composite moml I notice it's referred to twice, once as a PortParameter and once as a ParameterPort - is that how it should be?
<entity name="DataTurbine" class="org.kepler.data.datasource.rbnb.DataTurbine">
...
<property name="Start Time (for Request or Subscribe modes)" class="ptolemy.actor.parameters.PortParameter" value=""2008-01-01 11:11:11"">
and
<port name="Start Time (for Request or Subscribe modes)" class="ptolemy.actor.parameters.ParameterPort">
<property name="input"/>
<property name="_cardinal" class="ptolemy.kernel.util.StringAttribute" value="NORTH">
</property>
</port>
Checked in a fix.
We were intentionally skipping adding PortParameters when exporting to an actor kar. Does anyone know why?
public void addAttribute(Attribute a) {
//if (a.getClassName().equals("ptolemy.actor.parameters.PortParameter")) {
// return;
//}
attributeVector.add(a);
}
I've commented this skipping out, and things seem to work fine. I've exported an actor with a PortParameter set, and it's now in the moml and in the actor after import. I've done a test with an actor with PortParameter set, inside a composite, and exported and imported the composite and this worked as well.
This dates back to kommineni, r12215: "addAttribute method has been changed to eliminate duplicate entries in moml file ...".
With my fix in place, things fine for me, but we do refer to the PortParameter three times now in moml, instead of the usual two. I don't think this is the "duplication" originally referred to, but let me know if you see any problems. E.g.:
<property name="kepler:Duration (for Request or Subscribe modes)" class="org.kepler.moml.PortAttribute">
<property name="direction" value="input" class="ptolemy.kernel.util.StringAttribute"/>
<property name="dataType" value="unknown" class="ptolemy.kernel.util.StringAttribute"/>
<property name="isMultiport" value="false" class="ptolemy.kernel.util.StringAttribute"/>
</property>
[snip]
<property name="Duration (for Request or Subscribe modes)" class="ptolemy.actor.parameters.PortParameter" value=""11111"">
</property>
[snip]
<property name="prop:Duration (for Request or Subscribe modes)" class="ptolemy.kernel.util.ConfigurableAttribute"><configure>The duration of the request. Unit is seconds unless fetchByFrame is set.</configure></property>
Original Bugzilla ID was 3593
Also available in: Atom
PDF