Jump to content
Sign in to follow this  
layer

Dopplar Radar!

Recommended Posts

layer

:D hey guys, the pictures are from weather.com in case it's copyright...

#include <GUIConstants.au3>
GUICreate ("Dopplar Radar", 700, 485)
GUISetState ()
Func GetEcho ()
   InetGet ("http://image.weather.com/web/radar/us_nyc_closeradar_large_usen.jpg", @DesktopDir & "\dopplar.jpg", 1, 0)
EndFunc
While 1
   $get= GUIGetMsg ()
   Select
   Case $get= -3
      Exit
      EndSelect
      GetEcho ()
      GUICtrlCreatePic (@DesktopDir & "\dopplar.jpg", -1, -1, 700, 485)
      Sleep (60000)
      WEnd

i ahve a winter storm warning!! w00t, i just put it together so sry for the slopiness!

sorry you cant close it until a minute is up =/ that is a minute right? sleep (100000)

enjoy!!! ;):D:idiot:

EDIT: fixed the GUI width so you can see the weather channel logo! :lol:

EDIT2: fixed the sleep amount!

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites
phillip123adams

hey guys, the pictures are from weather.com in case it's copyright...

i ahve a winter storm warning!! w00t, i just put it together so sry for the slopiness!

sorry you cant close it until a minute is up =/ that is a minute right? sleep (100000)

<{POST_SNAPBACK}>

Cool... One minute = 60 * 1000, or 60,000.

Phillip

Share this post


Link to post
Share on other sites
layer

ahhh ok, gotchya


FootbaG

Share this post


Link to post
Share on other sites
sykes

Very cool ... needs code to let you exit though ... either by hotkey or just allowing closing with normal clicking on the X method

Edited by sykes

We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites
layer

here ya go!

press Ctrl+E to exit! enjoy

Func Close ()
Exit
EndFunc
HotKeySet ("^e", "Close")
#include <GUIConstants.au3>
GUICreate ("Dopplar Radar", 700, 485)
GUISetState ()
MsgBox (0, "Exiting", "Press Ctrl+E to exit!!!")
Func GetEcho ()
   InetGet ("http://image.weather.com/web/radar/us_nyc_closeradar_large_usen.jpg", @DesktopDir & "\dopplar.jpg", 1, 0)
EndFunc
While 1
   $get= GUIGetMsg ()
   Select
   Case $get= -3
      Exit
      EndSelect
      GetEcho ()
      GUICtrlCreatePic (@DesktopDir & "\dopplar.jpg", -1, -1, 700, 485)
      Sleep (60000)
      WEnd

FootbaG

Share this post


Link to post
Share on other sites
cybie

Excellent use of AutoIt to perform a basic time-saving task! I made some VERY MINOR alterations to your code and thought I would make my changes available.

I removed the msgbox that came up with instructions to close, changed the shortcut to close to something that I am more familiar with that would not be used for anything else, made the window semi-transparent and organized the code a little diffently.

The reason that I assigned variables to the title was to slim the size and make changes slightly easier and the reason I assigned variables to the height and width is in case you want to do any handy tricks like:

$xPos = (@DesktopWidth - 700)
$yPos = (@DesktopHeight - 500)

to start the display ont he bottom or right side of your screen.

Again, full credit for this goes back to Layer for this idea. :idiot:

#include <GUIConstants.au3>
HotKeySet ("^{F4}", "Close")
$xPos = -1
$yPos = 0
$Title = "Doppler Radar - [Ctrl+F4 to exit]"
GUICreate ($Title, 700, 500, $xPos, $yPos, 0x00800000)
WinSetTrans ($Title, "", 200 )
GUISetState ()
While 1
  $get= GUIGetMsg ()
  Select
  Case $get= -3
     Exit
     EndSelect
     GetEcho ()
     GUICtrlCreatePic (@TempDir & "\doppler.jpg", -1, -1, 700, 485)
     Sleep (60000)
     WEnd

Func GetEcho ()
  InetGet ("http://image.weather.com/web/radar/us_ind_closeradar_large_usen.jpg", @TempDir & "\doppler.jpg", 1, 0)

EndFunc
     
Func Close ()
Exit
EndFunc
:D:lol:

Writing damaged code since 1996.

Share this post


Link to post
Share on other sites
sykes

This is what I love about these forums. Everybody coming up with ideas and other people adding to or suggesting things to make it different or better. That's what makes this community nice to be a part of. :idiot:


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites
layer

cool cybie! good work, and half the credit gose to you for making it like that :lol:

maybe ill make it so it's a pop up men so when u press ESC or something, it will pop up and you know, that would be cool, maybe ill work on it now ;)

EDIT: sykes, i totally agree with you :D:idiot::D

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites
cybie

maybe ill make it so it's a pop up men so when u press ESC or something, it will pop up and you know, that would be cool, maybe ill work on it now :idiot:

This program is fairly simple, but it's a hit! I have given this basic version in compiled form to a few people and they thought it was pretty cool. What I would like to do now is make GUI buttons across the top to load a different map into the window, but keep it refreshing every minute.

I am working on making this work now, but if anyone else has any ideas, please bring them to the table. :D

-again, thanks for bringing this idea out, Layer. This is fun to play with.


Writing damaged code since 1996.

Share this post


Link to post
Share on other sites
layer

haha, no problem, thats a brilliant idea though!! id like to see it when your finished! to see the buttons on the top and be able to view different maps! whoa!


FootbaG

Share this post


Link to post
Share on other sites
killaz219

This is pretty interesting..But it reminds me of that annoying "WeatherBug".

Share this post


Link to post
Share on other sites
layer

yea, i think when they say weather"bug"... i think they mean "bad bug"... but here you get to see the source and i hate spam so why would i make it? i used to have that weather bug and like everyday, my computer got, slower, and slower, and sl--o-----w----------------e---------------------------------------r...


FootbaG

Share this post


Link to post
Share on other sites
cybie

This is pretty interesting..But it reminds me of that annoying "WeatherBug".

<{POST_SNAPBACK}>

:D This is a cool weather tool, but is nothing like WeatherBug. WeatherBug is just a trojan, more-or-less, that happens to deliver weather news to you while it is loading your system full of it's affiliated spyware and sending your usage data back to arious vendors.

Although this program also gives you weather info, it's actually just pulling an image from weather.com (or wherever you tell it to) and serving it up to you in a GUI. Techincally, you could use the exact same code to make something that shows you your websites usage statistics or virtualyl any other dynamically generated graphic on the web or on your own local network.

While we are on the topic could someone tell me how to make the minimize and close buttons on the GUI work like they should??? :idiot: This is something I have never dealt with and I can't seem to figure it out...

Here is the code I have so far:

(I need help getting close to work, as well as figuring out why the images don't switch as they should... Seems to be a problem with the loop...)

#include <GUIConstants.au3>
Opt("GuiOnEventMode", 1)
HotKeySet ("^{F4}", "Close")
HotKeySet ("{F5}", "GetDoppler") ;redesign to refresh whichever image is in window.
HotKeySet ("{F1}", "Doppler")
HotKeySet ("{F2}", "Current")
HotKeySet ("{F3}", "Precip")
$xPos = -1;center
$yPos = 0 ;absolute top
$Title = "Weather Station - [Ctrl+F4 to exit]"
GUICreate ($Title, 720, 500, $xPos, $yPos)
WinSetTrans ($Title, "", 200 );will not work on older Win OSes
; add section to allow the minimize, maximize and close to work.
GUISetState ()

$GetMap = 1 ;set the default map as the doppler

While 1                    ;while open - continue looping
  If $GetMap = 1 Then
    GetDoppler ()
  ElseIf $GetMap = 2 Then
        GetCurrent ()
  ElseIf $GetMap = 3 Then
        GetPrecip ()
  EndIf
     Sleep (5000)
WEnd

Func GetDoppler ()
  InetGet ("http://image.weather.com/web/radar/us_ind_closeradar_large_usen.jpg", @TempDir & "\weather.jpg", 1, 0)
  GUICtrlCreatePic (@TempDir & "\weather.jpg", -1, -1, 720, 485)
EndFunc

Func GetCurrent ()
  InetGet ("http://image.weather.com/images/maps/current/cur_mw_720x486.jpg", @TempDir & "\weather2.jpg", 1, 0)
  GUICtrlCreatePic (@TempDir & "\weather2.jpg", -1, -1, 720, 485)
EndFunc

Func GetPrecip ()
  InetGet ("http://image.weather.com/images/maps/current/ec_curtemp_720x486.jpg", @TempDir & "\weather3.jpg", 1, 0)
  GUICtrlCreatePic (@TempDir & "\weather3.jpg", -1, -1, 720, 485)
EndFunc

Func Doppler ()
 $GetMap = 1
EndFunc

Func Current ()
 $GetMap = 2
EndFunc

Func Precip ()
 $GetMap = 3
EndFunc

Func Close ()
Exit
EndFunc
Edited by cybie

Writing damaged code since 1996.

Share this post


Link to post
Share on other sites
Gene

Hi, I have added some ideas to this, I expect to take some flack because they are not GUI, but I'm not there yet. The ideas are valid though. I look forward to comments :D , and flack too. :idiot:

I added code to show 17 local maps and a US map. It would be better to have used an INI file, but I had already done the Select statement. I'm looking for a listing of airport Ids with zip codes or vice versa, but nothing yet. If I find anything good, I'll put the info in an INI or as data pairs in a text string loaded from a file.

#include <GUIConstants.au3>
HotKeySet ("^{F4}", "Close")

Global $sZipCode
$sZipCode = ""; If you only want to see your area, put your Zip Code between 
;                   the quotes at left.  Note that not every area is configured.
If $sZipCode = "" Then
    $sZipCode = InputBox("Zip Code", "Enter your Zip Code," & @CRLF & "or " & @CRLF & "enter 'US' for a national map." & @CRLF & @CRLF & "Note that not every area is configured.", "", "", -1, -1, 0, 0)
EndIf

Global $sLocalCode
Select
    Case StringLeft ( $sZipCode, 2 ) = "27"
        $sLocalCode = "us_clt_"

    Case StringLeft ( $sZipCode, 2 ) = "60"
        $sLocalCode = "us_ord_"
        
    Case StringLeft ( $sZipCode, 2 ) = "10"
        $sLocalCode = "us_nyc_"
        
    Case StringLeft ( $sZipCode, 2 ) = "30"
        $sLocalCode = "us_atl_"
        
    Case StringLeft ( $sZipCode, 2 ) = "46"
        $sLocalCode = "us_ind_"
        
    Case StringLeft ( $sZipCode, 2 ) = "33"
        $sLocalCode = "us_mia_"
        
    Case StringLeft ( $sZipCode, 2 ) = "04"
        $sLocalCode = "us_btv_"
        
    Case StringLeft ( $sZipCode, 2 ) = "32"
        $sLocalCode = "us_tpa_"
    
    Case StringLeft ( $sZipCode, 2 ) = "70"
        $sLocalCode = "us_bix_"
    
    Case StringLeft ( $sZipCode, 2 ) = "94"
        $sLocalCode = "us_sfo_"
    
    Case StringLeft ( $sZipCode, 2 ) = "90"
        $sLocalCode = "us_lax_"
    
    Case StringLeft ( $sZipCode, 2 ) = "98"
        $sLocalCode = "us_sea_"
        
    Case StringLeft ( $sZipCode, 2 ) = "77"
        $sLocalCode = "us_gls_"
        
    Case StringLeft ( $sZipCode, 2 ) = "67"
        $sLocalCode = "us_ddc_"

    Case StringLeft ( $sZipCode, 2 ) = "23"
        $sLocalCode = "us_ric_"
        
    Case StringLeft ( StringUpper ( $sZipCode ), 2 ) = "US"
        $sLocalCode = "us"
        
    Case Else
         MsgBox(0, "Weather Map Zip and Location codes", "The Zip Code specified is not in the " & @CRLF & "Case statement, feel free to add it.")
         Exit

EndSelect

    $xPos = -1
$yPos = 0
$Title = "Doppler Radar - [Ctrl+F4 to exit]"
GUICreate ($Title, 700, 500, $xPos, $yPos, 0x00800000)
WinSetTrans ($Title, "", 200 )
GUISetState ()
While 1
 $get= GUIGetMsg ()
 Select
 Case $get= -3
    Exit
    EndSelect
    GetEcho ()
    GUICtrlCreatePic (@TempDir & "\doppler.jpg", -1, -1, 700, 475)
    Sleep (60000)
    WEnd

Func GetEcho ()
    If $sLocalCode = "us" Then
        InetGet ("http://image.weather.com/web/radar/us_radar_large_usen.jpg", @TempDir & "\doppler.jpg", 1, 0)
    Else
        InetGet ("http://image.weather.com/web/radar/" & $sLocalCode & "closeradar_large_usen.jpg", @TempDir & "\doppler.jpg", 1, 0)
    EndIf   
EndFunc
               
Func Close ()
Exit
EndFunc

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites
azjerry

I see functions like GUICreate and InetGet that generate an error when I try to run the script. Where do they come from?

Share this post


Link to post
Share on other sites
Gene

I see functions like GUICreate and InetGet that generate an error when I try to run the script.  Where do they come from?

<{POST_SNAPBACK}>

These and many other new functions are in the latest "Beta" versions of the software.

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites
b1t5tR3@m

I've been intrigued by this whole concept and thought I'd post my .02.

Personally, I've changed the linked URL to the smaller bitmap so it wouldn't take up so much screen real estate (http://image.weather.com/web/radar/us_ind_closeradar_medium_usen.jpg); then changed the appropriate script code to reflect that. I like Gene's addition of the edit box for where you live, but think it might be a bit easier to just allow the user to enter his/her abbreviated state....PA, MI, NY....etc, instead of using zip codes. Would cut down on the code entries as well.

I also like NASA's Global Hydrology and Climate Center site; you can pick different satellites to view, such as infrared, visible and also North and South America.

I Photoshopped an image to reflect the concept if anyone is interested...the basic layout is borrowed from Aaron's Encrypting tool.Weather_station.bmp

Share this post


Link to post
Share on other sites
layer

did you change the GUI color (not bk but like the border)? or is that just photo shop? i didnt know we could chnage color of border?


FootbaG

Share this post


Link to post
Share on other sites
zcoacoaz

make a drop down list of where you want to see, i had to change it to show my state (quite easy but u know)


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×