Author Topic: Flash Dynamic Rapid Fire Wind Vane in Beta!  (Read 5605 times)

mattm

  • Gentle Breeze
  • **
  • Posts: 21
  • Station Details: 2011 MacMini, Core2 duo, Vantage Pro 2 with 5 stations
Flash Dynamic Rapid Fire Wind Vane in Beta!
« on: March 11, 2012, 09:55:56 PM »
Friends, brethren, comrades. I've got a working wind speed/direction vane in working beta. I've designed it to look almost identical to Wunderground's rapid fire wind vane. This, of course, is customizable. You can make it look like whatever you'd like; colors, background colors, shadows, line thickness, size, pointer speed, radial ticks, radial numbers, etc. It's pretty much open. In mine, the live wind speed data value is always green, as opposed to Wunderground's where the value is black and changes to green upon a change in wind speed (I haven't quite figured out how to do that effectively, but I haven't really put my head around that yet).

A working model is on my webpage http://www.gardenxingweather.info/home.html. I have LWC to upload data every 10 seconds. The .xml file is set to update (re-draw) the graphic at the same frequency. It's important to have the .xml file update *at least* at the frequency of the station.

This is a Flash app, folks. Those of us with iPads and who use them to access our pages won't be able to see the wind vane. Bummer (unless there's a workaround?). I'd be happy to work with HTML 5 in the future if there were some nice, easy tools to work with. But, in the meantime, Flash will have to do.

This was *extremely* tricky to code the php file correctly. The main reason being that the wind direction data from Lightsoft or Weathercat is a scalar value (position), for example, 185. But the Flash application needs to move the pointer with data telling it how many degrees to move, so the ['winddir'] value can't be used directly. This entailed having to store a "previous" wind direction scalar and saving it in a .txt file, and subtracting it from a "current" wind direction scalar value to yield a "degrees to move" data value. This was the big hurdle. [banghead]

This uses Lightsoft's (or WC's) submit_weather.php file. I'm still using LWC and haven't upgraded to WC yet. I will shortly.

I've altered LWC's php file to output an .xml file instead of the .txt file that Stu designed it to. If you're currently using the .txt file for the live data output, you'd have to forego that functionality for this wind vane to work. However, you could use the .xml file to get the other live data you'd want and output it using Flash, if that was important to you.

Anyway, let me know what you all think. I'm happy to answer any questions.

I'll have the necessary files for you all to try in short order. Just smoothing some things out.

Matt

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: Flash Dynamic Rapid Fire Wind Vane in Beta!
« Reply #1 on: March 11, 2012, 11:20:38 PM »
Nice work Matt  [tup]

Stu.

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
KEWL - man!! (Re: Flash Wind Vane in Beta!)
« Reply #2 on: March 12, 2012, 12:02:12 AM »
Hi Matt and WeatherCat fans,

Friends, brethren, comrades. I've got a working wind speed/direction vane in working beta.

Well I first tried it . . . . nothing, nada, zip, zippo .  . . .  :o

It appears my Firefox has "issuez" with it.  However, a quick change to Safari and . . . . .

KEWL Man!!

I'm debugging my WC Status Growler script so this will be a quickie reply.  But this looks very promising indeed!!!  [tup]

Thanks Matt for trying to get your head around this problem!!!  [woohoo]

Cheers, Edouard  [cheers1]

mattm

  • Gentle Breeze
  • **
  • Posts: 21
  • Station Details: 2011 MacMini, Core2 duo, Vantage Pro 2 with 5 stations
Re: Flash Dynamic Rapid Fire Wind Vane in Beta!
« Reply #3 on: March 12, 2012, 12:30:45 AM »
Edouard:

You're having problems with it in Firefox? Hm. Works on my end with Safari, Firefox and Opera.

I had the vane off the site for about 10 minutes. Perhaps you viewed the page then?


Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: Flash Dynamic Rapid Fire Wind Vane in Beta!
« Reply #4 on: March 12, 2012, 01:15:31 AM »
Nice! Thanks for looking at this, Between you and Todd, we'll have some great stuff to add to our web pages.

I'm just using the default submit_data.php file as a link on my web page for instant updates, but that's just because I don't know how to do anything else with it.

Thanks,
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Firefox happy with it now. (Re: Flash Dynamic Wind Vane)
« Reply #5 on: March 12, 2012, 09:05:10 PM »
Hi Matt and WeatherCat fans,

You're having problems with it in Firefox? Hm. Works on my end with Safari, Firefox and Opera.

I had the vane off the site for about 10 minutes. Perhaps you viewed the page then?

It may have been exactly that 10 period because it is working perfectly well now.

Really nifty!!  [bounce]

Thanks again for doing this!  [tup]

Cheers, Edouard  [cheers1]

mattm

  • Gentle Breeze
  • **
  • Posts: 21
  • Station Details: 2011 MacMini, Core2 duo, Vantage Pro 2 with 5 stations
Re: Flash Dynamic Rapid Fire Wind Vane in Beta!
« Reply #6 on: March 12, 2012, 10:20:04 PM »
Actually I have a correction. I had said in my original post that the .txt file that the submit_weather.php file creates couldn't be used with my re-write of the php file. I lied.  ;D The php file can continue to output that .txt file if you are using it now. I'll have to re-write the php file to put that text output back in.

Sorry for the confusion.