Mercurial > hg > egg-tcls
comparison weather.tcl @ 238:a1d6e2d8789e
Add new data from FMI service and change datafile format.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 19 Jan 2015 16:26:42 +0200 |
parents | dc1afa011883 |
children | ae9d83ec50d5 |
comparison
equal
deleted
inserted
replaced
237:56af82fb7a6d | 238:a1d6e2d8789e |
---|---|
205 | 205 |
206 | 206 |
207 # Produce one location of weather data as a string | 207 # Produce one location of weather data as a string |
208 proc weather_get_data {ukey udata} { | 208 proc weather_get_data {ukey udata} { |
209 set str "\002[lindex $udata 0]\002, mitattu klo [weather_ctime [lindex $udata 2]]: \002[lindex $udata 3]°C\002" | 209 set str "\002[lindex $udata 0]\002, mitattu klo [weather_ctime [lindex $udata 2]]: \002[lindex $udata 3]°C\002" |
210 append str [weather_item $udata 5 ", @@"] | 210 if {[lindex $udata 1] == 0} { |
211 append str [weather_item $udata 6 ", kosteus \002@@%\002"] | 211 append str [weather_item $udata 4 ", @@"] |
212 append str [weather_item $udata 7 ", keli @@"] | 212 append str [weather_item $udata 5 ", keli @@"] |
213 append str [weather_item $udata 4 ", tien pinta @@°C"] | 213 append str [weather_item $udata 6 ", tien pinta @@°C"] |
214 } else { | |
215 append str [weather_item $udata 4 ", kosteus \002@@%\002"] | |
216 append str [weather_item $udata 5 ", tuuli \002@@\002 m/s"] | |
217 append str [weather_item $udata 6 ", pilvipeite \002@@\002"] | |
218 } | |
214 return "${str}." | 219 return "${str}." |
215 } | 220 } |
216 | 221 |
217 | 222 |
218 # Get data by location key | 223 # Get data by location key |