Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width45%

Anchor
frames
frames

Frames

A story (including the inbox) may consist of an arbitrary number of frames by specifying the frame key according to the following schema:

Anchor
titleFrame
titleFrame
The title of a frame in the inbox will be used in the list of actions that the user can invoke from the inbox drop-down menu. The title of a frame in a regular story will be used as the name of the button that the user can activate. As explained above, the title can be different for various languages.

Anchor
startFrame
startFrame
The start and stop keys indicate the time window in which the frame of a story is active. For a frame in the inbox this means that the associated event is available in the inbox within the time window defined by the start and stop time. For a frame in a regular story, the associated event will be executed if the user pushes the story button between the start and stop time. The start and stop keys have attributes date and time following the format YYYY-MM-DD and hh:mm:ss, respectively. Both the start and stop keys are optional. If these are not specified, then these default to the start and end time of the game, respectively.

Anchor
popup
popup
The popup key is a flag indicating whether or not to show a pop-up window at the start of the frame. For a frame belonging to the inbox this means that the associated event is executed. For a frame of a regular story, a message dialog appears informing the user that new content is available for that story, which can trigger the user to activate the relevant story button. If FEWS is running, these messages will appear within FEWS, otherwise a new window containing the message will be shown.

Anchor
requiredExperienceLevel
requiredExperienceLevel
The requiredExperienceLevel key specifies that an event is only executed for the indicated experience level. Experience levels are defined in the application configuration as a list, e.g. "Beginner;Intermediate;Expert". This key can be specified multiple times if the event should be executed for multiple levels (e.g. both Beginner and Intermediate). In a frame, one refers to these levels by a number (starting with 0), e.g. if an event is only to be executed for experts, then this is configured as 

Code Block
xml
xml
<requiredExperienceLevel>2</requiredExperienceLevel>

If this key is not specified, then the event will be executed for all experience levels.

Anchor
once
once
The once key is a flag indicating that an event must be executed only once during a time frame.

Any number of conditions can be added to a story (or inbox) frame; the associated event will only be executed if all of these conditions are fulfilled (see below).

Anchor
file
file
An event can be associated with a story frame by specifying the file key. Depending on the file type, a suitable application is started for displaying the file (e.g. a pdf-file is displayed in Adobe Reader and the contents of a txt-file is displayed in a message dialog window). The file key has an optional language attribute lang that behaves the same as for the title keys.

Anchor
message
message
Apart from a file, an event for the story frame may also be a message. For such a message, no file has to be added to the scenario/script database. Instead, the contents of the message (a text string) can be specified directly in the script configuration. The message key takes an optional lang attribute as explained before. If the message contains an URL (starting with 'http://', 'https://', 'ftp://' or 'mailto:// ' and ending with '/') then this URL is made clickable automatically. If FEWS is running, these messages appear within FEWS, otherwise a new window containing the message appears.

Column

Section
Column
width45%

A condition can be based on components of the forecast table. It must be specified according to:

Anchor
condition
condition

  • Anchor
    columnId
    columnId
    columnId is a reference to a column in the forecast table (see below), usually a parameter,
  • Anchor
    rowId
    rowId
    rowId is a reference to a row in the forecast table (see below), usually a location,
  • Anchor
    ifForecastValue
    ifForecastValue
    ifForecastValue indicates a condition based on the value of the published forecast,
  • Anchor
    ifForecastPublicationTime
    ifForecastPublicationTime
    ifForecastPublicationTime indicates a condition based on the publication time of the forecast,
  • Anchor
    ifForecastPublished
    ifForecastPublished
    ifForecastPublished indicates a condition based on whether a forecast has been published or not,
  • Anchor
    operator
    operator
    operator is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), "ge" (greater than or equal to), "eq" (equal to), "ne" (not equal to), "before", or "after", depending on the type of condition,
  • value is the reference value to compare to; depending on the condition type, this can be an integer/real value, a boolean value, or a date/time value.

Anchor
script_configExample
script_configExample

An example in which conditions are used:

Code Block
xml
xml
<frame>
   <title>condition example</title>
   <start date="2008-03-13" time="00:01:00"/>
   <stop date="2008-03-13" time="00:02:00"/>
   <popup>true</popup>
   <condition>
      <columnId>water_level</columnId>
      <rowId>Lowestoft</rowId>
      <ifForecastPublished>
         <operator>eq</operator>
         <value>false</value>
      </ifForecastPublished>
   </condition>
   <message>Hurry, the forecast for Lowestoft has not been published yet!</message>
</frame>
<frame>
   <title>condition example</title>
   <start date="2008-03-13" time="00:10:00"/>
   <stop date="2008-03-13" time="00:11:00"/>
   <popup>true</popup>
   <condition>
      <columnId>water_level</columnId>
      <rowId>Lowestoft</rowId>
      <ifForecastPublicationTime>
         <operator>after</operator>
         <value date="2008-03-13" time="00:10:00"/>
      </ifForecastPublicationTime>
   </condition>
   <message>You were quite late with the forecast for Lowestoft</message>
</frame>
<frame>
   <title>condition example</title>
   <start date="2008-03-13" time="00:15:00"/>
   <stop date="2008-03-13" time="00:16:00"/>
   <popup>true</popup>
   <condition>
      <columnId>water_level</columnId>
      <rowId>Lowestoft</rowId>
      <ifForecastValue>
         <operator>ge</operator>
         <value>300</value>
      </ifForecastValue>
   </condition>
   <file>emergency_telephone_call.mp3</file>
</frame>
Column

...

Anchor
example
example

Example

A complete An example of a script configuration is given here:

Code Block
xml
xml
titleExample of script configuration
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2009 sp1 (http://www.altova.com) by ICT (Stichting Deltares) -->
<script xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/watercoachschemas/version1.0/script_config.xsd">
	<title>Demonstration</title>
	<dataStart date="2007-10-04" time="10:00:00"/>
	<scriptStart date="2012-11-23" time="09:55:00"/>
	<scriptStop date="2012-11-23" time="13:00:00"/>
	<stories>
		<inbox>
			<title>inbox</title>
			<frame>
				<title lang="EN">Session start</title>
				<start date="20122007-1110-2304" time="10:0005:05"/>
				<popup>true</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<requiredExperienceLevel>1</requiredExperienceLevel>
				<file lang="EN">start_session.txt</file>
			</frame>
			<frame>
				<title lang="EN">KNMI analysis_1</title>
				<start date="20122007-1110-2304" time="10:0106:05"/>
				<popup>false</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<requiredExperienceLevel>1</requiredExperienceLevel>
				<file lang="EN">windfield_03111200.pdf</file>
			</frame>
			<frame>
				<title lang="EN">Assignment 1</title>
				<start date="20122007-1110-2304" time="10:1116:00"/>
				<popup>false</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<once>true</once>
				<file lang="EN">assignment_1.txt</file>
			</frame>
		</inbox>
		<story color="aquamarine">
			<title>KNMI</title>
			<frame>
				<title lang="EN">Telephone call</title>
				<start date="20122007-1110-2304" time="10:0106:00"/>
				<stop date="20122007-1110-2304" time="10:1016:00"/>
				<popup>true</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<requiredExperienceLevel>1</requiredExperienceLevel>
				<file lang="EN">phonecall_knmi_1.txt</file>
			</frame>
			<frame>
				<title lang="EN">KNMI phoneline is busy</title>
				<start date="20122007-1110-2304" time="10:1116:00"/>
				<stop date="20122007-1110-2304" time="11:0005:00"/>
				<popup>false</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<requiredExperienceLevel>1</requiredExperienceLevel>
				<message lang="EN">KNMI phoneline is busy. PLease try again later.</message>
				<message lang="NL">KNMI telefoonlijn is ingesprek. Probeer het later nogmaals.</message>
			</frame>
		</story>
		<story color="goldenrod">
			<title>HMCZ</title>
			<frame>
				<title lang="EN">Telephone call</title>
				<start date="20122007-1110-2304" time="11:0207:00"/>
				<stop date="20122007-1110-2304" time="12:0207:00"/>
				<popup>false</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<file lang="EN">phonecall_hmcz_1.txt</file>
			</frame>
		</story>
		<story color="forest green">
			<title>HMCN</title>
			<frame>
				<title lang="EN">Telephone call</title>
				<start date="20122007-1110-2304" time="10:0308:00"/>
				<stop date="20122007-1110-2304" time="12:0308:00"/>
				<popup>false</popup>
				<requiredExperienceLevel>0</requiredExperienceLevel>
				<file lang="EN">phonecall_hmcn_1.txt</file>
			</frame>
		</story>
	</stories>
	<forecastTable>
		<header>
			<column id="sector">sector</column>
			<column id="station">station</column>
			<column id="astro_date" lang="EN">date</column>
			<column id="astro_time" lang="EN">time astro high tide</column>
			<column id="astro_level" unit="cm" isExport="true" exportName="H.tidal.astronomic">astro water level</column>
			<column id="svsd_forecast" unit="cm" isEditable="true" exportName="H.tidal.peak">forecast</column>
		</header>
		<row id="Vlissingen">
			<cell columnId="sector">Schelde</cell>
			<cell columnId="station">Vlissingen</cell>
			<cell columnId="astro_date" lang="EN">January 1</cell>
			<cell columnId="astro_time">19:16</cell>
			<cell columnId="astro_level">237</cell>
		</row>
		<row id="HoekVanHolland">
			<cell columnId="sector">West Holland</cell>
			<cell columnId="station">Hoek van Holland</cell>
			<cell columnId="astro_date" lang="EN">January 1</cell>
			<cell columnId="astro_time">20:01</cell>
			<cell columnId="astro_level">122</cell>
		</row>
	</forecastTable>
	<forecastNote>
		<initialText lang="EN">Here you can add notes to support your forecast.</initialText>
	</forecastNote>
	<dictionaryFiles>
		<dictionaryFile lang="EN">Dictionary_1.xml</dictionaryFile>
	</dictionaryFiles>
</script>