Ticket #609: osd_core.c.diff

File osd_core.c.diff, 1008 bytes (added by tegzed, 11 years ago)

fix to emit announcement only when both percent and fixed limit is exceeded ; No fallback to roadprofile speed if roadprofile maxspeed is not set

  • osd_core.c

     
    10761076            if (rprof) {
    10771077                if(rprof->maxspeed!=0)
    10781078                    routespeed=rprof->maxspeed;
    1079                 else
    1080                     routespeed=rprof->speed;
    10811079            }
    10821080        }
    10831081        tracking_get_attr(tracking, attr_position_speed, &speed_attr, NULL);
    10841082        tracking_speed = *speed_attr.u.numd;
    10851083        if( -1 != tracking_speed && -1 != routespeed ) {
    10861084            snprintf(text,16,"%.0lf",routespeed);
    1087             if( this->speed_exceed_limit_offset+routespeed<tracking_speed ||
     1085            if( this->speed_exceed_limit_offset+routespeed<tracking_speed &&
    10881086                (100.0+this->speed_exceed_limit_percent)/100.0*routespeed<tracking_speed ) {
    10891087                if(this->announce_state==eNoWarn && this->announce_on) {
    10901088                    this->announce_state=eWarningTold; //warning told