[kepler-dev] fileOrURLPort broken in BinaryFileReader ?
Tristan King
tristan.king at jcu.edu.au
Mon Feb 6 15:35:26 PST 2006
Thanks Dan, that works for now.
just one note: the FileParameter is always overwritten when a value is
input thru the IOPort (i.e. the value in the Actor properties is
changed), not sure if that is the desired functionality or not, but I
can see cases where it might get annoying.
--Tristan
On Mon, 2006-02-06 at 12:13 -0800, Dan Higgins wrote:
> Hi Tristan,
> I certainly see the same err that you reported - namely that
> specifying the file name on the port never transfers the file name to
> the internal parameter!
>
> The problem seems to be in the 'if (fileOrURLPort.hasToken(0)) {'
> statement in the '_openAndReadFirstBytes' method. No token is being
> retreived. I think that the problem is that this method is being called
> in the initialize and preinitialze methods and tokens are not present
> yet when these are fired. I commmented out the calls to
> openAndReadFirstBytes in these methods and added it to the very top of
> the fire method and everything worked OK!
>
> I will defer to Efrat to take a look and see if my conclusion is
> correct, since this is a GEON actor.
>
> Dan Higgins
> NCEAS
>
> 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
> >
> >
>
>
--
Tristan King | Ph: (07) 4781 6911
DART project team | Email: Tristan.King at jcu.edu.au
James Cook University | Web: http://dart.edu.au
Townsville QLD 4814 | http://plone.jcu.edu.au/dart/
Australia |
More information about the Kepler-dev
mailing list