Laptop GPS World

Laptop GPS World

GPS Navigation on Laptop PC, TabletPC, UMPC

 

A new hotkey to place a pushpin on the map

This is a discussion on A new hotkey to place a pushpin on the map within the Free add-ons forums, part of the Microsoft Streets and Trips category; I think it would work the way you are describing it, but I'm not sure if it would work ...


Go Back   Laptop GPS World > Software Discussions > Microsoft Streets and Trips > Free add-ons

Register All Albums FAQ Search Today's Posts Mark Forums Read

Notices

Reply
 
Thread Tools Display Modes
  #16  
Old December 3rd, 2007, 07:42 AM
Laptop GPS World
www.laptopgpsworld.com
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 1,560
Default Re: A new hotkey to place a pushpin on the map

I think it would work the way you are describing it, but I'm not sure if it would work satisfactorily for most users. In order for it to work properly, the GPS position would indeed need to be kept centered - users wouldn't be able to use the Dynamic Turn View feature. Also the problem would be the zoom level - at each different zoom level the feature would give POI alerts at completely different distances
__________________
Marvin Hlavac

Laptop GPS software reviews | Stores offering discounts to our members: Semsons & Co. Inc. and Deluo Electronics
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17  
Old December 8th, 2007, 02:25 AM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

Marvin

I'm working on it and wrote a code for the pushpin to follow the GPS icon. The GPS will no longer need to kept centered to add a pushpin. This is the new code for 2006 if you wish to try it out early:

Func push_pin()
reset_hotkeys()
Sleep(250)
ControlClick($productname, "", $panbutton)
ControlClick($productname, "", $panbutton)
Sleep(250)
MouseMove(600, 400, 0 )
ControlClick($productname, "", $createpushpin)
Sleep(250)
$pos_AfxWnd702 = ControlGetPos($productname, "", "AfxWnd702")
$left_pushpin = $pos_AfxWnd702[0]
$top_pushpin = $pos_AfxWnd702[1]
$right_pushpin = $pos_AfxWnd702[0] + $pos_AfxWnd702[2]
$bottom_pushpin = $pos_AfxWnd702[1] + $pos_AfxWnd702[3] + $titlebarhight
$coord_pushpin = PixelSearch($left_pushpin, $top_pushpin, $right_pushpin, $bottom_pushpin, 0x800000, 0, 1 )
If Not @error Then
$coord_xpushpin = $coord_pushpin[0] - $left_pushpin - 8
$coord_ypushpin = $coord_pushpin[1] - $top_pushpin - $titlebarhight + 12
ControlFocus($productname, "", "AfxWnd702")
Sleep(250)
ControlClick($productname, "", "AfxWnd702", "left", 1, $coord_xpushpin, $coord_ypushpin )
EndIf
ControlClick($productname, "", $selectbutton)
EndFunc

I also figured out how to scan for a unique pixel and play a beep sound when it appears, but I'm getting into difficulties there. I'm getting into a loop if I use the while command and it is keeping the other functions from working. If I use processexist it beeps once, but does not scan anymore. How did you manage it for the autoreroute?

If figure once this is solved, a routine can be added to shrink or expand the scanned area depending on the zoom level detected. Thinking of using pixelsearch to determine the position of the green tip of the tracker bar. Once the value is known, the scanned area around the GPS icon can be reduced or increased.

Last edited by toyfountain; December 8th, 2007 at 05:34 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18  
Old December 8th, 2007, 01:49 PM
Laptop GPS World
www.laptopgpsworld.com
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 1,560
Default Re: A new hotkey to place a pushpin on the map

1. Wow! I suspected you were working on something really hard since you haven't posted in the past few days! If your code is able to follow the GPS icon on the screen, then I think you've done more than I thought was possible using AutoIt. Now it's just a question of how reliable the pushpin function can be in real life usage.

2. I suspect you will figure out how to solve the "stuck-in-the-loop" issue yourself, but feel free to e-mail me your code (and indicate which line it seems to get stuck at). The auto-rerouting code was in the main While loop. If needed it would press F3, and if there was no action required, it did nothing.

3. If I understand correctly, for the purpose of the "beep" function, you are going to be scanning area around the GPS icon, instead of around the centre of the map pane?
__________________
Marvin Hlavac

Laptop GPS software reviews | Stores offering discounts to our members: Semsons & Co. Inc. and Deluo Electronics
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19  
Old December 8th, 2007, 04:36 PM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

1) Marvin if you want to try it, just replace the pushpin func section in the source code for the beta 2008 in the first post of this thread. Take care to modify AfxWnd702 if it is not the same in 2007 or 2008. It works by recognizing the dark burgundy colour in the center of the GPS icon. I hope 2007 and 2008 uses the same colour in the GPS icon. For 2006, this colour is great because it is not used in any other place I could find on the map except one. The red tack that has it too. Avoid using it in the map, and you can track the GPS icon even in dynamic mode. I've included close ups of the icons.

2) If it can't be done without disrupting Keys, then I was thinking of a separate application that could be started by Keys and it's sole function would be to scan for a unique pixel (light pink) entering a given area (around the coordinates of the GPS icon). Once detected a beep can be sounded until it exits the area. I tried it a half sec beep with a 5 sec sleep mode to have the beep turn on and off. I'll post the code so you can look at it in the following post.

3) Yes, I used the maroon tack because it contains a unique pixel too. It is the light pink one. A custom pushpin could be used, but the colour code would have to be entered in the application by the user. For testing, I tried it with the Map Control pane, but the area could be shrunk to fit aroung the GPS icon. The scanned area could even be shrunk or expanded depending on the zoom level.
Attached Images
File Type: jpg gps_arrow.jpg (11.8 KB, 3 views)
File Type: jpg gps_round.jpg (11.2 KB, 2 views)
File Type: jpg red_tack.jpg (1.7 KB, 71 views)
File Type: jpg maroon_tack.jpg (1.6 KB, 70 views)
File Type: jpg zoom_tracker.jpg (5.5 KB, 1 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20  
Old December 8th, 2007, 04:52 PM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

Here's the code I used to detect a light pink pixel in a maroon tack. It is named While 10 just to not enter in conflict with any of the other codes you wrote.

While 10
If WinActive($productname, "Map Control") Then
$pos_AfxWnd702 = ControlGetPos($productname, "", "AfxWnd702")
$left_pushpinscan = $pos_AfxWnd702[0]
$top_pushpinscan = $pos_AfxWnd702[1]
$right_pushpinscan = $pos_AfxWnd702[0] + $pos_AfxWnd702[2]
$bottom_pushpinscan = $pos_AfxWnd702[1] + $pos_AfxWnd702[3] + $titlebarhight
$coord_pushpinscan = PixelSearch($left_pushpinscan, $top_pushpinscan, $right_pushpinscan, $bottom_pushpinscan, 0xFF00FF, 0, 1 )
If Not @error Then
Beep(500, 200)
Sleep(5000)
EndIf
EndIf
WEnd



You'll notice I haven't set it to use a small area around the GPS icon yet, nor detect the zoom level. It is a very early idea so far. I'm leaning toward a separate .exe to run in parallel to keys.

I used SI ColorPicker t determine the correct Hex code of the pixels in case someone wants to know. It's free ware at
Software Institute » Pick pixel colors as HTML, HEX or RGB values

Last edited by toyfountain; December 8th, 2007 at 05:09 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #21  
Old December 9th, 2007, 08:29 AM
Laptop GPS World
www.laptopgpsworld.com
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 1,560
Default Re: A new hotkey to place a pushpin on the map

That sounds good. I see what you mean by it preventing other functions working. But that's a minor issue. That can either be solved later, or it could be a separate exe. As long as it works reliably .
__________________
Marvin Hlavac

Laptop GPS software reviews | Stores offering discounts to our members: Semsons & Co. Inc. and Deluo Electronics
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22  
Old December 9th, 2007, 11:25 AM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

Marvin

Can you write the code for a separate .exe that would run at the same time of Keys? I keep getting script paused when I try it. I'm missing something and do not see what even with the help files. Once the start of the program is done, I can add the script to scan near the GPS icon.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #23  
Old December 9th, 2007, 12:41 PM
Laptop GPS World
www.laptopgpsworld.com
 
Join Date: Sep 2007
Location: ON, Canada
Posts: 1,560
Default Re: A new hotkey to place a pushpin on the map

How about inserting the following line within S&T Keys:

If FileExists(@DesktopDir & "\toyfountain.exe") Then Run(@DesktopDir & "\toyfountain.exe")

(The @DesktopDir could be substituted for something else.)
__________________
Marvin Hlavac

Laptop GPS software reviews | Stores offering discounts to our members: Semsons & Co. Inc. and Deluo Electronics
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #24  
Old December 10th, 2007, 02:13 AM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

I got it to work with a separate application, but so far only for the full map pane. As soon as I try to reduce the area, it stops detecting the maroon POI tack I use for the unique pixel.

I suspect it's double looping. It needs to search for the GPS then search for the maroon tack. I am thinking of having Keys write the coords to the ini file. The having the S&T Scanner.exe read the coords from the ini file, then search a cropped area. It might prevent the double looping.

Here's beta the code I've set up in S&T Scanner.exe (this is the name of the new application).


While 1
If WinActive($productname, "Map Control") Then
$pos_AfxWnd702 = ControlGetPos($productname, "", "AfxWnd702")
$left_MaroonTackScan = $pos_AfxWnd702[0]
$top_MaroonTackScan = $pos_AfxWnd702[1]
$right_MaroonTackScan = $pos_AfxWnd702[0] + $pos_AfxWnd702[2]
$bottom_MaroonTackScan = $pos_AfxWnd702[1] + $pos_AfxWnd702[3] + $titlebarhight
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 2 ) ;careful here, the html inserted a line break
If Not @error Then
Beep(500, 200)
Sleep(1000)
EndIf
EndIf
WEnd


---------------------------------------------------------------

Here's the beta code I use for the GPS search in Keys.exe

unc push_pin()
reset_hotkeys()
Sleep(250)
ControlClick($productname, "", $panbutton)
ControlClick($productname, "", $panbutton)
Sleep(250)
MouseMove(600, 400, 0 )
ControlClick($productname, "", $createpushpin)
Sleep(250)
$pos_AfxWnd702 = ControlGetPos($productname, "", "AfxWnd702")
$left_GPSsearch = $pos_AfxWnd702[0]
$top_GPSsearch = $pos_AfxWnd702[1]
$right_GPSsearch = $pos_AfxWnd702[0] + $pos_AfxWnd702[2]
$bottom_GPSsearch = $pos_AfxWnd702[1] + $pos_AfxWnd702[3] + $titlebarhight
$coord_GPS = PixelSearch($left_GPSsearch, $top_GPSsearch, $right_GPSsearch, $bottom_GPSsearch, 0x800000, 0, 1 )
If Not @error Then
$coord_xGPS = $coord_GPS[0] - $left_GPSsearch - 8
$coord_yGPS = $coord_GPS[1] - $top_GPSsearch - $titlebarhight + 12
ControlFocus($productname, "", "AfxWnd702")
Sleep(250)
ControlClick($productname, "", "AfxWnd702", "left", 1, $coord_xGPS, $coord_yGPS )
EndIf
ControlClick($productname, "", $selectbutton)
EndFunc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #25  
Old December 11th, 2007, 12:23 AM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

Marvin

If you wish to try it out I think this should work in S&T 2008 if the tacks and GPS icons use the same colours as in 2006. Remember use the maroon tack for the Scanner.exe and do NOT use the red tack in the map when tracking the GPS icon to add a pushpin. I joined a file you can download. I took the liberty of renaming the file, build 2.53.2

The scanner should beep 5 times when it finds the maroon tack in the map pane, then it will beep once every 20 seconds. If it fails to detect the pink pixel in the next 20 seconds, the beep resets and the next time it detects the pink pixel, it beeps 5 times again. I think this can be useful to warn of nearby red light cameras or preferred radar areas. I'll work on getting the search area around the GPS icon smaller if this can be done later.
Attached Images
File Type: jpg maroon_tack2.jpg (16.1 KB, 4 views)

Last edited by toyfountain; December 12th, 2007 at 10:39 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #26  
Old December 11th, 2007, 01:13 AM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

Quote:
Originally Posted by Driven1 View Post

I tossed another feature need at him and he bounced me over to you 'cause you're already working on it.

Pushpin Hot Keys. Here's an excerpt of what I wrote to Marv...

The ability to create a Pushpin from a hotkey that marks the spot that you're at while using GPS Tracking. I'd like to take it just a bit further than Neludok though and suggest Custom Pushpins with different symbols associated to different hotkeys. I'd like to also associate some sort of sound cue to each type that will sound when tracking comes near a previously created pushpin. Here's the reason...


In my new line of work there are various hazards to watch out for along the route as I'm plowing. Thin shoulders, low overhead wires, sleuce pipes, rocks jutting up in dirt roads, etc. I would like to be able to make a "dry run" and mark all of those hazards as I go along. This way I'll know what's coming up and where everything is when it's snow covered or dark out, so that I can react properly for the hazard at hand. It would have been nice to have a marking feature as well when I was running Over the Road.

As Bugs Bunny once said, "Ain't I a Stinker!"

I know this one's a toughie. If it can't be done, just say so and I'll leave ya alone.

Happy Holidays!

So Toyfountain, whatcha think? Can it be done?

Oh, and I downloaded the English version and then tried to run it. It stated that it couldn't find S&T or AutoRoute 2008. Did I grab the wrong version or something? I'm running S&T 2007.

Thanks!
Driven 1

Please try the file 2.42.5 for 2007 (other thread) and give us feedback on the new pushpin feature. I need to know if the same colour is use as in year 2006 for the GPS icon. If it works and follows the GPS icon, than it's the same. If it doesn't work, we'll have to determine the HEX code for it. You can also try out the new Scanner.exe but only to detect a maroon tack so far, no custom pushpin for now. I can only test year 2006 of S&T.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #27  
Old December 12th, 2007, 10:51 AM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

Marvin

I have a new one to try. Fixed hotkeys ZXCV in full screen, F10 for find nearby should work. The push_pin works in normal mode only. In true full screen it looks like the draw tools are disabled by S&T 2008. The pointer becomes an arrow.

BTW: Santa came early this year. I bought the stand alone version 2008. I just installed it.
Attached Files
File Type: zip toyfountain_Keys_2_53_2_beta_added_hotkeys_english.zip (533.5 KB, 17 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #28  
Old December 12th, 2007, 12:54 PM
Member
 
Join Date: Dec 2007
Posts: 54
Send a message via Skype™ to nialag
Default Affichage problèmatique

Hi toyfountain,

J'ai écrit:

"J'ai un problème d'affichage aussi bien avec la version anglaise que française des Keys: le texte est trop gros pour les fenêtres et j'en perd une partie ( sur les deux portables)... C'est probablement un problème de résolution d'écran !"

Ta réponse:

"Est-ce que la résolution du portable est au moins de 800X600?

Pourriez-vous prendre une image de votre écran lorsque le texte est trop gros?"

La résolution est de 1440 X 900 pixels sur mon Dell Inspiron 640m et de 1400 x 1050 sur mon Dell Inspiron 5160.


Je n'ai pas ton adresse de courriel pour t'envoyer des photos, aussi j'utilise ce forum...

Je n'ai pas utilisé les Keys avec Autoroute 2006 et je n'ai pas 2007.

Les 3 fichiers ci-joint te donne une idée de l'affichage avec S&T 2008 sur le Dell Inspiron 5160, c'est à peu près identique avec le 640m. Les 2 ordi utilisent XP familiale. La version française a sensiblement les mêmes problèmes.

Je te reviendrai plus tard si je pense avoir de bonnes suggestions pour les termes de la version française des Keys...

Mes connaissances limitées de l'anglais ne me permettrent pas d'écrire rapidement dans cette langue et les outils de traduction automatique sont pas très fidèles ?

Sorry for this tread in French but my English is limited... And the automatic translators are horrible !

Alain
Attached Images
File Type: jpg S&T Keys_menusB.jpg (65.8 KB, 5 views)
File Type: jpg S&T Keys_Help_B.jpg (85.4 KB, 6 views)
File Type: jpg S&T Keys Options.jpg (150.7 KB, 6 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #29  
Old December 12th, 2007, 02:45 PM
 
Join Date: Oct 2007
Posts: 139
Default Re: A new hotkey to place a pushpin on the map

nialag

Essaie celui-ci pour le problème du texte.
http://www.laptopgpsworld.com/attach...ys_english.zip
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #30  
Old December 12th, 2007, 03:12 PM
Member
 
Join Date: Dec 2007
Posts: 54
Send a message via Skype™ to nialag
Default Re: A new hotkey to place a pushpin on the map

Bonjour,

Exactement le même affichage...

aucune différence !

Merci

Alain
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pushpin links to files and folders Marvin Hlavac Microsoft Streets and Trips 1 January 4th, 2008 05:51 AM


All times are GMT -4. The time now is 11:40 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
Copyright © 2007 - 2008 Laptop GPS World. All Rights Reserved.