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-06-11 11:42:04
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18683 Modified Files: navigate_main.c Log Message: Fix next turn announcement. Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** navigate_main.c 11 Jun 2006 11:20:59 -0000 1.8 --- navigate_main.c 11 Jun 2006 11:41:58 -0000 1.9 *************** *** 394,397 **** --- 394,413 ---- roadmap_message_set ('C', properties.city); + if (NavigateDistanceToTurn <= 50) { + roadmap_message_unset ('w'); + } else { + + int distance_far = + roadmap_math_to_trip_distance(NavigateDistanceToTurn); + + if (distance_far > 0) { + roadmap_message_set ('w', "%d %s", + distance_far, roadmap_math_trip_unit()); + } else { + roadmap_message_set ('w', "%d %s", + NavigateDistanceToTurn, roadmap_math_distance_unit()); + }; + } + roadmap_voice_announce ("Driving Instruction"); } |
From: Ehud S. <esh...@us...> - 2006-06-11 11:41:44
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv18659 Modified Files: roadmap_voice.c Log Message: Fix next turn announcement. Index: roadmap_voice.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_voice.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_voice.c 22 May 2006 20:54:55 -0000 1.4 --- roadmap_voice.c 11 Jun 2006 11:41:40 -0000 1.5 *************** *** 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} }; --- 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 %w, %I'|flite -t '%I to %T'|flite -t '%I'"}, {ROADMAP_CONFIG_ITEM_EMPTY, NULL} }; |
From: Ehud S. <esh...@us...> - 2006-06-11 11:21:03
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17714 Modified Files: navigate_instr.c navigate_main.c Log Message: Fix GCC warnings. Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** navigate_main.c 11 Jun 2006 11:00:32 -0000 1.7 --- navigate_main.c 11 Jun 2006 11:20:59 -0000 1.8 *************** *** 97,101 **** int use_gps_location) { ! const RoadMapPosition *position; RoadMapPosition from_position; RoadMapPosition to_position; --- 97,101 ---- int use_gps_location) { ! const RoadMapPosition *position = NULL; RoadMapPosition from_position; RoadMapPosition to_position; Index: navigate_instr.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_instr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_instr.c 11 Jun 2006 11:00:32 -0000 1.2 --- navigate_instr.c 11 Jun 2006 11:20:59 -0000 1.3 *************** *** 95,99 **** int smallest_distance = 0x7fffffff; int distance; ! int seg_shape_end; RoadMapPosition seg_end_pos; RoadMapPosition seg_shape_initial; --- 95,99 ---- int smallest_distance = 0x7fffffff; int distance; ! int seg_shape_end = -1; RoadMapPosition seg_end_pos; RoadMapPosition seg_shape_initial; *************** *** 526,531 **** /* calculate cross time using the line length */ ! segment->cross_time = 1.0 * from_cross_time * segment->distance / ! (roadmap_line_length (segment->line.line_id)+1); } else { segment->distance = --- 526,531 ---- /* calculate cross time using the line length */ ! segment->cross_time = (int) (1.0 * from_cross_time * segment->distance / ! (roadmap_line_length (segment->line.line_id)+1)); } else { segment->distance = *************** *** 533,538 **** (&segment->to_pos, segment, LINE_START); ! segment->cross_time = 1.0 * to_cross_time * segment->distance / ! (roadmap_line_length (segment->line.line_id)+1); } --- 533,538 ---- (&segment->to_pos, segment, LINE_START); ! segment->cross_time = (int) (1.0 * to_cross_time * segment->distance / ! (roadmap_line_length (segment->line.line_id)+1)); } |
From: Ehud S. <esh...@us...> - 2006-06-11 11:20:50
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17698 Modified Files: editor_track_filter.c editor_track_unknown.c Log Message: Fix GCC warnings. Index: editor_track_filter.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_filter.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor_track_filter.c 25 Dec 2005 23:10:43 -0000 1.5 --- editor_track_filter.c 11 Jun 2006 11:20:46 -0000 1.6 *************** *** 162,167 **** while (roadmap_math_distance ! ( (RoadMapPosition*) &filter->last_gps_point, ! (RoadMapPosition*) &interpolated_point ) >= (filter->point_distance * 2)) { --- 162,167 ---- while (roadmap_math_distance ! ( (const RoadMapPosition*) &filter->last_gps_point, ! (const RoadMapPosition*) (void*)&interpolated_point ) >= (filter->point_distance * 2)) { Index: editor_track_unknown.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_unknown.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor_track_unknown.c 22 May 2006 20:56:29 -0000 1.5 --- editor_track_unknown.c 11 Jun 2006 11:20:46 -0000 1.6 *************** *** 58,62 **** int distance; int smallest_distance; ! int azymuth; RoadMapPosition intersection; --- 58,62 ---- int distance; int smallest_distance; ! int azymuth = 0; RoadMapPosition intersection; |
From: Ehud S. <esh...@us...> - 2006-06-11 11:20:36
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17675 Modified Files: editor_point.c editor_street.c Log Message: Fix GCC warnings. Index: editor_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_street.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor_street.c 17 Dec 2005 21:58:44 -0000 1.4 --- editor_street.c 11 Jun 2006 11:20:31 -0000 1.5 *************** *** 699,702 **** --- 699,703 ---- } else { assert (0); + str = 0; } *************** *** 727,730 **** --- 728,732 ---- } else { assert (0); + str = 0; } Index: editor_point.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_point.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_point.c 1 Dec 2005 12:16:07 -0000 1.2 --- editor_point.c 11 Jun 2006 11:20:31 -0000 1.3 *************** *** 119,123 **** int editor_point_roadmap_to_editor (int roadmap_id) { ! editor_db_del_point *del_point_ptr; editor_db_del_point del_point; int ed_point_id; --- 119,123 ---- int editor_point_roadmap_to_editor (int roadmap_id) { ! editor_db_del_point *del_point_ptr = NULL; editor_db_del_point del_point; int ed_point_id; |
From: Ehud S. <esh...@us...> - 2006-06-11 11:20:16
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17621 Modified Files: editor_main.c editor_screen.c Log Message: Fix GCC warnings. Index: editor_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** editor_main.c 22 May 2006 09:14:53 -0000 1.8 --- editor_main.c 11 Jun 2006 11:20:13 -0000 1.9 *************** *** 41,45 **** int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.7.0_pre1"; int editor_is_enabled (void) { --- 41,45 ---- int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.7.0_pre2"; int editor_is_enabled (void) { Index: editor_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_screen.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** editor_screen.c 10 Jun 2006 08:26:26 -0000 1.12 --- editor_screen.c 11 Jun 2006 11:20:13 -0000 1.13 *************** *** 364,368 **** EditorStreetProperties properties; ! int route; editor_street_get_properties (line, &properties); --- 364,368 ---- EditorStreetProperties properties; ! /* int route; */ editor_street_get_properties (line, &properties); |
From: Ehud S. <esh...@us...> - 2006-06-11 11:18:08
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16648 Modified Files: buildplace_main.c roadgps_screen.c roadmap_nmea.c roadmap_screen.c Log Message: Fix GCC warnings. Index: roadgps_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadgps_screen.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadgps_screen.c 5 Jun 2006 09:17:28 -0000 1.4 --- roadgps_screen.c 11 Jun 2006 11:18:05 -0000 1.5 *************** *** 432,451 **** } - static unsigned long dbg_time_rec[1]; - static unsigned long dbg_time_tmp[1]; - - #ifdef __WIN32 void dbg_time_start(int type) { - dbg_time_tmp[type] = GetTickCount(); } void dbg_time_end(int type) { - dbg_time_rec[type] += GetTickCount() - dbg_time_tmp[type]; } - #else - void dbg_time_start(int type) { - } - - void dbg_time_end(int type) { - } - #endif --- 432,438 ---- Index: roadmap_nmea.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_nmea.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_nmea.c 15 Oct 2005 22:18:50 -0000 1.1.1.1 --- roadmap_nmea.c 11 Jun 2006 11:18:05 -0000 1.2 *************** *** 134,138 **** if (strchr (value, '.') != NULL) { ! result = (int) trunc(atof(value) * unit); } else { result = atoi (value) * unit; --- 134,138 ---- if (strchr (value, '.') != NULL) { ! result = (int) (atof(value) * unit); } else { result = atoi (value) * unit; Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** roadmap_screen.c 11 Jun 2006 10:58:58 -0000 1.15 --- roadmap_screen.c 11 Jun 2006 11:18:05 -0000 1.16 *************** *** 799,803 **** int index = 0; int real_line; ! int real_square; int cfcc; int first_shape_line; --- 799,803 ---- int index = 0; int real_line; ! int real_square = -2; int cfcc; int first_shape_line; *************** *** 805,809 **** int first_shape; int last_shape; ! RoadMapPen layer_pen; int fips = roadmap_locator_active (); int total_length; --- 805,809 ---- int first_shape; int last_shape; ! RoadMapPen layer_pen = NULL; int fips = roadmap_locator_active (); int total_length; Index: buildplace_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildplace_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildplace_main.c 28 Nov 2005 19:36:34 -0000 1.2 --- buildplace_main.c 11 Jun 2006 11:18:05 -0000 1.3 *************** *** 61,65 **** static int BuildPlaceDSGCount = 0; ! static BuildMapDictionary DictionaryName; static int BuildPlaceFormatFamily = 0; --- 61,65 ---- static int BuildPlaceDSGCount = 0; ! /* static BuildMapDictionary DictionaryName; */ static int BuildPlaceFormatFamily = 0; *************** *** 110,113 **** --- 110,114 ---- + /* static RoadMapString str2dict (BuildMapDictionary d, const char *string) { *************** *** 119,123 **** return buildmap_dictionary_add (d, (char *) string, strlen(string)); } ! static void buildplace_select_format (poptContext decoder) { --- 120,124 ---- return buildmap_dictionary_add (d, (char *) string, strlen(string)); } ! */ static void buildplace_select_format (poptContext decoder) { *************** *** 208,211 **** --- 209,213 ---- + /* static int dsg2cfcc (const char *dsg) { ENTRY e, *ep; *************** *** 215,219 **** return ep ? BuildPlaceDSGcfcc[(int)ep->data] : 0; } ! static void buildplace_dsg_add (const char *dsg, int cfcc) { --- 217,221 ---- return ep ? BuildPlaceDSGcfcc[(int)ep->data] : 0; } ! */ static void buildplace_dsg_add (const char *dsg, int cfcc) { |
From: Ehud S. <esh...@us...> - 2006-06-11 11:01:47
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9721 Modified Files: objects Log Message: Update objects for navigation panel. Index: objects =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/objects,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** objects 5 Jun 2006 09:13:59 -0000 1.4 --- objects 11 Jun 2006 11:01:38 -0000 1.5 *************** *** 9,13 **** N zoom1_button I rm_zoom1.bmp ! P 215 100 O 160 A zoom1 --- 9,13 ---- N zoom1_button I rm_zoom1.bmp ! P -26 -135 O 160 A zoom1 *************** *** 17,21 **** N zoomin_button I rm_zoomin.bmp ! P 215 135 O 160 A zoomin --- 17,21 ---- N zoomin_button I rm_zoomin.bmp ! P -26 -100 O 160 A zoomin *************** *** 24,28 **** N zoomout_button I rm_zoomout.bmp ! P 215 170 O 160 A zoomout --- 24,28 ---- N zoomout_button I rm_zoomout.bmp ! P -26 -65 O 160 A zoomout *************** *** 31,35 **** N gps_button I rm_gps.bmp ! P 215 205 O 160 A gps --- 31,35 ---- N gps_button I rm_gps.bmp ! P -26 -30 O 160 A gps *************** *** 39,43 **** N quit_button I rm_quit.bmp ! P 220 1 A quit B -4 -4 20 20 --- 39,43 ---- N quit_button I rm_quit.bmp ! P -20 1 A quit B -4 -4 20 20 *************** *** 45,49 **** N full_screen I rm_full.bmp ! P 220 25 A full B -4 -4 20 20 --- 45,49 ---- N full_screen I rm_full.bmp ! P -20 25 A full B -4 -4 20 20 *************** *** 52,56 **** I rm_3d.bmp I rm_2d.bmp ! P 1 205 O 160 A toggleview --- 52,56 ---- I rm_3d.bmp I rm_2d.bmp ! P 1 -30 O 160 A toggleview |
From: Ehud S. <esh...@us...> - 2006-06-11 11:00:42
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9277 Modified Files: navigate_bar.c navigate_bar.h navigate_instr.c navigate_main.c navigate_main.h Log Message: Add display messages for distance and ETA. Index: navigate_bar.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_bar.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_bar.c 5 Jun 2006 18:51:04 -0000 1.1 --- navigate_bar.c 11 Jun 2006 11:00:32 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- #include "roadmap.h" #include "roadmap_canvas.h" + #include "roadmap_screen_obj.h" #include "roadmap_path.h" #include "roadmap_file.h" *************** *** 55,58 **** --- 56,61 ---- static NavigateBarPanel *NavigatePanel = NULL; + static RoadMapScreenSubscriber navigate_prev_after_refresh = NULL; + const char NAVIGATE_DIR_IMG[][40] = { *************** *** 73,76 **** --- 76,80 ---- static enum NavigateInstr NavigateBarCurrentInstr = LAST_DIRECTION; static int NavigateBarCurrentDistance = -1; + static int NavigateBarEnabled = 0; static RoadMapImage navigate_bar_load_image (const char *name) { *************** *** 108,111 **** --- 112,195 ---- + static int navigate_bar_align_text (char *text, char **line1, char **line2, + int size) { + + int width, ascent, descent; + + roadmap_canvas_get_text_extents + (text, size, &width, &ascent, &descent); + + if (width >= 2 * NavigatePanel->street_width) return -1; + + if (width < NavigatePanel->street_width) { + + *line1 = text; + return 1; + + } else { + + /* Check if we can place the text in two lines */ + + char *text_line = text; + char *text_end = text_line + strlen(text_line); + char *p1 = text_line + (strlen(text_line) / 2); + char *p2 = p1; + + while (p1 > text_line) { + if (*p1 == ' ') { + break; + } + p1 -= 1; + } + while (p2 < text_end) { + if (*p2 == ' ') { + break; + } + p2 += 1; + } + if (text_end - p1 > p2 - text_line) { + p1 = p2; + } + if (p1 > text_line) { + + char saved = *p1; + *p1 = 0; + + roadmap_canvas_get_text_extents + (text_line, size, &width, &ascent, &descent); + + if (width < NavigatePanel->street_width) { + + roadmap_canvas_get_text_extents + (text_line, size, &width, &ascent, &descent); + + if (width < NavigatePanel->street_width) { + + *line1 = text_line; + *line2 = p1 + 1; + return 2; + } + } + + *p1 = saved; + } + } + + return -1; + } + + + static void navigate_bar_after_refresh (void) { + + if (NavigateBarEnabled) { + navigate_bar_draw (); + } + + if (navigate_prev_after_refresh) { + (*navigate_prev_after_refresh) (); + } + } + + void navigate_bar_initialize (void) { *************** *** 148,151 **** --- 232,238 ---- NavigateBarInitialized = 1; + navigate_prev_after_refresh = + roadmap_screen_subscribe_after_refresh (navigate_bar_after_refresh); + return; *************** *** 214,285 **** - static int navigate_bar_align_text (char *text, char **line1, char **line2, - int size) { - - int width, ascent, descent; - - roadmap_canvas_get_text_extents - (text, size, &width, &ascent, &descent); - - if (width >= 2 * NavigatePanel->street_width) return -1; - - if (width < NavigatePanel->street_width) { - - *line1 = text; - return 1; - - } else { - - /* Check if we can place the text in two lines */ - - char *text_line = text; - char *text_end = text_line + strlen(text_line); - char *p1 = text_line + (strlen(text_line) / 2); - char *p2 = p1; - - while (p1 > text_line) { - if (*p1 == ' ') { - break; - } - p1 -= 1; - } - while (p2 < text_end) { - if (*p2 == ' ') { - break; - } - p2 += 1; - } - if (text_end - p1 > p2 - text_line) { - p1 = p2; - } - if (p1 > text_line) { - - char saved = *p1; - *p1 = 0; - - roadmap_canvas_get_text_extents - (text_line, size, &width, &ascent, &descent); - - if (width < NavigatePanel->street_width) { - - roadmap_canvas_get_text_extents - (text_line, size, &width, &ascent, &descent); - - if (width < NavigatePanel->street_width) { - - *line1 = text_line; - *line2 = p1 + 1; - return 2; - } - } - - *p1 = saved; - } - } - - return -1; - } - - void navigate_bar_set_street (const char *street) { --- 301,304 ---- *************** *** 353,356 **** --- 372,394 ---- + void navigate_bar_set_mode (int mode) { + int x_offset; + int y_offset; + + if (NavigateBarEnabled == mode) return; + + x_offset = 0; + y_offset = roadmap_canvas_image_height (NavigateBarBG); + + if (mode) { + roadmap_screen_obj_offset (x_offset, y_offset); + } else { + roadmap_screen_obj_offset (-x_offset, -y_offset); + } + + NavigateBarEnabled = mode; + } + + void navigate_bar_draw (void) { *************** *** 360,361 **** --- 398,400 ---- IMAGE_NORAML); } + Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** navigate_main.c 5 Jun 2006 18:51:04 -0000 1.6 --- navigate_main.c 11 Jun 2006 11:00:32 -0000 1.7 *************** *** 68,72 **** (PluginLine *current, int direction, PluginLine *next); ! static RoadMapScreenSubscriber roadmap_navigate_prev_after_refresh = NULL; RoadMapNavigateRouteCB NavigateCallbacks = { --- 68,77 ---- (PluginLine *current, int direction, PluginLine *next); ! static RoadMapCallback NextMessageUpdate; ! ! static int NavigateDistanceToDest; ! static int NavigateETA; ! static int NavigateDistanceToTurn; ! static int NavigateETAToTurn; RoadMapNavigateRouteCB NavigateCallbacks = { *************** *** 256,259 **** --- 261,265 ---- &NavigateSrcPos, &NavigateDestPos); NavigateTrackEnabled = 1; + navigate_bar_set_mode (NavigateTrackEnabled); NavigateCurrentSegment = 0; roadmap_navigate_route (NavigateCallbacks); *************** *** 263,275 **** ! static void roadmap_navigate_after_refresh (void) { ! if (NavigateTrackEnabled) { ! navigate_bar_draw (); ! } ! if (roadmap_navigate_prev_after_refresh) { ! (*roadmap_navigate_prev_after_refresh) (); ! } } --- 269,301 ---- ! static void navigate_main_format_messages (void) { ! int distance_to_destination; ! int distance_to_destination_far; ! int ETA; ! char str[100]; ! (*NextMessageUpdate) (); ! ! if (!NavigateTrackEnabled) return; ! ! distance_to_destination = NavigateDistanceToDest + NavigateDistanceToTurn; ! ETA = NavigateETA + NavigateETAToTurn + 60; ! ! distance_to_destination_far = ! roadmap_math_to_trip_distance(distance_to_destination); ! ! if (distance_to_destination_far > 0) { ! roadmap_message_set ('D', "%d %s", ! distance_to_destination_far, ! roadmap_math_trip_unit()); ! } else { ! roadmap_message_set ('D', "%d %s", ! distance_to_destination, ! roadmap_math_distance_unit()); ! }; ! ! sprintf (str, "%d:%02d", ETA / 3600, ETA / 60); ! roadmap_message_set ('T', str); } *************** *** 278,287 **** int annouce = 0; - int distance_to_destination; - int distance_to_destination_far; const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; int group_id = segment->group_id; const char *inst_text = ""; - char str[100]; if (!NavigateTrackEnabled) return; --- 304,310 ---- *************** *** 289,308 **** if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { ! distance_to_destination = navigate_instr_calc_length (position, segment, LINE_END); } else { ! distance_to_destination = navigate_instr_calc_length (position, segment, LINE_START); } while (segment < (NavigateSegments + NavigateNumSegments - 1)) { if ((segment+1)->group_id != group_id) break; segment++; ! distance_to_destination += segment->distance; } ! navigate_bar_set_distance (distance_to_destination); switch (segment->instruction) { --- 312,335 ---- if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { ! NavigateDistanceToTurn = navigate_instr_calc_length (position, segment, LINE_END); } else { ! NavigateDistanceToTurn = navigate_instr_calc_length (position, segment, LINE_START); } + NavigateETAToTurn = (int) (1.0 * segment->cross_time * NavigateDistanceToTurn / + (segment->distance + 1)); + while (segment < (NavigateSegments + NavigateNumSegments - 1)) { if ((segment+1)->group_id != group_id) break; segment++; ! NavigateDistanceToTurn += segment->distance; ! NavigateETAToTurn += segment->cross_time; } ! navigate_bar_set_distance (NavigateDistanceToTurn); switch (segment->instruction) { *************** *** 331,375 **** if ((segment->instruction == APPROACHING_DESTINATION) && ! distance_to_destination <= 10) { NavigateTrackEnabled = 0; roadmap_navigate_end_route (NavigateCallbacks); return; } - distance_to_destination_far = - 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 ()); - #if 0 - roadmap_display_text ("Driving Instruction", "In %d%s, %s", - distance_to_destination_far, - roadmap_math_trip_unit(), - inst_text); - #endif - } else { - - snprintf (str, sizeof(str), "%d", distance_to_destination); - roadmap_message_set ('D', str); - - roadmap_message_set ('U', roadmap_math_distance_unit ()); - - #if 0 - roadmap_display_text ("Driving Instruction", "In %d%s, %s", - distance_to_destination, - roadmap_math_distance_unit(), - inst_text); - #endif - }; - - //roadmap_display_show ("Driving Instruction"); - if (NavigateNextAnnounce == -1) { --- 358,371 ---- if ((segment->instruction == APPROACHING_DESTINATION) && ! NavigateDistanceToTurn <= 10) { NavigateTrackEnabled = 0; + navigate_bar_set_mode (NavigateTrackEnabled); roadmap_navigate_end_route (NavigateCallbacks); return; } roadmap_message_set ('I', inst_text); if (NavigateNextAnnounce == -1) { *************** *** 379,385 **** } ! if (distance_to_destination <= NavigateNextAnnounce) { NavigateNextAnnounce = 0; - roadmap_message_unset ('D'); annouce = 1; } --- 375,380 ---- } ! if (NavigateDistanceToTurn <= NavigateNextAnnounce) { NavigateNextAnnounce = 0; annouce = 1; } *************** *** 446,449 **** --- 441,445 ---- NavigateTrackEnabled = 0; + navigate_bar_set_mode (NavigateTrackEnabled); if (navigate_main_recalc_route () == -1) { *************** *** 466,469 **** --- 462,466 ---- if (new_instruction || !NavigateCurrentSegment) { + int group_id; /* new driving instruction */ *************** *** 480,483 **** --- 477,481 ---- navigate_bar_set_instruction (segment->instruction); + group_id = segment->group_id; if (segment < NavigateSegments + NavigateNumSegments - 1) { /* we need the name of the next street */ *************** *** 488,491 **** --- 486,506 ---- NavigateNextAnnounce = -1; + + if (segment->group_id != group_id) { + + /* Update distance to destination and ETA + * excluding current group (computed in navigate_update) + */ + + NavigateDistanceToDest = 0; + NavigateETA = 0; + + while (segment < NavigateSegments + NavigateNumSegments) { + + NavigateDistanceToDest += segment->distance; + NavigateETA += segment->cross_time; + segment++; + } + } } *************** *** 506,514 **** roadmap_canvas_set_thickness (ROUTE_PEN_WIDTH); - roadmap_navigate_prev_after_refresh = - roadmap_screen_subscribe_after_refresh (roadmap_navigate_after_refresh); navigate_bar_initialize (); navigate_main_set (1); NavigatePluginID = navigate_plugin_register (); } --- 521,530 ---- roadmap_canvas_set_thickness (ROUTE_PEN_WIDTH); navigate_bar_initialize (); navigate_main_set (1); + NextMessageUpdate = + roadmap_message_register (navigate_main_format_messages); + NavigatePluginID = navigate_plugin_register (); } *************** *** 536,539 **** --- 552,556 ---- NavigateDestination.plugin_id = INVALID_PLUGIN_ID; NavigateTrackEnabled = 0; + navigate_bar_set_mode (NavigateTrackEnabled); NavigateNumSegments = MAX_NAV_SEGEMENTS; *************** *** 555,558 **** --- 572,576 ---- if (track_time <= 0) { NavigateTrackEnabled = 0; + navigate_bar_set_mode (NavigateTrackEnabled); if (track_time < 0) { roadmap_messagebox("Error", "Error calculating route."); *************** *** 568,576 **** &NavigateSrcPos, &NavigateDestPos); - /* TODO no plugin support */ for (i=0; i<NavigateNumSegments; i++) { ! if (NavigateSegments[i].line.plugin_id == ROADMAP_PLUGIN_ID) { ! length += roadmap_line_length (NavigateSegments[i].line.line_id); ! } } --- 586,591 ---- &NavigateSrcPos, &NavigateDestPos); for (i=0; i<NavigateNumSegments; i++) { ! length += NavigateSegments[i].distance; } *************** *** 579,582 **** --- 594,598 ---- NavigateTrackEnabled = 1; + navigate_bar_set_mode (NavigateTrackEnabled); if (use_gps_location) { Index: navigate_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** navigate_main.h 5 Jun 2006 18:51:04 -0000 1.4 --- navigate_main.h 11 Jun 2006 11:00:32 -0000 1.5 *************** *** 53,56 **** --- 53,57 ---- int group_id; int distance; + int cross_time; } NavigateSegment; Index: navigate_bar.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_bar.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_bar.h 5 Jun 2006 18:51:04 -0000 1.1 --- navigate_bar.h 11 Jun 2006 11:00:32 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- void navigate_bar_initialize (void); + void navigate_bar_set_mode (int mode); void navigate_bar_draw (void); void navigate_bar_set_instruction (enum NavigateInstr instr); Index: navigate_instr.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_instr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navigate_instr.c 5 Jun 2006 18:51:04 -0000 1.1 --- navigate_instr.c 11 Jun 2006 11:00:32 -0000 1.2 *************** *** 151,155 **** } else { ! seg_shape_end = segment->last_shape - 1; seg_end_pos = intersection; } --- 151,155 ---- } else { ! seg_shape_end = segment->last_shape; seg_end_pos = intersection; } *************** *** 440,444 **** NavigateSegment *segment; - for (i=0; i < count; i++) { --- 440,443 ---- *************** *** 474,489 **** } ! segment = segments; - - if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { - segment->distance = - navigate_instr_calc_length (&segment->from_pos, segment, LINE_END); - } else { - segment->distance = - navigate_instr_calc_length (&segment->to_pos, segment, LINE_START); - } - - while (segment < segments + count) { --- 473,478 ---- } ! /* assign group ids */ segment = segments; while (segment < segments + count) { *************** *** 507,512 **** group_count++; - /* TODO no plugin support */ - segment->distance = roadmap_line_length (segment->line.line_id); } --- 496,499 ---- *************** *** 521,531 **** } ! segment = segments + count - 1; ! if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { ! segment->distance = ! navigate_instr_calc_length (&segment->from_pos, segment, LINE_END); ! } else { ! segment->distance = ! navigate_instr_calc_length (&segment->to_pos, segment, LINE_START); } --- 508,554 ---- } ! /* Calculate lengths and ETA for each segment */ ! segment = segments; ! while (segment < segments + count) { ! LineRouteTime from_cross_time; ! LineRouteTime to_cross_time; ! ! /* TODO no plugin support */ ! roadmap_line_route_get_cross_times ! (segment->line.line_id, &from_cross_time, &to_cross_time); ! ! if ((segment == segments) || (segment == (segments + count -1))) { ! ! if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { ! segment->distance = ! navigate_instr_calc_length ! (&segment->from_pos, segment, LINE_END); ! ! /* calculate cross time using the line length */ ! segment->cross_time = 1.0 * from_cross_time * segment->distance / ! (roadmap_line_length (segment->line.line_id)+1); ! } else { ! segment->distance = ! navigate_instr_calc_length ! (&segment->to_pos, segment, LINE_START); ! ! segment->cross_time = 1.0 * to_cross_time * segment->distance / ! (roadmap_line_length (segment->line.line_id)+1); ! } ! ! } else { ! ! segment->distance = roadmap_line_length (segment->line.line_id); ! roadmap_line_route_get_cross_times ! (segment->line.line_id, &from_cross_time, &to_cross_time); ! ! if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { ! segment->cross_time = from_cross_time; ! } else { ! segment->cross_time = to_cross_time; ! } ! } ! ! segment++; } |
From: Ehud S. <esh...@us...> - 2006-06-11 11:00:07
|
Update of /cvsroot/roadmap/roadmap_editor/src/icons/bmp In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8856 Modified Files: rm_full.bmp Log Message: Avi Romano. Index: rm_full.bmp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/icons/bmp/rm_full.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsAsYbCF and /tmp/cvsTdVnyY differ |
From: Ehud S. <esh...@us...> - 2006-06-11 10:59:43
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8792 Modified Files: editor_track_known.c editor_track_util.c Log Message: Add connection lines support. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** editor_track_util.c 10 Jun 2006 08:27:29 -0000 1.10 --- editor_track_util.c 11 Jun 2006 10:59:36 -0000 1.11 *************** *** 449,455 **** ! static int editor_track_util_get_node_id (PluginLine *from, ! int direction, ! int node_type) { int plugin_id = roadmap_plugin_get_id (from); --- 449,456 ---- ! static void editor_track_util_get_node (PluginLine *from, ! int direction, ! int node_type, ! NodeNeighbour *node) { int plugin_id = roadmap_plugin_get_id (from); *************** *** 477,484 **** } ! if (roadmap_id != -1) return roadmap_id; ! if (node_type == NODE_FROM) return -from_point_id-2; ! else return -to_point_id-2; } else { --- 478,492 ---- } ! if (roadmap_id != -1) { ! node->plugin_id = ROADMAP_PLUGIN_ID; ! node->id = roadmap_id; ! } else { ! ! node->plugin_id = EditorPluginID; ! ! if (node_type == NODE_FROM) node->id = from_point_id; ! else node->id = to_point_id; ! } } else { *************** *** 489,494 **** roadmap_line_points (line_id, &from_point_id, &to_point_id); ! if (node_type == NODE_FROM) return from_point_id; ! else return to_point_id; } } --- 497,504 ---- roadmap_line_points (line_id, &from_point_id, &to_point_id); ! node->plugin_id = ROADMAP_PLUGIN_ID; ! ! if (node_type == NODE_FROM) node->id = from_point_id; ! else node->id = to_point_id; } } *************** *** 500,505 **** int to_direction) { ! return editor_track_util_get_node_id (from, from_direction, NODE_TO) == ! editor_track_util_get_node_id (to, to_direction, NODE_FROM); } --- 510,564 ---- int to_direction) { ! NodeNeighbour from_node; ! NodeNeighbour to_node; ! ! editor_track_util_get_node (from, from_direction, NODE_TO, &from_node); ! editor_track_util_get_node (to, to_direction, NODE_FROM, &to_node); ! ! return editor_track_util_same_node (&from_node, &to_node); ! } ! ! ! int find_connecting_road (RoadMapPosition *pos, ! NodeNeighbour *from_node, ! NodeNeighbour *to_node) { ! ! RoadMapNeighbour neighbourhood[16]; ! int max = sizeof(neighbourhood) / sizeof(neighbourhood[1]); ! int count; ! int layers[128]; ! int layer_count; ! int i; ! ! layer_count = roadmap_layer_all_roads (layers, 128); ! ! count = roadmap_street_get_closest ! (pos, layers, layer_count, neighbourhood, max); ! ! count = roadmap_plugin_get_closest ! (pos, layers, layer_count, neighbourhood, count, max); ! ! for (i = 0; i < count; ++i) { ! NodeNeighbour c_from_node; ! NodeNeighbour c_to_node; ! ! editor_track_util_get_node (&neighbourhood[i].line, ! ROUTE_DIRECTION_WITH_LINE, ! NODE_FROM, &c_from_node); ! ! editor_track_util_get_node (&neighbourhood[i].line, ! ROUTE_DIRECTION_WITH_LINE, ! NODE_TO, &c_to_node); ! ! if ((editor_track_util_same_node (from_node, &c_from_node) && ! editor_track_util_same_node (to_node, &c_to_node)) || ! (editor_track_util_same_node (from_node, &c_to_node) && ! editor_track_util_same_node (to_node, &c_from_node))) { ! ! return 1; ! } ! } ! ! return 0; } *************** *** 714,723 **** //TODO: need to handle a merge of two nodes (each with two roads or more) ! //TODO: Check if there's a small line connecting both nodes. if (editor_track_util_nodes_distance (&from_node, &to_node) > ! editor_track_point_distance ()) { editor_log (ROADMAP_INFO, "The roads are too far away. Need a connection road."); return -1; } --- 773,790 ---- //TODO: need to handle a merge of two nodes (each with two roads or more) ! ! if (find_connecting_road (track_point_pos((from_point + to_point) / 2), ! &from_node, &to_node)) { ! ! editor_log (ROADMAP_INFO, "Found a third line connecting both lines. Done."); ! editor_log_pop (); ! return (from_point + to_point) / 2; ! } if (editor_track_util_nodes_distance (&from_node, &to_node) > ! 2 * editor_track_point_distance ()) { editor_log (ROADMAP_INFO, "The roads are too far away. Need a connection road."); + editor_log_pop (); return -1; } *************** *** 733,736 **** --- 800,804 ---- "Neither lines have a node near connection but the roads are connected. We need a connection road."); + editor_log_pop (); return -1; } *************** *** 754,757 **** --- 822,826 ---- editor_log (ROADMAP_INFO, "The roads are too far away. Need a connection road."); + editor_log_pop (); return -1; } *************** *** 762,765 **** --- 831,835 ---- editor_log (ROADMAP_INFO, "'from' line has no node but roads are connected. Do nothing."); + editor_log_pop (); return to_point; } *************** *** 770,773 **** --- 840,844 ---- editor_log (ROADMAP_INFO, "The roads are too far away. Need a connection road."); + editor_log_pop (); return -1; } *************** *** 778,781 **** --- 849,853 ---- editor_log (ROADMAP_INFO, "'to' line has no node but roads are connected. Do nothing."); + editor_log_pop (); return from_point; } *************** *** 786,789 **** --- 858,862 ---- editor_log (ROADMAP_INFO, "The roads are too far away. Need a connection road."); + editor_log_pop (); return -1; } Index: editor_track_known.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_known.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor_track_known.c 22 May 2006 20:56:29 -0000 1.5 --- editor_track_known.c 11 Jun 2006 10:59:36 -0000 1.6 *************** *** 393,396 **** --- 393,416 ---- */ if (confirmed_line->distance < editor_track_point_distance ()) { + RoadMapTracking candidate; + + /* current line */ + KnownCandidates[0].entries[0].street = *confirmed_street; + KnownCandidates[0].entries[0].line = *confirmed_line; + KnownCandidates[0].entries[0].point_id = 0; + KnownCandidates[0].count = 1; + + /* new line */ + candidate.opposite_street_direction = 0; + candidate.valid = 1; + candidate.fuzzyfied = roadmap_navigate_fuzzify + (&candidate, confirmed_street, + confirmed_line, RoadMapNeighbourhood+found, + gps_position->steering); + KnownCandidates[1].entries[0].street = candidate; + KnownCandidates[1].entries[0].line = RoadMapNeighbourhood[found]; + KnownCandidates[1].entries[0].point_id = point_id; + KnownCandidates[1].count = 1; + KnownCandidatesCount = 2; return 0; } |
From: Ehud S. <esh...@us...> - 2006-06-11 10:59:05
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8388 Modified Files: roadmap_display.c roadmap_message.c roadmap_message.h roadmap_navigate.c roadmap_screen.c roadmap_screen_obj.c roadmap_screen_obj.h roadmap_trip.c roadmap_trip.h Log Message: Add navigation panel: message registeration. screen objects offset. Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_display.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_display.c 5 Jun 2006 09:17:28 -0000 1.8 --- roadmap_display.c 11 Jun 2006 10:58:58 -0000 1.9 *************** *** 620,625 **** frame[1].y = roadmap_canvas_height () - 6; } else { ! frame[0].y = 6; ! frame[1].y = ascent + descent + 11; } frame[2].y = frame[1].y; --- 620,625 ---- frame[1].y = roadmap_canvas_height () - 6; } else { ! frame[0].y = 40; ! frame[1].y = ascent + descent + frame[0].y + 5; } frame[2].y = frame[1].y; Index: roadmap_message.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_message.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_message.h 15 Oct 2005 22:19:00 -0000 1.1.1.1 --- roadmap_message.h 11 Jun 2006 10:58:58 -0000 1.2 *************** *** 25,28 **** --- 25,31 ---- #define INCLUDE__ROADMAP_MESSAGE__H + RoadMapCallback roadmap_message_register (RoadMapCallback callback); + void roadmap_message_update (void); + void roadmap_message_set (char parameter, const char *format, ...); void roadmap_message_unset (char parameter); Index: roadmap_message.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_message.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_message.c 15 Oct 2005 22:19:00 -0000 1.1.1.1 --- roadmap_message.c 11 Jun 2006 10:58:58 -0000 1.2 *************** *** 37,40 **** --- 37,58 ---- static char *RoadMapMessageParameters[128] = {NULL}; + static void roadmap_message_dummy (void) {} + + static RoadMapCallback RoadMapMessageUpdate = roadmap_message_dummy; + + RoadMapCallback roadmap_message_register (RoadMapCallback callback) { + + RoadMapCallback prev = RoadMapMessageUpdate; + RoadMapMessageUpdate = callback; + + return prev; + } + + + void roadmap_message_update (void) { + + (*RoadMapMessageUpdate) (); + } + int roadmap_message_format (char *text, int length, const char *format) { Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_trip.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_trip.c 12 May 2006 13:14:17 -0000 1.7 --- roadmap_trip.c 11 Jun 2006 10:58:58 -0000 1.8 *************** *** 75,78 **** --- 75,79 ---- static int RoadMapTripFocusMoved = 1; + static RoadMapCallback RoadMapTripNextMessageUpdate; typedef struct roadmap_trip_point { *************** *** 560,563 **** --- 561,678 ---- + static void roadmap_trip_format_messages (void) { + + int distance_to_destination; + int distance_to_destination_far; + RoadMapTripPoint *gps = RoadMapTripGps; + RoadMapTripPoint *waypoint; + + + if (RoadMapTripFocus == gps && + RoadMapTripDestination != NULL && + RoadMapTripDestination->has_value) { + + time_t now = time(NULL); + time_t sun; + + roadmap_message_set ('T', roadmap_time_get_hours_minutes(now)); + + distance_to_destination = + roadmap_math_distance (&gps->map, &RoadMapTripDestination->map); + + roadmap_log (ROADMAP_DEBUG, + "GPS: distance to destination = %d %s", + distance_to_destination, + roadmap_math_distance_unit()); + + distance_to_destination_far = + roadmap_math_to_trip_distance(distance_to_destination); + + if (distance_to_destination_far > 0) { + roadmap_message_set ('D', "%d %s", + distance_to_destination_far, + roadmap_math_trip_unit()); + } else { + roadmap_message_set ('D', "%d %s", + distance_to_destination, + roadmap_math_distance_unit()); + }; + + + RoadMapTripNextWaypoint = RoadMapTripDestination; + + for (waypoint = (RoadMapTripPoint *)RoadMapTripWaypoints.first; + waypoint != NULL; + waypoint = (RoadMapTripPoint *)waypoint->link.next) { + + if (waypoint->in_trip && waypoint != RoadMapTripDeparture) { + if ((waypoint->distance < distance_to_destination) && + (waypoint->distance > RoadMapTripNextWaypoint->distance)) { + RoadMapTripNextWaypoint = waypoint; + } + } + } + + if (RoadMapTripNextWaypoint != RoadMapTripDestination) { + + int distance_to_waypoint = + roadmap_math_distance (&gps->map, + &RoadMapTripNextWaypoint->map); + + roadmap_log (ROADMAP_DEBUG, + "GPS: distance to next waypoint %s = %d %s", + RoadMapTripNextWaypoint->id, + distance_to_waypoint, + roadmap_math_distance_unit()); + + roadmap_message_set ('W', "%d %s", + roadmap_math_to_trip_distance + (distance_to_waypoint), + roadmap_math_trip_unit()); + + } else { + roadmap_message_unset ('W'); + } + + roadmap_message_set ('S', "%3d %s", + roadmap_math_to_speed_unit(gps->gps.speed), + roadmap_math_speed_unit()); + + roadmap_message_set ('H', "%d %s", + gps->gps.altitude, + roadmap_math_distance_unit()); + + sun = roadmap_sunset (&gps->gps); + if (sun > now) { + + roadmap_message_unset ('M'); + + roadmap_message_set ('E', roadmap_time_get_hours_minutes(sun)); + + } else { + + roadmap_message_unset ('E'); + + sun = roadmap_sunrise (&gps->gps); + roadmap_message_set ('M', roadmap_time_get_hours_minutes(sun)); + } + + } else { + + RoadMapTripNextWaypoint = NULL; + + roadmap_message_unset ('D'); + roadmap_message_unset ('S'); + roadmap_message_unset ('T'); + roadmap_message_unset ('W'); + + roadmap_message_unset ('M'); + roadmap_message_unset ('E'); + } + + (*RoadMapTripNextMessageUpdate) (); + } + + static int roadmap_trip_gps_state (void) { *************** *** 855,971 **** - void roadmap_trip_format_messages (void) { - - int distance_to_destination; - int distance_to_destination_far; - RoadMapTripPoint *gps = RoadMapTripGps; - RoadMapTripPoint *waypoint; - - - if (RoadMapTripFocus == gps && - RoadMapTripDestination != NULL && - RoadMapTripDestination->has_value) { - - time_t now = time(NULL); - time_t sun; - - roadmap_message_set ('T', roadmap_time_get_hours_minutes(now)); - - distance_to_destination = - roadmap_math_distance (&gps->map, &RoadMapTripDestination->map); - - roadmap_log (ROADMAP_DEBUG, - "GPS: distance to destination = %d %s", - distance_to_destination, - roadmap_math_distance_unit()); - - distance_to_destination_far = - roadmap_math_to_trip_distance(distance_to_destination); - - if (distance_to_destination_far > 0) { - roadmap_message_set ('D', "%d %s", - distance_to_destination_far, - roadmap_math_trip_unit()); - } else { - roadmap_message_set ('D', "%d %s", - distance_to_destination, - roadmap_math_distance_unit()); - }; - - - RoadMapTripNextWaypoint = RoadMapTripDestination; - - for (waypoint = (RoadMapTripPoint *)RoadMapTripWaypoints.first; - waypoint != NULL; - waypoint = (RoadMapTripPoint *)waypoint->link.next) { - - if (waypoint->in_trip && waypoint != RoadMapTripDeparture) { - if ((waypoint->distance < distance_to_destination) && - (waypoint->distance > RoadMapTripNextWaypoint->distance)) { - RoadMapTripNextWaypoint = waypoint; - } - } - } - - if (RoadMapTripNextWaypoint != RoadMapTripDestination) { - - int distance_to_waypoint = - roadmap_math_distance (&gps->map, - &RoadMapTripNextWaypoint->map); - - roadmap_log (ROADMAP_DEBUG, - "GPS: distance to next waypoint %s = %d %s", - RoadMapTripNextWaypoint->id, - distance_to_waypoint, - roadmap_math_distance_unit()); - - roadmap_message_set ('W', "%d %s", - roadmap_math_to_trip_distance - (distance_to_waypoint), - roadmap_math_trip_unit()); - - } else { - roadmap_message_unset ('W'); - } - - roadmap_message_set ('S', "%3d %s", - roadmap_math_to_speed_unit(gps->gps.speed), - roadmap_math_speed_unit()); - - roadmap_message_set ('H', "%d %s", - gps->gps.altitude, - roadmap_math_distance_unit()); - - sun = roadmap_sunset (&gps->gps); - if (sun > now) { - - roadmap_message_unset ('M'); - - roadmap_message_set ('E', roadmap_time_get_hours_minutes(sun)); - - } else { - - roadmap_message_unset ('E'); - - sun = roadmap_sunrise (&gps->gps); - roadmap_message_set ('M', roadmap_time_get_hours_minutes(sun)); - } - - } else { - - RoadMapTripNextWaypoint = NULL; - - roadmap_message_unset ('A'); - roadmap_message_unset ('D'); - roadmap_message_unset ('S'); - roadmap_message_unset ('T'); - roadmap_message_unset ('W'); - - roadmap_message_unset ('M'); - roadmap_message_unset ('E'); - } - } - - void roadmap_trip_display (void) { --- 970,973 ---- *************** *** 1029,1033 **** ("session", &RoadMapTripPredefined[i].config_position, ! ROADMAP_DEFAULT_POSITION); if (RoadMapTripPredefined[i].mobile) { --- 1031,1035 ---- ("session", &RoadMapTripPredefined[i].config_position, ! ROADMAP_DEFAULT_POSITION); if (RoadMapTripPredefined[i].mobile) { *************** *** 1050,1053 **** --- 1052,1058 ---- ("session", &RoadMapConfigFocusRotate, "1"); + RoadMapTripNextMessageUpdate = + roadmap_message_register (roadmap_trip_format_messages); + roadmap_state_add ("GPS_focus", roadmap_trip_gps_state); } Index: roadmap_screen_obj.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen_obj.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_screen_obj.h 2 May 2006 12:46:58 -0000 1.2 --- roadmap_screen_obj.h 11 Jun 2006 10:58:58 -0000 1.3 *************** *** 32,35 **** --- 32,36 ---- void roadmap_screen_obj_initialize (void); + void roadmap_screen_obj_offset (int x, int y); void roadmap_screen_obj_draw (void); Index: roadmap_navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_navigate.c 5 Jun 2006 09:17:28 -0000 1.12 --- roadmap_navigate.c 11 Jun 2006 10:58:58 -0000 1.13 *************** *** 797,800 **** --- 797,802 ---- RoadMapConfirmedStreet.line_direction, &RoadMapRouteInfo.next_line); + + callbacks.update (&RoadMapLatestPosition, &RoadMapConfirmedLine.line); } Index: roadmap_trip.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_trip.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_trip.h 29 Apr 2006 11:16:55 -0000 1.3 --- roadmap_trip.h 11 Jun 2006 10:58:58 -0000 1.4 *************** *** 63,67 **** void roadmap_trip_reverse (void); - void roadmap_trip_format_messages (void); void roadmap_trip_display (void); --- 63,66 ---- Index: roadmap_screen_obj.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen_obj.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_screen_obj.c 2 May 2006 12:46:58 -0000 1.3 --- roadmap_screen_obj.c 11 Jun 2006 10:58:58 -0000 1.4 *************** *** 57,61 **** int states_count; ! RoadMapGuiPoint position; /* position on screen */ int disable_rotate; /* rotate with screen? */ --- 57,62 ---- int states_count; ! short pos_x; /* position on screen */ ! short pos_y; /* position on screen */ int disable_rotate; /* rotate with screen? */ *************** *** 74,77 **** --- 75,80 ---- static RoadMapScreenObj RoadMapObjectList = NULL; static RoadMapScreenObj RoadMapScreenObjSelected = NULL; + static int OffsetX = 0; + static int OffsetY = 0; static char *roadmap_object_string (const char *data, int length) { *************** *** 233,236 **** --- 236,240 ---- char arg[255]; + int pos; argc -= 1; *************** *** 242,249 **** roadmap_screen_obj_decode_arg (arg, sizeof(arg), argv[1], argl[1]); ! object->position.x = atoi(arg); roadmap_screen_obj_decode_arg (arg, sizeof(arg), argv[2], argl[2]); ! object->position.y = atoi(arg); } --- 246,255 ---- roadmap_screen_obj_decode_arg (arg, sizeof(arg), argv[1], argl[1]); ! pos = atoi(arg); ! object->pos_x = pos; roadmap_screen_obj_decode_arg (arg, sizeof(arg), argv[2], argl[2]); ! pos = atoi(arg); ! object->pos_y = pos; } *************** *** 400,403 **** --- 406,429 ---- + static void roadmap_screen_obj_pos (RoadMapScreenObj object, + RoadMapGuiPoint *pos) { + + pos->x = object->pos_x; + pos->y = object->pos_y; + + if (pos->x < 0) { + pos->x += roadmap_canvas_width (); + } else { + pos->x += OffsetX; + } + + if (pos->y < 0) { + pos->y += roadmap_canvas_height (); + } else { + pos->y += OffsetY; + } + } + + RoadMapScreenObj roadmap_screen_obj_search (const char *name) { *************** *** 413,417 **** void roadmap_screen_obj_move (const char *name, ! const RoadMapGuiPoint *position) { RoadMapScreenObj cursor = roadmap_screen_obj_search (name); --- 439,443 ---- void roadmap_screen_obj_move (const char *name, ! const RoadMapGuiPoint *position) { RoadMapScreenObj cursor = roadmap_screen_obj_search (name); *************** *** 419,428 **** if (cursor != NULL) { ! cursor->position.x = position->x; ! cursor->position.y = position->y; } } #if 0 void roadmap_object_iterate (RoadMapObjectAction action) { --- 445,461 ---- if (cursor != NULL) { ! cursor->pos_x = position->x; ! cursor->pos_y = position->y; } } + void roadmap_screen_obj_offset (int x, int y) { + + OffsetX += x; + OffsetY += y; + } + + #if 0 void roadmap_object_iterate (RoadMapObjectAction action) { *************** *** 474,477 **** --- 507,511 ---- int state = 0; int image_mode = IMAGE_NORAML; + RoadMapGuiPoint pos; if (cursor->state_fn) { *************** *** 484,490 **** } if (cursor->images[state]) { ! roadmap_canvas_draw_image (cursor->images[state], &cursor->position, cursor->opacity, image_mode); } --- 518,526 ---- } + roadmap_screen_obj_pos (cursor, &pos); + if (cursor->images[state]) { ! roadmap_canvas_draw_image (cursor->images[state], &pos, cursor->opacity, image_mode); } *************** *** 493,500 **** if (cursor->disable_rotate) { ! roadmap_sprite_draw (cursor->sprites[state], &cursor->position, -roadmap_math_get_orientation()); } else { ! roadmap_sprite_draw (cursor->sprites[state], &cursor->position, 0); } } --- 529,536 ---- if (cursor->disable_rotate) { ! roadmap_sprite_draw (cursor->sprites[state], &pos, -roadmap_math_get_orientation()); } else { ! roadmap_sprite_draw (cursor->sprites[state], &pos, 0); } } *************** *** 509,516 **** for (cursor = RoadMapObjectList; cursor != NULL; cursor = cursor->next) { ! if ((point->x >= (cursor->position.x + cursor->bbox.minx)) && ! (point->x <= (cursor->position.x + cursor->bbox.maxx)) && ! (point->y >= (cursor->position.y + cursor->bbox.miny)) && ! (point->y <= (cursor->position.y + cursor->bbox.maxy))) { return cursor; --- 545,555 ---- for (cursor = RoadMapObjectList; cursor != NULL; cursor = cursor->next) { ! RoadMapGuiPoint pos; ! roadmap_screen_obj_pos (cursor, &pos); ! ! if ((point->x >= (pos.x + cursor->bbox.minx)) && ! (point->x <= (pos.x + cursor->bbox.maxx)) && ! (point->y >= (pos.y + cursor->bbox.miny)) && ! (point->y <= (pos.y + cursor->bbox.maxy))) { return cursor; *************** *** 546,551 **** if (object->images[state]) { ! roadmap_canvas_draw_image (object->images[state], &object->position, object->opacity, IMAGE_SELECTED); } --- 585,592 ---- if (object->images[state]) { + RoadMapGuiPoint pos; + roadmap_screen_obj_pos (object, &pos); ! roadmap_canvas_draw_image (object->images[state], &pos, object->opacity, IMAGE_SELECTED); } Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** roadmap_screen.c 5 Jun 2006 09:17:28 -0000 1.14 --- roadmap_screen.c 11 Jun 2006 10:58:58 -0000 1.15 *************** *** 48,52 **** #include "roadmap_sprite.h" #include "roadmap_object.h" ! #include "roadmap_trip.h" #include "roadmap_canvas.h" #include "roadmap_screen_obj.h" --- 48,53 ---- #include "roadmap_sprite.h" #include "roadmap_object.h" ! #include "roadmap_trip.h" ! #include "roadmap_message.h" #include "roadmap_canvas.h" #include "roadmap_screen_obj.h" *************** *** 1127,1143 **** roadmap_object_iterate (roadmap_screen_draw_object); ! roadmap_trip_format_messages (); roadmap_screen_obj_draw (); ! if (roadmap_config_match (&RoadMapConfigMapSigns, "yes")) { ! roadmap_trip_display (); ! roadmap_display_signs (); ! } } RoadMapScreenAfterRefresh(); roadmap_canvas_refresh (); --- 1128,1144 ---- roadmap_object_iterate (roadmap_screen_draw_object); ! roadmap_message_update (); roadmap_screen_obj_draw (); + } ! if (roadmap_config_match (&RoadMapConfigMapSigns, "yes")) { ! roadmap_trip_display (); } RoadMapScreenAfterRefresh(); + roadmap_display_signs (); roadmap_canvas_refresh (); |
From: Ehud S. <esh...@us...> - 2006-06-10 08:29:44
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9046 Modified Files: libroadmap.vcp Log Message: Add navigation panel. Index: libroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap/libroadmap.vcp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libroadmap.vcp 12 May 2006 14:23:39 -0000 1.10 --- libroadmap.vcp 10 Jun 2006 08:29:41 -0000 1.11 *************** *** 438,441 **** --- 438,442 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_file.h"\ "..\..\..\roadmap_gui.h"\ *************** *** 446,449 **** --- 447,451 ---- "..\..\..\roadmap_path.h"\ [...1209 lines suppressed...] + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_shape.h"\ "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_types.h"\ *************** *** 7241,7244 **** --- 7593,7597 ---- "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_shape.h"\ "..\..\..\roadmap_square.h"\ *************** *** 7263,7266 **** --- 7616,7620 ---- "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_shape.h"\ "..\..\..\roadmap_square.h"\ |
From: Ehud S. <esh...@us...> - 2006-06-10 08:29:13
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8986 Modified Files: roadmap_dialog.c Log Message: Fix sheet width / height mixup (Luigi). Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_dialog.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_dialog.c 15 May 2006 19:51:38 -0000 1.7 --- roadmap_dialog.c 10 Jun 2006 08:29:09 -0000 1.8 *************** *** 937,942 **** if (sheet != NULL) { MoveWindow(sheet, 0, 0, height - MAX_ROW_HEIGHT, ! width, TRUE); return TRUE; } --- 937,943 ---- if (sheet != NULL) { MoveWindow(sheet, 0, 0, + width, height - MAX_ROW_HEIGHT, ! TRUE); return TRUE; } |
From: Ehud S. <esh...@us...> - 2006-06-10 08:27:32
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8179 Modified Files: editor_track_main.c editor_track_util.c Log Message: Add connection lines support. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** editor_track_util.c 22 May 2006 20:56:29 -0000 1.9 --- editor_track_util.c 10 Jun 2006 08:27:29 -0000 1.10 *************** *** 67,70 **** --- 67,72 ---- #define SPLIT_CHECK 0x8 + #define NODE_FROM 1 + #define NODE_TO 2 void editor_track_util_set_focus(const RoadMapPosition *position) { *************** *** 96,100 **** int split_type, int max_distance_allowed, ! int opposite_direction, NodeNeighbour *connect_point) { #define MAX_RECENT_POINTS 50 --- 98,102 ---- int split_type, int max_distance_allowed, ! int line_direction, NodeNeighbour *connect_point) { #define MAX_RECENT_POINTS 50 *************** *** 162,166 **** } ! if (opposite_direction) { steering = steering - 180; } --- 164,168 ---- } ! if (line_direction) { steering = steering - 180; } *************** *** 383,386 **** --- 385,400 ---- + static int editor_track_util_nodes_distance (NodeNeighbour *node1, + NodeNeighbour *node2) { + + RoadMapPosition p1; + RoadMapPosition p2; + + editor_track_util_node_pos (node1, &p1); + editor_track_util_node_pos (node2, &p2); + + return roadmap_math_distance (&p1, &p2); + } + static int editor_track_util_same_node (NodeNeighbour *from_node, *************** *** 402,406 **** ! static void adjust_connect_node (NodeNeighbour *node, PluginLine *line) { RoadMapPosition split_position; --- 416,420 ---- ! static int adjust_connect_node (NodeNeighbour *node, PluginLine *line) { RoadMapPosition split_position; *************** *** 409,424 **** editor_track_util_node_pos (node, &split_position); - //editor_track_util_set_focus(&split_position); if (!roadmap_plugin_get_distance (&split_position, line, &result)) { assert (0); ! ! //editor_track_util_release_focus (); ! node->id = -1; ! return; } - //editor_track_util_release_focus (); ! assert (result.distance < 5*editor_track_point_distance ()); split_position.longitude = result.intersection.longitude; --- 423,436 ---- editor_track_util_node_pos (node, &split_position); if (!roadmap_plugin_get_distance (&split_position, line, &result)) { assert (0); ! return -1; } ! if (result.distance > editor_track_point_distance ()) { ! ! return -1; ! } split_position.longitude = result.intersection.longitude; *************** *** 432,435 **** --- 444,505 ---- //TODO: make sure that the point is not shared editor_point_set_pos (node->id, &split_position); + + return 0; + } + + + static int editor_track_util_get_node_id (PluginLine *from, + int direction, + int node_type) { + + int plugin_id = roadmap_plugin_get_id (from); + int line_id = roadmap_plugin_get_line_id (from); + + if (direction == ROUTE_DIRECTION_AGAINST_LINE) { + /* toggle node type */ + + if (node_type == NODE_FROM) node_type = NODE_TO; + else node_type = NODE_FROM; + } + + if (plugin_id == EditorPluginID) { + + int from_point_id; + int to_point_id; + int roadmap_id; + + editor_line_get_points (line_id, &from_point_id, &to_point_id); + + if (node_type == NODE_FROM) { + editor_point_roadmap_id (from_point_id, &roadmap_id); + } else { + editor_point_roadmap_id (to_point_id, &roadmap_id); + } + + if (roadmap_id != -1) return roadmap_id; + + if (node_type == NODE_FROM) return -from_point_id-2; + else return -to_point_id-2; + + } else { + + int from_point_id; + int to_point_id; + + roadmap_line_points (line_id, &from_point_id, &to_point_id); + + if (node_type == NODE_FROM) return from_point_id; + else return to_point_id; + } + } + + + static int editor_track_util_is_connected (PluginLine *from, + int from_direction, + PluginLine *to, + int to_direction) { + + return editor_track_util_get_node_id (from, from_direction, NODE_TO) == + editor_track_util_get_node_id (to, to_direction, NODE_FROM); } *************** *** 438,442 **** const RoadMapPosition *pos, int points_count, ! int opposite_direction, NodeNeighbour *node) { --- 508,512 ---- const RoadMapPosition *pos, int points_count, ! int line_direction, NodeNeighbour *node) { *************** *** 444,448 **** return find_split_point (&line->line, pos, points_count, ! SPLIT_START, 2, opposite_direction, node); } --- 514,518 ---- return find_split_point (&line->line, pos, points_count, ! SPLIT_START, 2, line_direction, node); } *************** *** 451,455 **** const RoadMapPosition *pos, int points_count, ! int opposite_direction, NodeNeighbour *node) { --- 521,525 ---- const RoadMapPosition *pos, int points_count, ! int line_direction, NodeNeighbour *node) { *************** *** 457,461 **** return find_split_point (&line->line, pos, points_count, ! SPLIT_END, 2, opposite_direction, node); } --- 527,531 ---- return find_split_point (&line->line, pos, points_count, ! SPLIT_END, 2, line_direction, node); } *************** *** 602,607 **** int editor_track_util_connect_roads (PluginLine *from, PluginLine *to, ! int from_opposite_direction, ! int to_opposite_direction, const RoadMapGpsPosition *gps_position, int last_point_id) { --- 672,677 ---- int editor_track_util_connect_roads (PluginLine *from, PluginLine *to, ! int from_direction, ! int to_direction, const RoadMapGpsPosition *gps_position, int last_point_id) { *************** *** 613,616 **** --- 683,688 ---- int from_point; int to_point; + int roads_connected = editor_track_util_is_connected + (from, from_direction, to, to_direction); editor_log_push ("editor_track_connect_roads"); *************** *** 626,633 **** from_point = find_split_point (from, &position, last_point_id, SPLIT_START|SPLIT_CHECK, ! 3, from_opposite_direction, &from_node); to_point = find_split_point (to, &position, last_point_id, SPLIT_END|SPLIT_CHECK, ! 3, to_opposite_direction, &to_node); if ((from_point != -1) && (to_point != -1)) { --- 698,705 ---- from_point = find_split_point (from, &position, last_point_id, SPLIT_START|SPLIT_CHECK, ! 3, from_direction, &from_node); to_point = find_split_point (to, &position, last_point_id, SPLIT_END|SPLIT_CHECK, ! 3, to_direction, &to_node); if ((from_point != -1) && (to_point != -1)) { *************** *** 642,646 **** //TODO: need to handle a merge of two nodes (each with two roads or more) ! //Check if there's a small line connecting both nodes. editor_log_pop (); return (from_point + to_point) / 2; --- 714,726 ---- //TODO: need to handle a merge of two nodes (each with two roads or more) ! //TODO: Check if there's a small line connecting both nodes. ! ! if (editor_track_util_nodes_distance (&from_node, &to_node) > ! editor_track_point_distance ()) { ! editor_log (ROADMAP_INFO, ! "The roads are too far away. Need a connection road."); ! return -1; ! } ! editor_log_pop (); return (from_point + to_point) / 2; *************** *** 649,657 **** if ((from_point == -1) && (to_point == -1)) { editor_log (ROADMAP_INFO, "Neither lines have a node. Create a node."); from_point = find_split_point (from, &position, last_point_id, SPLIT_START, ! 3, from_opposite_direction, &from_node); if (from_point == -1) { --- 729,744 ---- if ((from_point == -1) && (to_point == -1)) { + if (roads_connected) { + editor_log (ROADMAP_INFO, + "Neither lines have a node near connection but the roads are connected. We need a connection road."); + + return -1; + } + editor_log (ROADMAP_INFO, "Neither lines have a node. Create a node."); from_point = find_split_point (from, &position, last_point_id, SPLIT_START, ! 3, from_direction, &from_node); if (from_point == -1) { *************** *** 662,676 **** } ! connect_node = from_node; ! adjust_connect_node (&connect_node, to); } else if (from_point != -1) { ! connect_node = from_node; ! adjust_connect_node (&connect_node, to); } else { ! connect_node = to_node; ! adjust_connect_node (&connect_node, from); } --- 749,792 ---- } ! connect_node = from_node; ! ! if (adjust_connect_node (&connect_node, to) == -1) { ! editor_log (ROADMAP_INFO, ! "The roads are too far away. Need a connection road."); ! return -1; ! } } else if (from_point != -1) { ! if (roads_connected) { ! editor_log (ROADMAP_INFO, ! "'from' line has no node but roads are connected. Do nothing."); ! return to_point; ! } ! ! connect_node = from_node; ! ! if (adjust_connect_node (&connect_node, to) == -1) { ! editor_log (ROADMAP_INFO, ! "The roads are too far away. Need a connection road."); ! return -1; ! } ! } else { ! if (roads_connected) { ! editor_log (ROADMAP_INFO, ! "'to' line has no node but roads are connected. Do nothing."); ! return from_point; ! } ! ! connect_node = to_node; ! ! if (adjust_connect_node (&connect_node, from) == -1) { ! editor_log (ROADMAP_INFO, ! "The roads are too far away. Need a connection road."); ! return -1; ! } ! } *************** *** 689,702 **** from_point = find_split_point (from, &position, last_point_id, SPLIT_START|SPLIT_NODE, ! 3, from_opposite_direction, &connect_node); } if (to_point == -1) { ! editor_log (ROADMAP_INFO, "'to' line has no node. Need to split."); to_point = find_split_point (to, &position, last_point_id, SPLIT_END|SPLIT_NODE, ! 3, to_opposite_direction, &connect_node); } --- 805,818 ---- from_point = find_split_point (from, &position, last_point_id, SPLIT_START|SPLIT_NODE, ! 3, from_direction, &connect_node); } if (to_point == -1) { ! editor_log (ROADMAP_INFO, "'to' line has no node. Need to split."); to_point = find_split_point (to, &position, last_point_id, SPLIT_END|SPLIT_NODE, ! 3, to_direction, &connect_node); } Index: editor_track_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_main.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** editor_track_main.c 22 May 2006 20:56:29 -0000 1.12 --- editor_track_main.c 10 Jun 2006 08:27:29 -0000 1.13 *************** *** 47,50 **** --- 47,51 ---- #include "../db/editor_point.h" #include "../db/editor_route.h" + #include "../db/editor_line.h" #include "../editor_log.h" #include "editor_track_filter.h" *************** *** 205,208 **** --- 206,279 ---- + static int add_road_connection (int point_id, + RoadMapTracking *new_street, + RoadMapNeighbour *new_line) { + + int from_point; + int end_point; + int line_id; + NodeNeighbour end_node = NODE_NEIGHBOUR_NULL; + + editor_log_push ("add_road_connection"); + + from_point = + editor_track_util_new_road_start + (&TrackConfirmedLine, + track_point_pos (point_id), + point_id, + TrackConfirmedStreet.line_direction, + &cur_node); + + assert (from_point != -1); + + if (from_point == -1) { + return -1; + } + + if (editor_track_known_end_segment + (&TrackPreviousLine.line, from_point, + &TrackConfirmedLine.line, is_new_track)) { + + is_new_track = 0; + } + + track_reset_points (from_point); + + /*FIXME the whole previous line thing is not used and broken */ + TrackPreviousLine = TrackConfirmedLine; + + TrackConfirmedLine = *new_line; + TrackConfirmedStreet = *new_street; + + end_point = + editor_track_util_new_road_end + (&TrackConfirmedLine, + track_point_pos (points_count - 1), + points_count - 1, + TrackConfirmedStreet.line_direction, + &end_node); + + if (end_node.plugin_id == ROADMAP_PLUGIN_ID) { + end_node.id = editor_point_roadmap_to_editor (end_node.id); + end_node.plugin_id = EditorPluginID; + } + + line_id = create_new_line (0, end_point, -1, end_node.id, 4); + + if (line_id != -1) { + int cfcc; + int flags; + + editor_line_get (line_id, NULL, NULL, NULL, &cfcc, &flags); + editor_line_modify_properties + (line_id, cfcc, flags | ED_LINE_CONNECTION); + } + + track_reset_points (end_point); + + return 0; + } + + static void end_known_segment (int point_id, RoadMapTracking *new_street, *************** *** 239,253 **** (&TrackConfirmedLine.line, &new_line->line, ! TrackConfirmedStreet.opposite_street_direction, ! new_street->opposite_street_direction, track_point_gps (point_id), point_id); ! if (editor_track_known_end_segment ! (&TrackPreviousLine.line, split_point, ! &TrackConfirmedLine.line, is_new_track)) { is_new_track = 0; TrackPreviousLine = TrackConfirmedLine; } --- 310,346 ---- (&TrackConfirmedLine.line, &new_line->line, ! TrackConfirmedStreet.line_direction, ! new_street->line_direction, track_point_gps (point_id), point_id); ! if (split_point != -1) { ! ! if (editor_track_known_end_segment ! (&TrackPreviousLine.line, split_point, ! &TrackConfirmedLine.line, is_new_track)) { ! ! is_new_track = 0; ! ! /*FIXME the whole previous line thing is not used and broken */ ! TrackPreviousLine = TrackConfirmedLine; ! } ! ! } else { ! ! /* We can't just connect the two roads. ! * We need to create a new road in between. ! */ ! ! if (add_road_connection (point_id, new_street, new_line) == -1) { ! TrackConfirmedLine = *new_line; ! TrackConfirmedStreet = *new_street; ! track_reset_points (-1); ! return; ! } is_new_track = 0; TrackPreviousLine = TrackConfirmedLine; + return; } *************** *** 275,279 **** track_point_pos (point_id), point_id, ! TrackConfirmedStreet.opposite_street_direction, &cur_node); --- 368,372 ---- track_point_pos (point_id), point_id, ! TrackConfirmedStreet.line_direction, &cur_node); *************** *** 375,379 **** track_point_pos (end_point), end_point, ! TrackConfirmedStreet.opposite_street_direction, &end_node); --- 468,472 ---- track_point_pos (end_point), end_point, ! TrackConfirmedStreet.line_direction, &end_node); |
From: Ehud S. <esh...@us...> - 2006-06-10 08:27:09
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8086 Modified Files: editor_export.c Log Message: Add connection lines support. Index: editor_export.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_export.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** editor_export.c 12 May 2006 14:21:55 -0000 1.10 --- editor_export.c 10 Jun 2006 08:27:05 -0000 1.11 *************** *** 509,513 **** editor_line_get (line_id, &from, &to, NULL, &cfcc, &flags); ! if (flags & ED_LINE_DELETED) { editor_line_modify_properties --- 509,513 ---- editor_line_get (line_id, &from, &to, NULL, &cfcc, &flags); ! if (flags & (ED_LINE_DELETED|ED_LINE_CONNECTION)) { editor_line_modify_properties |
From: Ehud S. <esh...@us...> - 2006-06-10 08:26:53
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7777 Modified Files: editor_line.h Log Message: Add connection lines support. Index: editor_line.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_line.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_line.h 12 Dec 2005 20:45:10 -0000 1.2 --- editor_line.h 10 Jun 2006 08:26:50 -0000 1.3 *************** *** 33,36 **** --- 33,37 ---- #define ED_LINE_EXPLICIT_SPLIT 0x2 /* flag */ #define ED_LINE_DIRTY 0x4 /* flag */ + #define ED_LINE_CONNECTION 0x8 typedef struct editor_db_line_s { |
From: Ehud S. <esh...@us...> - 2006-06-10 08:26:29
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7744 Modified Files: editor_screen.c Log Message: Show editor lines as red if they have no data. Index: editor_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_screen.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** editor_screen.c 21 May 2006 12:42:44 -0000 1.11 --- editor_screen.c 10 Jun 2006 08:26:26 -0000 1.12 *************** *** 329,335 **** int has_route = 0; - return NO_ROAD_STATE; if (plugin_id == ROADMAP_PLUGIN_ID) { if (roadmap_locator_activate (fips) >= 0) { --- 329,336 ---- int has_route = 0; if (plugin_id == ROADMAP_PLUGIN_ID) { + return NO_ROAD_STATE; + if (roadmap_locator_activate (fips) >= 0) { *************** *** 371,378 **** --- 372,383 ---- } + #if 0 route = editor_line_get_route (line); if (route != -1) { has_route = 1; } + #else + has_route = 1; + #endif } } *************** *** 499,503 **** case NO_DATA_STATE: return "dark red"; case MISSING_NAME_STATE: return "red"; ! case MISSING_ROUTE_STATE: return "orange"; default: --- 504,508 ---- case NO_DATA_STATE: return "dark red"; case MISSING_NAME_STATE: return "red"; ! case MISSING_ROUTE_STATE: return "yellow"; default: *************** *** 601,604 **** --- 606,612 ---- road_state = SELECTED_STATE; + } else if (flag & ED_LINE_CONNECTION) { + + road_state = MISSING_ROUTE_STATE; } else { |
From: Ehud S. <esh...@us...> - 2006-06-07 20:23:47
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv563 Modified Files: buildmap_postgres.c Log Message: Add ramp and trail support. Index: buildmap_postgres.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_postgres.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** buildmap_postgres.c 15 May 2006 19:54:37 -0000 1.8 --- buildmap_postgres.c 5 Jun 2006 09:12:56 -0000 1.9 *************** *** 105,108 **** --- 105,110 ---- case 2: return ROADMAP_ROAD_MAIN; case 3: return ROADMAP_ROAD_FREEWAY; + case 4: return ROADMAP_ROAD_RAMP; + case 5: return ROADMAP_ROAD_TRAIL; } |
From: Ehud S. <esh...@us...> - 2006-06-07 20:23:47
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2856 Modified Files: Makefile roadgps_screen.c roadmap_canvas.h roadmap_display.c roadmap_label.c roadmap_navigate.c roadmap_screen.c roadmap_screen.h Log Message: Add navigation panel. Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_display.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_display.c 21 May 2006 12:40:37 -0000 1.7 --- roadmap_display.c 5 Jun 2006 09:17:28 -0000 1.8 *************** *** 285,289 **** roadmap_canvas_get_text_extents ! (sign->content, &width, &ascent, &descent); width += 8; /* Keep some room around the text. */ --- 285,289 ---- roadmap_canvas_get_text_extents ! (sign->content, -1, &width, &ascent, &descent); width += 8; /* Keep some room around the text. */ *************** *** 522,528 **** (sign->content == NULL || strcmp (sign->content, text) != 0); ! sign->deadline = ! time(NULL) ! + roadmap_config_get_integer (&RoadMapConfigDisplayDuration); --- 522,534 ---- (sign->content == NULL || strcmp (sign->content, text) != 0); ! if (roadmap_config_get_integer (&RoadMapConfigDisplayDuration) == -1) { ! sign->deadline = -1; ! ! } else { ! ! sign->deadline = ! time(NULL) ! + roadmap_config_get_integer (&RoadMapConfigDisplayDuration); ! } *************** *** 598,602 **** } ! roadmap_canvas_get_text_extents (text, &width, &ascent, &descent); if (corner & ROADMAP_CANVAS_RIGHT) { --- 604,608 ---- } ! roadmap_canvas_get_text_extents (text, -1, &width, &ascent, &descent); if (corner & ROADMAP_CANVAS_RIGHT) { *************** *** 652,657 **** sign->content = strdup(text); ! sign->deadline = ! time(NULL) + roadmap_config_get_integer (&RoadMapConfigDisplayDuration); } --- 658,669 ---- sign->content = strdup(text); ! if (roadmap_config_get_integer (&RoadMapConfigDisplayDuration) == -1) { ! sign->deadline = -1; ! ! } else { ! sign->deadline = ! time(NULL) + ! roadmap_config_get_integer (&RoadMapConfigDisplayDuration); ! } } Index: roadgps_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadgps_screen.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadgps_screen.c 29 Apr 2006 14:58:18 -0000 1.3 --- roadgps_screen.c 5 Jun 2006 09:17:28 -0000 1.4 *************** *** 337,341 **** roadmap_canvas_get_text_extents ! ("09", &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent + 2; --- 337,341 ---- roadmap_canvas_get_text_extents ! ("09", -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent + 2; Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/Makefile,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile 21 May 2006 12:40:37 -0000 1.14 --- Makefile 5 Jun 2006 09:17:28 -0000 1.15 *************** *** 196,199 **** --- 196,201 ---- editor/db/editor_db.c \ navigate/navigate_main.c \ + navigate/navigate_instr.c \ + navigate/navigate_bar.c \ navigate/navigate_plugin.c \ navigate/navigate_dglib.c \ Index: roadmap_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_canvas.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_canvas.h 15 May 2006 20:16:33 -0000 1.6 --- roadmap_canvas.h 5 Jun 2006 09:17:28 -0000 1.7 *************** *** 65,69 **** */ void roadmap_canvas_get_text_extents ! (const char *text, int *width, int *ascent, int *descent); --- 65,69 ---- */ void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent); *************** *** 116,119 **** --- 116,122 ---- #define CANVAS_NO_ROTATE 0x2 + #define CANVAS_COPY_NORMAL 0x1 + #define CANVAS_COPY_BLEND 0x2 + void roadmap_canvas_draw_string (RoadMapGuiPoint *position, int corner, *************** *** 147,150 **** --- 150,156 ---- const char *text); + int roadmap_canvas_image_width (const RoadMapImage image); + int roadmap_canvas_image_height (const RoadMapImage image); + RoadMapImage roadmap_canvas_load_image (const char *path, const char* file_name); *************** *** 153,156 **** --- 159,171 ---- int opacity, int mode); + void roadmap_canvas_copy_image (RoadMapImage dst_image, + const RoadMapGuiPoint *pos, + const RoadMapGuiRect *rect, + RoadMapImage src_image, int mode); + + void roadmap_canvas_draw_image_text (RoadMapImage image, + const RoadMapGuiPoint *position, + int size, const char *text); + #endif // INCLUDE__ROADMAP_CANVAS__H Index: roadmap_navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_navigate.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** roadmap_navigate.c 22 May 2006 20:54:01 -0000 1.11 --- roadmap_navigate.c 5 Jun 2006 09:17:28 -0000 1.12 *************** *** 769,772 **** --- 769,779 ---- RoadMapConfirmedStreet.valid = 0; } + + if (RoadMapRouteInfo.enabled) { + + RoadMapRouteInfo.callbacks.update + (&RoadMapLatestPosition, + &RoadMapConfirmedLine.line); + } } Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_label.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_label.c 2 May 2006 15:08:44 -0000 1.3 --- roadmap_label.c 5 Jun 2006 09:17:28 -0000 1.4 *************** *** 188,192 **** cachePtr->street = properties.plugin_street; ! roadmap_canvas_get_text_extents(text, &width, &ascent, &descent); r.minx = 0; r.maxx=width+1; --- 188,192 ---- cachePtr->street = properties.plugin_street; ! roadmap_canvas_get_text_extents(text, -1, &width, &ascent, &descent); r.minx = 0; r.maxx=width+1; Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_screen.c 22 May 2006 09:08:06 -0000 1.13 --- roadmap_screen.c 5 Jun 2006 09:17:28 -0000 1.14 *************** *** 1564,1568 **** ! void roadmap_screen_subscribe_after_refresh (RoadMapScreenSubscriber handler) { if (handler == NULL) { --- 1564,1571 ---- ! RoadMapScreenSubscriber roadmap_screen_subscribe_after_refresh ! (RoadMapScreenSubscriber handler) { ! ! RoadMapScreenSubscriber previous = RoadMapScreenAfterRefresh; if (handler == NULL) { *************** *** 1571,1574 **** --- 1574,1579 ---- RoadMapScreenAfterRefresh = handler; } + + return previous; } Index: roadmap_screen.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_screen.h 8 May 2006 16:07:26 -0000 1.6 --- roadmap_screen.h 5 Jun 2006 09:17:28 -0000 1.7 *************** *** 68,72 **** typedef void (*RoadMapShapeItr) (int shape, RoadMapPosition *position); ! void roadmap_screen_subscribe_after_refresh (RoadMapScreenSubscriber handler); void roadmap_screen_draw_one_line (RoadMapPosition *from, --- 68,73 ---- typedef void (*RoadMapShapeItr) (int shape, RoadMapPosition *position); ! RoadMapScreenSubscriber roadmap_screen_subscribe_after_refresh ! (RoadMapScreenSubscriber handler); void roadmap_screen_draw_one_line (RoadMapPosition *from, |
From: Ehud S. <esh...@us...> - 2006-06-07 20:23:45
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1900 Modified Files: sprites Log Message: Fix GPS sprite location (Avi). Index: sprites =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/sprites,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sprites 2 May 2006 12:40:36 -0000 1.3 --- sprites 5 Jun 2006 09:15:47 -0000 1.4 *************** *** 10,17 **** S GPS F white 2 ! L 0,0 7,14 0,8 -7,14 F blue 1 ! P 0,1 6,13 0,10 -6,13 ! L 8,11 0,-3 -8,11 S Friend --- 10,17 ---- S GPS F white 2 ! L 0,-7 7,8 0,4 -7,8 0,-7 F blue 1 ! P 0,-6 6,7 0,3 -6,7 ! L 9,7 0,-9 -9,7 S Friend |
From: Ehud S. <esh...@us...> - 2006-06-07 20:23:44
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2351 Modified Files: roadmap_street.c Log Message: Fix address search. Index: roadmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_street.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_street.c 22 May 2006 09:14:30 -0000 1.8 --- roadmap_street.c 5 Jun 2006 09:16:24 -0000 1.9 *************** *** 473,476 **** --- 473,479 ---- street->name = roadmap_dictionary_locate (RoadMapRangeActive->RoadMapStreetNames, name); + if (street->prefix == ROADMAP_INVALID_STRING) street->prefix = 0; + if (street->suffix == ROADMAP_INVALID_STRING) street->suffix = 0; + if (street->type == ROADMAP_INVALID_STRING) street->type = 0; } |
From: Ehud S. <esh...@us...> - 2006-06-07 20:23:42
|
Update of /cvsroot/roadmap/roadmap_editor/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3876 Modified Files: Makefile Log Message: Fix RoadGPS link. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/gtk2/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 12 May 2006 14:18:07 -0000 1.7 --- Makefile 5 Jun 2006 09:19:54 -0000 1.8 *************** *** 114,117 **** gtkroadgps: roadmap_main.o ../libguiroadgps.a $(RDMLIBS) ! $(CC) $(LDFLAGS) roadmap_main.o -o gtkroadgps ../libguiroadgps.a $(LIBS) --- 114,117 ---- gtkroadgps: roadmap_main.o ../libguiroadgps.a $(RDMLIBS) ! $(CXX) $(LDFLAGS) roadmap_main.o -o gtkroadgps ../libguiroadgps.a $(LIBS) |
From: Ehud S. <esh...@us...> - 2006-06-07 20:22:47
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5763 Modified Files: navigate_main.c navigate_main.h Added Files: navigate_bar.c navigate_bar.h navigate_instr.c navigate_instr.h Log Message: Add navigation panel. Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** navigate_main.c 22 May 2006 20:57:06 -0000 1.5 --- navigate_main.c 5 Jun 2006 18:51:04 -0000 1.6 *************** *** 49,61 **** #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 --- 49,60 ---- #include "roadmap_navigate.h" #include "roadmap_point.h" + #include "roadmap_layer.h" #include "navigate_plugin.h" #include "navigate_graph.h" ! #include "navigate_bar.h" ! #include "navigate_instr.h" #include "navigate_main.h" #define ROUTE_PEN_WIDTH 4 *************** *** 69,72 **** --- 68,73 ---- (PluginLine *current, int direction, PluginLine *next); + static RoadMapScreenSubscriber roadmap_navigate_prev_after_refresh = NULL; + RoadMapNavigateRouteCB NavigateCallbacks = { &navigate_update, *************** *** 224,510 **** - 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->shape_inital_pos; - } else { - - last_shape = seg->last_shape; - shape_pos = &start; - *shape_pos = seg->shape_inital_pos; - } - - for (shape = seg->first_shape; shape <= last_shape; shape++) { - - seg->shape_itr (shape, shape_pos); - } - } - - return roadmap_math_azymuth (&start, &end); - } - - - 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) { - - int seg1_azymuth; - int seg2_azymuth; - int delta; - int minimum_turn_degree = 15; - - if (roadmap_plugin_same_street (&seg1->street, &seg2->street)) { - minimum_turn_degree = 30; - } - - 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 < -minimum_turn_degree) { - - if (delta > -45) { - seg1->instruction = KEEP_RIGHT; - } else { - seg1->instruction = TURN_RIGHT; - } - - } else if (delta > minimum_turn_degree) { - - 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, - RoadMapPosition *src_pos, - RoadMapPosition *dst_pos) { - - 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); - - segments[i].shape_inital_pos = segments[i].from_pos; - - 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 = 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; - } - - static int navigate_main_recalc_route () { --- 225,228 ---- *************** *** 535,539 **** } ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments, &NavigateSrcPos, &NavigateDestPos); NavigateTrackEnabled = 1; --- 253,257 ---- } ! navigate_instr_prepare_segments (NavigateSegments, NavigateNumSegments, &NavigateSrcPos, &NavigateDestPos); NavigateTrackEnabled = 1; *************** *** 545,548 **** --- 263,278 ---- + static void roadmap_navigate_after_refresh (void) { + + if (NavigateTrackEnabled) { + navigate_bar_draw (); + } + + if (roadmap_navigate_prev_after_refresh) { + (*roadmap_navigate_prev_after_refresh) (); + } + } + + void navigate_update (RoadMapPosition *position, PluginLine *current) { *************** *** 551,554 **** --- 281,285 ---- int distance_to_destination_far; const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; + int group_id = segment->group_id; const char *inst_text = ""; char str[100]; *************** *** 559,588 **** 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); } switch (segment->instruction) { --- 290,309 ---- distance_to_destination = ! navigate_instr_calc_length (position, segment, LINE_END); } else { distance_to_destination = ! navigate_instr_calc_length (position, segment, LINE_START); } ! while (segment < (NavigateSegments + NavigateNumSegments - 1)) { ! if ((segment+1)->group_id != group_id) break; segment++; ! distance_to_destination += segment->distance; } + + navigate_bar_set_distance (distance_to_destination); + switch (segment->instruction) { *************** *** 605,612 **** inst_text = "Continue straight"; break; } if ((segment->instruction == APPROACHING_DESTINATION) && ! distance_to_destination < 5) { NavigateTrackEnabled = 0; --- 326,335 ---- inst_text = "Continue straight"; break; + default: + break; } if ((segment->instruction == APPROACHING_DESTINATION) && ! distance_to_destination <= 10) { NavigateTrackEnabled = 0; *************** *** 626,633 **** --- 349,358 ---- roadmap_message_set ('U', roadmap_math_trip_unit ()); + #if 0 roadmap_display_text ("Driving Instruction", "In %d%s, %s", distance_to_destination_far, roadmap_math_trip_unit(), inst_text); + #endif } else { *************** *** 637,647 **** 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); }; ! ! roadmap_display_show ("Driving Instruction"); if (NavigateNextAnnounce == -1) { --- 362,374 ---- roadmap_message_set ('U', roadmap_math_distance_unit ()); + #if 0 roadmap_display_text ("Driving Instruction", "In %d%s, %s", distance_to_destination, roadmap_math_distance_unit(), inst_text); + #endif }; ! ! //roadmap_display_show ("Driving Instruction"); if (NavigateNextAnnounce == -1) { *************** *** 650,660 **** annouce = 1; ! } else { ! if (distance_to_destination <= NavigateNextAnnounce) { ! NavigateNextAnnounce = 0; ! roadmap_message_unset ('D'); ! annouce = 1; ! } } --- 377,386 ---- annouce = 1; ! } ! if (distance_to_destination <= NavigateNextAnnounce) { ! NavigateNextAnnounce = 0; ! roadmap_message_unset ('D'); ! annouce = 1; } *************** *** 682,686 **** (PluginLine *current, int direction, PluginLine *next) { ! const PluginStreet *current_street = NULL; if (!NavigateTrackEnabled) { --- 408,412 ---- (PluginLine *current, int direction, PluginLine *next) { ! int new_instruction = 0; if (!NavigateTrackEnabled) { *************** *** 688,693 **** if (navigate_main_recalc_route () != -1) { - roadmap_display_text ("Driving Instruction", "Drive carefully."); - roadmap_display_show ("Driving Instruction"); roadmap_trip_stop (); } --- 414,417 ---- *************** *** 699,704 **** (current, &NavigateSegments[NavigateCurrentSegment].line)) { ! current_street = &NavigateSegments[NavigateCurrentSegment].street; ! NavigateCurrentSegment++; } --- 423,442 ---- (current, &NavigateSegments[NavigateCurrentSegment].line)) { ! int i; ! for (i=NavigateCurrentSegment+1; i < NavigateNumSegments; i++) { ! ! if (roadmap_plugin_same_line ! (current, &NavigateSegments[i].line)) { ! ! if (NavigateSegments[NavigateCurrentSegment].group_id != ! NavigateSegments[i].group_id) { ! ! new_instruction = 1; ! } ! ! NavigateCurrentSegment = i; ! break; ! } ! } } *************** *** 708,721 **** NavigateTrackEnabled = 0; - //roadmap_navigate_end_route (NavigateCallbacks); if (navigate_main_recalc_route () == -1) { - roadmap_display_hide ("Driving Instruction"); roadmap_trip_start (); } NavigateNextAnnounce = -1; - //roadmap_messagebox("Error", "Lost route."); return; --- 446,456 ---- *************** *** 730,738 **** } ! if ((NavigateCurrentSegment < NavigateNumSegments) && ! (!current_street || ! !roadmap_plugin_same_street ! (current_street, ! &NavigateSegments[NavigateCurrentSegment].street))) { NavigateNextAnnounce = -1; --- 465,489 ---- } ! if (new_instruction || !NavigateCurrentSegment) { ! ! /* new driving instruction */ ! ! PluginStreetProperties properties; ! const NavigateSegment *segment = ! NavigateSegments + NavigateCurrentSegment; ! ! while (segment < NavigateSegments + NavigateNumSegments - 1) { ! if ((segment + 1)->group_id != segment->group_id) break; ! segment++; ! } ! ! navigate_bar_set_instruction (segment->instruction); ! ! if (segment < NavigateSegments + NavigateNumSegments - 1) { ! /* we need the name of the next street */ ! segment++; ! } ! roadmap_plugin_get_street_properties (&segment->line, &properties); ! navigate_bar_set_street (properties.street); NavigateNextAnnounce = -1; *************** *** 755,758 **** --- 506,512 ---- roadmap_canvas_set_thickness (ROUTE_PEN_WIDTH); + roadmap_navigate_prev_after_refresh = + roadmap_screen_subscribe_after_refresh (roadmap_navigate_after_refresh); + navigate_bar_initialize (); navigate_main_set (1); *************** *** 811,815 **** int length = 0; ! navigate_main_prepare_segments (NavigateSegments, NavigateNumSegments, &NavigateSrcPos, &NavigateDestPos); --- 565,569 ---- int length = 0; ! navigate_instr_prepare_segments (NavigateSegments, NavigateNumSegments, &NavigateSrcPos, &NavigateDestPos); *************** *** 834,839 **** roadmap_screen_redraw (); - roadmap_display_text ("Driving Instruction", "Drive carefully."); - roadmap_display_show ("Driving Instruction"); roadmap_messagebox ("Route found", msg); } --- 588,591 ---- --- NEW FILE: navigate_instr.c --- /* navigate_instr.c - calculate navigation instructions * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SYNOPSYS: * * See navigate_instr.h */ #include "roadmap.h" #include "roadmap_line.h" #include "roadmap_line_route.h" #include "roadmap_math.h" #include "roadmap_point.h" #include "roadmap_street.h" #include "roadmap_turns.h" #include "roadmap_layer.h" #include "navigate_main.h" #include "navigate_instr.h" static int navigate_instr_azymuth_delta (int az1, int az2) { int delta; delta = az1 - az2; while (delta > 180) delta -= 360; while (delta < -180) delta += 360; return delta; } static int navigate_instr_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->shape_inital_pos; } else { last_shape = seg->last_shape; shape_pos = &start; *shape_pos = seg->shape_inital_pos; } for (shape = seg->first_shape; shape <= last_shape; shape++) { seg->shape_itr (shape, shape_pos); } } return roadmap_math_azymuth (&start, &end); } 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) { if (type == LINE_START) { seg_shape_end = -1; seg_end_pos = intersection; seg_shape_initial = from; } else { seg_shape_end = segment->last_shape - 1; seg_end_pos = intersection; } } 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 void navigate_instr_check_neighbours (NavigateSegment *seg1, NavigateSegment *seg2) { RoadMapPosition *junction; int junction_node_id; RoadMapNeighbour neighbours[16]; int i; int count; int layers_count; int layers[128]; int seg1_azymuth; int seg2_azymuth; int delta; int left_delta; int right_delta; int accuracy; RoadMapArea focus; if (seg1->line_direction == ROUTE_DIRECTION_WITH_LINE) { seg1_azymuth = navigate_instr_calc_azymuth (seg1, LINE_END); /* TODO no plugin support */ roadmap_line_points (roadmap_plugin_get_line_id (&seg1->line), &i, &junction_node_id); junction = &seg1->to_pos; } else { seg1_azymuth = 180 + navigate_instr_calc_azymuth (seg1, LINE_START); /* TODO no plugin support */ roadmap_line_points (roadmap_plugin_get_line_id (&seg1->line), &junction_node_id, &i); junction = &seg1->from_pos; } if (seg2->line_direction == ROUTE_DIRECTION_WITH_LINE) { seg2_azymuth = navigate_instr_calc_azymuth (seg2, LINE_START); } else { seg2_azymuth = 180 + navigate_instr_calc_azymuth (seg2, LINE_END); } delta = navigate_instr_azymuth_delta (seg1_azymuth, seg2_azymuth); left_delta = right_delta = delta; layers_count = roadmap_layer_all_roads (layers, 128); accuracy = 10; focus.west = junction->longitude - accuracy; focus.east = junction->longitude + accuracy; focus.north = junction->latitude + accuracy; focus.south = junction->latitude - accuracy; roadmap_math_set_focus (&focus); /* TODO no plugin support */ count = roadmap_street_get_closest (junction, layers, layers_count, neighbours, sizeof(neighbours) / sizeof(RoadMapNeighbour)); roadmap_math_release_focus (); for (i = 0; i < count; ++i) { PluginLine *line = &neighbours[i].line; RoadMapPosition from_pos; RoadMapPosition to_pos; int line_delta; int direction; if (roadmap_plugin_same_line (line, &seg1->line) || roadmap_plugin_same_line (line, &seg2->line)) { continue; } roadmap_plugin_line_from (line, &from_pos); roadmap_plugin_line_to (line, &to_pos); direction = roadmap_plugin_get_direction (line, ROUTE_CAR_ALLOWED); if (!roadmap_math_distance (junction, &from_pos)) { if (direction == ROUTE_DIRECTION_AGAINST_LINE) continue; line_delta = navigate_instr_azymuth_delta (seg1_azymuth, roadmap_math_azymuth (&neighbours[i].from, &neighbours[i].to)); } else if (!roadmap_math_distance (junction, &to_pos)) { if (direction == ROUTE_DIRECTION_WITH_LINE) continue; line_delta = navigate_instr_azymuth_delta (seg1_azymuth, roadmap_math_azymuth (&neighbours[i].to, &neighbours[i].from)); } else { continue; } /* TODO no plugin support */ if (roadmap_plugin_get_id (line) == ROADMAP_PLUGIN_ID) { if (roadmap_turns_find_restriction (junction_node_id, roadmap_plugin_get_line_id (&seg1->line), roadmap_plugin_get_line_id (line))) { continue; } } if (line_delta < left_delta) left_delta = line_delta; if (line_delta > right_delta) right_delta = line_delta; } if (((left_delta != delta) && (right_delta != delta)) || ((left_delta == delta) && (right_delta == delta))) { seg1->instruction = CONTINUE; } else if (left_delta != delta) { seg1->instruction = KEEP_LEFT; } else { seg1->instruction = KEEP_RIGHT; } } static void navigate_instr_set_road_instr (NavigateSegment *seg1, NavigateSegment *seg2) { int seg1_azymuth; int seg2_azymuth; int delta; int minimum_turn_degree = 15; if (seg1->line_direction == ROUTE_DIRECTION_WITH_LINE) { seg1_azymuth = navigate_instr_calc_azymuth (seg1, LINE_END); } else { seg1_azymuth = 180 + navigate_instr_calc_azymuth (seg1, LINE_START); } if (seg2->line_direction == ROUTE_DIRECTION_WITH_LINE) { seg2_azymuth = navigate_instr_calc_azymuth (seg2, LINE_START); } else { seg2_azymuth = 180 + navigate_instr_calc_azymuth (seg2, LINE_END); } delta = navigate_instr_azymuth_delta (seg1_azymuth, seg2_azymuth); if (roadmap_plugin_same_street (&seg1->street, &seg2->street)) { minimum_turn_degree = 45; } if (delta < -minimum_turn_degree) { if (delta > -45) { seg1->instruction = KEEP_RIGHT; } else { seg1->instruction = TURN_RIGHT; } } else if (delta > minimum_turn_degree) { if (delta < 45) { seg1->instruction = KEEP_LEFT; } else { seg1->instruction = TURN_LEFT; } } else { if (!roadmap_plugin_same_street (&seg1->street, &seg2->street)) { navigate_instr_check_neighbours (seg1, seg2); } else { seg1->instruction = CONTINUE; } } } int navigate_instr_calc_length (const 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; } } int navigate_instr_prepare_segments (NavigateSegment *segments, int count, RoadMapPosition *src_pos, RoadMapPosition *dst_pos) { int i; int group_id = 0; NavigateSegment *segment; 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); segments[i].shape_inital_pos = segments[i].from_pos; roadmap_plugin_get_street (&segments[i].line, &segments[i].street); } for (i=0; i < count - 1; i++) { navigate_instr_set_road_instr (&segments[i], &segments[i+1]); } 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); } segment = segments; if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { segment->distance = navigate_instr_calc_length (&segment->from_pos, segment, LINE_END); } else { segment->distance = navigate_instr_calc_length (&segment->to_pos, segment, LINE_START); } while (segment < segments + count) { int group_count = 0; while (segment->instruction == CONTINUE) { NavigateSegment *prev = segment; /* Check if the previous segment is the last */ if (prev == (segments + count - 1)) { break; } segment++; if (!roadmap_plugin_same_street (&prev->street, &segment->street)) { segment = prev; break; } group_count++; /* TODO no plugin support */ segment->distance = roadmap_line_length (segment->line.line_id); } while (group_count >= 0) { /* (segment - group_count)->instruction = segment->instruction; */ (segment - group_count)->group_id = group_id; group_count--; } segment++; group_id++; } segment = segments + count - 1; if (segment->line_direction == ROUTE_DIRECTION_WITH_LINE) { segment->distance = navigate_instr_calc_length (&segment->from_pos, segment, LINE_END); } else { segment->distance = navigate_instr_calc_length (&segment->to_pos, segment, LINE_START); } return 0; } Index: navigate_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** navigate_main.h 21 May 2006 12:44:15 -0000 1.3 --- navigate_main.h 5 Jun 2006 18:51:04 -0000 1.4 *************** *** 31,40 **** enum NavigateInstr { ! TURN_LEFT, TURN_RIGHT, KEEP_LEFT, KEEP_RIGHT, CONTINUE, ! APPROACHING_DESTINATION }; --- 31,41 ---- enum NavigateInstr { ! TURN_LEFT = 0, TURN_RIGHT, KEEP_LEFT, KEEP_RIGHT, CONTINUE, ! APPROACHING_DESTINATION, ! LAST_DIRECTION }; *************** *** 50,53 **** --- 51,56 ---- RoadMapShapeItr shape_itr; enum NavigateInstr instruction; + int group_id; + int distance; } NavigateSegment; --- NEW FILE: navigate_instr.h --- /* navigate_instr.h - Navigation instructions * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef INCLUDE__NAVIGATE_INSTR__H #define INCLUDE__NAVIGATE_INSTR__H #include "navigate_main.h" #define LINE_START 0 #define LINE_END 1 int navigate_instr_calc_length (const RoadMapPosition *position, const NavigateSegment *segment, int type); int navigate_instr_prepare_segments (NavigateSegment *segments, int count, RoadMapPosition *src_pos, RoadMapPosition *dst_pos); #endif // INCLUDE__NAVIGATE_INSTR__H --- NEW FILE: navigate_bar.c --- /* navigate_bar.c - implement navigation bar * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * SYNOPSYS: * * See navigate_bar.h */ #include <stdlib.h> #include <string.h> #include "roadmap.h" #include "roadmap_canvas.h" #include "roadmap_path.h" #include "roadmap_file.h" #include "roadmap_math.h" #include "navigate_main.h" #include "navigate_bar.h" typedef struct { const char *image_file; int min_screen_width; RoadMapGuiPoint instruction_pos; RoadMapGuiRect distance_rect; RoadMapGuiPoint distance_value_pos; RoadMapGuiPoint distance_unit_pos; int street_start; int street_width; } NavigateBarPanel; static NavigateBarPanel NavigateBarDefaultPanels[] = { {"nav_panel_wide.bmp", 320, {0, 0}, {0, 65, 48, 110}, {3, 70}, {3, 95}, 75, 230}, {"nav_panel.bmp", 240, {0, 0}, {55, 0, 95, 50}, {55, 5}, {58, 30}, 98, 133} }; static NavigateBarPanel *NavigatePanel = NULL; const char NAVIGATE_DIR_IMG[][40] = { "nav_turn_left.bmp", "nav_turn_right.bmp", "nav_keep_left.bmp", "nav_keep_right.bmp", "nav_continue.bmp", "nav_approaching.bmp" }; static RoadMapImage NavigateBarImage; static RoadMapImage NavigateBarBG; static RoadMapImage NavigateDirections[LAST_DIRECTION]; static int NavigateBarInitialized = 0; static RoadMapGuiPoint NavigateBarLocation; static enum NavigateInstr NavigateBarCurrentInstr = LAST_DIRECTION; static int NavigateBarCurrentDistance = -1; static RoadMapImage navigate_bar_load_image (const char *name) { RoadMapImage image = NULL; const char *cursor; char *file = roadmap_path_join ("icons", name); for (cursor = roadmap_path_first ("config"); cursor != NULL; cursor = roadmap_path_next ("config", cursor)) { if (roadmap_file_exists (cursor, file)) { image = roadmap_canvas_load_image (cursor, file); break; } } if (!image) { for (cursor = roadmap_path_first ("user"); cursor != NULL; cursor = roadmap_path_next ("user", cursor)) { if (roadmap_file_exists (cursor, file)) { image = roadmap_canvas_load_image (cursor, file); break; } } } free (file); return image; } void navigate_bar_initialize (void) { int i; int width; if (NavigateBarInitialized) return; width = roadmap_canvas_width (); for (i=0; (unsigned)i< sizeof(NavigateBarDefaultPanels)/sizeof(NavigateBarDefaultPanels[0]); i++) { if (width >= NavigateBarDefaultPanels[i].min_screen_width) { NavigatePanel = NavigateBarDefaultPanels + i; break; } } if (!NavigatePanel) { roadmap_log (ROADMAP_ERROR, "Can't find nav panel for screen width: %d", width); NavigateBarInitialized = -1; } NavigateBarBG = navigate_bar_load_image (NavigatePanel->image_file); NavigateBarImage = navigate_bar_load_image (NavigatePanel->image_file); if (!NavigateBarBG || !NavigateBarImage) goto error; for (i=0; i<LAST_DIRECTION; i++) { NavigateDirections[i] = navigate_bar_load_image (NAVIGATE_DIR_IMG[i]); if (!NavigateDirections[i]) goto error; } NavigateBarLocation.x = 0; NavigateBarLocation.y = 0; NavigateBarInitialized = 1; return; error: NavigateBarInitialized = -1; } void navigate_bar_set_instruction (enum NavigateInstr instr) { RoadMapGuiPoint pos = NavigatePanel->instruction_pos; if (NavigateBarInitialized != 1) return; roadmap_canvas_copy_image (NavigateBarImage, &pos, NULL, NavigateBarBG, CANVAS_COPY_NORMAL); roadmap_canvas_copy_image (NavigateBarImage, &pos, NULL, NavigateDirections[(int)instr], CANVAS_COPY_BLEND); NavigateBarCurrentInstr = instr; } void navigate_bar_set_distance (int distance) { char str[100]; char unit_str[20]; int distance_far; RoadMapGuiPoint position = {0, 0}; if (NavigateBarInitialized != 1) return; if (NavigateBarCurrentDistance == distance) return; /* erase the old distance */ roadmap_canvas_copy_image (NavigateBarImage, &position, &NavigatePanel->distance_rect, NavigateBarBG, CANVAS_COPY_NORMAL); distance_far = roadmap_math_to_trip_distance(distance); if (distance_far > 0) { snprintf (str, sizeof(str), "%d", distance_far); snprintf (unit_str, sizeof(unit_str), "%s", roadmap_math_trip_unit()); } else { snprintf (str, sizeof(str), "%d", distance); snprintf (unit_str, sizeof(unit_str), "%s", roadmap_math_distance_unit()); }; position = NavigatePanel->distance_value_pos; roadmap_canvas_draw_image_text (NavigateBarImage, &NavigatePanel->distance_value_pos, 22, str); position = NavigatePanel->distance_unit_pos; roadmap_canvas_draw_image_text (NavigateBarImage, &NavigatePanel->distance_unit_pos, 18, unit_str); } static int navigate_bar_align_text (char *text, char **line1, char **line2, int size) { int width, ascent, descent; roadmap_canvas_get_text_extents (text, size, &width, &ascent, &descent); if (width >= 2 * NavigatePanel->street_width) return -1; if (width < NavigatePanel->street_width) { *line1 = text; return 1; } else { /* Check if we can place the text in two lines */ char *text_line = text; char *text_end = text_line + strlen(text_line); char *p1 = text_line + (strlen(text_line) / 2); char *p2 = p1; while (p1 > text_line) { if (*p1 == ' ') { break; } p1 -= 1; } while (p2 < text_end) { if (*p2 == ' ') { break; } p2 += 1; } if (text_end - p1 > p2 - text_line) { p1 = p2; } if (p1 > text_line) { char saved = *p1; *p1 = 0; roadmap_canvas_get_text_extents (text_line, size, &width, &ascent, &descent); if (width < NavigatePanel->street_width) { roadmap_canvas_get_text_extents (text_line, size, &width, &ascent, &descent); if (width < NavigatePanel->street_width) { *line1 = text_line; *line2 = p1 + 1; return 2; } } *p1 = saved; } } return -1; } void navigate_bar_set_street (const char *street) { #define NORMAL_SIZE 20 #define SMALL_SIZE 16 int width, ascent, descent; int size; char *line1; char *line2; char *text; int num_lines; int i; //street = "ר××× ×××× ×××××× ×××§× ×¤×¨××× 18"; if (NavigateBarInitialized != 1) return; text = strdup(street); size = NORMAL_SIZE; num_lines = navigate_bar_align_text (text, &line1, &line2, size); if (num_lines < 0) { /* Try again with a smaller font size */ size = SMALL_SIZE; num_lines = navigate_bar_align_text (text, &line1, &line2, size); } /* Cut some text until it fits */ while (num_lines < 0) { char *end = text + strlen(text) - 1; while ((end > text) && (*end != ' ')) end--; if (end == text) { roadmap_log (ROADMAP_ERROR, "Can't align street in nav bar: %s", street); free(text); return; } *end = '\0'; num_lines = navigate_bar_align_text (text, &line1, &line2, size); } for (i=0; i < num_lines; i++) { char *line; RoadMapGuiPoint position = {NavigatePanel->street_start, 5}; if (i ==0 ) { line = line1; } else { line = line2; position.y = 20; } roadmap_canvas_get_text_extents (line, size, &width, &ascent, &descent); position.x = NavigatePanel->street_width - width + NavigatePanel->street_start; roadmap_canvas_draw_image_text (NavigateBarImage, &position, size, line); } } void navigate_bar_draw (void) { if (NavigateBarInitialized != 1) return; roadmap_canvas_draw_image (NavigateBarImage, &NavigateBarLocation, 0, IMAGE_NORAML); } --- NEW FILE: navigate_bar.h --- /* navigate_bar.h - Navigation bar images * * LICENSE: * * Copyright 2006 Ehud Shabtai * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef INCLUDE__NAVIGATE_BAR__H #define INCLUDE__NAVIGATE_BAR__H #include "roadmap_canvas.h" void navigate_bar_initialize (void); void navigate_bar_draw (void); void navigate_bar_set_instruction (enum NavigateInstr instr); void navigate_bar_set_distance (int distance); void navigate_bar_set_street (const char *street); #endif // INCLUDE__NAVIGATE_BAR__H |
From: Ehud S. <esh...@us...> - 2006-06-07 20:22:45
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6477 Modified Files: roadmap_spawn.c Log Message: Use flite's dll if available. Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_spawn.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_spawn.c 28 Nov 2005 19:36:35 -0000 1.2 --- roadmap_spawn.c 5 Jun 2006 18:52:30 -0000 1.3 *************** *** 31,35 **** #include "../roadmap_list.h" #include "../roadmap_spawn.h" ! static char *RoadMapSpawnPath = NULL; --- 31,44 ---- #include "../roadmap_list.h" #include "../roadmap_spawn.h" ! ! typedef void (*text2speech)(const char *text); ! static int flite_dll_initialized = 0; ! static HINSTANCE flite_dll_inst; ! static text2speech flite_t2s; ! static HANDLE flite_thread; ! static HANDLE flite_inuse_event; ! static HANDLE flite_launch_event; ! static RoadMapFeedback *flite_feedback; ! static const char *flite_text; static char *RoadMapSpawnPath = NULL; *************** *** 37,40 **** --- 46,123 ---- static RoadMapList RoadMapSpawnActive = ROADMAP_LIST_EMPTY; + DWORD WINAPI FliteThread(LPVOID lpParam) { + + while (1) { + char *text; + + if (WaitForSingleObject(flite_launch_event, INFINITE) != WAIT_OBJECT_0) { + roadmap_log (ROADMAP_ERROR, + "FliteThread - error waiting for event. No more talking."); + break; + } + + text = strdup(flite_text); + SetEvent(flite_inuse_event); + + flite_t2s(text); + free(text); + + flite_feedback->handler (flite_feedback->data); + } + + return 0; + } + + + static int exec_flite_dll (const char *command_line, + RoadMapFeedback *feedback) { + + if (flite_dll_initialized == -1) return -1; + + if (!flite_dll_initialized) { + + flite_dll_inst = LoadLibrary(L"\\Storage card\\RoadMap\\flite_dll.dll"); + if (!flite_dll_inst) { + flite_dll_initialized = -1; + return -1; + } + + flite_t2s = (text2speech)GetProcAddress(flite_dll_inst, L"text2speech"); + if (!flite_t2s) { + FreeLibrary(flite_dll_inst); + flite_dll_initialized = -1; + return -1; + } + + flite_inuse_event = CreateEvent(NULL, FALSE, FALSE, NULL); + flite_launch_event = CreateEvent(NULL, FALSE, FALSE, NULL); + + flite_thread = CreateThread(NULL, 0, FliteThread, 0, 0, NULL); + + SetThreadPriority(flite_thread, THREAD_PRIORITY_HIGHEST); + + flite_dll_initialized = 1; + } + + do { + while (*command_line && (*command_line == ' ')) command_line++; + if(*command_line == '-') { + while (*command_line && (*command_line != ' ')) command_line++; + } + } while ((*command_line == ' ') || (*command_line == '-')); + + flite_text = command_line; + flite_feedback = feedback; + + SetEvent (flite_launch_event); + if (WaitForSingleObject (flite_inuse_event, 1000) != WAIT_OBJECT_0) { + + ResetEvent (flite_launch_event); + feedback->handler (feedback->data); + } + + return 0; + } + static int roadmap_spawn_child (const char *name, *************** *** 115,119 **** const char *command_line, RoadMapFeedback *feedback) ! { roadmap_list_append (&RoadMapSpawnActive, &feedback->link); feedback->child = roadmap_spawn_child (name, command_line, NULL); --- 198,208 ---- const char *command_line, RoadMapFeedback *feedback) ! { ! if (!strcmp (name, "flite") && ! (exec_flite_dll(command_line, feedback) != -1)) { ! ! return 0; ! } ! roadmap_list_append (&RoadMapSpawnActive, &feedback->link); feedback->child = roadmap_spawn_child (name, command_line, NULL); |