Configuring the WeatherEase Demo Program

Last revised: 09Nov01 GLG

Table of Contents

Notice of Disclaimer

By default, this software uses and presents data supplied by a NOAA web-server.
NOAA disclaims any use of the supplied data for aviation or other operational purposes -- "Data distribution via the Internet is not considered an operational delivery mechanism by the NWS due to our inability to insure access to this service, therefore, the information available here shall not be used for flight planning or other operational purposes."
Furthermore, the author of the WeatherEase Toolkit software reminds you that this software is distributed under the "Artistic License", one condition of which is:
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Introduction

The Weather Watcher demo program is very flexible and configurable. Nonetheless, it is still only a demo program. It is not intended as full-featured consumer software for presenting current weather conditions. So if you think of a feature you'd like to see, you are encouraged to implement it yourself, rather than asking me to add the feature. My purpose behind creating the WeatherEase Toolkit was to make it easier for YOU to write weather software.

Numbers are typically shown rounded to the nearest whole number for whatever the reading and its units are. There are exceptions to this rule, however:

All the properties described below are optional. If not defined, a default is used. There are no default stations, so if the stations-file is missing, empty, or malformed, the list will have no items in it.

Principal Properties and Command-Line Parameters

The name of the principal properties file is "All-watched-settings", with or without a ".txt" suffix. This file is first looked for in the "user.dir" directory (i.e. in the app's own directory), then in the "user.home" directory. In each location, it is first looked for without a suffix, then with a ".txt" suffix. When the first matching file is found, that is the file whose contents are read as the principal properties. If no matching file is found anywhere, then the principal properties are just the system properties.

After any principal properties have been loaded, the command-line args are parsed. All the args are treated as additional properties-files, which are loaded in turn. Any arg that starts with "-" is quietly ignored, since the demo uses no option-flags. Any filename that does not exist or is unreadable is skipped over without ill effect. Any file whose contents are not really structured as properties-text will cause parsing exceptions which are ultimately ignored.

Since command-line properties-files are opened in turn, files later in the list override properties defined earlier. That is, the last property-file loaded that defines a particular property will prevail. There is no warning of this, and it is not considered an error. It's a feature.

You can also define command-line properties in lieu of using properties-files. These are simply added to the system properties before main() is called, so are part of the default properties context.

All the properties defined by loading files or defined as system properties will ultimately determine how the application looks and acts:

Stations File Format

The list of stations to watch is given by the contents of a text file. The filename of the stations file is given by the app.weather.watch.stations property in the main properties file. By default, that filename is "All-watched-stations.txt", which is a relative pathname signifying that the file is located in the app's own default directory.

The contents of the stations file must be in a format acceptable to the StationBuilder class whose fully qualified class-name is given by the app.weather.watch.stations.class property. By default, that's the fully qualified name of the NWSStationBuilder class.

The NWSStationBuilder reads stations one line at a time. Empy lines, blank lines, and lines consisting entirly of white-space are ignored. Lines starting with "#" are treated as comments and are also ignored. All other lines consist of a semicolon-separated list of station data. That format matches the format in which NOAA/NWS distributes a zipped text file containing a comprehensive list of stations. Not all stations in that list are actually available from the NOAA web-server. The simplest way to determine whether a given station is available from the NOAA web-server or not is to copy and paste its line of semicolon-separated fields into "All-watched-stations.txt" and see whether the demo program can retrieve data for it or not. If you see a FileNotFoundException in the list rather than weather readings, then you know that no data is available from NOAA for that station.

The format of stations recognized by NWSStationBuilder is for the NOAA-supplied station-list keyed by location identifier (ICAO location ID). The field offsets in an array are as follows:

(0) ICAO Location Indicator -- 4 alphanumeric characters.

(1) Block Number -- 2 digits representing the WMO-assigned block. Not all stations in the file have an assigned block number. The value "--" is used for stations without an assigned number.

(2) Station Number -- 3 digits representing the WMO-assigned station. Not all stations in the file have an assigned station number. The value "---" is used for stations without an assigned number.

(3) Place Name -- Common name of station location.

(4) State -- 2 character abbreviation (included for stations located in the United States only).

(5) Country Name -- Country name in ISO short English form.

(6) WMO Region -- digits 1 through 6 representing the corresponding WMO region, 7 stands for the WMO Antarctic region.

(7) Station Latitude -- DD-MM-SSH where DD is degrees, MM is minutes, SS is seconds and H is N for northern hemisphere or S for southern hemisphere. The seconds value is omitted for those stations where the seconds value is unknown.

(8) Station Longitude -- DDD-MM-SSH where DDD is degrees, MM is minutes, SS is seconds and H is E for eastern hemisphere or W for western hemisphere. The seconds value is omitted for those stations where the seconds value is unknown.

(9) Upper Air Latitude -- DD-MM-SSH where DD is degrees, MM is minutes, SS is seconds and H is N for northern hemisphere or S for southern hemisphere. The seconds value is omitted for those stations where the seconds value is unknown.

(10) Upper Air Longitude -- DDD-MM-SSH where DDD is degrees, MM is minutes, SS is seconds and H is E for eastern hemisphere or W for western hemisphere. The seconds value is omitted for those stations where the seconds value is unknown.

(11) Station Elevation (Ha) -- The station elevation in meters. Value is omitted if unknown.

(12) Upper Air Elevation (Hp) -- The upper air elevation in meters. Value is omitted if unknown.

(13) RBSN indicator -- P if station is defined by the WMO as belonging to the Regional Basic Synoptic Network, omitted otherwise.

FlexibleListView List-item Properties

These properties control how each list-item is formatted, and the units in which readings are displayed. The comma-separated list in the "app.weather.watch.listview.sky" property is an ordered list of 6 text items used to represent the different levels of sky cover (cloudiness). It must consist of at least 6 items or it will not be used. The first item is for clear skies, the next for 1/4 coverage, and so on through 4/4 coverage (overcast). The last (6th) item is for obscured skies (i.e. Sky.INDEFINITE). Excess white-space is always trimmed from the text before determining the padding width.

FlexibleListView List-item Symbols

The list-item template contains literal characters, and symbols prefaced with '$'. Every literal character is placed into the formatted list item exactly as and where given. Use literal characters for inserting spaces or literal text between symbols, and those literals appear in the formatted list item.

Every symbol is replaced in the formatted list item with a specific reading or measurement from the weather report. Most symbols produce a number and the units. $C, $F, and $H only produce numbers. $D, $K, $X and some others produce text and no units.

FlexibleListView Descriptive-text Properties

When you designate FlexibleListView as the listview class, you also gain control over the contents of the descriptive-text area. You will always get a description of the station itself, including its name, country, elevation, and latitude & longitude. You can also specify additional readings or measurements to be described from the current report. In general, the descriptive-text version of some reported reading will either expand on the data presented in the list-item, or present it in the highest available precision.

In addition to reported readings that can appear in list-items, you have additional readings that can only appear in descriptive text. For example, recent weather phenomena, peak wind, pressure-trend, cumulative precipitation, temperature extremes, and the string form of the actual report data.

FlexibleListView Descriptive-text Symbols

The descriptive-text formatting template is a string with symbols representing different readings from a weather report. Unlike the List-item template, every character is a symbol representing a reading, and there are no literal characters. You include or exclude specific characters to include or exclude the corresponding readings. The order of the characters in the template determines the order of the descriptive text. All characters that don't have a symbolic meaning are ignored.

The recognized descriptive-text symbols are:

The J descriptive text uses the list of 6 comma-separated text items given by the "app.weather.watch.listview.describe.sky" property.

The T and U descriptive texts use the SimpleDateFormat template designated by the "app.weather.watch.listview.describe.time" property.


To Greg's Home Page
To Greg's Software Page