Update of /cvsroot/playerstage/code/player/utils/playerv
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16180/utils/playerv
Modified Files:
playerv.h pv_dev_vectormap.c
Log Message:
applied patch [ 1893823 ] playerv: vectormap continuous update
Index: pv_dev_vectormap.c
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/playerv/pv_dev_vectormap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pv_dev_vectormap.c 4 Feb 2008 18:59:44 -0000 1.3
--- pv_dev_vectormap.c 15 Feb 2008 08:25:38 -0000 1.4
***************
*** 59,62 ****
--- 59,63 ----
map->menu = rtk_menu_create_sub(mainwnd->device_menu, label);
map->subscribe_item = rtk_menuitem_create(map->menu, "Subscribe", 1);
+ map->continuous_item = rtk_menuitem_create(map->menu, "continuous update",
1);
// Set the initial menu state
rtk_menuitem_check(map->subscribe_item, subscribe);
***************
*** 122,127 ****
// Dont draw the map.
if(map->proxy->info.subscribed)
rtk_fig_show(map->fig, 1);
! else
rtk_fig_show(map->fig, 0);
}
--- 123,159 ----
// Dont draw the map.
if(map->proxy->info.subscribed)
+ {
+ if(rtk_menuitem_ischecked(map->continuous_item))
+ {
+ static struct timeval old_time = {0,0};
+ struct timeval time;
+ double time_diff = 0.0;
+ gettimeofday(&time, NULL);
+ // i don't use (map->proxy->info.datatime !=
map->datatime))
+ // because some drivers return strange datatimes
+ // and the map may change to often for the current map
format
+ // in playerv.h you can adjust MAP_UPDATE_TIME (default
1 sec)
+ time_diff = (double)(time.tv_sec - old_time.tv_sec) +
+ (double)(time.tv_usec -
old_time.tv_usec)/1000000;
+ if (time_diff > MAP_UPDATE_TIME)
+ {
+ // get the map info
+ playerc_vectormap_get_map_info( map->proxy );
+
+ // download intial map data
+ for (ii = 0; ii < map->proxy->layers_count;
++ii)
+ {
+ if (playerc_vectormap_get_layer_data(
map->proxy, ii ))
+ {
+ PRINT_ERR1("libplayerc error: %s",
playerc_error_str());
+ return;
+ }
+ }
+ vectormap_draw( map );
+ old_time = time;
+ }
+ }
rtk_fig_show(map->fig, 1);
! } else
rtk_fig_show(map->fig, 0);
}
Index: playerv.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/playerv/playerv.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** playerv.h 9 Jan 2008 11:45:37 -0000 1.53
--- playerv.h 15 Feb 2008 08:25:38 -0000 1.54
***************
*** 40,43 ****
--- 40,44 ----
#define MAP_UPDATE_TIME 1.0
+ #define VECTORMAP_UPDATE_TIME 1.0
/***************************************************************************
***************
*** 936,939 ****
--- 937,941 ----
rtk_menu_t *menu;
rtk_menuitem_t *subscribe_item;
+ rtk_menuitem_t *continuous_item;
// Figures
rtk_fig_t *fig;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit