summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-05-13 12:17:41 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-05-13 12:17:41 +0000
commit324c66d52ea233f538066961244d38711306774f (patch)
treee272e1feb9212a0061372f490b07fdf7fbaf7e3f
parent9c2467e42ba04d6d948a2f2704ca0708842d35b9 (diff)
downloadnavit-svn-324c66d52ea233f538066961244d38711306774f.tar.gz
Fix:Core:Further improvement in turn around handling
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit/src@1045 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navigation.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/navigation.c b/navigation.c
index bad3b10b..8f3b3303 100644
--- a/navigation.c
+++ b/navigation.c
@@ -600,34 +600,36 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
if (!this_->cmd_first)
return;
callback_list_call(this_->callback, 1, &p);
+ dbg(1,"force_speech=%d turn_around=%d turn_around_limit=%d\n", force_speech, this_->turn_around, this_->turn_around_limit);
distance=round_distance(this_->first->dest_length-this_->cmd_first->itm->dest_length);
- if (this_->turn_around && this_->turn_around == this_->turn_around_limit) {
- if (distance > this_->distance_turn) {
+ if (this_->turn_around_limit && this_->turn_around == this_->turn_around_limit) {
+ dbg(1,"distance=%d distance_turn=%d\n", distance, this_->distance_turn);
+ while (distance > this_->distance_turn) {
this_->level_last=4;
level=4;
force_speech=1;
- if (this_->distance_turn > 500)
+ if (this_->distance_turn >= 500)
this_->distance_turn*=2;
else
this_->distance_turn=500;
}
- } else {
+ } else if (!this_->turn_around_limit || this_->turn_around == -this_->turn_around_limit+1) {
this_->distance_turn=50;
level=navigation_get_announce_level(this_, this_->first->item.type, distance);
if (level < this_->level_last) {
- dbg(0,"level %d < %d\n", level, this_->level_last);
+ dbg(1,"level %d < %d\n", level, this_->level_last);
this_->level_last=level;
force_speech=1;
}
if (!item_is_equal(this_->cmd_first->itm->item, this_->item_last)) {
- dbg(0,"item different\n");
+ dbg(1,"item different\n");
this_->item_last=this_->cmd_first->itm->item;
force_speech=1;
}
}
if (force_speech) {
this_->level_last=level;
- dbg(0,"distance=%d level=%d type=0x%x\n", distance, level, this_->first->item.type);
+ dbg(1,"distance=%d level=%d type=0x%x\n", distance, level, this_->first->item.type);
callback_list_call(this_->callback_speech, 1, &p);
}
}
@@ -663,7 +665,7 @@ navigation_update(struct navigation *this_, struct route *route)
incr=1;
navigation_itm_update(itm, ritem);
} else {
- dbg(0,"not on track\n");
+ dbg(1,"not on track\n");
do {
dbg(1,"item\n");
navigation_itm_new(this_, ritem);