Re: [Viking-devel] GPSbabel and viking on windows

2012-09-06 Thread Guilhem Bonnefille
2012/9/6 Robert Norris rw_nor...@hotmail.com:


 Actually fdopen(), wasn't difficult just use _fdopen() on Windows.

I'm surprised. fdopen seems already used in a_babel_convert (lbabel.c:95).

 Attached is new a patch to (hopefully) get the GPSBabel progress callback 
 working on Windows - and thus the list of available GPS devices and file 
 types.

 The previous hard-coding patch can be ignored (unless this patch doesn't 
 work).

 Be Seeing You - Rob.
 If at first you don't succeed,
 then skydiving isn't for you.


 
 From: rw_nor...@hotmail.com
 CC: viking-devel@lists.sourceforge.net
 Date: Wed, 5 Sep 2012 21:51:28 +0100
 Subject: Re: [Viking-devel] GPSbabel and viking on windows



 Good point about g_spawn_async_with_pipes() being cross platform.

 However fdopen() and waitpid() aren't.

 WaitForSingleObject() can be used instead of waitpid() for Windows.
 [or we could use g_child_watch_add ()  instead and an appropriate callback
 http://developer.gnome.org/glib/2.32/glib-The-Main-Event-Loop.html#g-child-watch-add
  ]

 Unfortunately fdopen() replacement is a bit more complicated...
 http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx

 I should be able to create a patch that supports a progress callback on 
 Windows.

 This is less work than I previously thought with the CreatePipe() method.

 Be Seeing You - Rob.
 If at first you don't succeed,
 then skydiving isn't for you.


 
  Date: Wed, 5 Sep 2012 11:55:03 +0200
  Subject: Re: [Viking-devel] GPSbabel and viking on windows
  From: guilhem.bonnefi...@gmail.com
  To: rw_nor...@hotmail.com
  CC: viking-devel@lists.sourceforge.net
 
  Hi,
 
  Thanks Robert for sharing your analysis.
 
  Just a naïve question: why viking has specific code for windows here?
  Reading documentation, it seems that g_spawn_async_with_pipes works
  under windows.
  http://developer.gimp.org/api/2.0/glib/glib-Spawning-Processes.html#g-spawn-async-with-pipes
 
  Can someone test by removing the windows specific code?
 
 
  2012/9/5 Robert Norris rw_nor...@hotmail.com:
  
  
   The code has never had progress support of GPSBabel on Windows.
  
   I think the best approach for now is to simply hard code the list of 
   devices back in again (albeit just for Windows) as attached.
  
   I think some form of pipe is needed to be created to access the StdOut 
   stream, but this is much more complicated on Windows:
  
   http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx
  
   And without a build environment for Windows, I'm not even going to try 
   to attempt to resolve it.
  
   Be Seeing You - Rob.
   If at first you don't succeed,
   then skydiving isn't for you.
  
  
   
   From: rw_nor...@hotmail.com
   To: guilhem.bonnefi...@gmail.com; mathie...@gmail.com
   Date: Tue, 4 Sep 2012 21:20:07 +0100
   CC: viking-devel@lists.sourceforge.net
   Subject: Re: [Viking-devel] GPSbabel and viking on windows
  
  
  
   I think I've found the problem.
  
   Unfortunately no immediate solution springs to mind :(
  
   Inspecting the babel.c code one can 'quickly' realise that there is 
   only *one* call made to the callback indicating the process has 
   completed (i.e. done - see line 157) for the Windows version.
  
   Whereas the 'Linux' code has two uses, for completion (line 193) and 
   *during* the process (line 190) for diagnostic purposes.
  
   Hence I can surmise the Windows version never gives the user feedback 
   during the Acquiring GPS points up/download - it just completes at some 
   point.
  
   Unfortunately in finding the available devices list it uses the 
   diagnostic method, which as not available in Windows meaning it leaves 
   the devices list blank.
  
   IIRC the babel code was refactored 'recently'. Maybe an old version has 
   a better Windows function which has some progress callback but I doubt 
   it.
  
   Be Seeing You - Rob.
   If at first you don't succeed,
   then skydiving isn't for you.
  
  
   
From: rw_nor...@hotmail.com
To: guilhem.bonnefi...@gmail.com; mathie...@gmail.com
Date: Tue, 4 Sep 2012 18:59:32 +0100
CC: viking-devel@lists.sourceforge.net
Subject: Re: [Viking-devel] GPSbabel and viking on windows
   
   
   
The '^' character is an escape character in DOS.
   
Thus for windows it needs to be escaped itself: thus needs to be 
-^^3 for Windows systems.
   
   
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.
   
   

Date: Tue, 4 Sep 2012 11:44:26 +0200
From: guilhem.bonnefi...@gmail.com
To: mathie...@gmail.com
CC: viking-devel@lists.sourceforge.net
Subject: Re: [Viking-devel] GPSbabel and viking on windows
   
   
Hi,
   
2012/9/4 Mathieu mathie...@gmail.com:
 The other one 

Re: [Viking-devel] GPSbabel and viking on windows

2012-09-06 Thread Robert Norris


Oh well probably doesn't matter too much.

I think Microsoft wants people to use _fdopen() as fdopen() is depreciated.
http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx

I see now fdopen() is used in various places in Viking.

May be one gets several warnings when compiling on Windows...


Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.



 Date: Thu, 6 Sep 2012 09:33:17 +0200
 Subject: Re: [Viking-devel] GPSbabel and viking on windows
 From: guilhem.bonnefi...@gmail.com
 To: rw_nor...@hotmail.com
 CC: mathie...@gmail.com; viking-devel@lists.sourceforge.net

 2012/9/6 Robert Norris rw_nor...@hotmail.com:
 
 
  Actually fdopen(), wasn't difficult just use _fdopen() on Windows.

 I'm surprised. fdopen seems already used in a_babel_convert (lbabel.c:95).

  Attached is new a patch to (hopefully) get the GPSBabel progress callback 
  working on Windows - and thus the list of available GPS devices and file 
  types.
 
  The previous hard-coding patch can be ignored (unless this patch doesn't 
  work).
 
  Be Seeing You - Rob.
  If at first you don't succeed,
  then skydiving isn't for you.
 
 
  
  From: rw_nor...@hotmail.com
  CC: viking-devel@lists.sourceforge.net
  Date: Wed, 5 Sep 2012 21:51:28 +0100
  Subject: Re: [Viking-devel] GPSbabel and viking on windows
 
 
 
  Good point about g_spawn_async_with_pipes() being cross platform.
 
  However fdopen() and waitpid() aren't.
 
  WaitForSingleObject() can be used instead of waitpid() for Windows.
  [or we could use g_child_watch_add () instead and an appropriate callback
  http://developer.gnome.org/glib/2.32/glib-The-Main-Event-Loop.html#g-child-watch-add
   ]
 
  Unfortunately fdopen() replacement is a bit more complicated...
  http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx
 
  I should be able to create a patch that supports a progress callback on 
  Windows.
 
  This is less work than I previously thought with the CreatePipe() method.
 
  Be Seeing You - Rob.
  If at first you don't succeed,
  then skydiving isn't for you.
 
 
  
   Date: Wed, 5 Sep 2012 11:55:03 +0200
   Subject: Re: [Viking-devel] GPSbabel and viking on windows
   From: guilhem.bonnefi...@gmail.com
   To: rw_nor...@hotmail.com
   CC: viking-devel@lists.sourceforge.net
  
   Hi,
  
   Thanks Robert for sharing your analysis.
  
   Just a naïve question: why viking has specific code for windows here?
   Reading documentation, it seems that g_spawn_async_with_pipes works
   under windows.
   http://developer.gimp.org/api/2.0/glib/glib-Spawning-Processes.html#g-spawn-async-with-pipes
  
   Can someone test by removing the windows specific code?
  
  
   2012/9/5 Robert Norris rw_nor...@hotmail.com:
   
   
The code has never had progress support of GPSBabel on Windows.
   
I think the best approach for now is to simply hard code the list of 
devices back in again (albeit just for Windows) as attached.
   
I think some form of pipe is needed to be created to access the StdOut 
stream, but this is much more complicated on Windows:
   
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx
   
And without a build environment for Windows, I'm not even going to try 
to attempt to resolve it.
   
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.
   
   

From: rw_nor...@hotmail.com
To: guilhem.bonnefi...@gmail.com; mathie...@gmail.com
Date: Tue, 4 Sep 2012 21:20:07 +0100
CC: viking-devel@lists.sourceforge.net
Subject: Re: [Viking-devel] GPSbabel and viking on windows
   
   
   
I think I've found the problem.
   
Unfortunately no immediate solution springs to mind :(
   
Inspecting the babel.c code one can 'quickly' realise that there is 
only *one* call made to the callback indicating the process has 
completed (i.e. done - see line 157) for the Windows version.
   
Whereas the 'Linux' code has two uses, for completion (line 193) and 
*during* the process (line 190) for diagnostic purposes.
   
Hence I can surmise the Windows version never gives the user feedback 
during the Acquiring GPS points up/download - it just completes at 
some point.
   
Unfortunately in finding the available devices list it uses the 
diagnostic method, which as not available in Windows meaning it 
leaves the devices list blank.
   
IIRC the babel code was refactored 'recently'. Maybe an old version 
has a better Windows function which has some progress callback but I 
doubt it.
   
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.
   
   

 From: rw_nor...@hotmail.com
 To: guilhem.bonnefi...@gmail.com; 

Re: [Viking-devel] GPSbabel and viking on windows

2012-09-06 Thread Guilhem Bonnefille
2012/9/6 Robert Norris rw_nor...@hotmail.com:


 Oh well probably doesn't matter too much.

 I think Microsoft wants people to use _fdopen() as fdopen() is depreciated.
 http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx

It seems quite crazy to not support standard function and provide a
replacement fully compatible, changing only its name.

 I see now fdopen() is used in various places in Viking.

 May be one gets several warnings when compiling on Windows...


 Be Seeing You - Rob.
 If at first you don't succeed,
 then skydiving isn't for you.


 
 Date: Thu, 6 Sep 2012 09:33:17 +0200
 Subject: Re: [Viking-devel] GPSbabel and viking on windows
 From: guilhem.bonnefi...@gmail.com
 To: rw_nor...@hotmail.com
 CC: mathie...@gmail.com; viking-devel@lists.sourceforge.net

 2012/9/6 Robert Norris rw_nor...@hotmail.com:
 
 
  Actually fdopen(), wasn't difficult just use _fdopen() on Windows.

 I'm surprised. fdopen seems already used in a_babel_convert (lbabel.c:95).

  Attached is new a patch to (hopefully) get the GPSBabel progress callback 
  working on Windows - and thus the list of available GPS devices and file 
  types.
 
  The previous hard-coding patch can be ignored (unless this patch doesn't 
  work).
 
  Be Seeing You - Rob.
  If at first you don't succeed,
  then skydiving isn't for you.
 
 
  
  From: rw_nor...@hotmail.com
  CC: viking-devel@lists.sourceforge.net
  Date: Wed, 5 Sep 2012 21:51:28 +0100
  Subject: Re: [Viking-devel] GPSbabel and viking on windows
 
 
 
  Good point about g_spawn_async_with_pipes() being cross platform.
 
  However fdopen() and waitpid() aren't.
 
  WaitForSingleObject() can be used instead of waitpid() for Windows.
  [or we could use g_child_watch_add () instead and an appropriate callback
  http://developer.gnome.org/glib/2.32/glib-The-Main-Event-Loop.html#g-child-watch-add
   ]
 
  Unfortunately fdopen() replacement is a bit more complicated...
  http://msdn.microsoft.com/en-us/library/dye30d82%28v=vs.80%29.aspx
 
  I should be able to create a patch that supports a progress callback on 
  Windows.
 
  This is less work than I previously thought with the CreatePipe() method.
 
  Be Seeing You - Rob.
  If at first you don't succeed,
  then skydiving isn't for you.
 
 
  
   Date: Wed, 5 Sep 2012 11:55:03 +0200
   Subject: Re: [Viking-devel] GPSbabel and viking on windows
   From: guilhem.bonnefi...@gmail.com
   To: rw_nor...@hotmail.com
   CC: viking-devel@lists.sourceforge.net
  
   Hi,
  
   Thanks Robert for sharing your analysis.
  
   Just a naïve question: why viking has specific code for windows here?
   Reading documentation, it seems that g_spawn_async_with_pipes works
   under windows.
   http://developer.gimp.org/api/2.0/glib/glib-Spawning-Processes.html#g-spawn-async-with-pipes
  
   Can someone test by removing the windows specific code?
  
  
   2012/9/5 Robert Norris rw_nor...@hotmail.com:
   
   
The code has never had progress support of GPSBabel on Windows.
   
I think the best approach for now is to simply hard code the list of 
devices back in again (albeit just for Windows) as attached.
   
I think some form of pipe is needed to be created to access the 
StdOut stream, but this is much more complicated on Windows:
   
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx
   
And without a build environment for Windows, I'm not even going to 
try to attempt to resolve it.
   
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.
   
   

From: rw_nor...@hotmail.com
To: guilhem.bonnefi...@gmail.com; mathie...@gmail.com
Date: Tue, 4 Sep 2012 21:20:07 +0100
CC: viking-devel@lists.sourceforge.net
Subject: Re: [Viking-devel] GPSbabel and viking on windows
   
   
   
I think I've found the problem.
   
Unfortunately no immediate solution springs to mind :(
   
Inspecting the babel.c code one can 'quickly' realise that there is 
only *one* call made to the callback indicating the process has 
completed (i.e. done - see line 157) for the Windows version.
   
Whereas the 'Linux' code has two uses, for completion (line 193) and 
*during* the process (line 190) for diagnostic purposes.
   
Hence I can surmise the Windows version never gives the user 
feedback during the Acquiring GPS points up/download - it just 
completes at some point.
   
Unfortunately in finding the available devices list it uses the 
diagnostic method, which as not available in Windows meaning it 
leaves the devices list blank.
   
IIRC the babel code was refactored 'recently'. Maybe an old version 
has a better Windows function which has some progress callback but I 
doubt it.
   
Be Seeing You - Rob.
If at first