Previous: Writing Text Files Next: Scripting with Jython Table of contents Images Frames Unidata's Integrated Data Viewer > Miscellaneous > IDV Scripting

7.1.7 Changing Bundle Properties

<displayproperties> Changing bundle display properties
<displayproperties
    display="the display with properties that need to be changed"
    property="name and new value of the existing property " >

The displayproperties tag allows you to change the existing properties in a bundle file. For example, this could be used to change the probe location, chart name, etc.

In this example, we use the displayproperties tag to change two existing properties in the bundle RUC.xidv. First, the IDV needs to identify the display to search for existing properties, which is the ProbeControl. After we identify the display, the IDV uses the property name and new value to replace the existing property, and the two properties being changed are probe location and chart name.

<isl debug="true" offscreen="false">
    <procedure name="mkCHART">
        <bundle clear="true" file="${islpath}/RUC.xidv"/>
        <pause/>
        <displayproperties display="class:ucar.unidata.idv.control.ProbeControl">
          <property name="EarthLocation"  value="${probeLocation}"/>
          <property name="ChartName"  value="Chart #: ${idx}"/>
        </displayproperties>
        <pause/>
        <image file="${islpath}/chart${idx}.png" display="class:ucar.unidata.idv.control.ProbeControl"/>
    </procedure>
    <image file="${islpath}/map.png" />
    <mkCHART idx="10" probeLocation="30.0, -105.0"/>
    <mkCHART idx="11" probeLocation="40.0, -100.0"/>

</isl>
probeTimeSeries.isl

In the next example, we use the displayproperties tag to change two existing properties: the smoothing type and the smoothing factor, in the bundle RUC.xidv. First, the IDV needs to identify the display to search for existing properties, which is the ContourPlanViewControl. After we identify the display, the IDV uses the property name and new value to replace the existing property, and the new smoothing type and factor being applied to contours.

<isl debug="ture" offscreen="false">
      <procedure name="mkSmoothedContour">
          <bundle clear="true" file="${islpath}/RUC.xidv"/>
          <pause/>
          <displayproperties display="class:ucar.unidata.idv.control.ContourPlanViewControl">
            <property name="SmoothingType"  value="${stype}"/>
            <property name="SmoothingFactor"  value="${sfactor}"/>
          </displayproperties>
          <pause/>
          <image file="${islpath}/contourImage${idx}.png"/>
      </procedure>
      <mkSmoothedContour idx="11" sfactor="11" stype="GWFS"/>
</isl>
contourSmoothing.isl

In the third example, we use the displayproperties tag to change two end points of a cross section in the bundle RUC.xidv. First, the IDV needs to identify the display to search for existing properties, which is the ContourCrossSectionControl. After we identify the display, the IDV uses the property name and new value to replace the existing property, and the new end points being applied to the cross section.

<isl debug="ture" offscreen="false">
      <procedure name="mkContourCrossSection">
          <bundle clear="true" file="${islpath}/RUC.xidv"/>
          <pause/>
          <displayproperties display="class:ucar.unidata.idv.control.ContourCrossSectionControl">
            <property name="StartPoint"  value="${startLocation}"/>
            <property name="EndPoint"  value="${endLocation}"/>
          </displayproperties>
          <pause/>
          <image file="${islpath}/contourCS${idx}.png" display="class:ucar.unidata.idv.control.ContourCrossSectionControl"/>
      </procedure>
      <mkContourCrossSection idx="11" startLocation="34.0, -140.0" endLocation="40.0, -55.0"/>
</isl>
contourCrossSection.isl

In the fourth example, we use the displayproperties tag to change the azimuth value of radar RHI display in the bundle radar.xidv. First, the IDV needs to identify the display, and it is the ColorRhiControl. After we identify the display, the IDV uses the property name "EndPoint" and new value to replace the existing property, and the new azimuth value being applied to the RHI cross section.

<isl debug="true" loop="1" offscreen="true" sleep="60.0minutes">
  <bundle clear="true" file="${islpath}/radar.xidv"/>
  <pause/>
  <displayproperties display="class:ucar.unidata.idv.control.ColorRhiControl">
      <property name="EndPoint"  value="45.0"/>
  </displayproperties>
  <pause/>
  <image file="${islpath}/radar.png" what="rhi" display="class:ucar.unidata.idv.control.ColorRhiControl"/>
</isl>
radarRHI.isl

In the fifth example, we use the displayproperties tag to change the time zone of the display list. The ISL only need to provides one of the control in the display, and it is the ContourPlanViewControl in this example. After we identify the display, the IDV uses the property name "DisplayListTimeZone" to identify the function to reset the time zone value and update the display list. The time zone in the test bundle is GMT, and the ISL script changes the time zone to MST and EST before capturing the image.

<?xml version="1.0" encoding="ISO-8859-1"?>
<isl debug="true" loop="1" offscreen="true" sleep="60.0minutes">
  <bundle clear="true" file="${islpath}/test.xidv" wait="true"/>
  <displayproperties display="class:ucar.unidata.idv.control.ContourPlanViewControl">
            <property name="DisplayListTimeZone"  value="MST"/>
  </displayproperties>
  <pause/>
  <image file="${islpath}/test.png"/>
  <displayproperties display="class:ucar.unidata.idv.control.ContourPlanViewControl">
            <property name="DisplayListTimeZone"  value="EST"/>
  </displayproperties>
  <pause/>
  <image file="${islpath}/test1.png"/>
</isl>
changingTimeZone.isl

 


Previous: Writing Text Files Next: Scripting with Jython Table of contents Images Frames Unidata's Integrated Data Viewer > Miscellaneous > IDV Scripting