You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Ehud S. <esh...@us...> - 2006-05-22 20:54:58
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25621 Modified Files: roadmap_voice.c Log Message: Door to door navigation. Index: roadmap_voice.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_voice.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_voice.c 21 May 2006 12:40:40 -0000 1.3 --- roadmap_voice.c 22 May 2006 20:54:55 -0000 1.4 *************** *** 57,61 **** {ROADMAP_CONFIG_ITEM("Voice", "Next Intersection"), "flite -t 'Next intersection: %N'"}, {ROADMAP_CONFIG_ITEM("Voice", "Selected Street"), "flite -t 'Selected %N'"}, ! {ROADMAP_CONFIG_ITEM("Voice", "Driving Instruction"), "flite -t 'In %D %U, %I'|flite -t '%I'"}, {ROADMAP_CONFIG_ITEM_EMPTY, NULL} }; --- 57,61 ---- {ROADMAP_CONFIG_ITEM("Voice", "Next Intersection"), "flite -t 'Next intersection: %N'"}, {ROADMAP_CONFIG_ITEM("Voice", "Selected Street"), "flite -t 'Selected %N'"}, ! {ROADMAP_CONFIG_ITEM("Voice", "Driving Instruction"), "flite -t 'In %D %U, %I'|flite -t '%I to %T'|flite -t '%I'"}, {ROADMAP_CONFIG_ITEM_EMPTY, NULL} }; *************** *** 98,103 **** {"E", "east"}, {"right", "ra-ight"}, ! {"m", "meter"}, ! {"km", "kilo-meter"}, {NULL, NULL} }; --- 98,103 ---- {"E", "east"}, {"right", "ra-ight"}, ! {"m", "meters"}, ! {"Km", "kilo-meters"}, {NULL, NULL} }; |
From: Ehud S. <esh...@us...> - 2006-05-22 20:54:09
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25259 Modified Files: roadmap_fuzzy.c roadmap_fuzzy.h roadmap_navigate.c roadmap_navigate.h Log Message: Fix connection fuzzy. Index: roadmap_fuzzy.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_fuzzy.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_fuzzy.h 15 May 2006 19:21:06 -0000 1.3 --- roadmap_fuzzy.h 22 May 2006 20:54:01 -0000 1.4 *************** *** 45,48 **** --- 45,49 ---- (const RoadMapNeighbour *street, const RoadMapNeighbour *reference, + int prev_direction, int direction, RoadMapPosition *connection); Index: roadmap_navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_navigate.c 21 May 2006 12:40:37 -0000 1.10 --- roadmap_navigate.c 22 May 2006 20:54:01 -0000 1.11 *************** *** 143,168 **** roadmap_log_push ("roadmap_navigate_retrieve_line"); ! roadmap_math_coordinate (position, &focus_point); ! roadmap_math_rotate_coordinates (1, &focus_point); ! focus_point.x += accuracy; ! focus_point.y += accuracy; ! roadmap_math_to_position (&focus_point, &focus_position, 1); ! focus.west = focus_position.longitude; ! focus.east = focus_position.longitude; ! focus.north = focus_position.latitude; ! focus.south = focus_position.latitude; ! accuracy *= 2; ! ! focus_point.x -= accuracy; ! roadmap_navigate_adjust_focus (&focus, &focus_point); ! focus_point.y -= accuracy; ! roadmap_navigate_adjust_focus (&focus, &focus_point); ! focus_point.x += accuracy; ! roadmap_navigate_adjust_focus (&focus, &focus_point); if (type == LAYER_VISIBLE_ROADS) { --- 143,180 ---- roadmap_log_push ("roadmap_navigate_retrieve_line"); ! if (roadmap_math_point_is_visible (position)) { ! roadmap_math_coordinate (position, &focus_point); ! roadmap_math_rotate_coordinates (1, &focus_point); ! focus_point.x += accuracy; ! focus_point.y += accuracy; ! roadmap_math_to_position (&focus_point, &focus_position, 1); ! focus.west = focus_position.longitude; ! focus.east = focus_position.longitude; ! focus.north = focus_position.latitude; ! focus.south = focus_position.latitude; ! accuracy *= 2; ! focus_point.x -= accuracy; ! roadmap_navigate_adjust_focus (&focus, &focus_point); ! ! focus_point.y -= accuracy; ! roadmap_navigate_adjust_focus (&focus, &focus_point); ! ! focus_point.x += accuracy; ! roadmap_navigate_adjust_focus (&focus, &focus_point); ! ! } else { ! ! accuracy *= 100; ! ! focus.west = position->longitude - accuracy; ! focus.east = position->longitude + accuracy; ! focus.north = position->latitude + accuracy; ! focus.south = position->latitude - accuracy; ! } if (type == LAYER_VISIBLE_ROADS) { *************** *** 234,237 **** --- 246,250 ---- int roadmap_navigate_fuzzify (RoadMapTracking *tracked, + RoadMapTracking *previous_street, RoadMapNeighbour *previous_line, RoadMapNeighbour *line, *************** *** 248,251 **** --- 261,268 ---- int symetric = 0; + if (!previous_street || !previous_street->valid) { + previous_line = NULL; + } + fuzzyfied_distance = roadmap_fuzzy_distance (line->distance); *************** *** 295,299 **** connected = roadmap_fuzzy_connected ! (line, previous_line, tracked->line_direction, &tracked->entry); } else { connected = roadmap_fuzzy_not (0); --- 312,317 ---- connected = roadmap_fuzzy_connected ! (line, previous_line, previous_street->line_direction, ! tracked->line_direction, &tracked->entry); } else { connected = roadmap_fuzzy_not (0); *************** *** 608,613 **** current_fuzzy = roadmap_navigate_fuzzify ! (&RoadMapConfirmedStreet, &RoadMapConfirmedLine, ! &RoadMapConfirmedLine, gps_position->steering); } --- 626,634 ---- current_fuzzy = roadmap_navigate_fuzzify ! (&RoadMapConfirmedStreet, ! &RoadMapConfirmedStreet, ! &RoadMapConfirmedLine, ! &RoadMapConfirmedLine, ! gps_position->steering); } *************** *** 643,648 **** result = roadmap_navigate_fuzzify (&candidate, ! RoadMapConfirmedStreet.valid ? ! &RoadMapConfirmedLine : NULL, RoadMapNeighbourhood+i, gps_position->steering); --- 664,669 ---- result = roadmap_navigate_fuzzify (&candidate, ! &RoadMapConfirmedStreet, ! &RoadMapConfirmedLine, RoadMapNeighbourhood+i, gps_position->steering); *************** *** 717,720 **** --- 738,743 ---- if (RoadMapRouteInfo.enabled) { + RoadMapRouteInfo.current_line = RoadMapConfirmedLine.line; + RoadMapRouteInfo.callbacks.get_next_line (&RoadMapConfirmedLine.line, Index: roadmap_navigate.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_navigate.h 21 May 2006 12:40:37 -0000 1.5 --- roadmap_navigate.h 22 May 2006 20:54:01 -0000 1.6 *************** *** 76,79 **** --- 76,80 ---- int roadmap_navigate_fuzzify (RoadMapTracking *tracked, + RoadMapTracking *previous_street, RoadMapNeighbour *previous_line, RoadMapNeighbour *line, int direction); Index: roadmap_fuzzy.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_fuzzy.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_fuzzy.c 15 May 2006 19:21:06 -0000 1.3 --- roadmap_fuzzy.c 22 May 2006 20:54:00 -0000 1.4 *************** *** 130,133 **** --- 130,134 ---- (const RoadMapNeighbour *street, const RoadMapNeighbour *reference, + int prev_direction, int direction, RoadMapPosition *connection) { *************** *** 162,192 **** roadmap_plugin_line_to (&reference->line, &(reference_point[1])); ! for (i = 0; i <= 1; ++i) { ! for (j = 0; j <= 1; ++j) { ! if ((line_point[i].latitude == reference_point[j].latitude) && ! (line_point[i].longitude == reference_point[j].longitude)) { ! ! if (direction == ROUTE_DIRECTION_AGAINST_LINE) { ! ! if (i == 0) { ! /* we are heading out of this road */ ! ! return roadmap_fuzzy_false (); ! } ! ! } else { ! if (i == 1) { ! /* we are heading out of this road */ ! return roadmap_fuzzy_false (); ! } ! } ! *connection = line_point[i]; ! return (FUZZY_TRUTH_MAX * 2) / 3; ! } ! } } --- 163,184 ---- roadmap_plugin_line_to (&reference->line, &(reference_point[1])); ! if (direction == ROUTE_DIRECTION_AGAINST_LINE) { ! i = 1; ! } else { ! i = 0; ! } ! if (prev_direction == ROUTE_DIRECTION_AGAINST_LINE) { ! j = 0; ! } else { ! j = 1; ! } ! if ((line_point[i].latitude == reference_point[j].latitude) && ! (line_point[i].longitude == reference_point[j].longitude)) { ! *connection = line_point[i]; ! return (FUZZY_TRUTH_MAX * 2) / 3; } *************** *** 229,232 **** --- 221,225 ---- } + int roadmap_fuzzy_is_good (RoadMapFuzzy a) { return (a >= FUZZY_TRUTH_MAX / 2); |
From: Ehud S. <esh...@us...> - 2006-05-22 09:14:58
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24657 Modified Files: editor_main.c Log Message: Version bump. Index: editor_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** editor_main.c 15 May 2006 20:17:18 -0000 1.7 --- editor_main.c 22 May 2006 09:14:53 -0000 1.8 *************** *** 41,45 **** int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.6.0"; int editor_is_enabled (void) { --- 41,45 ---- int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.7.0_pre1"; int editor_is_enabled (void) { |
From: Ehud S. <esh...@us...> - 2006-05-22 09:14:33
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24582 Modified Files: roadmap_street.c Log Message: Add ROADMAP_INVALID_STRING instead of 0. Index: roadmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_street.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_street.c 22 May 2006 09:09:30 -0000 1.7 --- roadmap_street.c 22 May 2006 09:14:30 -0000 1.8 *************** *** 507,512 **** if ((range_index == range_end) && (city < 0)) { - RoadMapRangeByCity *by_city = RoadMapRangeActive->RoadMapByCity + - by_street->first_city; blocks[count].street = i; blocks[count].first = range_index; --- 507,510 ---- |
From: Ehud S. <esh...@us...> - 2006-05-22 09:09:34
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22523 Modified Files: roadmap_crossing.c roadmap_dictionary.c roadmap_locator.c roadmap_street.c roadmap_types.h Log Message: Add ROADMAP_INVALID_STRING instead of 0. Index: roadmap_crossing.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_crossing.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_crossing.c 12 May 2006 13:14:17 -0000 1.3 --- roadmap_crossing.c 22 May 2006 09:09:30 -0000 1.4 *************** *** 162,166 **** state = roadmap_locator_get_state (state_name); ! if (state <= 0) { roadmap_messagebox ("Warning", "unknown state"); return; --- 162,166 ---- state = roadmap_locator_get_state (state_name); ! if (state == ROADMAP_INVALID_STRING) { roadmap_messagebox ("Warning", "unknown state"); return; Index: roadmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_street.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_street.c 12 May 2006 13:16:43 -0000 1.6 --- roadmap_street.c 22 May 2006 09:09:30 -0000 1.7 *************** *** 413,417 **** (RoadMapRangeActive->RoadMapStreetPrefix, buffer); ! if (street->prefix > 0) { name = name + length; while (*name == ' ') ++name; --- 413,417 ---- (RoadMapRangeActive->RoadMapStreetPrefix, buffer); ! if (street->prefix != ROADMAP_INVALID_STRING) { name = name + length; while (*name == ' ') ++name; *************** *** 435,439 **** (RoadMapRangeActive->RoadMapStreetType, trailer); ! if (street->type > 0) { length = (unsigned)(space - name); --- 435,439 ---- (RoadMapRangeActive->RoadMapStreetType, trailer); ! if (street->type != ROADMAP_INVALID_STRING) { length = (unsigned)(space - name); *************** *** 456,460 **** (RoadMapRangeActive->RoadMapStreetSuffix, trailer); ! if (street->suffix > 0) { while (*space == ' ') { --- 456,460 ---- (RoadMapRangeActive->RoadMapStreetSuffix, trailer); ! if (street->suffix != ROADMAP_INVALID_STRING) { while (*space == ' ') { *************** *** 505,508 **** --- 505,524 ---- by_street->first_range + by_street->count_range; + if ((range_index == range_end) && (city < 0)) { + + RoadMapRangeByCity *by_city = RoadMapRangeActive->RoadMapByCity + + by_street->first_city; + blocks[count].street = i; + blocks[count].first = range_index; + blocks[count].city = 0; + blocks[count].count = 0; + + if (++count >= size) { + return count; + } + + continue; + } + for (j = by_street->first_city; range_index < range_end; j++) { *************** *** 550,554 **** roadmap_street_locate (street_name, &street); ! if (street.name <= 0) { return ROADMAP_STREET_NOSTREET; } --- 566,570 ---- roadmap_street_locate (street_name, &street); ! if (street.name == ROADMAP_INVALID_STRING) { return ROADMAP_STREET_NOSTREET; } *************** *** 562,566 **** city = roadmap_dictionary_locate (RoadMapRangeActive->RoadMapCityNames, city_name); ! if (city <= 0) { return ROADMAP_STREET_NOCITY; } --- 578,582 ---- city = roadmap_dictionary_locate (RoadMapRangeActive->RoadMapCityNames, city_name); ! if (city == ROADMAP_INVALID_STRING) { return ROADMAP_STREET_NOCITY; } *************** *** 635,639 **** roadmap_street_locate (street_name, &street); ! if (street.name <= 0) { return ROADMAP_STREET_NOSTREET; } --- 651,655 ---- roadmap_street_locate (street_name, &street); ! if (street.name == ROADMAP_INVALID_STRING) { return ROADMAP_STREET_NOSTREET; } *************** *** 1573,1580 **** roadmap_street_locate (street1_name, &street1); ! if (street1.name <= 0) continue; roadmap_street_locate (street2_name, &street2); ! if (street2.name <= 0) continue; results += roadmap_street_intersection_county --- 1589,1596 ---- roadmap_street_locate (street1_name, &street1); ! if (street1.name == ROADMAP_INVALID_STRING) continue; roadmap_street_locate (street2_name, &street2); ! if (street2.name == ROADMAP_INVALID_STRING) continue; results += roadmap_street_intersection_county *************** *** 2013,2017 **** (RoadMapRangeActive->RoadMapCityNames, city); ! if (city_index <= 0) return; } --- 2029,2033 ---- (RoadMapRangeActive->RoadMapCityNames, city); ! if (city_index == ROADMAP_INVALID_STRING) return; } Index: roadmap_types.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_types.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_types.h 12 Dec 2005 20:35:42 -0000 1.2 --- roadmap_types.h 22 May 2006 09:09:30 -0000 1.3 *************** *** 25,28 **** --- 25,30 ---- #define INCLUDED__ROADMAP_TYPES__H + #define ROADMAP_INVALID_STRING ((unsigned short) -1) + typedef unsigned short RoadMapZip; typedef unsigned short RoadMapString; Index: roadmap_dictionary.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_dictionary.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_dictionary.c 12 May 2006 13:16:43 -0000 1.2 --- roadmap_dictionary.c 22 May 2006 09:09:30 -0000 1.3 *************** *** 226,230 **** if (index < 0) { ! return 0; } --- 226,230 ---- if (index < 0) { ! return -1; } *************** *** 590,594 **** if (result < 0) { ! return 0; } --- 590,594 ---- if (result < 0) { ! return ROADMAP_INVALID_STRING; } Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_locator.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_locator.c 12 May 2006 13:16:43 -0000 1.8 --- roadmap_locator.c 22 May 2006 09:09:30 -0000 1.9 *************** *** 319,323 **** state = roadmap_dictionary_locate (RoadMapUsStateDictionary, state_symbol); ! if (state <= 0) { return 0; } --- 319,323 ---- state = roadmap_dictionary_locate (RoadMapUsStateDictionary, state_symbol); ! if (state == ROADMAP_INVALID_STRING) { return 0; } *************** *** 334,338 **** state = roadmap_dictionary_locate (RoadMapUsStateDictionary, state_symbol); ! if (state <= 0) { return ROADMAP_US_NOSTATE; } --- 334,338 ---- state = roadmap_dictionary_locate (RoadMapUsStateDictionary, state_symbol); ! if (state == ROADMAP_INVALID_STRING) { return ROADMAP_US_NOSTATE; } *************** *** 343,347 **** } city = roadmap_dictionary_locate (RoadMapUsCityDictionary, city_name); ! if (city <= 0) { return ROADMAP_US_NOCITY; } --- 343,347 ---- } city = roadmap_dictionary_locate (RoadMapUsCityDictionary, city_name); ! if (city == ROADMAP_INVALID_STRING) { return ROADMAP_US_NOCITY; } |
From: Ehud S. <esh...@us...> - 2006-05-22 09:08:20
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22014 Modified Files: roadmap_math.c roadmap_math.h roadmap_screen.c Log Message: Fix screen drag in 3D view. Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_math.h 29 Apr 2006 15:00:43 -0000 1.6 --- roadmap_math.h 22 May 2006 09:08:06 -0000 1.7 *************** *** 73,76 **** --- 73,77 ---- RoadMapPosition *position, int projected); + void roadmap_math_unproject (RoadMapGuiPoint *point); void roadmap_math_rotate_coordinates (int count, RoadMapGuiPoint *points); Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_screen.c 21 May 2006 12:40:37 -0000 1.12 --- roadmap_screen.c 22 May 2006 09:08:06 -0000 1.13 *************** *** 1231,1237 **** static void roadmap_screen_drag_motion (RoadMapGuiPoint *point) { ! roadmap_screen_record_move ! (RoadMapScreenPointerLocation.x - point->x, ! RoadMapScreenPointerLocation.y - point->y); roadmap_screen_repaint (); RoadMapScreenPointerLocation = *point; --- 1231,1252 ---- static void roadmap_screen_drag_motion (RoadMapGuiPoint *point) { ! if (RoadMapScreenViewMode == VIEW_MODE_3D) { ! ! RoadMapGuiPoint p = *point; ! RoadMapGuiPoint p2 = RoadMapScreenPointerLocation; ! ! roadmap_math_unproject (&p); ! roadmap_math_unproject (&p2); ! ! roadmap_screen_record_move ! (p2.x - p.x, p2.y - p.y); ! ! } else { ! ! roadmap_screen_record_move ! (RoadMapScreenPointerLocation.x - point->x, ! RoadMapScreenPointerLocation.y - point->y); ! } ! roadmap_screen_repaint (); RoadMapScreenPointerLocation = *point; Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_math.c 29 Apr 2006 15:00:43 -0000 1.7 --- roadmap_math.c 22 May 2006 09:08:06 -0000 1.8 *************** *** 968,978 **** ! void roadmap_math_to_position (const RoadMapGuiPoint *point, ! RoadMapPosition *position, ! int projected) { ! RoadMapGuiPoint point2; ! if (projected && RoadMapContext._3D_horizon) { double fDistFromCenterX = point->x - RoadMapContext.width / 2; // X distance from center of screen --- 968,976 ---- ! void roadmap_math_unproject (RoadMapGuiPoint *point) { ! if (RoadMapContext._3D_horizon) { ! RoadMapGuiPoint point2; double fDistFromCenterX = point->x - RoadMapContext.width / 2; // X distance from center of screen *************** *** 988,991 **** --- 986,1006 ---- point2.y = (int) (RoadMapContext.height - fD); // center on screen + + *point = point2; + } + } + + + void roadmap_math_to_position (const RoadMapGuiPoint *point, + RoadMapPosition *position, + int projected) { + + RoadMapGuiPoint point2; + + if (projected && RoadMapContext._3D_horizon) { + + point2 = *point; + roadmap_math_unproject (&point2); + point = &point2; } |
From: Ehud S. <esh...@us...> - 2006-05-21 16:36:10
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20294 Modified Files: roadmap_serial.c Log Message: GPS detection (Avi). Index: roadmap_serial.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_serial.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_serial.c 2 May 2006 12:56:30 -0000 1.5 --- roadmap_serial.c 21 May 2006 16:36:06 -0000 1.6 *************** *** 26,51 **** #include "../roadmap.h" #include "../roadmap_serial.h" ! #include "win32_serial.h" #include "listports.h" ! ! ! static int serial_ports[MAX_SERIAL_ENUMS]; ! ! static BOOL list_port_callback(LPVOID pCallbackValue, ! LISTPORTS_PORTINFO* lpPortInfo) { ! ! int index; ! char *str = ConvertToMultiByte (lpPortInfo->lpPortName, CP_UTF8); ! ! index = atoi (str+3); ! free (str); ! ! if ((index >= 0) && (index < MAX_SERIAL_ENUMS)) { ! serial_ports [index] = 1; ! } ! ! return TRUE; ! } ! RoadMapSerial roadmap_serial_open(const char *name, const char *mode, --- 26,53 ---- #include "../roadmap.h" #include "../roadmap_serial.h" ! #include "win32_serial.h" #include "listports.h" ! ! ! static int serial_ports[MAX_SERIAL_ENUMS]; ! ! #define MAX_SERIAL_SPEEDS 10 ! ! static BOOL list_port_callback(LPVOID pCallbackValue, ! LISTPORTS_PORTINFO* lpPortInfo) { ! ! int index; ! char *str = ConvertToMultiByte (lpPortInfo->lpPortName, CP_UTF8); ! ! index = atoi (str+3); ! free (str); ! ! if ((index >= 0) && (index < MAX_SERIAL_ENUMS)) { ! serial_ports [index] = 1; ! } ! ! return TRUE; ! } ! RoadMapSerial roadmap_serial_open(const char *name, const char *mode, *************** *** 132,144 **** } ! ! const int *roadmap_serial_enumerate (void) ! { ! if (!serial_ports[0]) { ! ! ListPorts (list_port_callback, NULL); ! } ! ! return serial_ports; ! } ! --- 134,155 ---- } ! ! const int *roadmap_serial_enumerate (void) ! { ! if (!serial_ports[0]) { ! ! ListPorts (list_port_callback, NULL); ! } ! ! return serial_ports; ! } ! ! ! const char **roadmap_serial_get_speeds (void) ! { ! static const char *serial_speeds[MAX_SERIAL_SPEEDS] = ! {"4800", "9600", "19200", "38400", "57600", NULL}; ! ! return serial_speeds; ! } ! |
From: Ehud S. <esh...@us...> - 2006-05-21 16:35:47
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19952 Modified Files: roadmap_gps.c roadmap_gps.h roadmap_serial.h roadmap_start.c Log Message: GPS detection (Avi). Index: roadmap_gps.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_gps.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_gps.c 21 May 2006 12:40:37 -0000 1.9 --- roadmap_gps.c 21 May 2006 16:35:43 -0000 1.10 *************** *** 45,48 **** --- 45,52 ---- #include "roadmap_message.h" + #include "roadmap_dialog.h" + #include "roadmap_main.h" + #include "roadmap_messagebox.h" + #include "roadmap_gps.h" *************** *** 63,66 **** --- 67,72 ---- static RoadMapConfigDescriptor RoadMapConfigGPSBaudRate = ROADMAP_CONFIG_ITEM("GPS", "Baud Rate"); + + static void roadmap_gps_detect_periodic(void); #endif *************** *** 145,149 **** } else if (RoadMapGpsActiveSatelliteCount == 0) { new_state = GPS_RECEPTION_NONE; ! } else if ((RoadMapGpsActiveSatelliteCount <= 3) || (RoadMapGpsQuality.dilution_horizontal > 2.3)) { --- 151,155 ---- } else if (RoadMapGpsActiveSatelliteCount == 0) { new_state = GPS_RECEPTION_NONE; ! } else if ((RoadMapGpsActiveSatelliteCount <= 3) || (RoadMapGpsQuality.dilution_horizontal > 2.3)) { *************** *** 581,586 **** --- 587,594 ---- #ifdef _WIN32 const int *serial_ports; + static const char **speeds; RoadMapConfigItem *source_item = NULL; RoadMapConfigItem *virtual_item = NULL; + RoadMapConfigItem *speed_item = NULL; int i; #endif *************** *** 599,603 **** virtual_item = roadmap_config_declare_enumeration ("preferences", &RoadMapConfigGPSVirtual, "", NULL); ! serial_ports = roadmap_serial_enumerate (); for (i=0; i<MAX_SERIAL_ENUMS; ++i) { --- 607,611 ---- virtual_item = roadmap_config_declare_enumeration ("preferences", &RoadMapConfigGPSVirtual, "", NULL); ! serial_ports = roadmap_serial_enumerate (); for (i=0; i<MAX_SERIAL_ENUMS; ++i) { *************** *** 624,629 **** } ! roadmap_config_declare ! ("preferences", &RoadMapConfigGPSBaudRate, "4800"); #endif roadmap_config_declare --- 632,645 ---- } ! ! speed_item = roadmap_config_declare_enumeration ! ("preferences", &RoadMapConfigGPSBaudRate, "", NULL); ! speeds = roadmap_serial_get_speeds (); ! i = 0; ! while (speeds[i] != NULL) { ! roadmap_config_add_enumeration_value (speed_item, speeds[i]); ! i++; ! } ! #endif roadmap_config_declare *************** *** 836,840 **** switch (RoadMapGpsProtocol) { ! case ROADMAP_GPS_NMEA: --- 852,856 ---- switch (RoadMapGpsProtocol) { ! case ROADMAP_GPS_NMEA: *************** *** 996,997 **** --- 1012,1156 ---- + /* GPS auto detection - win32 only */ + #ifdef _WIN32 + static void roadmap_gps_detect_finalize(void){ + roadmap_main_remove_periodic (roadmap_gps_detect_periodic); + roadmap_dialog_set_data ("GPS Receiver Auto Detect", "Port", ""); + roadmap_dialog_set_data ("GPS Receiver Auto Detect", "Speed", ""); + roadmap_dialog_hide ("Auto Detect"); + } + + + static void roadmap_gps_detect_periodic(void){ + + static const int *serial_ports; + static const char **speeds; + static time_t OpenTime; + + static int SpeedIndex = -1; + static int CurrentPort = -1; + static int VirtualPort; + + static char *SavedSpeed; + static char *SavedPort; + static int SavedRetryPending = 0; + + static char Prompt[100]; + + if (CurrentPort == -1) { /* new run */ + const char *virtual_port = roadmap_config_get (&RoadMapConfigGPSVirtual); + serial_ports = roadmap_serial_enumerate (); + speeds = roadmap_serial_get_speeds (); + + /* check for virtual port configuration */ + if ((strlen(virtual_port) >= 5) && !strncmp(virtual_port, "COM", 3)) { + VirtualPort = atoi (virtual_port + 3); + } else { + VirtualPort = -1; + } + + SavedSpeed = (char *)roadmap_config_get (&RoadMapConfigGPSBaudRate); + SavedPort = (char *)roadmap_config_get (&RoadMapConfigGPSSource); + SavedRetryPending = RoadMapGpsRetryPending; + + OpenTime = time(NULL) - (time_t)3; /* make sure first time will be processed */ + CurrentPort++; + /* skip undefined ports */ + while ((CurrentPort < MAX_SERIAL_ENUMS) && + (!serial_ports[CurrentPort] || + (CurrentPort == VirtualPort))) { + + CurrentPort++; + } + } + + if (time(NULL) - OpenTime > (time_t)2) { /* passed 2 seconds since trying to open gps */ + SpeedIndex++; + if (speeds[SpeedIndex] == NULL) { + SpeedIndex = 0; + CurrentPort++; + + /* skip undefined ports */ + while ((CurrentPort < MAX_SERIAL_ENUMS) && + (!serial_ports[CurrentPort] || + (CurrentPort == VirtualPort))) { + + CurrentPort++; + } + } + + if (CurrentPort == MAX_SERIAL_ENUMS) { /* not found */ + roadmap_gps_detect_finalize(); + roadmap_config_set (&RoadMapConfigGPSSource, SavedPort); + roadmap_config_set (&RoadMapConfigGPSBaudRate, SavedSpeed); + if ((SavedRetryPending) && (! RoadMapGpsRetryPending)) { + (*RoadMapGpsPeriodicAdd) (roadmap_gps_open); + RoadMapGpsRetryPending = 1; + } + SpeedIndex = -1; + CurrentPort = -1; + roadmap_messagebox("Failure", + "GPS Receiver not found\nMake sure your receiver is connected and turned on"); + return; + } + + /* prepare to test the new configuration */ + if (RoadMapGpsRetryPending) { + (*RoadMapGpsPeriodicRemove) (roadmap_gps_open); + RoadMapGpsRetryPending = 0; + } + + roadmap_gps_shutdown(); + + sprintf (Prompt, "COM%d:", CurrentPort); + + roadmap_dialog_set_data ("GPS Receiver Auto Detect", "Speed", + speeds[SpeedIndex]); + roadmap_dialog_set_data ("GPS Receiver Auto Detect", "Port", Prompt); + + roadmap_config_set (&RoadMapConfigGPSSource, Prompt); + roadmap_config_set (&RoadMapConfigGPSBaudRate, speeds[SpeedIndex]); + + OpenTime = time(NULL); + roadmap_gps_open(); + return; + } + + if (RoadMapGpsReception != 0) { /* found */ + roadmap_gps_detect_finalize(); + snprintf (Prompt, sizeof(Prompt), + "Found GPS Receiver.\nPort: COM%d:\nSpeed: %s", + CurrentPort, speeds[SpeedIndex]); + SpeedIndex = -1; + CurrentPort = -1; + roadmap_messagebox("Success", Prompt); + } + } + + + void roadmap_gps_detect_receiver (void) { + + if (RoadMapGpsReception != 0) { + roadmap_messagebox("Info","GPS already connected !"); + } else { + if (roadmap_dialog_activate ("Auto Detect", NULL)) { + + roadmap_dialog_new_label ("GPS Receiver Auto Detect", "Port"); + roadmap_dialog_new_label ("GPS Receiver Auto Detect", "Speed"); + roadmap_dialog_new_label ("GPS Receiver Auto Detect", "Status"); + + roadmap_dialog_complete (0); + } + + roadmap_dialog_set_data ("GPS Receiver Auto Detect", "Status", + "Running, please wait..."); + roadmap_main_set_periodic (200,roadmap_gps_detect_periodic); + } + } + + #else + /* Unix */ + + void roadmap_gps_detect_receiver (void) {} + #endif + Index: roadmap_gps.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_gps.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_gps.h 29 Apr 2006 11:12:55 -0000 1.4 --- roadmap_gps.h 21 May 2006 16:35:43 -0000 1.5 *************** *** 134,137 **** --- 134,139 ---- void roadmap_gps_shutdown (void); + void roadmap_gps_detect_receiver (void); + #endif // INCLUDE__ROADMAP_GPS__H Index: roadmap_serial.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_serial.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_serial.h 2 May 2006 12:49:25 -0000 1.4 --- roadmap_serial.h 21 May 2006 16:35:43 -0000 1.5 *************** *** 56,59 **** --- 56,60 ---- void roadmap_serial_close (RoadMapSerial serial); const int *roadmap_serial_enumerate (void); + const char **roadmap_serial_get_speeds (void); #endif // INCLUDE__ROADMAP_FILE__H Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_start.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** roadmap_start.c 12 May 2006 13:18:20 -0000 1.18 --- roadmap_start.c 21 May 2006 16:35:43 -0000 1.19 *************** *** 349,352 **** --- 349,358 ---- + static void roadmap_start_detect_receiver (void) { + + roadmap_gps_detect_receiver (); + } + + /* The RoadMap menu and toolbar items: ----------------------------------- */ *************** *** 532,535 **** --- 538,543 ---- {"uploadgpx", "Upload GPX file", NULL, NULL, "Export editor data", roadmap_start_upload_gpx}, + {"detectreceiver", "Detect GPS receiver", NULL, NULL, + "Auto-detect GPS receiver", roadmap_start_detect_receiver}, {NULL, NULL, NULL, NULL, NULL, NULL} *************** *** 637,640 **** --- 645,651 ---- "deletewaypoints", + ROADMAP_MENU "Tools", + + "detectreceiver", ROADMAP_MENU "Help", |
From: Ehud S. <esh...@us...> - 2006-05-21 12:44:23
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21847 Modified Files: navigate_dglib.c navigate_main.c navigate_main.h Log Message: Door to door navigation. Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** navigate_main.c 15 May 2006 20:17:33 -0000 1.3 --- navigate_main.c 21 May 2006 12:44:15 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- #include <stdio.h> #include <string.h> + #include <stdlib.h> #include "type.h" #include "graph.h" *************** *** 36,39 **** --- 37,42 ---- #include "roadmap_line.h" #include "roadmap_display.h" + #include "roadmap_message.h" + #include "roadmap_voice.h" #include "roadmap_messagebox.h" #include "roadmap_canvas.h" *************** *** 79,82 **** --- 82,88 ---- static PluginLine NavigateDestination = PLUGIN_LINE_NULL; static int NavigateDestPoint; + static RoadMapPosition NavigateDestPos; + static RoadMapPosition NavigateSrcPos; + static int NavigateNextAnnounce; *************** *** 102,105 **** --- 108,112 ---- if (roadmap_navigate_get_current (&pos, &line, &direction) != -1) { + NavigateSrcPos = pos; roadmap_line_points (line.line_id, &from_tmp, &to_tmp); *************** *** 114,117 **** --- 121,125 ---- } else { position = roadmap_trip_get_position ("GPS"); + NavigateSrcPos = *position; } *************** *** 119,122 **** --- 127,131 ---- position = roadmap_trip_get_position ("Departure"); + NavigateSrcPos = *position; } *************** *** 126,130 **** if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance) == -1) || (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { --- 135,139 ---- if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance, LAYER_ALL_ROADS) == -1) || (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { *************** *** 175,180 **** if (!position) return -1; if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance) == -1) || (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { --- 184,191 ---- if (!position) return -1; + NavigateDestPos = *position; + if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance, LAYER_ALL_ROADS) == -1) || (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { *************** *** 200,207 **** break; case ROUTE_DIRECTION_WITH_LINE: ! roadmap_line_points (to_line->line_id, &to_tmp, to_point); break; case ROUTE_DIRECTION_AGAINST_LINE: ! roadmap_line_points (to_line->line_id, to_point, &to_tmp); break; default: --- 211,218 ---- break; case ROUTE_DIRECTION_WITH_LINE: ! roadmap_line_points (to_line->line_id, to_point, &to_tmp); break; case ROUTE_DIRECTION_AGAINST_LINE: ! roadmap_line_points (to_line->line_id, &to_tmp, to_point); break; default: *************** *** 231,239 **** last_shape = seg->first_shape; shape_pos = &end; ! *shape_pos = seg->from_pos; } else { last_shape = seg->last_shape; shape_pos = &start; } --- 242,251 ---- last_shape = seg->first_shape; shape_pos = &end; ! *shape_pos = seg->shape_inital_pos; } else { last_shape = seg->last_shape; shape_pos = &start; + *shape_pos = seg->shape_inital_pos; } *************** *** 248,251 **** --- 260,412 ---- + static void navigate_fix_line_end (RoadMapPosition *position, + NavigateSegment *segment, + int type) { + + RoadMapPosition from; + RoadMapPosition to; + RoadMapPosition intersection; + int smallest_distance = 0x7fffffff; + int distance; + int seg_shape_end; + RoadMapPosition seg_end_pos; + RoadMapPosition seg_shape_initial; + int i; + + if (segment->first_shape <= -1) { + + from = segment->from_pos; + to = segment->to_pos; + } else { + + to = from = segment->from_pos; + + for (i = segment->first_shape; i <= segment->last_shape; i++) { + + segment->shape_itr (i, &to); + + distance = + roadmap_math_get_distance_from_segment + (position, &from, &to, &intersection); + + if (distance < smallest_distance) { + + smallest_distance = distance; + + if (type == LINE_START) { + + seg_shape_end = i; + seg_end_pos = intersection; + seg_shape_initial = from; + } else { + + seg_shape_end = i-1; + seg_end_pos = intersection; + } + } + + from = to; + } + + to = segment->to_pos; + } + + distance = + roadmap_math_get_distance_from_segment + (position, &from, &to, &intersection); + + if (distance < smallest_distance) { + + seg_end_pos = intersection; + seg_shape_end = -1; + } + + if (type == LINE_START) { + + segment->from_pos = seg_end_pos; + segment->shape_inital_pos = seg_shape_initial; + if ((seg_shape_end < 0) || (seg_shape_end > segment->last_shape)) { + segment->first_shape = segment->last_shape = -1; + } else { + segment->first_shape = seg_shape_end; + } + + } else { + + segment->to_pos = seg_end_pos; + if ((seg_shape_end < 0) || (seg_shape_end < segment->first_shape)) { + segment->first_shape = segment->last_shape = -1; + } else { + segment->last_shape = seg_shape_end; + } + } + } + + + static int navigate_calc_length (RoadMapPosition *position, + const NavigateSegment *segment, + int type) { + + RoadMapPosition from; + RoadMapPosition to; + RoadMapPosition intersection; + int current_length = 0; + int length_result = 0; + int smallest_distance = 0x7fffffff; + int distance; + int i; + + if (segment->first_shape <= -1) { + + from = segment->from_pos; + to = segment->to_pos; + } else { + + from = segment->from_pos; + to = segment->shape_inital_pos; + + for (i = segment->first_shape; i <= segment->last_shape; i++) { + + segment->shape_itr (i, &to); + + distance = + roadmap_math_get_distance_from_segment + (position, &from, &to, &intersection); + + if (distance < smallest_distance) { + smallest_distance = distance; + length_result = current_length + + roadmap_math_distance (&from, &intersection); + } + + current_length += roadmap_math_distance (&from, &to); + from = to; + } + + to = segment->to_pos; + } + + distance = + roadmap_math_get_distance_from_segment + (position, &from, &to, &intersection); + + if (distance < smallest_distance) { + + length_result = current_length + + roadmap_math_distance (&from, &intersection); + } + + current_length += roadmap_math_distance (&from, &to); + + if (type == LINE_START) { + + return length_result; + } else { + + return current_length - length_result; + } + } + + static void navigate_main_set_road_instr (NavigateSegment *seg1, NavigateSegment *seg2) { *************** *** 299,303 **** static int navigate_main_prepare_segments (NavigateSegment *segments, ! int count) { int i; --- 460,466 ---- static int navigate_main_prepare_segments (NavigateSegment *segments, ! int count, ! RoadMapPosition *src_pos, ! RoadMapPosition *dst_pos) { int i; *************** *** 312,315 **** --- 475,480 ---- &segments[i].shape_itr); + segments[i].shape_inital_pos = segments[i].from_pos; + roadmap_plugin_get_street (&segments[i].line, &segments[i].street); } *************** *** 320,325 **** } ! segments[i].instruction = APPROCHING_DESTINATION; return 0; } --- 485,501 ---- } ! segments[i].instruction = APPROACHING_DESTINATION; + if (segments[0].line_direction == ROUTE_DIRECTION_WITH_LINE) { + navigate_fix_line_end (src_pos, &segments[0], LINE_START); + } else { + navigate_fix_line_end (src_pos, &segments[0], LINE_END); + } + + if (segments[i].line_direction == ROUTE_DIRECTION_WITH_LINE) { + navigate_fix_line_end (dst_pos, &segments[i], LINE_END); + } else { + navigate_fix_line_end (dst_pos, &segments[i], LINE_START); + } return 0; } *************** *** 354,358 **** } ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments); NavigateTrackEnabled = 1; NavigateCurrentSegment = 0; --- 530,535 ---- } ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments, ! &NavigateSrcPos, &NavigateDestPos); NavigateTrackEnabled = 1; NavigateCurrentSegment = 0; *************** *** 369,381 **** const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; const char *inst_text = ""; if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { distance_to_destination = ! roadmap_math_distance (position, &segment->to_pos); } else { distance_to_destination = ! roadmap_math_distance (position, &segment->from_pos); } --- 546,580 ---- const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; const char *inst_text = ""; + char str[100]; + + if (!NavigateTrackEnabled) return; if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { distance_to_destination = ! navigate_calc_length (position, segment, LINE_END); } else { distance_to_destination = ! navigate_calc_length (position, segment, LINE_START); ! } ! ! while (segment->instruction == CONTINUE) { ! ! const NavigateSegment *prev = segment; ! ! /* Check if the previous segment is the last */ ! if (prev == (NavigateSegments + NavigateNumSegments - 1)) { ! break; ! } ! ! segment++; ! ! if (!roadmap_plugin_same_street (&prev->street, &segment->street)) { ! break; ! } ! ! /* TODO no plugin support */ ! distance_to_destination += roadmap_line_length (segment->line.line_id); } *************** *** 394,403 **** inst_text = "Keep right"; break; case CONTINUE: inst_text = "Continue straight"; break; ! case APPROCHING_DESTINATION: ! inst_text = "Approaching destination"; ! break; } --- 593,610 ---- inst_text = "Keep right"; break; + case APPROACHING_DESTINATION: + inst_text = "Approaching destination"; + break; case CONTINUE: inst_text = "Continue straight"; break; ! } ! ! if ((segment->instruction == APPROACHING_DESTINATION) && ! distance_to_destination < 5) { ! ! NavigateTrackEnabled = 0; ! roadmap_navigate_end_route (NavigateCallbacks); ! return; } *************** *** 405,422 **** roadmap_math_to_trip_distance(distance_to_destination); if (distance_to_destination_far > 0) { ! roadmap_display_text ("Driving Instruction", "%s, %d %s", ! inst_text, distance_to_destination_far, ! roadmap_math_trip_unit()); } else { ! roadmap_display_text ("Driving Instruction", "%s, %d %s", ! inst_text, distance_to_destination, ! roadmap_math_distance_unit()); }; } --- 612,653 ---- roadmap_math_to_trip_distance(distance_to_destination); + roadmap_message_set ('I', inst_text); + if (distance_to_destination_far > 0) { ! snprintf (str, sizeof(str), "%d", distance_to_destination_far); ! roadmap_message_set ('D', str); ! ! roadmap_message_set ('U', roadmap_math_trip_unit ()); ! roadmap_display_text ("Driving Instruction", "In %d%s, %s", distance_to_destination_far, ! roadmap_math_trip_unit(), ! inst_text); } else { ! snprintf (str, sizeof(str), "%d", distance_to_destination); ! roadmap_message_set ('D', str); ! ! roadmap_message_set ('U', roadmap_math_distance_unit ()); ! ! roadmap_display_text ("Driving Instruction", "In %d%s, %s", distance_to_destination, ! roadmap_math_distance_unit(), ! inst_text); }; + if (NavigateNextAnnounce == -1) { + + NavigateNextAnnounce = 50; + roadmap_voice_announce ("Driving Instruction"); + } else { + + if (distance_to_destination <= NavigateNextAnnounce) { + NavigateNextAnnounce = 0; + roadmap_message_unset ('D'); + roadmap_voice_announce ("Driving Instruction"); + } + } + } *************** *** 425,432 **** --- 656,667 ---- (PluginLine *current, int direction, PluginLine *next) { + const PluginStreet *current_street; + if (!NavigateTrackEnabled) { if (navigate_main_recalc_route () != -1) { + roadmap_display_text ("Driving Instruction", "Drive carefully."); + roadmap_display_show ("Driving Instruction"); roadmap_trip_stop (); } *************** *** 437,440 **** --- 672,677 ---- if (!roadmap_plugin_same_line (current, &NavigateSegments[NavigateCurrentSegment].line)) { + + current_street = &NavigateSegments[NavigateCurrentSegment].street; NavigateCurrentSegment++; } *************** *** 449,454 **** --- 686,694 ---- if (navigate_main_recalc_route () == -1) { + roadmap_display_hide ("Driving Instruction"); roadmap_trip_start (); } + + NavigateNextAnnounce = -1; //roadmap_messagebox("Error", "Lost route."); *************** *** 460,464 **** next->plugin_id = INVALID_PLUGIN_ID; } else { ! *next = NavigateSegments[NavigateCurrentSegment].line; } --- 700,713 ---- next->plugin_id = INVALID_PLUGIN_ID; } else { ! ! *next = NavigateSegments[NavigateCurrentSegment+1].line; ! } ! ! if ((NavigateCurrentSegment < NavigateNumSegments) && ! !roadmap_plugin_same_street ! (current_street, ! &NavigateSegments[NavigateCurrentSegment].street)) { ! ! NavigateNextAnnounce = -1; } *************** *** 503,507 **** int from_point; int use_gps_location = (strcmp (roadmap_trip_get_focus_name (), "GPS") == 0); - use_gps_location = 0; NavigateDestination.plugin_id = INVALID_PLUGIN_ID; --- 752,755 ---- *************** *** 536,541 **** int length = 0; ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments); for (i=0; i<NavigateNumSegments; i++) { if (NavigateSegments[i].line.plugin_id == ROADMAP_PLUGIN_ID) { --- 784,791 ---- int length = 0; ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments, ! &NavigateSrcPos, &NavigateDestPos); + /* TODO no plugin support */ for (i=0; i<NavigateNumSegments; i++) { if (NavigateSegments[i].line.plugin_id == ROADMAP_PLUGIN_ID) { *************** *** 557,560 **** --- 807,812 ---- roadmap_screen_redraw (); + roadmap_display_text ("Driving Instruction", "Drive carefully."); + roadmap_display_show ("Driving Instruction"); roadmap_messagebox ("Route found", msg); } *************** *** 599,603 **** &segment->to_pos, 0, ! &segment->from_pos, segment->first_shape, segment->last_shape, --- 851,855 ---- &segment->to_pos, 0, ! &segment->shape_inital_pos, segment->first_shape, segment->last_shape, Index: navigate_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_main.h 15 May 2006 19:52:15 -0000 1.2 --- navigate_main.h 21 May 2006 12:44:15 -0000 1.3 *************** *** 36,40 **** KEEP_RIGHT, CONTINUE, ! APPROCHING_DESTINATION }; --- 36,40 ---- KEEP_RIGHT, CONTINUE, ! APPROACHING_DESTINATION }; *************** *** 45,48 **** --- 45,49 ---- RoadMapPosition from_pos; RoadMapPosition to_pos; + RoadMapPosition shape_inital_pos; int first_shape; int last_shape; Index: navigate_dglib.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_dglib.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_dglib.c 15 May 2006 19:52:15 -0000 1.2 --- navigate_dglib.c 21 May 2006 12:44:15 -0000 1.3 *************** *** 204,210 **** /* FIXME no plugin support */ if (segments[i-1].line.line_id != to_line->line_id) { segments[i].line = *to_line; ! /* TODO destination line should have a direction */ ! segments[i].line_direction = ROUTE_DIRECTION_NONE; (*size)++; } --- 204,220 ---- /* FIXME no plugin support */ if (segments[i-1].line.line_id != to_line->line_id) { + + int from_point; + int to_point; segments[i].line = *to_line; ! roadmap_line_points (to_line->line_id, &from_point, &to_point); ! ! if (from_point == dglNodeGet_Id(&graph, &pReport->nDestinationNode)) { ! ! segments[i].line_direction = ROUTE_DIRECTION_WITH_LINE; ! } else { ! ! segments[i].line_direction = ROUTE_DIRECTION_AGAINST_LINE; ! } (*size)++; } |
From: Ehud S. <esh...@us...> - 2006-05-21 12:43:27
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21481 Modified Files: editor_trkseg.c Log Message: Fix split bug. Index: editor_trkseg.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_trkseg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor_trkseg.c 23 Apr 2006 13:22:43 -0000 1.5 --- editor_trkseg.c 21 May 2006 12:43:18 -0000 1.6 *************** *** 319,322 **** --- 319,342 ---- } + if (flags & ED_TRKSEG_OPPOSITE_DIR) { + to = *line_from; + } else { + to = *line_to; + } + + distance = + roadmap_math_get_distance_from_segment + (split_position, &from, &to, &intersection); + + if (distance < smallest_distance) { + smallest_distance = distance; + result.from = from; + result.to = to; + result.intersection = intersection; + split_shape_point = i; + /* split_time is the time of the previous shape */ + split_time = shape_time; + } + //roadmap_math_release_focus (); *************** *** 351,356 **** } ! if ((split_shape_point == last_shape) && ! !roadmap_math_compare_points (&result.to, &result.intersection)) { /* the split is after the trkseg points */ --- 371,377 ---- } ! if ((split_shape_point > last_shape) || ! ((split_shape_point == last_shape) && ! !roadmap_math_compare_points (&result.to, &result.intersection))) { /* the split is after the trkseg points */ |
From: Ehud S. <esh...@us...> - 2006-05-21 12:42:51
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21135 Modified Files: editor_screen.c Log Message: Door to door navigation. Index: editor_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_screen.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** editor_screen.c 2 May 2006 12:53:49 -0000 1.10 --- editor_screen.c 21 May 2006 12:42:44 -0000 1.11 *************** *** 224,228 **** if (roadmap_navigate_retrieve_line ! (&position, 20, &line, &distance) == -1) { roadmap_display_hide ("Selected Street"); --- 224,228 ---- if (roadmap_navigate_retrieve_line ! (&position, 20, &line, &distance, LAYER_ALL_ROADS) == -1) { roadmap_display_hide ("Selected Street"); |
From: Ehud S. <esh...@us...> - 2006-05-21 12:40:52
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20355 Modified Files: Makefile roadmap_display.c roadmap_display.h roadmap_gps.c roadmap_layer.h roadmap_navigate.c roadmap_navigate.h roadmap_plugin.c roadmap_plugin.h roadmap_screen.c roadmap_turns.c roadmap_voice.c Log Message: Door to door navigation. Index: roadmap_plugin.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_plugin.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_plugin.h 15 May 2006 19:26:39 -0000 1.5 --- roadmap_plugin.h 21 May 2006 12:40:37 -0000 1.6 *************** *** 192,198 **** void roadmap_plugin_screen_repaint (int max_pen); ! const char *roadmap_plugin_street_full_name (PluginLine *line); ! void roadmap_plugin_get_street_properties (PluginLine *line, PluginStreetProperties *props); --- 192,198 ---- void roadmap_plugin_screen_repaint (int max_pen); ! const char *roadmap_plugin_street_full_name (const PluginLine *line); ! void roadmap_plugin_get_street_properties (const PluginLine *line, PluginStreetProperties *props); Index: roadmap_display.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_display.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_display.h 28 Nov 2005 19:36:34 -0000 1.2 --- roadmap_display.h 21 May 2006 12:40:37 -0000 1.3 *************** *** 33,37 **** int roadmap_display_activate (const char *title, ! PluginLine *line, const RoadMapPosition *position, PluginStreet *street); --- 33,37 ---- int roadmap_display_activate (const char *title, ! const PluginLine *line, const RoadMapPosition *position, PluginStreet *street); *************** *** 39,42 **** --- 39,43 ---- void roadmap_display_text (const char *title, const char *format, ...); + void roadmap_display_show (const char *title); void roadmap_display_hide (const char *title); Index: roadmap_voice.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_voice.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_voice.c 12 May 2006 13:14:57 -0000 1.2 --- roadmap_voice.c 21 May 2006 12:40:40 -0000 1.3 *************** *** 57,60 **** --- 57,61 ---- {ROADMAP_CONFIG_ITEM("Voice", "Next Intersection"), "flite -t 'Next intersection: %N'"}, {ROADMAP_CONFIG_ITEM("Voice", "Selected Street"), "flite -t 'Selected %N'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Driving Instruction"), "flite -t 'In %D %U, %I'|flite -t '%I'"}, {ROADMAP_CONFIG_ITEM_EMPTY, NULL} }; *************** *** 96,99 **** --- 97,103 ---- {"S", "south"}, {"E", "east"}, + {"right", "ra-ight"}, + {"m", "meter"}, + {"km", "kilo-meter"}, {NULL, NULL} }; Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile 12 May 2006 13:18:20 -0000 1.13 --- Makefile 21 May 2006 12:40:37 -0000 1.14 *************** *** 182,188 **** editor/db/editor_route.c \ editor/db/editor_dictionary.c \ ! buildmap_dbwrite.c \ ! buildmap_metadata.c \ ! buildmap_messages.c \ editor/db/editor_override.c \ editor/export/editor_export.c \ --- 182,188 ---- editor/db/editor_route.c \ editor/db/editor_dictionary.c \ ! buildmap_dbwrite.c \ ! buildmap_metadata.c \ ! buildmap_messages.c \ editor/db/editor_override.c \ editor/export/editor_export.c \ *************** *** 194,201 **** editor/track/editor_track_unknown.c \ editor/track/editor_track_known.c \ ! editor/db/editor_db.c \ ! navigate/navigate_main.c \ ! navigate/navigate_plugin.c \ ! navigate/navigate_dglib.c \ RMPLUGINOBJS=$(RMPLUGINSRCS:.c=.o) --- 194,201 ---- editor/track/editor_track_unknown.c \ editor/track/editor_track_known.c \ ! editor/db/editor_db.c \ ! navigate/navigate_main.c \ ! navigate/navigate_plugin.c \ ! navigate/navigate_dglib.c \ RMPLUGINOBJS=$(RMPLUGINSRCS:.c=.o) Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_display.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_display.c 15 May 2006 19:26:39 -0000 1.6 --- roadmap_display.c 21 May 2006 12:40:37 -0000 1.7 *************** *** 126,130 **** ROADMAP_SIGN(NULL, "Info", SIGN_CENTER, NULL, "yellow", "black"), ROADMAP_SIGN(NULL, "Error", SIGN_CENTER, NULL, "red", "white"), ! ROADMAP_SIGN("GPS", "Driving Instruction", SIGN_TOP, NULL, "red", "white"), ROADMAP_SIGN(NULL, NULL, 0, NULL, NULL, NULL) }; --- 126,130 ---- ROADMAP_SIGN(NULL, "Info", SIGN_CENTER, NULL, "yellow", "black"), ROADMAP_SIGN(NULL, "Error", SIGN_CENTER, NULL, "red", "white"), ! ROADMAP_SIGN("GPS", "Driving Instruction", SIGN_TOP, "In %D %I", "red", "white"), ROADMAP_SIGN(NULL, NULL, 0, NULL, NULL, NULL) }; *************** *** 458,462 **** int roadmap_display_activate (const char *title, ! PluginLine *line, const RoadMapPosition *position, PluginStreet *street) { --- 458,462 ---- int roadmap_display_activate (const char *title, ! const PluginLine *line, const RoadMapPosition *position, PluginStreet *street) { *************** *** 569,572 **** --- 569,584 ---- } + + void roadmap_display_show (const char *title) { + + RoadMapSign *sign; + + sign = roadmap_display_search_sign (title); + if (sign != NULL) { + sign->deadline = -1; + } + } + + static void roadmap_display_console_box (int corner, RoadMapConfigDescriptor *item) { *************** *** 671,675 **** (! strcmp (sign->page, RoadMapDisplayPage))) { ! if (sign->deadline > now && sign->content != NULL) { roadmap_display_sign (sign); } --- 683,689 ---- (! strcmp (sign->page, RoadMapDisplayPage))) { ! if ( ((sign->deadline == -1) || (sign->deadline > now)) ! && sign->content != NULL) { ! roadmap_display_sign (sign); } Index: roadmap_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_plugin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_plugin.c 15 May 2006 19:26:39 -0000 1.5 --- roadmap_plugin.c 21 May 2006 12:40:37 -0000 1.6 *************** *** 395,399 **** ! const char *roadmap_plugin_street_full_name (PluginLine *line) { if (line->plugin_id == ROADMAP_PLUGIN_ID) { --- 395,399 ---- ! const char *roadmap_plugin_street_full_name (const PluginLine *line) { if (line->plugin_id == ROADMAP_PLUGIN_ID) { *************** *** 423,427 **** ! void roadmap_plugin_get_street_properties (PluginLine *line, PluginStreetProperties *props) { --- 423,427 ---- ! void roadmap_plugin_get_street_properties (const PluginLine *line, PluginStreetProperties *props) { Index: roadmap_navigate.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_navigate.h 15 May 2006 19:26:39 -0000 1.4 --- roadmap_navigate.h 21 May 2006 12:40:37 -0000 1.5 *************** *** 67,74 **** int roadmap_navigate_retrieve_line ! (const RoadMapPosition *position, ! int accuracy, ! PluginLine *line, ! int *distance); void roadmap_navigate_locate (const RoadMapGpsPosition *gps_position); --- 67,72 ---- int roadmap_navigate_retrieve_line ! (const RoadMapPosition *position, int accuracy, PluginLine *line, ! int *distance, int type); void roadmap_navigate_locate (const RoadMapGpsPosition *gps_position); Index: roadmap_turns.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_turns.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_turns.c 15 May 2006 19:26:09 -0000 1.2 --- roadmap_turns.c 21 May 2006 12:40:40 -0000 1.3 *************** *** 289,294 **** for (; first_turn <= last_turn; first_turn++) { if ((RoadMapTurnsActive->Turns[first_turn].from_line == from_line) && ! RoadMapTurnsActive->Turns[first_turn].to_line == to_line) return 1; } --- 289,298 ---- for (; first_turn <= last_turn; first_turn++) { + if ((RoadMapTurnsActive->Turns[first_turn].from_line == from_line) && ! RoadMapTurnsActive->Turns[first_turn].to_line == to_line) { ! ! return 1; ! } } Index: roadmap_gps.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_gps.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_gps.c 8 May 2006 13:57:46 -0000 1.8 --- roadmap_gps.c 21 May 2006 12:40:37 -0000 1.9 *************** *** 229,240 **** roadmap_log (ROADMAP_ERROR, "GPS timeout detected."); ! (*RoadMapGpsPeriodicRemove) (roadmap_gps_keep_alive); ! ! (*RoadMapGpsLinkRemove) (&RoadMapGpsLink); ! ! roadmap_io_close (&RoadMapGpsLink); /* Try to establish a new IO channel: */ - roadmap_gps_open(); } --- 229,235 ---- roadmap_log (ROADMAP_ERROR, "GPS timeout detected."); ! roadmap_gps_shutdown (); /* Try to establish a new IO channel: */ roadmap_gps_open(); } *************** *** 691,702 **** url = roadmap_gps_source (); ! if (url == NULL) { ! #ifdef _WIN32 ! url = roadmap_main_get_virtual_serial (); ! if (!url) { ! url = roadmap_config_get (&RoadMapConfigGPSSource); } #else ! url = roadmap_config_get (&RoadMapConfigGPSSource); #endif --- 686,697 ---- url = roadmap_gps_source (); ! if (url == NULL) { ! #ifdef _WIN32 ! url = roadmap_main_get_virtual_serial (); ! if (!url) { ! url = roadmap_config_get (&RoadMapConfigGPSSource); } #else ! url = roadmap_config_get (&RoadMapConfigGPSSource); #endif *************** *** 1000,1001 **** --- 995,997 ---- } + Index: roadmap_navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_navigate.c 15 May 2006 19:26:39 -0000 1.9 --- roadmap_navigate.c 21 May 2006 12:40:37 -0000 1.10 *************** *** 129,133 **** static int roadmap_navigate_get_neighbours (const RoadMapPosition *position, int accuracy, ! RoadMapNeighbour *neighbours, int max) { int count = 0; --- 129,133 ---- static int roadmap_navigate_get_neighbours (const RoadMapPosition *position, int accuracy, ! RoadMapNeighbour *neighbours, int max, int type) { int count = 0; *************** *** 166,170 **** roadmap_navigate_adjust_focus (&focus, &focus_point); ! layer_count = roadmap_layer_visible_roads (layers, 128); if (layer_count > 0) { --- 166,174 ---- roadmap_navigate_adjust_focus (&focus, &focus_point); ! if (type == LAYER_VISIBLE_ROADS) { ! layer_count = roadmap_layer_visible_roads (layers, 128); ! } else { ! layer_count = roadmap_layer_all_roads (layers, 128); ! } if (layer_count > 0) { *************** *** 206,218 **** int roadmap_navigate_retrieve_line ! (const RoadMapPosition *position, ! int accuracy, ! PluginLine *line, ! int *distance) { RoadMapNeighbour closest; if (roadmap_navigate_get_neighbours ! (position, accuracy, &closest, 1) <= 0) { return -1; --- 210,220 ---- int roadmap_navigate_retrieve_line ! (const RoadMapPosition *position, int accuracy, PluginLine *line, ! int *distance, int type) { RoadMapNeighbour closest; if (roadmap_navigate_get_neighbours ! (position, accuracy, &closest, 1, type) <= 0) { return -1; *************** *** 537,541 **** PluginStreet street; RoadMapConfirmedStreet.intersection = *found; ! roadmap_display_activate ("Approach", found, &crossing, &street); } --- 539,546 ---- PluginStreet street; RoadMapConfirmedStreet.intersection = *found; ! ! if (!RoadMapRouteInfo.enabled) { ! roadmap_display_activate ("Approach", found, &crossing, &street); ! } } *************** *** 549,552 **** --- 554,559 ---- int found; int count; + int candidate_in_route = 0; + int nominated_in_route = 0; RoadMapFuzzy best; *************** *** 584,587 **** --- 591,596 ---- RoadMapFuzzy before = RoadMapConfirmedStreet.fuzzyfied; + RoadMapFuzzy current_fuzzy; + int previous_direction = RoadMapConfirmedStreet.line_direction; if (roadmap_plugin_activate_db *************** *** 590,603 **** } ! roadmap_plugin_get_distance ! (&RoadMapLatestPosition, ! &RoadMapConfirmedLine.line, ! &RoadMapConfirmedLine); ! if (roadmap_navigate_fuzzify ! (&RoadMapConfirmedStreet, ! &RoadMapConfirmedLine, ! &RoadMapConfirmedLine, gps_position->steering) >= before) { if (! roadmap_navigate_confirm_intersection (gps_position)) { PluginLine p_line; --- 599,621 ---- } ! if (!roadmap_plugin_get_distance ! (&RoadMapLatestPosition, ! &RoadMapConfirmedLine.line, ! &RoadMapConfirmedLine)) { ! current_fuzzy = 0; ! } else { + current_fuzzy = roadmap_navigate_fuzzify + (&RoadMapConfirmedStreet, &RoadMapConfirmedLine, + &RoadMapConfirmedLine, gps_position->steering); + } + + if ((previous_direction == RoadMapConfirmedStreet.line_direction) && + ((current_fuzzy >= before) || + roadmap_fuzzy_is_certain(current_fuzzy))) { + + RoadMapConfirmedStreet.fuzzyfied = current_fuzzy; + if (! roadmap_navigate_confirm_intersection (gps_position)) { PluginLine p_line; *************** *** 619,623 **** count = roadmap_navigate_get_neighbours (&RoadMapLatestPosition, roadmap_fuzzy_max_distance(), ! RoadMapNeighbourhood, ROADMAP_NEIGHBOURHOUD); for (i = 0, best = roadmap_fuzzy_false(), found = 0; i < count; ++i) { --- 637,641 ---- count = roadmap_navigate_get_neighbours (&RoadMapLatestPosition, roadmap_fuzzy_max_distance(), ! RoadMapNeighbourhood, ROADMAP_NEIGHBOURHOUD, LAYER_ALL_ROADS); for (i = 0, best = roadmap_fuzzy_false(), found = 0; i < count; ++i) { *************** *** 626,637 **** (&candidate, RoadMapConfirmedStreet.valid ? ! &RoadMapConfirmedLine : NULL, RoadMapNeighbourhood+i, gps_position->steering); ! if (result > best) { found = i; best = result; nominated = candidate; } } --- 644,681 ---- (&candidate, RoadMapConfirmedStreet.valid ? ! &RoadMapConfirmedLine : NULL, RoadMapNeighbourhood+i, gps_position->steering); ! ! if (RoadMapRouteInfo.enabled && ! (roadmap_plugin_same_line ! (&RoadMapNeighbourhood[i].line, ! &RoadMapRouteInfo.current_line) || ! roadmap_plugin_same_line ! (&RoadMapNeighbourhood[i].line, ! &RoadMapRouteInfo.next_line))) { ! ! candidate_in_route = 1; ! } else { ! ! candidate_in_route = 0; ! } ! ! if ((result > best) || ! (!nominated_in_route && ! candidate_in_route && ! roadmap_fuzzy_is_acceptable (result))) { ! ! if (nominated_in_route && !candidate_in_route) { ! /* Prefer one of the routing segments */ ! ! continue; ! } ! found = i; best = result; nominated = candidate; + nominated_in_route = candidate_in_route; } } *************** *** 659,667 **** &RoadMapConfirmedStreet.street); - if (gps_position->speed > roadmap_gps_speed_accuracy()) { - PluginLine p_line; - roadmap_navigate_find_intersection (gps_position, &p_line); - } - if (!roadmap_plugin_same_line (&RoadMapConfirmedLine.line, &old_line)) { --- 703,706 ---- *************** *** 685,688 **** --- 724,731 ---- } + if (gps_position->speed > roadmap_gps_speed_accuracy()) { + PluginLine p_line; + roadmap_navigate_find_intersection (gps_position, &p_line); + } } else { Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** roadmap_screen.c 15 May 2006 19:26:39 -0000 1.11 --- roadmap_screen.c 21 May 2006 12:40:37 -0000 1.12 *************** *** 1173,1177 **** roadmap_config_get_integer (&RoadMapConfigAccuracyMouse), &line, ! &distance) != -1) { PluginStreet street; --- 1173,1178 ---- roadmap_config_get_integer (&RoadMapConfigAccuracyMouse), &line, ! &distance, ! LAYER_ALL_ROADS) != -1) { PluginStreet street; Index: roadmap_layer.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_layer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_layer.h 15 May 2006 19:26:39 -0000 1.4 --- roadmap_layer.h 21 May 2006 12:40:37 -0000 1.5 *************** *** 27,30 **** --- 27,33 ---- #include "roadmap_canvas.h" + #define LAYER_VISIBLE_ROADS 1 + #define LAYER_ALL_ROADS 2 + int roadmap_layer_max_pen(void); |
From: Ehud S. <esh...@us...> - 2006-05-15 20:17:37
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15485 Modified Files: navigate_main.c Log Message: Disable door to door navigation. Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_main.c 15 May 2006 19:52:15 -0000 1.2 --- navigate_main.c 15 May 2006 20:17:33 -0000 1.3 *************** *** 503,508 **** --- 503,510 ---- int from_point; int use_gps_location = (strcmp (roadmap_trip_get_focus_name (), "GPS") == 0); + use_gps_location = 0; NavigateDestination.plugin_id = INVALID_PLUGIN_ID; + NavigateTrackEnabled = 0; NavigateNumSegments = MAX_NAV_SEGEMENTS; *************** *** 544,552 **** snprintf(msg, sizeof(msg), "Length: %.1f km\nTime: %.1f minutes", length/1000.0, track_time/60.0); NavigateTrackEnabled = 1; - NavigateCurrentSegment = 0; ! roadmap_trip_stop (); ! roadmap_navigate_route (NavigateCallbacks); roadmap_screen_redraw (); --- 546,558 ---- snprintf(msg, sizeof(msg), "Length: %.1f km\nTime: %.1f minutes", length/1000.0, track_time/60.0); + NavigateTrackEnabled = 1; ! if (use_gps_location) { ! NavigateCurrentSegment = 0; ! ! roadmap_trip_stop (); ! roadmap_navigate_route (NavigateCallbacks); ! } roadmap_screen_redraw (); *************** *** 576,582 **** if (width != current_width) { ! roadmap_canvas_select_pen (NavigatePen); roadmap_canvas_set_thickness (width); current_width = width; } --- 582,594 ---- if (width != current_width) { ! ! RoadMapPen previous_pen; ! previous_pen = roadmap_canvas_select_pen (NavigatePen); roadmap_canvas_set_thickness (width); current_width = width; + + if (previous_pen) { + roadmap_canvas_select_pen (previous_pen); + } } |
From: Ehud S. <esh...@us...> - 2006-05-15 20:17:21
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15472 Modified Files: editor_main.c Log Message: Disable door to door navigation. Index: editor_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** editor_main.c 12 May 2006 14:19:36 -0000 1.6 --- editor_main.c 15 May 2006 20:17:18 -0000 1.7 *************** *** 41,45 **** int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.6 pre3"; int editor_is_enabled (void) { --- 41,45 ---- int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.6.0"; int editor_is_enabled (void) { |
From: Ehud S. <esh...@us...> - 2006-05-15 20:16:52
|
Update of /cvsroot/roadmap/roadmap_editor/src/agg In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15144 Modified Files: roadmap_canvas.cpp Log Message: Modify select_pen to return the current pen. Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/agg/roadmap_canvas.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_canvas.cpp 15 May 2006 19:50:40 -0000 1.2 --- roadmap_canvas.cpp 15 May 2006 20:16:49 -0000 1.3 *************** *** 159,164 **** ! void roadmap_canvas_select_pen (RoadMapPen pen) { dbg_time_start(DBG_TIME_SELECT_PEN); if (!CurrentPen || (pen->thickness != CurrentPen->thickness)) { --- 159,165 ---- ! RoadMapPen roadmap_canvas_select_pen (RoadMapPen pen) { + RoadMapPen old_pen = CurrentPen; dbg_time_start(DBG_TIME_SELECT_PEN); if (!CurrentPen || (pen->thickness != CurrentPen->thickness)) { *************** *** 171,175 **** dbg_time_end(DBG_TIME_SELECT_PEN); ! return; } --- 172,176 ---- dbg_time_end(DBG_TIME_SELECT_PEN); ! return old_pen; } |
From: Ehud S. <esh...@us...> - 2006-05-15 20:16:41
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15124 Modified Files: roadmap_canvas.h Log Message: Modify select_pen to return the current pen. Index: roadmap_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_canvas.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_canvas.h 15 May 2006 19:26:39 -0000 1.5 --- roadmap_canvas.h 15 May 2006 20:16:33 -0000 1.6 *************** *** 78,82 **** * on the canvas. */ ! void roadmap_canvas_select_pen (RoadMapPen pen); --- 78,82 ---- * on the canvas. */ ! RoadMapPen roadmap_canvas_select_pen (RoadMapPen pen); |
From: Ehud S. <esh...@us...> - 2006-05-15 20:05:32
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6871 Modified Files: navigate_dglib.c navigate_graph.h navigate_main.c navigate_main.h navigate_plugin.c Log Message: Add initial door to door navigation. Index: navigate_dglib.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_dglib.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_dglib.c 22 Mar 2006 08:53:15 -0000 1.1 --- navigate_dglib.c 15 May 2006 19:52:15 -0000 1.2 *************** *** 30,40 **** #include <stdlib.h> #include "type.h" ! #include "graph.h" #include "roadmap.h" #include "roadmap_path.h" #include "roadmap_locator.h" #include "roadmap_turns.h" #include "roadmap_metadata.h" #include "roadmap_messagebox.h" #include "navigate_main.h" --- 30,42 ---- #include <stdlib.h> #include "type.h" ! #include "graph.h" #include "roadmap.h" #include "roadmap_path.h" + #include "roadmap_line.h" #include "roadmap_locator.h" #include "roadmap_turns.h" #include "roadmap_metadata.h" #include "roadmap_messagebox.h" + #include "roadmap_line_route.h" #include "navigate_main.h" *************** *** 54,58 **** if ( roadmap_turns_find_restriction ( dglNodeGet_Id(pgraph, pIn->pnNodeFrom), ! dglEdgeGet_Id(pgraph, pIn->pnPrevEdge), dglEdgeGet_Id(pgraph, pIn->pnEdge))) { /* --- 56,62 ---- if ( roadmap_turns_find_restriction ( dglNodeGet_Id(pgraph, pIn->pnNodeFrom), ! pIn->pnPrevEdge != NULL ? ! dglEdgeGet_Id(pgraph, pIn->pnPrevEdge) : ! (int) pvarg, dglEdgeGet_Id(pgraph, pIn->pnEdge))) { /* *************** *** 121,125 **** ! int navigate_get_route_segments (int from, int to, int *segments, int *size) { int i; --- 125,134 ---- ! int navigate_get_route_segments (PluginLine *from_line, ! int from_point, ! PluginLine *to_line, ! int to_point, ! NavigateSegment *segments, ! int *size) { int i; *************** *** 130,134 **** if (fips_data_loaded != roadmap_locator_active ()) return -1; ! nret = dglShortestPath (&graph, &pReport, from, to, clipper, NULL, &spCache); if (nret <= 0) return nret; --- 139,147 ---- if (fips_data_loaded != roadmap_locator_active ()) return -1; ! /* save places for start & end lines */ ! *size -= 2; ! ! nret = dglShortestPath (&graph, &pReport, from_point, to_point, ! clipper, (void *)from_line->line_id, NULL); if (nret <= 0) return nret; *************** *** 138,146 **** *size = pReport->cArc; for(i=0; i < pReport->cArc ;i++) { ! segments[i] = dglEdgeGet_Id(&graph, pReport->pArc[i].pnEdge); ! if (segments[i] < 0) { ! segments[i] = abs(segments[i]); } /* printf( "edge[%d]: from %ld to %ld - travel cost %ld - user edgeid %ld - distance from start node %ld\n" , --- 151,191 ---- *size = pReport->cArc; + /* add starting line */ + if (abs(dglEdgeGet_Id(&graph, pReport->pArc[0].pnEdge)) != + from_line->line_id) { + + int tmp_from; + int tmp_to; + + /* FIXME no plugin support */ + roadmap_line_points (from_line->line_id, &tmp_from, &tmp_to); + + segments[0].line = *from_line; + + if (from_point == tmp_from) { + segments[0].line_direction = ROUTE_DIRECTION_AGAINST_LINE; + } else { + segments[0].line_direction = ROUTE_DIRECTION_WITH_LINE; + } + + segments++; + (*size)++; + } + + for(i=0; i < pReport->cArc ;i++) { ! segments[i].line.plugin_id = ROADMAP_PLUGIN_ID; ! segments[i].line.line_id = dglEdgeGet_Id(&graph, pReport->pArc[i].pnEdge); ! segments[i].line.fips = roadmap_locator_active (); ! segments[i].line.cfcc = *(unsigned char *) ! dglEdgeGet_Attr(&graph, pReport->pArc[i].pnEdge); ! if (segments[i].line.line_id < 0) { ! segments[i].line.line_id = abs(segments[i].line.line_id); ! segments[i].line_direction = ROUTE_DIRECTION_AGAINST_LINE; ! ! } else { ! segments[i].line_direction = ROUTE_DIRECTION_WITH_LINE; } + /* printf( "edge[%d]: from %ld to %ld - travel cost %ld - user edgeid %ld - distance from start node %ld\n" , *************** *** 154,157 **** --- 199,213 ---- */ } + + /* add ending line */ + + /* FIXME no plugin support */ + if (segments[i-1].line.line_id != to_line->line_id) { + segments[i].line = *to_line; + /* TODO destination line should have a direction */ + segments[i].line_direction = ROUTE_DIRECTION_NONE; + (*size)++; + } + dglFreeSPReport(&graph, pReport); Index: navigate_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_plugin.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_plugin.c 22 Mar 2006 08:53:15 -0000 1.1 --- navigate_plugin.c 15 May 2006 19:52:15 -0000 1.2 *************** *** 42,46 **** NULL, &navigate_main_override_pen, ! NULL, NULL, NULL, --- 42,46 ---- NULL, &navigate_main_override_pen, ! &navigate_main_screen_repaint, NULL, NULL, Index: navigate_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_main.h 22 Mar 2006 08:53:15 -0000 1.1 --- navigate_main.h 15 May 2006 19:52:15 -0000 1.2 *************** *** 27,31 **** --- 27,55 ---- #include "roadmap_canvas.h" + #include "roadmap_plugin.h" + #include "roadmap_screen.h" + enum NavigateInstr { + TURN_LEFT, + TURN_RIGHT, + KEEP_LEFT, + KEEP_RIGHT, + CONTINUE, + APPROCHING_DESTINATION + }; + + typedef struct { + PluginLine line; + int line_direction; + PluginStreet street; + RoadMapPosition from_pos; + RoadMapPosition to_pos; + int first_shape; + int last_shape; + RoadMapShapeItr shape_itr; + enum NavigateInstr instruction; + + } NavigateSegment; + int navigate_is_enabled (void); void navigate_main_initialize (void); *************** *** 33,36 **** --- 57,62 ---- void navigate_main_calc_route (void); + void navigate_main_screen_repaint (int max_pen); + int navigate_main_override_pen (int line, int cfcc, Index: navigate_graph.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_graph.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_graph.h 22 Mar 2006 08:53:15 -0000 1.1 --- navigate_graph.h 15 May 2006 19:52:15 -0000 1.2 *************** *** 26,31 **** #define _NAVIGATE_GRAPH_H_ int navigate_load_data (void); ! int navigate_get_route_segments (int from, int to, int *segments, int *size); #endif /* _NAVIGATE_GRAPH_H_ */ --- 26,39 ---- #define _NAVIGATE_GRAPH_H_ + #include "navigate_main.h" + int navigate_load_data (void); ! ! int navigate_get_route_segments (PluginLine *from_line, ! int from_point, ! PluginLine *to_line, ! int to_point, ! NavigateSegment *segments, ! int *size); #endif /* _NAVIGATE_GRAPH_H_ */ Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_main.c 22 Mar 2006 08:53:15 -0000 1.1 --- navigate_main.c 15 May 2006 19:52:15 -0000 1.2 *************** *** 35,38 **** --- 35,39 ---- #include "roadmap_plugin.h" #include "roadmap_line.h" + #include "roadmap_display.h" #include "roadmap_messagebox.h" #include "roadmap_canvas.h" *************** *** 43,52 **** --- 44,60 ---- #include "roadmap_line_route.h" #include "roadmap_math.h" + #include "roadmap_navigate.h" #include "roadmap_point.h" #include "navigate_plugin.h" #include "navigate_graph.h" + #include "roadmap_layer.h" #include "navigate_main.h" + #define LINE_START 0 + #define LINE_END 1 + + #define ROUTE_PEN_WIDTH 4 + int NavigateEnabled = 0; int NavigatePluginID = -1; *************** *** 54,65 **** static RoadMapPen NavigatePen; #define MAX_NAV_SEGEMENTS 100 ! int NavigateSegments[MAX_NAV_SEGEMENTS]; ! int NavigateNumSegments = 0; ! static int navigate_find_track_points (int *from_line, int *from_point, ! int *to_line, int *to_point) { const RoadMapPosition *position; RoadMapPosition from_position; --- 62,88 ---- static RoadMapPen NavigatePen; + static void navigate_update (RoadMapPosition *position, PluginLine *current); + static void navigate_get_next_line + (PluginLine *current, int direction, PluginLine *next); + + RoadMapNavigateRouteCB NavigateCallbacks = { + &navigate_update, + &navigate_get_next_line + }; + + #define MAX_NAV_SEGEMENTS 100 ! static NavigateSegment NavigateSegments[MAX_NAV_SEGEMENTS]; ! static int NavigateNumSegments = 0; ! static int NavigateCurrentSegment = 0; ! static PluginLine NavigateDestination = PLUGIN_LINE_NULL; ! static int NavigateDestPoint; ! static int navigate_find_track_points (PluginLine *from_line, int *from_point, ! PluginLine *to_line, int *to_point, ! int use_gps_location) { ! const RoadMapPosition *position; RoadMapPosition from_position; *************** *** 69,108 **** int from_tmp; int to_tmp; ! position = roadmap_trip_get_position ("Departure"); ! if (!position) return -1; ! if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance) == -1) || ! (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { ! roadmap_messagebox ("Error", "Can't find a road near departure point."); ! return -1; ! } ! *from_line = roadmap_plugin_get_line_id (&line); ! switch (roadmap_line_route_get_direction (*from_line, ROUTE_CAR_ALLOWED)) { ! case ROUTE_DIRECTION_ANY: ! case ROUTE_DIRECTION_NONE: ! roadmap_line_points (*from_line, &from_tmp, &to_tmp); ! roadmap_point_position (from_tmp, &from_position); ! roadmap_point_position (to_tmp, &to_position); - if (roadmap_math_distance (position, &from_position) < - roadmap_math_distance (position, &to_position)) { - *from_point = from_tmp; - } else { *from_point = to_tmp; } ! break; ! case ROUTE_DIRECTION_WITH_LINE: ! roadmap_line_points (*from_line, &from_tmp, from_point); ! break; ! case ROUTE_DIRECTION_AGAINST_LINE: ! roadmap_line_points (*from_line, from_point, &from_tmp); ! break; ! default: ! roadmap_line_points (*from_line, &from_tmp, to_point); } --- 92,173 ---- int from_tmp; int to_tmp; + int direction = ROUTE_DIRECTION_NONE; ! *from_point = -1; ! if (use_gps_location) { ! RoadMapPosition pos; ! if (roadmap_navigate_get_current (&pos, &line, &direction) != -1) { ! roadmap_line_points (line.line_id, &from_tmp, &to_tmp); ! ! if (direction == ROUTE_DIRECTION_WITH_LINE) { *from_point = to_tmp; + } else { + + *from_point = from_tmp; } ! ! } else { ! position = roadmap_trip_get_position ("GPS"); ! } ! ! } else { ! ! position = roadmap_trip_get_position ("Departure"); ! } ! ! if (*from_point == -1) { ! ! if (!position) return -1; ! ! if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance) == -1) || ! (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { ! ! roadmap_messagebox ! ("Error", "Can't find a road near departure point."); ! ! return -1; ! } ! ! } ! ! *from_line = line; ! ! if (direction == ROUTE_DIRECTION_NONE) { ! ! switch (roadmap_plugin_get_direction (from_line, ROUTE_CAR_ALLOWED)) { ! case ROUTE_DIRECTION_ANY: ! case ROUTE_DIRECTION_NONE: ! roadmap_line_points (from_line->line_id, &from_tmp, &to_tmp); ! roadmap_point_position (from_tmp, &from_position); ! roadmap_point_position (to_tmp, &to_position); ! ! if (roadmap_math_distance (position, &from_position) < ! roadmap_math_distance (position, &to_position)) { ! *from_point = from_tmp; ! } else { ! *from_point = to_tmp; ! } ! break; ! case ROUTE_DIRECTION_WITH_LINE: ! roadmap_line_points (from_line->line_id, &from_tmp, from_point); ! break; ! case ROUTE_DIRECTION_AGAINST_LINE: ! roadmap_line_points (from_line->line_id, from_point, &from_tmp); ! break; ! default: ! roadmap_line_points (from_line->line_id, &from_tmp, to_point); ! } ! } ! ! ! if (to_line->plugin_id != INVALID_PLUGIN_ID) { ! /* we already calculated the destination point */ ! return 0; } *************** *** 111,116 **** if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance) == -1) || ! (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { roadmap_messagebox ("Error", "Can't find a road near destination point."); --- 176,181 ---- if ((roadmap_navigate_retrieve_line ! (position, 20, &line, &distance) == -1) || ! (roadmap_plugin_get_id (&line) != ROADMAP_PLUGIN_ID)) { roadmap_messagebox ("Error", "Can't find a road near destination point."); *************** *** 118,127 **** } ! *to_line = roadmap_plugin_get_line_id (&line); ! switch (roadmap_line_route_get_direction (*to_line, ROUTE_CAR_ALLOWED)) { case ROUTE_DIRECTION_ANY: case ROUTE_DIRECTION_NONE: ! roadmap_line_points (*to_line, &from_tmp, &to_tmp); roadmap_point_position (from_tmp, &from_position); roadmap_point_position (to_tmp, &to_position); --- 183,192 ---- } ! *to_line = line; ! switch (roadmap_plugin_get_direction (to_line, ROUTE_CAR_ALLOWED)) { case ROUTE_DIRECTION_ANY: case ROUTE_DIRECTION_NONE: ! roadmap_line_points (to_line->line_id, &from_tmp, &to_tmp); roadmap_point_position (from_tmp, &from_position); roadmap_point_position (to_tmp, &to_position); *************** *** 135,145 **** break; case ROUTE_DIRECTION_WITH_LINE: ! roadmap_line_points (*to_line, &to_tmp, to_point); break; case ROUTE_DIRECTION_AGAINST_LINE: ! roadmap_line_points (*to_line, to_point, &to_tmp); break; default: ! roadmap_line_points (*to_line, &to_tmp, to_point); } --- 200,210 ---- break; case ROUTE_DIRECTION_WITH_LINE: ! roadmap_line_points (to_line->line_id, &to_tmp, to_point); break; case ROUTE_DIRECTION_AGAINST_LINE: ! roadmap_line_points (to_line->line_id, to_point, &to_tmp); break; default: ! roadmap_line_points (to_line->line_id, &to_tmp, to_point); } *************** *** 148,151 **** --- 213,470 ---- + static int navigate_main_calc_azymuth (NavigateSegment *seg, int type) { + + RoadMapPosition start; + RoadMapPosition end; + RoadMapPosition *shape_pos; + int shape; + + start = seg->from_pos; + end = seg->to_pos; + + if (seg->first_shape > -1) { + + int last_shape; + + if (type == LINE_START) { + + last_shape = seg->first_shape; + shape_pos = &end; + *shape_pos = seg->from_pos; + } else { + + last_shape = seg->last_shape; + shape_pos = &start; + } + + for (shape = seg->first_shape; shape <= last_shape; shape++) { + + seg->shape_itr (shape, shape_pos); + } + } + + return roadmap_math_azymuth (&start, &end); + } + + + static void navigate_main_set_road_instr (NavigateSegment *seg1, + NavigateSegment *seg2) { + + int seg1_azymuth; + int seg2_azymuth; + int delta; + + if (seg1->line_direction == ROUTE_DIRECTION_WITH_LINE) { + + seg1_azymuth = navigate_main_calc_azymuth (seg1, LINE_END); + } else { + seg1_azymuth = 180 + navigate_main_calc_azymuth (seg1, LINE_START); + } + + + if (seg2->line_direction == ROUTE_DIRECTION_WITH_LINE) { + + seg2_azymuth = navigate_main_calc_azymuth (seg2, LINE_START); + } else { + seg2_azymuth = 180 + navigate_main_calc_azymuth (seg2, LINE_END); + } + + delta = seg1_azymuth - seg2_azymuth; + + while (delta > 180) delta -= 360; + while (delta < -180) delta += 360; + + if (delta < -30) { + + if (delta > -45) { + seg1->instruction = KEEP_RIGHT; + } else { + seg1->instruction = TURN_RIGHT; + } + + } else if (delta > 30) { + + if (delta < 45) { + seg1->instruction = KEEP_LEFT; + } else { + seg1->instruction = TURN_LEFT; + } + + } else { + + seg1->instruction = CONTINUE; + } + } + + + static int navigate_main_prepare_segments (NavigateSegment *segments, + int count) { + + int i; + + for (i=0; i < count; i++) { + + roadmap_plugin_get_line_points (&segments[i].line, + &segments[i].from_pos, + &segments[i].to_pos, + &segments[i].first_shape, + &segments[i].last_shape, + &segments[i].shape_itr); + + roadmap_plugin_get_street (&segments[i].line, &segments[i].street); + } + + for (i=0; i < count - 1; i++) { + + navigate_main_set_road_instr (&segments[i], &segments[i+1]); + } + + segments[i].instruction = APPROCHING_DESTINATION; + + return 0; + } + + + static int navigate_main_recalc_route () { + + int track_time; + PluginLine from_line; + int from_point; + + NavigateNumSegments = MAX_NAV_SEGEMENTS; + + if (navigate_load_data () < 0) { + return -1; + } + + if (navigate_find_track_points + (&from_line, &from_point, + &NavigateDestination, &NavigateDestPoint, 1) < 0) { + + return -1; + } + + track_time = + navigate_get_route_segments + (&from_line, from_point, &NavigateDestination, NavigateDestPoint, + NavigateSegments, &NavigateNumSegments); + + if (track_time <= 0) { + return -1; + } + + navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments); + NavigateTrackEnabled = 1; + NavigateCurrentSegment = 0; + roadmap_navigate_route (NavigateCallbacks); + + return 0; + } + + + void navigate_update (RoadMapPosition *position, PluginLine *current) { + + int distance_to_destination; + int distance_to_destination_far; + const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; + const char *inst_text = ""; + + if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { + + distance_to_destination = + roadmap_math_distance (position, &segment->to_pos); + } else { + + distance_to_destination = + roadmap_math_distance (position, &segment->from_pos); + } + + switch (segment->instruction) { + + case TURN_LEFT: + inst_text = "Turn left"; + break; + case KEEP_LEFT: + inst_text = "Keep left"; + break; + case TURN_RIGHT: + inst_text = "Turn right"; + break; + case KEEP_RIGHT: + inst_text = "Keep right"; + break; + case CONTINUE: + inst_text = "Continue straight"; + break; + case APPROCHING_DESTINATION: + inst_text = "Approaching destination"; + break; + } + + distance_to_destination_far = + roadmap_math_to_trip_distance(distance_to_destination); + + if (distance_to_destination_far > 0) { + + roadmap_display_text ("Driving Instruction", "%s, %d %s", + inst_text, + distance_to_destination_far, + roadmap_math_trip_unit()); + } else { + + roadmap_display_text ("Driving Instruction", "%s, %d %s", + inst_text, + distance_to_destination, + roadmap_math_distance_unit()); + }; + + } + + + void navigate_get_next_line + (PluginLine *current, int direction, PluginLine *next) { + + if (!NavigateTrackEnabled) { + + if (navigate_main_recalc_route () != -1) { + + roadmap_trip_stop (); + } + + return; + } + + if (!roadmap_plugin_same_line + (current, &NavigateSegments[NavigateCurrentSegment].line)) { + NavigateCurrentSegment++; + } + + if ((NavigateCurrentSegment < NavigateNumSegments) && + !roadmap_plugin_same_line + (current, &NavigateSegments[NavigateCurrentSegment].line)) { + + NavigateTrackEnabled = 0; + //roadmap_navigate_end_route (NavigateCallbacks); + + if (navigate_main_recalc_route () == -1) { + + roadmap_trip_start (); + } + //roadmap_messagebox("Error", "Lost route."); + + return; + } + + if ((NavigateCurrentSegment+1) >= NavigateNumSegments) { + + next->plugin_id = INVALID_PLUGIN_ID; + } else { + *next = NavigateSegments[NavigateCurrentSegment].line; + } + + return; + } + + int navigate_is_enabled (void) { return NavigateEnabled; *************** *** 157,161 **** NavigatePen = roadmap_canvas_create_pen ("NavigatePen1"); roadmap_canvas_set_foreground ("blue"); ! roadmap_canvas_set_thickness (3); navigate_main_set (1); --- 476,481 ---- NavigatePen = roadmap_canvas_create_pen ("NavigatePen1"); roadmap_canvas_set_foreground ("blue"); ! roadmap_canvas_set_opacity (160); ! roadmap_canvas_set_thickness (ROUTE_PEN_WIDTH); navigate_main_set (1); *************** *** 180,193 **** int track_time; ! int from_line; ! int to_line; int from_point; ! int to_point; ! NavigateNumSegments = MAX_NAV_SEGEMENTS - 2; if (navigate_load_data () < 0) return; if (navigate_find_track_points ! (&from_line, &from_point, &to_line, &to_point) < 0) { return; --- 500,516 ---- int track_time; ! PluginLine from_line; int from_point; ! int use_gps_location = (strcmp (roadmap_trip_get_focus_name (), "GPS") == 0); ! ! NavigateDestination.plugin_id = INVALID_PLUGIN_ID; ! ! NavigateNumSegments = MAX_NAV_SEGEMENTS; if (navigate_load_data () < 0) return; if (navigate_find_track_points ! (&from_line, &from_point, &NavigateDestination, &NavigateDestPoint, ! use_gps_location) < 0) { return; *************** *** 196,200 **** track_time = navigate_get_route_segments ! (from_point, to_point, NavigateSegments, &NavigateNumSegments); if (track_time <= 0) { --- 519,524 ---- track_time = navigate_get_route_segments ! (&from_line, from_point, &NavigateDestination, NavigateDestPoint, ! NavigateSegments, &NavigateNumSegments); if (track_time <= 0) { *************** *** 210,231 **** int length = 0; ! if (NavigateSegments[0] != from_line) { ! memmove (&NavigateSegments[1], &NavigateSegments[0], ! NavigateNumSegments * sizeof(NavigateSegments[0])); ! NavigateNumSegments++; ! NavigateSegments[0] = from_line; ! } ! ! if (NavigateSegments[NavigateNumSegments-1] != to_line) { ! NavigateSegments[NavigateNumSegments++] = to_line; ! } for (i=0; i<NavigateNumSegments; i++) { ! length += roadmap_line_length (NavigateSegments[i]); } ! snprintf(msg, sizeof(msg), "Length: %.1f km\nTime: %.1f minutes", length/1000.0, track_time/60.0); NavigateTrackEnabled = 1; ! roadmap_screen_redraw (); roadmap_messagebox ("Route found", msg); } --- 534,554 ---- int length = 0; ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments); for (i=0; i<NavigateNumSegments; i++) { ! if (NavigateSegments[i].line.plugin_id == ROADMAP_PLUGIN_ID) { ! length += roadmap_line_length (NavigateSegments[i].line.line_id); ! } } ! snprintf(msg, sizeof(msg), "Length: %.1f km\nTime: %.1f minutes", ! length/1000.0, track_time/60.0); NavigateTrackEnabled = 1; ! NavigateCurrentSegment = 0; ! ! roadmap_trip_stop (); ! roadmap_navigate_route (NavigateCallbacks); ! ! roadmap_screen_redraw (); roadmap_messagebox ("Route found", msg); } *************** *** 233,236 **** --- 556,603 ---- + void navigate_main_screen_repaint (int max_pen) { + int i; + int current_width = -1; + int last_cfcc = -1; + + if (!NavigateTrackEnabled) return; + + for (i=0; i<NavigateNumSegments; i++) { + + NavigateSegment *segment = NavigateSegments + i; + + if (segment->line.cfcc != last_cfcc) { + RoadMapPen pen = roadmap_layer_get_pen (segment->line.cfcc, 0); + int width = roadmap_canvas_get_thickness (pen); + + if (width < ROUTE_PEN_WIDTH) { + width = ROUTE_PEN_WIDTH; + } + + if (width != current_width) { + roadmap_canvas_select_pen (NavigatePen); + roadmap_canvas_set_thickness (width); + current_width = width; + } + + last_cfcc = segment->line.cfcc; + } + + roadmap_screen_draw_one_line (&segment->from_pos, + &segment->to_pos, + 0, + &segment->from_pos, + segment->first_shape, + segment->last_shape, + segment->shape_itr, + NavigatePen, + NULL, + NULL, + NULL); + + } + } + + int navigate_main_override_pen (int line, int cfcc, *************** *** 239,242 **** --- 606,612 ---- RoadMapPen *override_pen) { + return 0; + + #if 0 int j; *************** *** 251,254 **** --- 621,625 ---- *override_pen = NULL; return 0; + #endif } |
From: Ehud S. <esh...@us...> - 2006-05-15 20:05:31
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6532 Modified Files: roadmap_dialog.c Log Message: Add password entry widget. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_dialog.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_dialog.c 12 May 2006 14:22:40 -0000 1.6 --- roadmap_dialog.c 15 May 2006 19:51:38 -0000 1.7 *************** *** 46,50 **** #define ROADMAP_WIDGET_BUTTON 3 #define ROADMAP_WIDGET_LIST 4 ! #define ROADMAP_WIDGET_LABEL 5 const unsigned int MAX_ROW_HEIGHT = 20; --- 46,51 ---- #define ROADMAP_WIDGET_BUTTON 3 #define ROADMAP_WIDGET_LIST 4 ! #define ROADMAP_WIDGET_LABEL 5 ! #define ROADMAP_WIDGET_PASSWORD 6 const unsigned int MAX_ROW_HEIGHT = 20; *************** *** 288,297 **** void roadmap_dialog_new_entry (const char *frame, const char *name, ! RoadMapDialogCallback callback) { RoadMapDialogItem child = roadmap_dialog_new_item (frame, name); ! ! child->callback = callback; ! child->widget_type = ROADMAP_WIDGET_ENTRY; } --- 289,306 ---- void roadmap_dialog_new_entry (const char *frame, const char *name, ! RoadMapDialogCallback callback) ! { ! RoadMapDialogItem child = roadmap_dialog_new_item (frame, name); ! ! child->callback = callback; ! child->widget_type = ROADMAP_WIDGET_ENTRY; ! } ! ! ! void roadmap_dialog_new_password (const char *frame, const char *name) { RoadMapDialogItem child = roadmap_dialog_new_item (frame, name); ! ! child->widget_type = ROADMAP_WIDGET_PASSWORD; } *************** *** 540,544 **** this_item = roadmap_dialog_get (this_frame, name); ! switch (this_item->widget_type) { case ROADMAP_WIDGET_ENTRY: { --- 549,555 ---- this_item = roadmap_dialog_get (this_frame, name); ! switch (this_item->widget_type) { ! ! case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: { *************** *** 567,571 **** this_item = roadmap_dialog_get (this_frame, name); ! switch (this_item->widget_type) { case ROADMAP_WIDGET_ENTRY: case ROADMAP_WIDGET_LABEL: --- 578,584 ---- this_item = roadmap_dialog_get (this_frame, name); ! switch (this_item->widget_type) { ! ! case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: case ROADMAP_WIDGET_LABEL: *************** *** 652,656 **** } ! switch (item->widget_type) { case ROADMAP_WIDGET_ENTRY: name_unicode = ConvertToWideChar(title, CP_UTF8); --- 665,671 ---- } ! switch (item->widget_type) { ! ! case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: name_unicode = ConvertToWideChar(title, CP_UTF8); *************** *** 669,673 **** NULL); // Specify NULL for this parameter when you ! dwStyle |= WS_BORDER|ES_AUTOHSCROLL; item->w = CreateWindowEx ( 0, --- 684,693 ---- NULL); // Specify NULL for this parameter when you ! dwStyle |= WS_BORDER|ES_AUTOHSCROLL; ! ! if (item->widget_type == ROADMAP_WIDGET_PASSWORD) { ! dwStyle |= ES_PASSWORD; ! } ! item->w = CreateWindowEx ( 0, |
From: Ehud S. <esh...@us...> - 2006-05-15 20:05:30
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7578 Modified Files: buildmap_dglib.c buildmap_dglib.h buildmap_postgres.c Log Message: Add initial door to door navigation. Index: buildmap_dglib.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_dglib.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_dglib.h 22 Mar 2006 08:41:54 -0000 1.1 --- buildmap_dglib.h 15 May 2006 19:54:37 -0000 1.2 *************** *** 33,36 **** --- 33,37 ---- unsigned short from_cross_time, unsigned short to_cross_time, + unsigned char layer, int line); Index: buildmap_postgres.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_postgres.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** buildmap_postgres.c 12 May 2006 13:04:35 -0000 1.7 --- buildmap_postgres.c 15 May 2006 19:54:37 -0000 1.8 *************** *** 69,73 **** static const char *roads_sql = "SELECT segments.id AS id, AsText(simplify(segments.the_geom, 0.00002)) AS the_geom, segments.road_type AS layer, segments.from_node AS from_node_id, segments.to_node AS to_node_id, streets.name AS street_name, streets.text2speech as text2speech, cities.name as city_name FROM segments LEFT JOIN streets ON segments.street_id = streets.id LEFT JOIN cities ON streets.city_id = cities.id;"; ! static const char *roads_route_sql = "SELECT segments.id AS id, segments.from_car_allowed AS from_car_allowed, segments.to_car_allowed AS to_car_allowed, segments.from_max_speed AS from_max_speed, segments.to_max_speed AS to_max_speed, segments.from_cross_time AS from_cross_time, segments.to_cross_time AS to_cross_time FROM segments;"; static const char *country_borders_sql = "SELECT id AS id, AsText(simplify(the_geom, 0.00002)) AS the_geom FROM borders;"; static const char *water_sql = "SELECT id AS id, AsText(simplify(the_geom, 0.00002)) AS the_geom FROM water;"; --- 69,73 ---- static const char *roads_sql = "SELECT segments.id AS id, AsText(simplify(segments.the_geom, 0.00002)) AS the_geom, segments.road_type AS layer, segments.from_node AS from_node_id, segments.to_node AS to_node_id, streets.name AS street_name, streets.text2speech as text2speech, cities.name as city_name FROM segments LEFT JOIN streets ON segments.street_id = streets.id LEFT JOIN cities ON streets.city_id = cities.id;"; ! static const char *roads_route_sql = "SELECT segments.id AS id, segments.from_car_allowed AS from_car_allowed, segments.to_car_allowed AS to_car_allowed, segments.from_max_speed AS from_max_speed, segments.to_max_speed AS to_max_speed, segments.from_cross_time AS from_cross_time, segments.to_cross_time AS to_cross_time, segments.road_type AS layer FROM segments;"; static const char *country_borders_sql = "SELECT id AS id, AsText(simplify(the_geom, 0.00002)) AS the_geom FROM borders;"; static const char *water_sql = "SELECT id AS id, AsText(simplify(the_geom, 0.00002)) AS the_geom FROM water;"; *************** *** 344,347 **** --- 344,348 ---- unsigned short from_cross_time; unsigned short to_cross_time; + unsigned char layer; PGresult *db_result; *************** *** 378,381 **** --- 379,383 ---- from_cross_time = atoi(PQgetvalue(db_result, irec, column++)); to_cross_time = atoi(PQgetvalue(db_result, irec, column++)); + layer = (unsigned char) pg2layer (atoi(PQgetvalue(db_result, irec, column++))); line = buildmap_line_find_sorted(tlid); *************** *** 388,392 **** buildmap_dglib_add (from_car_allowed, to_car_allowed, from_max_speed, to_max_speed, ! from_cross_time, to_cross_time, line); } --- 390,394 ---- buildmap_dglib_add (from_car_allowed, to_car_allowed, from_max_speed, to_max_speed, ! from_cross_time, to_cross_time, layer, line); } Index: buildmap_dglib.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_dglib.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_dglib.c 22 Mar 2006 08:41:54 -0000 1.1 --- buildmap_dglib.c 15 May 2006 19:54:37 -0000 1.2 *************** *** 75,79 **** 2 , 0 , /* node attributes size */ ! 0 , /* edge attributes size */ opaqueset /* opaque graph parameters */ ); --- 75,79 ---- 2 , 0 , /* node attributes size */ ! 1 , /* edge attributes size */ opaqueset /* opaque graph parameters */ ); *************** *** 90,93 **** --- 90,94 ---- unsigned short from_cross_time, unsigned short to_cross_time, + unsigned char layer, int line) { *************** *** 102,106 **** status = dglAddEdgeX( &graph , from , to , from_cross_time , ! line , NULL , NULL , NULL , 0 ); if ( status < 0 ) { buildmap_fatal (0, "dglAddEdge error: %s\n", dglStrerror( &graph ) ); --- 103,107 ---- status = dglAddEdgeX( &graph , from , to , from_cross_time , ! line , NULL , NULL , &layer, 0 ); if ( status < 0 ) { buildmap_fatal (0, "dglAddEdge error: %s\n", dglStrerror( &graph ) ); *************** *** 112,116 **** status = dglAddEdgeX( &graph , to , from , to_cross_time , ! -line , NULL , NULL , NULL , 0 ); if ( status < 0 ) { buildmap_fatal (0, "dglAddEdge error: %s\n", dglStrerror( &graph ) ); --- 113,117 ---- status = dglAddEdgeX( &graph , to , from , to_cross_time , ! -line , NULL , NULL , &layer, 0 ); if ( status < 0 ) { buildmap_fatal (0, "dglAddEdge error: %s\n", dglStrerror( &graph ) ); |
From: Ehud S. <esh...@us...> - 2006-05-15 19:53:45
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7230 Modified Files: editor_track_util.c Log Message: Add initial door to door navigation. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** editor_track_util.c 17 Mar 2006 09:56:00 -0000 1.7 --- editor_track_util.c 15 May 2006 19:53:38 -0000 1.8 *************** *** 550,554 **** if (roadmap_fuzzy_is_certain ( roadmap_fuzzy_connected ! (&neighbourhood[i], previous_line, &connection))) { if (roadmap_math_distance --- 550,556 ---- if (roadmap_fuzzy_is_certain ( roadmap_fuzzy_connected ! (&neighbourhood[i], previous_line, ! candidate.line_direction, ! &connection))) { if (roadmap_math_distance |
From: Ehud S. <esh...@us...> - 2006-05-15 19:52:58
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6904 Modified Files: editor_upload.c Log Message: Fix receive error. Index: editor_upload.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_upload.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_upload.c 12 May 2006 14:21:55 -0000 1.1 --- editor_upload.c 15 May 2006 19:52:48 -0000 1.2 *************** *** 163,167 **** if (roadmap_net_send (socket, buffer, length) != length) { error ("send error on: %s", buffer); ! return 0; } return length; --- 163,167 ---- if (roadmap_net_send (socket, buffer, length) != length) { error ("send error on: %s", buffer); ! return -1; } return length; *************** *** 204,208 **** ! static int editor_http_send_header (const char *target, const char *full_name, size_t size, --- 204,208 ---- ! static RoadMapSocket editor_http_send_header (const char *target, const char *full_name, size_t size, *************** *** 223,227 **** if (host == NULL) { error ("no more memory"); ! return 0; } --- 223,227 ---- if (host == NULL) { error ("no more memory"); ! return ROADMAP_INVALID_SOCKET; } *************** *** 233,237 **** error ("bad URL syntax in: %s", host); free (host); ! return 0; } *path = 0; /* Isolate the host string. */ --- 233,237 ---- error ("bad URL syntax in: %s", host); free (host); ! return ROADMAP_INVALID_SOCKET; } *path = 0; /* Isolate the host string. */ *************** *** 241,245 **** error ("bad URL syntax in: %s", target); free (host); ! return 0; } --- 241,245 ---- error ("bad URL syntax in: %s", target); free (host); ! return ROADMAP_INVALID_SOCKET; } *************** *** 248,252 **** */ fd = roadmap_net_connect ("tcp", host, 80); ! if (fd >= 0) { const char *filename = roadmap_path_skip_directories (full_name); char *p = strchr(host, ':'); --- 248,252 ---- */ fd = roadmap_net_connect ("tcp", host, 80); ! if (ROADMAP_NET_IS_VALID(fd)) { const char *filename = roadmap_path_skip_directories (full_name); char *p = strchr(host, ':'); *************** *** 254,274 **** if (p != NULL) *p = 0; /* remove the port/service info. */ ! editor_http_send (fd, error, "POST %s HTTP/1.0\r\n", path); ! editor_http_send (fd, error, "Host: %s\r\n", host); send_auth (user, pw, fd, error); ! editor_http_send (fd, error, "Content-Type: multipart/form-data; boundary=---------------------------10424402741337131014341297293\r\n"); ! editor_http_send (fd, error, "Content-Length: %d\r\n", size + 261 + strlen(filename)); ! editor_http_send (fd, error, "\r\n"); ! editor_http_send (fd, error, "-----------------------------10424402741337131014341297293\r\n"); ! editor_http_send (fd, error, "Content-disposition: form-data; name=\"file_0\"; filename=\"%s\"\r\n", filename); ! editor_http_send (fd, error, "Content-type: application/octet-stream\r\n"); ! editor_http_send (fd, error, "Content-Transfer-Encoding: binary\r\n\r\n"); } free (host); - return fd; } --- 254,309 ---- if (p != NULL) *p = 0; /* remove the port/service info. */ ! if (editor_http_send (fd, error, "POST %s HTTP/1.0\r\n", path) == -1) ! goto send_error; ! ! if (editor_http_send (fd, error, "Host: %s\r\n", host) == -1) ! goto send_error; send_auth (user, pw, fd, error); ! if (editor_http_send (fd, error, ! "Content-Type: multipart/form-data; boundary=---------------------------10424402741337131014341297293\r\n") == -1) { ! goto send_error; ! } ! ! if (editor_http_send (fd, error, "Content-Length: %d\r\n", ! size + 261 + strlen(filename)) == -1) { ! goto send_error; ! } ! ! if (editor_http_send (fd, error, "\r\n") == -1) goto send_error; ! ! if (editor_http_send (fd, error, ! "-----------------------------10424402741337131014341297293\r\n") == -1) { ! goto send_error; ! } ! ! if (editor_http_send (fd, error, ! "Content-disposition: form-data; name=\"file_0\"; filename=\"%s\"\r\n", ! filename) == -1) { ! goto send_error; ! } ! ! if (editor_http_send (fd, error, ! "Content-type: application/octet-stream\r\n") == -1) { ! goto send_error; ! } ! ! if (editor_http_send (fd, error, ! "Content-Transfer-Encoding: binary\r\n\r\n") == -1) { ! goto send_error; ! } ! ! } else { ! error ("Can't connect to server: %s", host); } free (host); return fd; + + send_error: + free (host); + roadmap_net_close (fd); + return ROADMAP_INVALID_SOCKET; } *************** *** 394,398 **** RoadMapFile file = roadmap_file_open (file_name, "r"); ! if (!ROADMAP_FILE_IS_VALID(file)) { editor_upload_error ("Can't open file: %s\n", file_name); return 0; --- 429,433 ---- RoadMapFile file = roadmap_file_open (file_name, "r"); ! if (!ROADMAP_NET_IS_VALID(file)) { editor_upload_error ("Can't open file: %s\n", file_name); return 0; *************** *** 405,409 **** fd = editor_http_send_header (target, file_name, size, user_name, password, editor_upload_error); ! if (fd < 0) { return 0; } --- 440,444 ---- fd = editor_http_send_header (target, file_name, size, user_name, password, editor_upload_error); ! if (!ROADMAP_NET_IS_VALID(fd)) { return 0; } *************** *** 431,434 **** --- 466,471 ---- editor_http_send (fd, editor_upload_error, "\r\n-----------------------------10424402741337131014341297293--\r\n"); fflush (dbg_file); + + loaded = sizeof(buffer); if (!editor_http_decode_response (fd, buffer, &loaded, editor_upload_error)) { *************** *** 483,490 **** void editor_upload_file (const char *filename) { ! ! static char s_file[500]; ! strncpy (s_file, filename, sizeof(s_file)); ! s_file[sizeof(s_file)-1] = 0; if (roadmap_dialog_activate ("Upload gpx file", NULL)) { --- 520,527 ---- void editor_upload_file (const char *filename) { ! ! static char s_file[500]; ! strncpy (s_file, filename, sizeof(s_file)); ! s_file[sizeof(s_file)-1] = 0; if (roadmap_dialog_activate ("Upload gpx file", NULL)) { *************** *** 493,497 **** roadmap_dialog_new_entry (".file", "To", NULL); roadmap_dialog_new_entry (".file", "User Name", NULL); ! roadmap_dialog_new_entry (".file", "Password", NULL); roadmap_dialog_add_button ("OK", editor_upload_ok); --- 530,534 ---- roadmap_dialog_new_entry (".file", "To", NULL); roadmap_dialog_new_entry (".file", "User Name", NULL); ! roadmap_dialog_new_password (".file", "Password"); roadmap_dialog_add_button ("OK", editor_upload_ok); *************** *** 537,541 **** roadmap_config_declare ("preferences", &RoadMapConfigUser, ""); ! roadmap_config_declare ("preferences", &RoadMapConfigPassword, ""); } --- 574,578 ---- roadmap_config_declare ("preferences", &RoadMapConfigUser, ""); ! roadmap_config_declare_password ("preferences", &RoadMapConfigPassword, ""); } |
From: Ehud S. <esh...@us...> - 2006-05-15 19:51:58
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6563 Modified Files: roadmap_canvas_agg.cpp Log Message: Add opacity to pens. Index: roadmap_canvas_agg.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_canvas_agg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_canvas_agg.cpp 8 May 2006 16:37:55 -0000 1.3 --- roadmap_canvas_agg.cpp 15 May 2006 19:51:55 -0000 1.4 *************** *** 86,92 **** if (*color == '#') { ! int r, g, b; ! sscanf(color, "#%2x%2x%2x", &r, &g, &b); ! return agg::rgba8(r, g, b); } else { /* Do binary search on color table */ --- 86,100 ---- if (*color == '#') { ! int r, g, b, a; ! int count; ! ! count = sscanf(color, "#%2x%2x%2x%2x", &r, &g, &b, &a); ! ! if (count == 4) { ! return agg::rgba8(r, g, b, a); ! } else { ! return agg::rgba8(r, g, b); ! } ! } else { /* Do binary search on color table */ |
From: Ehud S. <esh...@us...> - 2006-05-15 19:51:24
|
Update of /cvsroot/roadmap/roadmap_editor/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6515 Modified Files: roadmap_dialog.c Log Message: Add password entry widget. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/gtk2/roadmap_dialog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_dialog.c 12 May 2006 14:18:07 -0000 1.2 --- roadmap_dialog.c 15 May 2006 19:51:20 -0000 1.3 *************** *** 50,53 **** --- 50,54 ---- #define ROADMAP_WIDGET_LIST 4 #define ROADMAP_WIDGET_LABEL 5 + #define ROADMAP_WIDGET_PASSWORD 6 enum { *************** *** 401,404 **** --- 402,414 ---- + void roadmap_dialog_new_password (const char *frame, const char *name) { + + GtkWidget *w = gtk_entry_new (); + gtk_entry_set_visibility(GTK_ENTRY(w), FALSE); + RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, w, 0); + child->widget_type = ROADMAP_WIDGET_PASSWORD; + } + + void roadmap_dialog_new_label (const char *frame, const char *name) { *************** *** 747,750 **** --- 757,761 ---- switch (this_item->widget_type) { + case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: *************** *** 769,772 **** --- 780,784 ---- switch (this_item->widget_type) { + case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: |
From: Ehud S. <esh...@us...> - 2006-05-15 19:51:07
|
Update of /cvsroot/roadmap/roadmap_editor/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6394 Modified Files: roadmap_canvas_agg.cpp Log Message: Add opacity to pens. Index: roadmap_canvas_agg.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/gtk2/roadmap_canvas_agg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_canvas_agg.cpp 12 May 2006 14:18:07 -0000 1.4 --- roadmap_canvas_agg.cpp 15 May 2006 19:51:04 -0000 1.5 *************** *** 87,90 **** --- 87,104 ---- GdkColor native_color; + if (*color == '#') { + int r, g, b, a; + int count; + + count = sscanf(color, "#%2x%2x%2x%2x", &r, &g, &b, &a); + + if (count == 4) { + return agg::rgba8(r, g, b, a); + } else { + return agg::rgba8(r, g, b); + } + + } + gdk_color_parse (color, &native_color); gdk_color_alloc (gdk_colormap_get_system(), &native_color); |
From: Ehud S. <esh...@us...> - 2006-05-15 19:50:46
|
Update of /cvsroot/roadmap/roadmap_editor/src/agg In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6165 Modified Files: roadmap_canvas.cpp Log Message: Add opacity to pens. Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/agg/roadmap_canvas.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_canvas.cpp 12 May 2006 13:29:29 -0000 1.1 --- roadmap_canvas.cpp 15 May 2006 19:50:40 -0000 1.2 *************** *** 212,215 **** --- 212,223 ---- + int roadmap_canvas_get_thickness (RoadMapPen pen) { + + if (pen == NULL) return 0; + + return pen->thickness; + } + + void roadmap_canvas_set_thickness (int thickness) { |