Re: [idvusers] Automated/dynamic text object?

Thanks Bill,

I was able to get a basic script to work that saved an image. When I tried to add the overlay tag I broke what had been working. Does the overlay tag live in a block before, after or inside of the image tag?

It seems that I get errors about tags not being closed now. (isl, overlay, image) I can generate a number of errors, depending on the nesting of these things. Alternatively, am I being dense? Does the overlay tag replace the image tag to create the image with that overlay?


When I tried this code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<isl debug="true" loop="1" offscreen="true" sleep="10.0seconds">
<bundle clear="true" file="${islpath}/test3.xidv" height="600" wait="true" width="800"/>

  <image file="${islpath}/${time:yyyyMMdd_HHmm}.png">

</image>

<overlay
    image="${islpath}/${time:yyyyMMdd_HHmm}.png"
    text="${time:HHmm}"
    place="UR"
    anchor="M"
    fontsize="48"
    fontface="Lucida Sans"
    color="white"
    background="black"
    transparency="0" >

</overlay>

</isl>


The image is created (without the overlay) but I get the messages:
Thu Feb 20 18:08:12 EST 2014: Loading bundle: ./test3.xidv
Thu Feb 20 18:08:31 EST 2014: Writing image:./20060912_1400.png
Unknown tag:overlay

-----

When I place just the </image> tag after the block of overlay code I get:

Thu Feb 20 18:07:01 EST 2014: Loading bundle: ./test3.xidv
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
        at java.lang.String.substring(Unknown Source)
        at ucar.unidata.ui.drawing.Glyph.getPointOnRect(Glyph.java:428)
        at ucar.unidata.ui.drawing.Glyph.getPointOnRect(Glyph.java:346)
        at ucar.unidata.ui.ImageUtils.parsePoint(ImageUtils.java:474)
at ucar.unidata.idv.ui.ImageGenerator.processImage(ImageGenerator.java:5075) at ucar.unidata.idv.ui.ImageGenerator.captureImage(ImageGenerator.java:4230) at ucar.unidata.idv.ui.ImageGenerator.processTagImage(ImageGenerator.java:2916)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
at ucar.unidata.idv.ui.ImageGenerator.processNode(ImageGenerator.java:1036) at ucar.unidata.idv.ui.ImageGenerator.processChildren(ImageGenerator.java:1070) at ucar.unidata.idv.ui.ImageGenerator.processTagGroup(ImageGenerator.java:2735) at ucar.unidata.idv.ui.ImageGenerator.processTagIsl(ImageGenerator.java:2689)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
at ucar.unidata.idv.ui.ImageGenerator.processNode(ImageGenerator.java:1036) at ucar.unidata.idv.ui.ImageGenerator.processScriptFile(ImageGenerator.java:949) at ucar.unidata.idv.ui.ImageGenerator.processScriptFile(ImageGenerator.java:873) at ucar.unidata.idv.ui.ImageGenerator.processScriptFiles(ImageGenerator.java:857)
        at ucar.unidata.idv.ArgsManager$1.run(ArgsManager.java:407)
at ucar.unidata.idv.ArgsManager.runInitRunnables(ArgsManager.java:454)
        at ucar.unidata.idv.ArgsManager.access$000(ArgsManager.java:73)
        at ucar.unidata.idv.ArgsManager$3.run(ArgsManager.java:433)
        at ucar.unidata.util.Misc$3.run(Misc.java:1251)
An error occurred:java.lang.StringIndexOutOfBoundsException: String index out of range: 2

----

When I stick the code for the image tag inside of the overlay block I get the "Unknown tag" error and no image is created.

When I stick the code for the image after the overlay code then I get the unknown tag error and no image is generated.

Thanks to anyone who can help,

CH

--

 Dr. Christopher G. Herbster
 Associate Professor
 Director of Science and Technology
 for the ERAU Weather Center
 Applied Aviation Sciences
 Embry-Riddle Aeronautical Univ.
 600 S. Clyde Morris Blvd.
 Daytona Beach, FL 32114-3900
386.226.6444 Office
 386.226.6446 Weather Center
 http://wx.erau.edu/

Schedule at:  http://wx.erau.edu/faculty/herbster/Schedules/

On 02/20/14 14:28, the Fingerhuts wrote:
Chris,

This can be done with an isl script that: runs a bundle, saves an image, uses the overlay tag to format and place the time of the data.

Good luck,
Bill Fingerhut

On 2/20/2014 2:08 PM, Chris Herbster wrote:
Hi folks!

We have a sequence of images that we are trying to prepare for publication using the IDV. We have modified the display list to only display the current time of the image (using %timestamp% with our own format applied). Now what we want to do is to move the location of the text to the upper right quadrant of the image where it doesn't compete with weather that moves into the lower part of the image where the default layout is located.

I don't see any user controlled elements that suggest I can move the location of the text, but we are willing to tweak code to get that done if it is the best solution.

Alternatively, is there a way to have dynamic text in a "Drawing Control" or other text box type of object?

I looked a little at the ISL pages, but didn't see anything that screamed "This is the way!" - I'm overdue for learning how to do some of these things, so I'm all ears!

Thanks in advance for any suggestions.

Best to all,

Chris Herbster






  • 2014 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the idvusers archives: