[kepler-dev] fileOrURLPort broken in BinaryFileReader ?
Efrat Frank
efrat at sdsc.edu
Thu Feb 9 11:43:27 PST 2006
Hi Tristan,
The problem was with the port value being read in the initialize method
instead of in the prefire.The initialize method is called for all the
actors as the user hits the run button prior to the
prefire/fire/postfire iterations, thus, since the preceding actor hasn't
fired yet, the BinaryFileReader port doesn't have a token available. I
updated the code and checked it in to CVS.
- Efrat
Tristan King wrote:
>Hi,
>
>I can't seem to get the BinaryFileReader actor to read any files passed
>to it by the fileOrURLPort. Even a basic workflow like the one attached
>doesn't seem to work, the file reader always reads the file specified in
>the FileOrURL Parameter.
>
>Is there something I'm doing wrong? or am I misunderstanding the use of
>the fileOrURLPort ?
>
>Thanks
>--Tristan
>
>
>
>------------------------------------------------------------------------
>
><?xml version="1.0" standalone="no"?>
><!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
> "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
><entity name="bfr-test" class="ptolemy.actor.TypedCompositeActor">
> <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="5.1-alpha">
> </property>
> <property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
> <property name="_svgIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>../kepler-docs/dev/usability/graphics/svg/director.svg</configure>
> </property>
> <property name="_thumbnailRasterIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>/actorthumbs/director-sm.gif</configure>
> </property>
> <property name="timeResolution" class="ptolemy.moml.SharedParameter" value="1E-10">
> </property>
> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:director:1:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.domains.sdf.kernel.SDFDirector">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:directorclass:1:1">
> </property>
> </property>
> <property name="semanticType000" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#Director">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{115, 210}">
> </property>
> </property>
> <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={214, 116, 852, 792}, maximized=false}">
> </property>
> <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[600, 659]">
> </property>
> <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
> </property>
> <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{300.0, 329.5}">
> </property>
> <entity name="Display" class="ptolemy.actor.lib.gui.Display">
> <property name="_svgIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>../kepler-docs/dev/usability/graphics/svg/text_disp.svg</configure>
> </property>
> <property name="_thumbnailRasterIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>/actorthumbs/text_disp-sm.gif</configure>
> </property>
> <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10">
> </property>
> <property name="columnsDisplayed" class="ptolemy.data.expr.Parameter" value="40">
> </property>
> <property name="suppressBlankLines" class="ptolemy.data.expr.Parameter" value="false">
> </property>
> <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={426, 405, 428, 214}, maximized=false}">
> </property>
> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:7:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="ptolemy.actor.lib.gui.Display">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:883:1">
> </property>
> </property>
> <property name="semanticType000" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#TextualOutputActor">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{475, 330}">
> </property>
> </entity>
> <entity name="Binary File Reader" class="org.geon.BinaryFileReader">
> <property name="_svgIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>../kepler-docs/dev/usability/graphics/svg/basic-actor.svg</configure>
> </property>
> <property name="_thumbnailRasterIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>/actorthumbs/basic-actor-sm.gif</configure>
> </property>
> <property name="fileOrURL" class="ptolemy.data.expr.FileParameter" value="/home/tristan/diff.txt">
> </property>
> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:125:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.geon.BinaryFileReader">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:994:1">
> </property>
> </property>
> <property name="semanticType000" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ReaderExternalInputActor">
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{220, 325}">
> </property>
> </entity>
> <entity name="String Constant" class="org.sdm.spa.StringConst">
> <property name="_svgIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>../kepler-docs/dev/usability/graphics/svg/basic-actor.svg</configure>
> </property>
> <property name="_thumbnailRasterIcon" class="ptolemy.kernel.util.ConfigurableAttribute">
> <configure>/actorthumbs/basic-actor-sm.gif</configure>
> </property>
> <property name="value" class="ptolemy.data.expr.FileParameter" value="/home/tristan/diff.txt">
> </property>
> <property name="entityId" class="org.kepler.moml.NamedObjId" value="urn:lsid:kepler-project.org:actor:204:1">
> </property>
> <property name="class" class="ptolemy.kernel.util.StringAttribute" value="org.sdm.spa.StringConst">
> <property name="id" class="ptolemy.kernel.util.StringAttribute" value="urn:lsid:kepler-project.org:class:1052:1">
> </property>
> </property>
> <property name="semanticType000" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#StringFunctionActor">
> </property>
> <property name="semanticType111" class="org.kepler.sms.SemanticType" value="urn:lsid:localhost:onto:1:1#ConstantActor">
> </property>
> <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
> <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
> </property>
> <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
> </property>
> </property>
> <property name="_location" class="ptolemy.kernel.util.Location" value="{115, 465}">
> </property>
> </entity>
> <relation name="relation" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> </relation>
> <relation name="relation2" class="ptolemy.actor.TypedIORelation">
> <property name="width" class="ptolemy.data.expr.Parameter" value="1">
> </property>
> </relation>
> <link port="Display.input" relation="relation"/>
> <link port="Binary File Reader.output" relation="relation"/>
> <link port="Binary File Reader.fileOrURLPort" relation="relation2"/>
> <link port="String Constant.output" relation="relation2"/>
></entity>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Kepler-dev mailing list
>Kepler-dev at ecoinformatics.org
>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20060209/2086ef64/attachment.html>
More information about the Kepler-dev
mailing list