Comment 2 for bug 597670

Revision history for this message
Ward Muylaert (ward-muylaert) wrote :

There is something wrong with it though, feels like cannot be -6C at 22C. At the moment it is -4C at 25C.
A quick check tells me that (values rounded down) 22F = -6C and 25F = -4C. I'm not the biggest believer of a coincidence like that, so I inspected http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=Brussels,%20Belgium and noticed it didn't mention those values (well, it did, it says NA).

Now here's what I *think* goes wrong:
First, Temp is set @ http://bazaar.launchpad.net/~docky-core/docky/trunk/annotate/head:/StandardPlugins/Weather/src/Sources/WunderWeatherSource.cs#L189 , this is done in F.
Now FeelsLike tries to get set, it fails the checks for "NA" and thus executes:
FeelsLike = Temp; ( http://bazaar.launchpad.net/~docky-core/docky/trunk/annotate/head:/StandardPlugins/Weather/src/Sources/WunderWeatherSource.cs#L205 )
That's where it goes wrong, Temp's get is called and returns it in Celcius as per http://bazaar.launchpad.net/~docky-core/docky/trunk/annotate/head:/StandardPlugins/Weather/src/Sources/AbstractWeatherSource.cs#L84
So the value stored in FeelsLike is in C.
Now when FeelsLike's get is called, it will do the UseMetric check and call ConvertFtoC -again-, but FeelsLike value already was in C! So you end up with a weird negative value while it's the warmest day in weeks :)

Hope that made sense, I've never programmed in C# so I might have missed something.