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 is with the new "File->Acquire->Acquire from GPS". In
> > >> the following dialog, the "GPS Protocol" menu is empty. I do not
> > >> reproduce this under Linux. Can someone running viking on windows do
> > >> the test? It is really simple, just open the dialog and report the
> > >> available entries.
> > >
> > > I confirm the problem.
> > > And I wil add one : when you try to import a file with GPSBabel, the
> > > file type menu is also empty.
> >
> > Thanks for confirmation. These lists are build with some gpsbabel
> > output. The command line use "-^3" switch. Can you try to launch
> > gpsbabel with this switch on windows to check is availability?
> >
> > > Windows builds really need some in-depth testing.
> >
> > Certainly.
> > Perhaps adding some automatic test can help in this process. Here is a
> > really initial patch to verify gpsbabel. Currently, the patch include
> > only a "dump" tool, but in few hours (I'm at office), it will consist
> > on something checking that we retrieve what we expect. But I imagine
> > this single executable can already help to investigate.
> >
> > --
> > Guilhem BONNEFILLE
> > -=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com
> > -=- mailto:guilhem.bonnefi...@gmail.com
> > -=- http://nathguil.free.fr/
> >
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > Viking-devel mailing list
> > Viking-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/viking-devel
> > Viking home page: http://viking.sf.net/
> >
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > Viking-devel mailing list
> > Viking-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/viking-devel
> > Viking home page: http://viking.sf.net/
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Viking-devel mailing list
> Viking-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/viking-devel
> Viking home page: http://viking.sf.net/
                                          
From 51148c1f65701b841baaba624b2a91204f931e81 Mon Sep 17 00:00:00 2001
From: Rob Norris <rw_nor...@hotmail.com>
Date: Tue, 4 Sep 2012 23:45:37 +0100
Subject: [PATCH] Temporary work around to restore Acquire GPS Device types on
 Windows systems.

Due to no method in Viking to process output of GPSBabel on Windows systems, the method used to dynamically build the supported items does not work.
Resort to simply hardcoding the output of GPSBabel 1.3.6 for generation of the supported devices.

Also add a small sample of the GPSBabel Import file types (but not all 133 types!)
---
 src/babel.c |   36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/babel.c b/src/babel.c
index 384523a..d4b8445 100644
--- a/src/babel.c
+++ b/src/babel.c
@@ -106,6 +106,12 @@ gboolean a_babel_convert( VikTrwLayer *vt, const char *babelargs, BabelStatusFun
 }
 
 #ifdef WINDOWS
+/**
+ * Note that currently the BabelStatusFunc callback is *only* called on completion,
+ *   is does not callback during the functions progress
+ * Probably to fix this need to use the more complicated anonymous pipes method, see:
+ *  http://msdn.microsoft.com/en-us/library/windows/desktop/ms682499%28v=vs.85%29.aspx
+ */
 static gboolean babel_general_convert( BabelStatusFunc cb, gchar **args, gpointer user_data )
 {
   gboolean ret;
@@ -488,19 +494,39 @@ static void load_feature_cb (BabelProgressCode code, gpointer line, gpointer use
 
 static gboolean load_feature ()
 {
-  int i;
   gboolean ret = FALSE;
-  gchar *args[4];  
-
   if ( gpsbabel_loc ) {
-    i = 0;
+    // Temporarily hard code supported GPSBabel 1.3.6 items
+    //   until progress callback is supported on Windows systems to learn the devices+file types dynamically
+#ifdef WINDOWS
+    // Note there are tab characters in these strings below...
+    // All devices
+    load_feature_parse_line ("serial	--r---	baroiq		Brauniger IQ Series Barograph Download	baroiq");
+    load_feature_parse_line ("serial	rwrwrw	garmin		Garmin serial/USB protocol	garmin");
+    load_feature_parse_line ("serial	--r---	dg-100		GlobalSat DG-100/BT-335 Download	dg-100");
+    load_feature_parse_line ("serial	--r---	m241		Holux M-241 (MTK based) download	m241");
+    load_feature_parse_line ("serial	rwrwrw	magellan		Magellan serial protocol	magellan");
+    load_feature_parse_line ("serial	--r---	mtk		MTK Logger (iBlue 747,Qstarz BT-1000,...) download	mtk");
+    load_feature_parse_line ("serial	rwrwrw	navilink		NaviGPS GT-11/BGT-11 Download	navilink");
+    load_feature_parse_line ("serial	r-r---	wbt		Wintec WBT-100/200 GPS Download	wbt");
+    // A few file types but I can't be bothered adding all 133 kinds
+    load_feature_parse_line ("file	rwrwrw	gdb	gdb	Garmin MapSource - gdb	gdb");
+    load_feature_parse_line ("file	rwrwrw	mapsource	mps	Garmin MapSource - mps	mapsource");
+    load_feature_parse_line ("file	rwrwrw	garmin_txt	txt	Garmin MapSource - txt (tab delimited)	garmin_txt");
+    load_feature_parse_line ("file	rwrwrw	pcx	pcx	Garmin PCX5	pcx");
+
+    ret = TRUE;
+#else
+    int i = 0;
+    gchar *args[4];
+
     if ( unbuffer_loc )
       args[i++] = unbuffer_loc;
     args[i++] = gpsbabel_loc;
     args[i++] = "-^3";
     args[i] = NULL;
-
     ret = babel_general_convert (load_feature_cb, args, NULL);
+#endif
   } else
     g_error("gpsbabel not found in PATH");
 
-- 
1.7.10.4

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to