The isl tag is the top level tag. It acts just like the group tag but it can also hold a debug attribute which results in status messages being printed out. The offscreen attribute allows you to turn off off screen rendering (the default is to do offscreen rendering).
The group tag holds a arbitrary number of children tags.
You can define properties with the property tag. Any subsequent tag may have these property values substituted by using:
${propertyname}e.g.:
The state within an ISL is stack based - i.e., if you are in a group tag or calling a procedure (see below) the properties that are defined there are local to that group or procedure call. When you leave that group or procedure call any properties that are defined are removed. However, you can specify global="true" in the property tag and this will cause the property to be defined globally.<property name="basedir" value="/some/directory"/> <property name="fromfile" fromfile="${islpath}/template.txt"/> <property name="imagetype" value="png"/> <image file="${basedir}/theimage.${imagetype}"/>
There are a set of predefined properties that can be used. As described above, if you are in a loop the property ${loopindex} will be set to the loop index. e.g.:
The set of date and time values for the current time are also available. The property names are those defined for the Java SimpleDateFormat class.<isl loop="1000" sleep="3600"> <bundle file="test${loopindex}.xidv"/> </isl>
The time properties are:
You can also define a property with "now:<some date format>" in it. This takes the current time and formats it with the full date format. e.g.,:
${yyyy} Year ${yy} Last 2 yar digits ${M} month number ${MM} two character month number ${MMM} Short month name ${MMMMM} Full month name ${D} Day in year ${d} Day in month ${dd} two character day in month ${EEE} Day name ${H} 0 based hour in day (24 hour) ${HH} 0 based two character hour in day (24 hour) ${k} 1 based hour in day (24 hour) ${kk} 1 based two character hour in day (24 hour) ${K} Hour in am/pm (12 hour) ${KK} two character hour in am/pm ${a} am/pm ${mm} two character minute in hour ${s} second in minute ${ss} two character second in minute ${S} Millisecond ${Z} Timezone ${G} Era designator
${now:yyyy-MM-DD} ${now:yyyy_MM_DD:hh:mm}You can also use "time:" to use the current animation time as the time to format:
${time:yyyy-MM-DD} ${time:yyyy_MM_DD:hh:mm}
This is just like the property tag but it appends the value.
This allows you to set properties in the IDV that may affect image capture behavior, etc. For example, doing:
sets the pause between each movie frame capture to be 1000 milliseconds.<idvproperty name="idv.capture.sleep" value="1000"/>
The echo tag allows you to print out a message. Here, for example, we are printing out the loop index and the date/time:
<isl loop="10" sleep="1"> <echo message="Loop iteration: ${loopindex} at: ${yyyy}-${MM}-${dd} ${HH}:${mm}:${ss}"/> <echo> The message can also be contained by the echo tag </echo> </isl> echo.isl
The import tag allows you to import another ISL file. For example, using the import tag here:
<isl>
<import file="systemdefs.isl"/>
</isl>
import.isl
Where systemdefs.isl has:
Will result in something like:<isl> <property name="prop1" value="somevalue"/> <property name="prop2" value="somevalue"/> </isl> systemdefs.isl
You could use the import, for example, as a way of having common property definitions (e.g., location of data, images, etc.) shared by a set of ISL files.<isl> ... <group> <property name="prop1" value="somevalue"/> <property name="prop2" value="somevalue"/> </group> ... </isl>
The procedure tag allows you to define a "procedure" that can be called with the call tag.
The call tag allows you to call a procedure. The attributes within the call tag are set as properties and can be referenced within the procedure tags. For example, here we have a procedure called "makeImage" It is called two times, passing in values for bundlefile and imagefile. As noted, you can also drop the call tag and use the procedure name as the tag name.
<isl> <procedure name="makeImage"> <bundle file="${bundlefile}"/> <pause/> <image file="${imagefile}"> <thumbnail width="25%"/> </image> </procedure> <call name="makeImage" bundlefile="test1.xidv" imagefile="test1.png"/> <call name="makeImage" bundlefile="test2.xidv" imagefile="test2.png"/> <!-- Note: you can also call the procedure directly with: --> <makeImage bundlefile="test2.xidv" imagefile="test2.png"/> </isl> procedure.isl
The jython tag allows you to evaluate jython. The Jython is specified both in line as well as file based:
This Jython is evaluated by an interpreter that has all of the normal IDV Jython libraries. The global variable "idv" points to the IntegratedDataView. The global variable "ig" points to the instance of the ImageGenerator class that is running the ISL.<isl> <jython file="somejython.py"/> <!-- Or: --> <jython code="some jython code"/> <!-- Or: --> <jython> <![CDATA[ some jython code ]]> </jython> </isl> jython.isl
All attribute values can also be prefixed with "jython:". This allows you to write a snippet of jython code that will return an attribute value:
<isl loop="10"> <echo message="jython:'number = ' + str(${loopindex}*50)"/> </isl> jythoninattr.isl
<stop/>
The trace tag allows you to turn on tracing in the IDV:
<trace pattern="GeoGridDataSource.*"/>
The pause tag can have a number of attributes:
<pause/> | No arguments will pause until all displays have been created. |
<pause seconds="10"/> | Pause for 10 seconds. |
<pause minutes="5.5"/> | Pause for 5.5 minutes. |
<pause hours="12.5"/> | Pause for 12.5 hours. |
<pause every="1"/> | Pause until the next hour. The 'every' attribute means every N hours after midnight. |
<pause every=".5"/> | Pause until the next hour or half hour. |
<pause every="0.25"/> | Pause until the next 15 minute time. e.g., on the hour, quarter after, half past, etc. |
The foreach tag allows you to iterate across a set of comma separated values.
For example, here we are generating three different image types:<foreach fruit="apple,orange,banana" color="red,green,blue" ... valueN="..."> ... Any ISL tags. The property references ${fruit}, ${color}, etc., will be replaced the values above. e.g., First time in the loop ${fruit} will be replaced with 'apple', ${color} with 'red', etc. ... </foreach>
Another example is to read each line from a file using the foreach:<isl> <foreach suffix="png,jpg,gif"> <echo message="Creating test.${suffix}"/> <image file="test.${suffix}"/> </foreach> </isl> foreach.isl
<isl> <foreach foo="file:file:${islpath}/test.txt" bar="apples,oranges,bananas,peach,grape"> <echo message="value=${foo} fruit=${bar}"/> </foreach> </isl> foreachlineinafile.isl
hello there how are you test.txt
The for tag allows you to have a for loop. The start, end and increment attributes define the value of the index property at each step in the loop. Here's an example:
<for start="5" end="20" increment="2"> <echo message="printing index ${index}"/> </for>
The exec tag allows you to execute external programs. For example, if you were generating images on one machine and then need to scp them to your web server you could do:
<isl> <property name="imagefile" value="test.png"/> <group loop="1000" sleep="3600"> <bundle file="test.xidv"/> <pause/> <image file="test.png"/> <exec command="scp ${imagefile} yourwebserver:/imagedir/${imagefile}"/> </group </isl> exec.isl
The if tag allows you to have decision structures in your ISL. The form is:
<if expr="some jython expression">
<then>
... The then block ...
</then>
<else>
... The optional else block ...
</else>
</if>
For example, say you only wanted to generate a particular image when the hour
of the day is after 12 noon. One could just go:
<isl loop="1000" sleep="3600"> <!-- Note the less than sign is escaped --> <if expr="${k}>12"> <then> <echo message="Generating image at ${k}:${mm}"/> <image file="test.png"/> </then> </if> <!-- Or you can include the expression in a CDATA block: so you don't have to escape anything --> <if> <![CDATA[${k}>12]]> <then> <echo message="Generating image at ${k}:${mm}"/> <image file="test.png"/> </then> </if> </isl> if.isl