Add:vehicle_file:Made replay interval configurable
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 24 Apr 2008 20:01:25 +0000 (20:01 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 24 Apr 2008 20:01:25 +0000 (20:01 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1029 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/src/vehicle/file/vehicle_file.c

index f0a81ff..c637313 100644 (file)
@@ -50,6 +50,7 @@ struct vehicle_priv {
        double height;
        int status;
        int sats_used;
+       int time;
 #ifdef _WIN32
        int no_data_count;
 #endif
@@ -293,7 +294,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
 #ifndef _WIN32
                if (priv->file_type == file_type_file) {
                        vehicle_file_disable_watch(priv);
-                       g_timeout_add(1000,
+                       g_timeout_add(priv->time,
                                      vehicle_file_enable_watch_timer,
                                      priv);
                }
@@ -446,6 +447,7 @@ vehicle_file_new_file(struct vehicle_methods
 {
        struct vehicle_priv *ret;
        struct attr *source;
+       struct attr *time;
 
        dbg(1, "enter\n");
        source = attr_search(attrs, NULL, attr_source);
@@ -459,6 +461,11 @@ vehicle_file_new_file(struct vehicle_methods
                vehicle_file_enable_watch(ret);
                return ret;
        }
+
+       ret->time=1000;
+       time = attr_search(attrs, NULL, attr_time);
+       if (time)
+               ret->time=time->u.num;
 #ifdef _WIN32
     ret->no_data_count = 0;
 #endif