The default generation model for wview is to generate a weather Web site based on a series of HTML file templates and images. For any template file named example.[ext]x and listed in html-templates.conf, wview will generate a file named example.[ext]. Thus, myscript.phpx listed in html-templates.conf and found in $prefix/var/wview/html will have all wview tags replaced, and the resulting file will be named myscript.php. For any template file named example.htmx and listed in html-templates.conf, wview will generate a file named example.htm. The resulting files are stored at the location specified on the wviewmgmt File Generation page: “Generation Target Path”.
Changing HTML templates in $prefix/etc/wview/html does not require you to restart wview. The changes you make will take effect at the next htmlgend (HTML generation dæmon) generation cycle. Changing the config files images.conf, html-templates.conf and (if supported) forecast.conf does not require restarting wview, but it does require an HUP signal to be sent to htmlgend to cause these files to be reread. Do this as follows (this also will toggle log verbosity):
$ sudo kill -s HUP `cat $prefix/var/wview/htmlgend.pid`
wview supports template macro file inclusion in template files. The meta-tag is <!--include filename.xxx-->. Any template macro file that is to be included in one or more template files should be listed before any templates including it in the $prefix/etc/wview/html-templates.conf configuration file. There is no restriction on the levels of inclusion, just be sure you specify macro templates early in the html-templates.conf file. The wview default Web site templates utilize several header macro files.
HTML template files (in $prefix/etc/wview/html) can be customized to your language and design preferences. The configuration file html-templates.conf specifies the template files to be used for generation. You may add or remove from this list as needed. Weather image captions can be edited in the $prefix/etc/wview/images.conf file for your language preferences. The configuration parameter on the File Generation Page “Enable Metric Units For Generation?” allows for configuration of metric units. If set to “yes”, it causes wview to output all images (buckets and charts) as well as all values for HTML tags in metric units. The file images.conf can be edited to translate the English labels, titles and units to any language. By editing this file and the HTML template files, any language can be supported by wview. In fact, you easily can switch back and forth between US and metric units by toggling this configuration parameter and restarting wview.
wview provides a number of features that allow advanced use of the weather data collected from your station. Alarms may be defined such that if an upper or lower bound is exceeded, a user-defined script will be executed. These scripts may send a notification e-mail or trigger an external application. It's also possible to connect to the wview server via TCP/IP socket and receive an unsolicited, periodic data feed of weather data. By using the “Virtual” station type, you can connect to another wview server remotely and receive the station data as if it were connected directly to the station hardware.
Mark Teel is the Software Engineering Manager for a major supplier of display and control systems for mass transit and commercial airline systems. He is also an advocate of open-source software development and has contributed to several projects, including CodeAnalyzer (a Java-based source code analyzer), radlib (Rapid Application Development Library) and wview.
- Readers' Choice Awards 2013
- The Geek's Guide to the Coolest 2013 Holiday Gifts
- Two Pi R
- Non-Linux FOSS: Let's Make Music Together
- Best. Cake. Ever.
- A Handy U-Boot Trick
- Raspberry Pi: the Perfect Home Server
- AIDE—Developing for Android on Android
- Tech Tip: Really Simple HTTP Server with Python
- Linux Systems Administrator
2 hours 48 min ago
18 hours 54 min ago
- Thanks for clearing that up.
1 day 18 min ago
- Nice coding on the cake. I
1 day 11 hours ago
- Baker's identity
1 day 16 hours ago
- Uber jealous
1 day 21 hours ago
- Reality is disapointing
2 days 8 hours ago
- Máy sấy quần áo
2 days 10 hours ago
- Services on GlusterFS
2 days 11 hours ago
- Reply to comment | Linux Journal
2 days 12 hours ago