From 546a3bd2a5e99582edf2ad672b9a43f16524bece Mon Sep 17 00:00:00 2001 From: kazer_ Date: Thu, 4 Feb 2010 12:02:29 +0000 Subject: [PATCH] Add:Logging:Added a 'Mark' button for use whith gpx loggin, ticket #542 git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2945 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/attr_def.h | 1 + navit/navit/vehicle.c | 14 ++++++++++++++ navit/navit/xmlconfig.c | 2 +- navit/navit/xpm/Makefile.am | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/navit/navit/attr_def.h b/navit/navit/attr_def.h index 9403042..1f2a8fb 100644 --- a/navit/navit/attr_def.h +++ b/navit/navit/attr_def.h @@ -279,6 +279,7 @@ ATTR(layout_name) ATTR(user_name) ATTR(user_pass) ATTR(status_text) +ATTR(log_gpx_desc) ATTR2(0x0003ffff,type_string_end) ATTR2(0x00040000,type_special_begin) ATTR(order) diff --git a/navit/navit/vehicle.c b/navit/navit/vehicle.c index dd0c749..117a71f 100644 --- a/navit/navit/vehicle.c +++ b/navit/navit/vehicle.c @@ -45,6 +45,7 @@ struct vehicle { struct vehicle_priv *priv; struct callback_list *cbl; struct log *nmea_log, *gpx_log; + char *gpx_desc; struct attr **attrs; // cursor @@ -182,6 +183,10 @@ vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *attr, if (ret) return ret; } + if (type == attr_log_gpx_desc) { + attr->u.str = this_->gpx_desc; + return 1; + } return attr_generic_get_attr(this_->attrs, NULL, type, attr, iter); } @@ -198,6 +203,10 @@ vehicle_set_attr(struct vehicle *this_, struct attr *attr) int ret=1; if (this_->meth.set_attr) ret=this_->meth.set_attr(this_->priv, attr); + if (ret == 1 && attr->type == attr_log_gpx_desc) { + g_free(this_->gpx_desc); + this_->gpx_desc = attr->u.str; + } if (ret == 1 && attr->type != attr_navit) this_->attrs=attr_generic_set_attr(this_->attrs, attr); return ret != 0; @@ -446,6 +455,11 @@ vehicle_log_gpx(struct vehicle *this_, struct log *log) g_free(timep); } } + if (this_->gpx_desc) { + logstr=g_strconcat_printf(logstr,"\t%s\n",this_->gpx_desc); + g_free(this_->gpx_desc); + this_->gpx_desc = NULL; + } if (attr_types_contains_default(attr_types, attr_position_direction,0) && this_->meth.position_attr_get(this_->priv, attr_position_direction, &attr)) logstr=g_strconcat_printf(logstr,"\t%.1f\n",*attr.u.numd); if (attr_types_contains_default(attr_types, attr_position_speed, 0) && this_->meth.position_attr_get(this_->priv, attr_position_speed, &attr)) diff --git a/navit/navit/xmlconfig.c b/navit/navit/xmlconfig.c index 76d3d96..0472405 100644 --- a/navit/navit/xmlconfig.c +++ b/navit/navit/xmlconfig.c @@ -265,7 +265,7 @@ static struct object_func object_funcs[] = { { attr_speech, NEW(speech_new), GET(speech_get_attr), NULL, NULL, SET(speech_set_attr)}, { attr_text, NEW(text_new)}, { attr_tracking, NEW(tracking_new)}, - { attr_vehicle, NEW(vehicle_new), GET(vehicle_get_attr), NULL, NULL, NULL, ADD(vehicle_add_attr) }, + { attr_vehicle, NEW(vehicle_new), GET(vehicle_get_attr), NULL, NULL, SET(vehicle_set_attr), ADD(vehicle_add_attr) }, { attr_vehicleprofile, NEW(vehicleprofile_new), GET(vehicleprofile_get_attr), NULL, NULL, SET(vehicleprofile_set_attr), ADD(vehicleprofile_add_attr) }, }; diff --git a/navit/navit/xpm/Makefile.am b/navit/navit/xpm/Makefile.am index 67f9fb1..7695cd7 100644 --- a/navit/navit/xpm/Makefile.am +++ b/navit/navit/xpm/Makefile.am @@ -31,6 +31,7 @@ xpm_DATA += information.xpm xpm_DATA += justice.xpm xpm_DATA += level_crossing.xpm xpm_DATA += library.xpm +xpm_DATA += mark.xpm xpm_DATA += mini_roundabout.xpm xpm_DATA += memorial.xpm xpm_DATA += military.xpm @@ -84,6 +85,7 @@ svgs += gui_sound_off.svg svgs += gui_tools.svg svgs += gui_fullscreen.svg svgs += gui_leave_fullscreen.svg +svgs += mark.svg svgs += gui_quit.svg gui_stop.svg svgs += gui_town.svg svgs += gui_vehicle.svg -- 2.7.4