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: <pg...@us...> - 2015-06-30 15:00:32
|
Revision: 2904 http://sourceforge.net/p/roadmap/code/2904 Author: pgf Date: 2015-06-30 15:00:30 +0000 (Tue, 30 Jun 2015) Log Message: ----------- add support for binding to "all arrows pressed", for OLPC XO game button Modified Paths: -------------- trunk/roadmap/src/gtk2/roadmap_main.c trunk/roadmap/src/roadmap_start.c Modified: trunk/roadmap/src/gtk2/roadmap_main.c =================================================================== --- trunk/roadmap/src/gtk2/roadmap_main.c 2015-06-29 22:02:49 UTC (rev 2903) +++ trunk/roadmap/src/gtk2/roadmap_main.c 2015-06-30 15:00:30 UTC (rev 2904) @@ -153,14 +153,72 @@ } +static char *arrows[] = { + "Special-LeftArrow", + "Special-RightArrow", + "Special-UpArrow", + "Special-DownArrow" +}; +static int arrows_down, keybits, first_key, numkeys; + +static void arrow_keys_timeout(void) { + + char *newkey; + + roadmap_main_remove_periodic(arrow_keys_timeout); + if (!keybits) return; + + if (keybits == 15) { + newkey = "Special-All-Arrows"; + } else if (numkeys >= 1) { /* use the first pressed */ + newkey = arrows[first_key]; + } else { + arrows_down = first_key = keybits = numkeys = 0; + return; + } + if (newkey != NULL && RoadMapMainInput != NULL) { + (*RoadMapMainInput) (newkey); + } + arrows_down = first_key = keybits = numkeys = 0; +} + + +/* the OLPC XO has a game-key button that produces arrow events. it + * can produce more than one event at a time. this code lets us + * define more more unique key event: all arrows down at once. + * otherwise, the KP_<arrow> keys simply map to "Special-<arrow>". + */ +static void special_keypad_arrow_treatment(int keyval) +{ + int key; + + switch (keyval) { + case GDK_KP_Left: key = 0; break; + case GDK_KP_Right: key = 1; break; + case GDK_KP_Up: key = 2; break; + case GDK_KP_Down: key = 3; break; + } + + /* don't count the same arrow twice */ + if ((keybits & (1<<key)) == 0) + numkeys++; + + /* first arrow key down starts the timer */ + if (!arrows_down) { + first_key = key; + roadmap_main_set_periodic (100, arrow_keys_timeout); + arrows_down = 1; + } + + /* keep track of what's down */ + keybits |= (1 << key); +} + static gint roadmap_main_key_pressed (GtkWidget *w, GdkEventKey *event) { char *key = NULL; char regular_key[2]; - // fprintf(stderr, "got 0x%x\n", event->keyval); - - switch (event->keyval) { case GDK_Left: key = "LeftArrow"; break; @@ -181,11 +239,14 @@ case GDK_KP_Page_Down: key = "Special-PageDown"; break; // square case GDK_KP_Home: key = "Special-Home"; break; // X case GDK_KP_End: key = "Special-End"; break; // checkmark - case GDK_KP_Left: key = "Special-LeftArrow"; break; // joy left - case GDK_KP_Right: key = "Special-RightArrow"; break; // joy right - case GDK_KP_Up: key = "Special-UpArrow"; break; // joy up - case GDK_KP_Down: key = "Special-DownArrow"; break; // joy down + case GDK_KP_Left: + case GDK_KP_Right: + case GDK_KP_Up: + case GDK_KP_Down: + special_keypad_arrow_treatment(event->keyval); + return TRUE; + case 0xffbe: key = "F1"; break; case 0xffbf: key = "F2"; break; case 0xffc0: key = "F3"; break; Modified: trunk/roadmap/src/roadmap_start.c =================================================================== --- trunk/roadmap/src/roadmap_start.c 2015-06-29 22:02:49 UTC (rev 2903) +++ trunk/roadmap/src/roadmap_start.c 2015-06-30 15:00:30 UTC (rev 2904) @@ -1213,7 +1213,14 @@ "Special-PageDown" ROADMAP_MAPPED_TO "zoomout", // square "Special-Home" ROADMAP_MAPPED_TO "resumeroute", // X "Special-End" ROADMAP_MAPPED_TO "destination", // checkmark + "Special-LeftArrow" ROADMAP_MAPPED_TO "left", // joy button left + "Special-RightArrow" ROADMAP_MAPPED_TO "right", // joy button right + "Special-UpArrow" ROADMAP_MAPPED_TO "up", // joy button up + "Special-DownArrow" ROADMAP_MAPPED_TO "down", // joy button down + "Special-All-Arrows" ROADMAP_MAPPED_TO "resumeroute", // joy button all + "Special-All-Arrows" ROADMAP_MAPPED_TO "resumeroute", // mash the joy button down + /* These binding are for regular keyboards (case unsensitive !): */ "+" ROADMAP_MAPPED_TO "zoomin", "=" ROADMAP_MAPPED_TO "zoomin", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 22:02:51
|
Revision: 2903 http://sourceforge.net/p/roadmap/code/2903 Author: pgf Date: 2015-06-29 22:02:49 +0000 (Mon, 29 Jun 2015) Log Message: ----------- roadmap_trip: improve the voice announcement right around waypoints Modified Paths: -------------- trunk/roadmap/src/roadmap_trip.c Modified: trunk/roadmap/src/roadmap_trip.c =================================================================== --- trunk/roadmap/src/roadmap_trip.c 2015-06-29 22:02:45 UTC (rev 2902) +++ trunk/roadmap/src/roadmap_trip.c 2015-06-29 22:02:49 UTC (rev 2903) @@ -2358,6 +2358,7 @@ int waypoint_size; static RoadMapPosition lastgpsmap = {-1, -1}; static waypoint *within_waypoint = NULL; + static waypoint *say_within = NULL; static int distance_threshold_lesser; static int distance_threshold_greater; static int getting_close; @@ -2414,6 +2415,7 @@ (distance_to_next, (distance_to_next < waypoint_size), RoadMapTripNext); roadmap_message_unset ('W'); + within_waypoint = NULL; } else { /* we're still mid-route. if we've gotten within @@ -2452,6 +2454,7 @@ RoadMapTripNext->shortname, distance_to_next); within_waypoint = RoadMapTripNext; + say_within = within_waypoint; need_newgoal = 1; getting_close = 0; @@ -2504,6 +2507,8 @@ /* We've decided we're ready for the next waypoint. */ if (need_newgoal) { RoadMapTripNext = roadmap_trip_next(RoadMapTripNext); + distance_to_next = distance_to_directions = + roadmap_math_distance (&gps->map, &RoadMapTripNext->pos); } if (within_waypoint) { @@ -2518,24 +2523,29 @@ } - if (lastRoadMapTripNext != RoadMapTripNext || - distance_to_next < distance_threshold_lesser || - distance_to_next > distance_threshold_greater) { - char *dir; + if (roadmap_voice_idle()) { + if (lastRoadMapTripNext != RoadMapTripNext || + distance_to_next < distance_threshold_lesser || + distance_to_next > distance_threshold_greater) { + char *dir; - dir = roadmap_trip_angle_to_direction(roadmap_trip_next_point_angle()); - roadmap_message_set('1', dir); - dir = roadmap_trip_angle_to_direction(roadmap_trip_2nd_point_angle()); - roadmap_message_set('2', dir); + dir = roadmap_trip_angle_to_direction(roadmap_trip_next_point_angle()); + roadmap_message_set('1', dir); + dir = roadmap_trip_angle_to_direction(roadmap_trip_2nd_point_angle()); + roadmap_message_set('2', dir); - if (within_waypoint) - roadmap_voice_announce ("AtWaypoint", 0); - else - roadmap_voice_announce ("Waypoint", 1); + if (within_waypoint ) { + if (say_within == within_waypoint) + roadmap_voice_announce ("AtWaypoint", 1); + say_within = 0; + } else { + roadmap_voice_announce ("Waypoint", 1); + lastRoadMapTripNext = RoadMapTripNext; + } - roadmap_trip_new_threshold(distance_to_next, - &distance_threshold_lesser, &distance_threshold_greater); - lastRoadMapTripNext = RoadMapTripNext; + roadmap_trip_new_threshold(distance_to_next, + &distance_threshold_lesser, &distance_threshold_greater); + } } lastgpsmap = gps->map; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 22:02:47
|
Revision: 2902 http://sourceforge.net/p/roadmap/code/2902 Author: pgf Date: 2015-06-29 22:02:45 +0000 (Mon, 29 Jun 2015) Log Message: ----------- roadmap_voice: allow client to see if voice is idle before use Modified Paths: -------------- trunk/roadmap/src/roadmap_voice.c trunk/roadmap/src/roadmap_voice.h Modified: trunk/roadmap/src/roadmap_voice.c =================================================================== --- trunk/roadmap/src/roadmap_voice.c 2015-06-29 22:02:42 UTC (rev 2901) +++ trunk/roadmap/src/roadmap_voice.c 2015-06-29 22:02:45 UTC (rev 2902) @@ -57,9 +57,9 @@ static struct roadmap_voice_config RoadMapVoiceText[] = { {ROADMAP_CONFIG_ITEM("Voice", "AtWaypoint"), "flite" _EXE - " -t 'At waypoint, next is %1'"}, + " -t 'At waypoint, next is %2'"}, {ROADMAP_CONFIG_ITEM("Voice", "Waypoint"), "flite" _EXE - " -t 'Next is %W %1, pointing %2'|flite" _EXE " -t 'Destination %D %1'"}, + " -t 'Next is %W %1, second is %2'|flite" _EXE " -t 'Destination %D %1'"}, {ROADMAP_CONFIG_ITEM("Voice", "Approach"), "flite" _EXE " -t 'Approaching %N'"}, {ROADMAP_CONFIG_ITEM("Voice", "Current Street"), "flite" _EXE @@ -428,6 +428,9 @@ } } +int roadmap_voice_idle (void) { + return ! RoadMapVoiceInUse; +} void roadmap_voice_mute (void) { Modified: trunk/roadmap/src/roadmap_voice.h =================================================================== --- trunk/roadmap/src/roadmap_voice.h 2015-06-29 22:02:42 UTC (rev 2901) +++ trunk/roadmap/src/roadmap_voice.h 2015-06-29 22:02:45 UTC (rev 2902) @@ -24,6 +24,7 @@ #ifndef INCLUDE__ROADMAP_VOICE__H #define INCLUDE__ROADMAP_VOICE__H +int roadmap_voice_idle (void); void roadmap_voice_announce (const char *title, int force); void roadmap_voice_mute (void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 22:02:44
|
Revision: 2901 http://sourceforge.net/p/roadmap/code/2901 Author: pgf Date: 2015-06-29 22:02:42 +0000 (Mon, 29 Jun 2015) Log Message: ----------- buildmap_osm_text: don't tromp on random nodeid when creating a place Modified Paths: -------------- trunk/roadmap/src/buildmap_osm_text.c Modified: trunk/roadmap/src/buildmap_osm_text.c =================================================================== --- trunk/roadmap/src/buildmap_osm_text.c 2015-06-29 17:53:40 UTC (rev 2900) +++ trunk/roadmap/src/buildmap_osm_text.c 2015-06-29 22:02:42 UTC (rev 2901) @@ -847,7 +847,6 @@ /* this code looks like buildmap_osm_text_node_finish() */ point = buildmap_point_add(lon, lat); - buildmap_osm_text_point_add(ni.NodeId, point); if (wi.WayName && wi.WayTourism) { if (wi.WayLayer) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 17:53:43
|
Revision: 2900 http://sourceforge.net/p/roadmap/code/2900 Author: pgf Date: 2015-06-29 17:53:40 +0000 (Mon, 29 Jun 2015) Log Message: ----------- roadmap_sprite: until text scaling works right, don't scale the text boxes/rectangles i need to revisit this. but this is better than what was there. Modified Paths: -------------- trunk/roadmap/src/roadmap_sprite.c Modified: trunk/roadmap/src/roadmap_sprite.c =================================================================== --- trunk/roadmap/src/roadmap_sprite.c 2015-06-29 17:53:37 UTC (rev 2899) +++ trunk/roadmap/src/roadmap_sprite.c 2015-06-29 17:53:40 UTC (rev 2900) @@ -853,9 +853,11 @@ textseq = textsequence; } else if (sprite->textseq.object_count) { textseq = &sprite->textseq; +#if 0 if (text_bbox) roadmap_sprite_scale_bbox(text_bbox, &sprite->text_bbox, scale); text_bbox = &sprite->text_bbox; +#endif } if (bbox) roadmap_sprite_scale_bbox(bbox, &sprite->bbox, scale); @@ -883,7 +885,7 @@ static RoadmapSpriteDrawingSequence textpoly[1]; roadmap_sprite_box_sequence (sprite, textpoly, text_bbox); roadmap_sprite_place - (textpoly, location, -roadmap_math_get_orientation(), scale); + (textpoly, location, -roadmap_math_get_orientation(), 100); roadmap_canvas_draw_multiple_polygons (textpoly->object_count, textpoly->obj.objects, RoadMapSpritePoints, 1, RoadMapSpriteFastDraw); @@ -914,7 +916,7 @@ static RoadmapSpriteDrawingSequence textrect[1]; roadmap_sprite_box_sequence (sprite, textrect, text_bbox); roadmap_sprite_place - (textrect, location, -roadmap_math_get_orientation(), scale); + (textrect, location, -roadmap_math_get_orientation(), 100); roadmap_canvas_draw_multiple_lines (textrect->object_count, textrect->obj.objects, RoadMapSpritePoints, RoadMapSpriteFastDraw); @@ -938,7 +940,7 @@ int i; roadmap_sprite_place - (textseq, location, -roadmap_math_get_orientation(), scale); + (textseq, location, -roadmap_math_get_orientation(), 100); for (i = textseq->object_count - 1; i >= 0; i--) { const char *t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 17:53:39
|
Revision: 2899 http://sourceforge.net/p/roadmap/code/2899 Author: pgf Date: 2015-06-29 17:53:37 +0000 (Mon, 29 Jun 2015) Log Message: ----------- sprites: increase the thickness of the breadcrumb purple cross Modified Paths: -------------- trunk/roadmap/src/sprites Modified: trunk/roadmap/src/sprites =================================================================== --- trunk/roadmap/src/sprites 2015-06-29 17:53:33 UTC (rev 2898) +++ trunk/roadmap/src/sprites 2015-06-29 17:53:37 UTC (rev 2899) @@ -255,7 +255,7 @@ L -4,4 0,-4 4,4 S PurpleCross -F purple 1 +F purple 2 L -3,0 3,0 L 0,-3 0,3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 17:53:36
|
Revision: 2898 http://sourceforge.net/p/roadmap/code/2898 Author: pgf Date: 2015-06-29 17:53:33 +0000 (Mon, 29 Jun 2015) Log Message: ----------- roadmap_gps: display total satellite count Modified Paths: -------------- trunk/roadmap/src/roadgps_screen.c Modified: trunk/roadmap/src/roadgps_screen.c =================================================================== --- trunk/roadmap/src/roadgps_screen.c 2015-06-29 17:53:30 UTC (rev 2897) +++ trunk/roadmap/src/roadgps_screen.c 2015-06-29 17:53:33 UTC (rev 2898) @@ -342,13 +342,13 @@ char data[100]; RoadMapGuiPoint point; - int satcount, i, fix; + int actcount, i, fix; - satcount = 0; + actcount = 0; for (i = 0; i < RoadGpsSatelliteCount; ++i) if (RoadGpsSatellites[i].status == 'A') - satcount++; + actcount++; fix = RoadGpsPrecision.dimension; if (fix < 1) fix = 1; @@ -409,7 +409,8 @@ RoadGpsFrame.label_height-10; roadmap_canvas_select_pen (RoadGpsLabels); if (RoadGpsReception > GPS_RECEPTION_NO_COMM) { - sprintf(data,"%d active , %s fix", satcount, fixes[fix-1]); + sprintf(data,"%d/%d active , %s fix", actcount, + RoadGpsSatelliteCount, fixes[fix-1]); } else if (RoadGpsReception == GPS_RECEPTION_NO_COMM) { sprintf(data,"No data from GPS"); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 17:53:32
|
Revision: 2897 http://sourceforge.net/p/roadmap/code/2897 Author: pgf Date: 2015-06-29 17:53:30 +0000 (Mon, 29 Jun 2015) Log Message: ----------- roadmap_gps/gpsd3: fix gps status reporting i _think_ this will finally make the satellite counts accurate, and the presence of the GPS device will be tracked correctly. Modified Paths: -------------- trunk/roadmap/src/roadmap_gps.c trunk/roadmap/src/roadmap_gps.h trunk/roadmap/src/roadmap_gpsd3.c Modified: trunk/roadmap/src/roadmap_gps.c =================================================================== --- trunk/roadmap/src/roadmap_gps.c 2015-06-29 17:53:25 UTC (rev 2896) +++ trunk/roadmap/src/roadmap_gps.c 2015-06-29 17:53:30 UTC (rev 2897) @@ -231,9 +231,9 @@ RoadMapGpsLostFixMessage = roadmap_messagebox ("GPS Error", "GPS lost satellite fix"); RoadMapGPSLostFixTime = time(NULL); - // RoadMapGpsActiveSatelliteCount = 0; + //RoadMapGpsActiveSatelliteCount = 0; RoadMapLastKnownStatus = 'V'; - RoadMapGpsLatestData = 0; + //RoadMapGpsLatestData = 0; roadmap_gps_update_reception(); } } @@ -616,6 +616,12 @@ } } +void roadmap_gps_device_inactive(void) +{ + RoadMapGpsLatestData = 0; + roadmap_gps_update_reception(); +} + /* End of NMEA protocol support ---------------------------------------- */ @@ -697,12 +703,6 @@ static int active_count; - if (sequence < 0) { - RoadMapGpsLatestData = 0; - roadmap_gps_update_reception(); - sequence = 0; - } - if (sequence == 0) { /* End of list: propagate the information. */ @@ -1103,8 +1103,13 @@ RoadMapGpsRetryPending = 0; } +#if 0 + // this causes the system to think it's connected to a device when + // it may not be. it's definitely not needed for gpsd3. not sure + // about raw serial. other cases should be fixed as they're found. /* Give time for the whole system to initialize itself. */ roadmap_gps_got_data(); +#endif /* * Don't remove the keepalive, even if it isn't necessary for the connection : Modified: trunk/roadmap/src/roadmap_gps.h =================================================================== --- trunk/roadmap/src/roadmap_gps.h 2015-06-29 17:53:25 UTC (rev 2896) +++ trunk/roadmap/src/roadmap_gps.h 2015-06-29 17:53:30 UTC (rev 2897) @@ -132,6 +132,8 @@ void roadmap_gps_input (RoadMapIO *io); int roadmap_gps_active (void); +void roadmap_gps_device_inactive(void); + int roadmap_gps_estimated_error (void); int roadmap_gps_speed_accuracy (void); Modified: trunk/roadmap/src/roadmap_gpsd3.c =================================================================== --- trunk/roadmap/src/roadmap_gpsd3.c 2015-06-29 17:53:25 UTC (rev 2896) +++ trunk/roadmap/src/roadmap_gpsd3.c 2015-06-29 17:53:30 UTC (rev 2897) @@ -131,20 +131,20 @@ return 0; } -#ifdef THIS_DONT_WORK +#ifdef SADLY_THIS_DOESNT_WORK + // sigh. we get no reports at all while the gps is unplugged, + // ONLINE_SET never happens, and "online" is always 0. + roadmap_log (ROADMAP_DEBUG, "gpsd set 0x%x online_set %d", (unsigned int)gpsdp->set, gpsdp->set & ONLINE_SET); roadmap_log (ROADMAP_DEBUG, "gpsd online %d status %d dev_act %f", (int)gpsdp->online, gpsdp->status, gpsdp->dev.activated); - // we get no reports at all while the gps is unplugged, ONLINE_SET - // never happens, and "online" is always 0. if (!(gpsdp->set & ONLINE_SET)) return 0; if (!gpsdp->online) { - roadmap_gps_satellites (-1, 0, 0, 0, 0, 0); - roadmap_gps_navigation ('V', 0, 0, 0, 0, 0, 0); + roadmap_gps_device_inactive(); roadmap_log (ROADMAP_DEBUG, "gpsd: not online"); return 0; // No data } @@ -242,29 +242,32 @@ return 1; #else + int ret = 0; static int active, old_active = -1; // fprintf(stderr, "%s\n", sentence); + /* i'm sure the gpsd folks would scold me. when in NMEA mode, gpsd + * still emits json to indicate when the devices are + * activated/deactivated. this tells us whether there's really a + * device giving us data or not. so we "parse" the json, even + * though the gpsd docs say not to look at the wire protocol. + */ if (!strncmp(sentence, "{\"class\":",9)) /* } */ { // try to detect: {"class":"DEVICE","path":"/dev/ttyUSB1","activated":0} - roadmap_log (ROADMAP_DEBUG, "gpsd: found 'class'"); if (strstr(sentence, "\"activated\":0}")) { - roadmap_log (ROADMAP_DEBUG, "gpsd: not online"); + // roadmap_log (ROADMAP_DEBUG, "gpsd: not online"); active = 0; + if (old_active) + roadmap_gps_device_inactive(); } else if (strstr(sentence, "\"activated\":")) { // anything but '0' - roadmap_log (ROADMAP_DEBUG, "gpsd: online"); + // roadmap_log (ROADMAP_DEBUG, "gpsd: online"); active = 1; } - } else if (*sentence == '$') { - roadmap_log (ROADMAP_DEBUG, "gpsd: online with NMEA"); + } else if (*sentence == '$') { // then it's really NMEA, e.g. "$GPGGA" + // roadmap_log (ROADMAP_DEBUG, "gpsd: online with NMEA"); + ret = roadmap_nmea_decode (user_context, decoder_context, sentence); active = 1; } - if (active) - return roadmap_nmea_decode (user_context, decoder_context, sentence); - - if (old_active != active) { - roadmap_gps_satellites (active ? 0:-1, 0, 0, 0, 0, 0); - old_active = active; - } - return 0; + old_active = active; + return ret; #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-29 17:53:27
|
Revision: 2896 http://sourceforge.net/p/roadmap/code/2896 Author: pgf Date: 2015-06-29 17:53:25 +0000 (Mon, 29 Jun 2015) Log Message: ----------- roadmap_message: request display refresh when message parameters change Modified Paths: -------------- trunk/roadmap/src/roadmap_display.c trunk/roadmap/src/roadmap_message.c trunk/roadmap/src/roadmap_message.h Modified: trunk/roadmap/src/roadmap_display.c =================================================================== --- trunk/roadmap/src/roadmap_display.c 2015-06-28 16:19:44 UTC (rev 2895) +++ trunk/roadmap/src/roadmap_display.c 2015-06-29 17:53:25 UTC (rev 2896) @@ -774,7 +774,7 @@ } } - if (need_time_update || + if (need_time_update || roadmap_message_changed() || (RoadMapDisplayDeadline && now > RoadMapDisplayDeadline)) { roadmap_message_set ('T', thentime); RoadMapDisplayDeadline = 0; Modified: trunk/roadmap/src/roadmap_message.c =================================================================== --- trunk/roadmap/src/roadmap_message.c 2015-06-28 16:19:44 UTC (rev 2895) +++ trunk/roadmap/src/roadmap_message.c 2015-06-29 17:53:25 UTC (rev 2896) @@ -42,12 +42,20 @@ static char *RoadMapMessageParameters[128] = {NULL}; static int RoadMapMessagesUseTime; +static int RoadMapMessageChanged; int roadmap_message_time_in_use(void) { return RoadMapMessagesUseTime; } +int roadmap_message_changed(void) { + if (!RoadMapMessageChanged) return 0; + + RoadMapMessageChanged = 0; + return 1; +} + int roadmap_message_format (char *text, int length, const char *format) { char *f; @@ -131,6 +139,9 @@ * x Distance from one side of the screen to the other.<tr> * y Distance from the top to the bottom of the screen.</table> * + * 1 Angle (in vague english) to the next waypoint + * 2 Angle (in vague english) to the one after that waypoint + * * @param parameter indicates which message to set * @param format this and the next parameters are printf-style */ @@ -138,6 +149,7 @@ va_list ap; char value[256]; + int changed = 0; if (parameter <= 0) { roadmap_log (ROADMAP_ERROR, "invalid parameter code %d", parameter); @@ -147,8 +159,15 @@ va_start(ap, format); vsnprintf(value, sizeof(value), format, ap); va_end(ap); + + if ((RoadMapMessageParameters[parameter] == NULL) != (value[0] == 0)) { + changed = 1; + } if (RoadMapMessageParameters[parameter] != NULL) { + if (strcmp(RoadMapMessageParameters[parameter], value) != 0) { + changed = 1; + } free (RoadMapMessageParameters[parameter]); } if (value[0] == 0) { @@ -156,6 +175,8 @@ } else { RoadMapMessageParameters[parameter] = strdup (value); } + + if (changed) RoadMapMessageChanged = 1; } char *roadmap_message_get (int parameter) { @@ -175,5 +196,6 @@ if (RoadMapMessageParameters[parameter] != NULL) { free (RoadMapMessageParameters[parameter]); RoadMapMessageParameters[parameter] = NULL; + RoadMapMessageChanged = 1; } } Modified: trunk/roadmap/src/roadmap_message.h =================================================================== --- trunk/roadmap/src/roadmap_message.h 2015-06-28 16:19:44 UTC (rev 2895) +++ trunk/roadmap/src/roadmap_message.h 2015-06-29 17:53:25 UTC (rev 2896) @@ -31,5 +31,6 @@ int roadmap_message_format (char *text, int length, const char *format); int roadmap_message_time_in_use(void); +int roadmap_message_changed(void); #endif // INCLUDE__ROADMAP_MESSAGE__H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-28 16:19:46
|
Revision: 2895 http://sourceforge.net/p/roadmap/code/2895 Author: pgf Date: 2015-06-28 16:19:44 +0000 (Sun, 28 Jun 2015) Log Message: ----------- roadmap_trip: fix "at waypoint" voice announcements Modified Paths: -------------- trunk/roadmap/src/roadmap_trip.c Modified: trunk/roadmap/src/roadmap_trip.c =================================================================== --- trunk/roadmap/src/roadmap_trip.c 2015-06-28 16:19:41 UTC (rev 2894) +++ trunk/roadmap/src/roadmap_trip.c 2015-06-28 16:19:44 UTC (rev 2895) @@ -2416,10 +2416,23 @@ roadmap_message_unset ('W'); } else { + /* we're still mid-route. if we've gotten within + * "waypoint_size" of the waypoint, we're there, and can move + * on to the next. if we've gotten within twice that, we're + * close enough to consider ourselves "close". if we've been + * "close", but aren't anymore, we can move on if we're closer + * to the departure vector than the arrival vector. if we've + * never gotten close, we keep the current waypoint -- which + * is normal if we're still approaching, and unavoidably + * incorrect if we're now moving away. that's what the + * "resumeroute" command is for, to resynchronize us when + * we know we're doing the right thing, but missed the last + * waypoint. + */ int need_newgoal = 0; - if (within_waypoint != NULL) { + if (within_waypoint) { /* We really attained the waypoint, and may have now * left its minimal vicinity. If so, update on-screen * directions. @@ -2444,12 +2457,17 @@ } else if (distance_to_next < waypoint_size * 2) { - /* We're within the 2x vicinity. Do nothing yet. */ + /* We're within the 2x vicinity. Do nothing yet, but + * note that we got this close. + */ getting_close = 1; } else if (getting_close) { - /* If we got close (within 2x), but never quite there. */ + /* we were close (with 2x of waypoint_size, but never + * quite got there. if it looks like we're going the + * right way, switch to the next waypoint. + */ waypoint *goal = RoadMapTripNext; int distance = roadmap_math_distance (&gps->map, &goal->pos); @@ -2488,7 +2506,7 @@ RoadMapTripNext = roadmap_trip_next(RoadMapTripNext); } - if (within_waypoint != NULL) { + if (within_waypoint) { roadmap_trip_set_directions (distance_to_directions, (within_waypoint->description != NULL), within_waypoint); } else { @@ -2505,15 +2523,15 @@ distance_to_next > distance_threshold_greater) { char *dir; -if (distance_to_next < 200) -fprintf(stderr, "getting_close %d, within_waypoint %p\n", getting_close, within_waypoint); - dir = roadmap_trip_angle_to_direction(roadmap_trip_next_point_angle()); roadmap_message_set('1', dir); dir = roadmap_trip_angle_to_direction(roadmap_trip_2nd_point_angle()); roadmap_message_set('2', dir); - roadmap_voice_announce ("Waypoint", 1); + if (within_waypoint) + roadmap_voice_announce ("AtWaypoint", 0); + else + roadmap_voice_announce ("Waypoint", 1); roadmap_trip_new_threshold(distance_to_next, &distance_threshold_lesser, &distance_threshold_greater); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-28 16:19:43
|
Revision: 2894 http://sourceforge.net/p/roadmap/code/2894 Author: pgf Date: 2015-06-28 16:19:41 +0000 (Sun, 28 Jun 2015) Log Message: ----------- roadmap_voice: fix abbreviation expansion, add "At waypoint" message also, fixed misnaming of variables: they're not acronyms, they're abbreviations. Modified Paths: -------------- trunk/roadmap/src/roadmap_voice.c Modified: trunk/roadmap/src/roadmap_voice.c =================================================================== --- trunk/roadmap/src/roadmap_voice.c 2015-06-27 23:43:09 UTC (rev 2893) +++ trunk/roadmap/src/roadmap_voice.c 2015-06-28 16:19:41 UTC (rev 2894) @@ -56,11 +56,18 @@ ROADMAP_CONFIG_ITEM("Voice", "Mute"); static struct roadmap_voice_config RoadMapVoiceText[] = { - {ROADMAP_CONFIG_ITEM("Voice", "Waypoint"), "flite" _EXE " -t 'Next is %W %1, pointing %2'|flite" _EXE " -t 'Destination %D %1'"}, - {ROADMAP_CONFIG_ITEM("Voice", "Approach"), "flite" _EXE " -t 'Approaching %N'"}, - {ROADMAP_CONFIG_ITEM("Voice", "Current Street"), "flite" _EXE " -t 'On %N'"}, - {ROADMAP_CONFIG_ITEM("Voice", "Next Intersection"), "flite" _EXE " -t 'Next intersection: %N'"}, - {ROADMAP_CONFIG_ITEM("Voice", "Selected Street"), "flite" _EXE " -t 'Selected %N'"}, + {ROADMAP_CONFIG_ITEM("Voice", "AtWaypoint"), "flite" _EXE + " -t 'At waypoint, next is %1'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Waypoint"), "flite" _EXE + " -t 'Next is %W %1, pointing %2'|flite" _EXE " -t 'Destination %D %1'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Approach"), "flite" _EXE + " -t 'Approaching %N'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Current Street"), "flite" _EXE + " -t 'On %N'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Next Intersection"), "flite" _EXE + " -t 'Next intersection: %N'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Selected Street"), "flite" _EXE + " -t 'Selected %N'"}, {ROADMAP_CONFIG_ITEM_EMPTY, NULL} }; @@ -252,10 +259,11 @@ static int roadmap_voice_expand (const char *input, char *output, int size) { int length; - int acronym_length; - const char *acronym; + int abbrev_length; + const char *abbrev; struct voice_translation *cursor; - const char *acronym_found; + const char *abbrev_found; + int abbrev_at_start; struct voice_translation *cursor_found; for (;;) { @@ -264,17 +272,17 @@ return 0; } - acronym = input; - acronym_length = 0; - acronym_found = input + strlen(input); + abbrev = input; + abbrev_length = 0; + abbrev_found = input + strlen(input); cursor_found = NULL; for (cursor = RoadMapVoiceTranslate1; cursor->from != NULL; ++cursor) { - acronym = strstr (input, cursor->from); - if (acronym != NULL) { - if (acronym < acronym_found) { - acronym_found = acronym; + abbrev = strstr (input, cursor->from); + if (abbrev != NULL) { + if (abbrev < abbrev_found) { + abbrev_found = abbrev; cursor_found = cursor; } } @@ -282,23 +290,23 @@ for (cursor = RoadMapVoiceTranslate2; cursor->from != NULL; ++cursor) { - acronym = strstr (input, cursor->from); - if (acronym != NULL) { - if (acronym < acronym_found) { - acronym_found = acronym; + abbrev = strstr (input, cursor->from); + if (abbrev != NULL) { + if (abbrev < abbrev_found) { + abbrev_found = abbrev; cursor_found = cursor; - } else if (acronym == acronym_found) { + } else if (abbrev == abbrev_found) { int count = 0; int word_end = strlen(cursor->from); - if (acronym[word_end] == ' ') { - while (isalpha(acronym[++word_end])) ++count; + if (abbrev[word_end] == ' ') { + while (isalpha(abbrev[++word_end])) ++count; } if (count > 2) { /* Chance are this is a prefix. */ - acronym_found = acronym; + abbrev_found = abbrev; cursor_found = cursor; } } @@ -310,26 +318,27 @@ return 1; } - acronym = acronym_found; + abbrev = abbrev_found; + abbrev_at_start = (abbrev_found == input); cursor = cursor_found; - acronym_length = strlen(cursor->from); + abbrev_length = strlen(cursor->from); - length = acronym - input; + length = abbrev - input; if (length > size) return 0; - /* Copy the unexpanded part, up to the acronym that was found. */ + /* Copy the unexpanded part, up to the abbreviation that was found. */ strncpy (output, input, length); output += length; size -= length; if (size <= 0) return 0; - if ((acronym_length != 0) && - (acronym[acronym_length] == 0 || - (! isalnum(acronym[acronym_length])))) { - - /* This is a valid acronym: translate it. */ + if (abbrev_length != 0 && + !isalnum(abbrev[abbrev_length]) && + (!abbrev_at_start && !isalnum(abbrev[-1])) + ) { + /* This is a valid abbreviation: translate it. */ length = strlen(cursor->to); strncpy (output, cursor->to, size); output += length; @@ -338,13 +347,13 @@ if (size <= 0) return 0; } else { - /* This is not a valid acronym: leave it unchanged. */ - strncpy (output, acronym, acronym_length); - output += acronym_length; - size -= acronym_length; + /* This is not a valid abbreviation: leave it unchanged. */ + strncpy (output, abbrev, abbrev_length); + output += abbrev_length; + size -= abbrev_length; } - input = acronym + acronym_length; + input = abbrev + abbrev_length; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-27 23:43:11
|
Revision: 2893 http://sourceforge.net/p/roadmap/code/2893 Author: pgf Date: 2015-06-27 23:43:09 +0000 (Sat, 27 Jun 2015) Log Message: ----------- buildmap_osm_text: compilation warning suppression Modified Paths: -------------- trunk/roadmap/src/buildmap_osm_text.c Modified: trunk/roadmap/src/buildmap_osm_text.c =================================================================== --- trunk/roadmap/src/buildmap_osm_text.c 2015-06-27 23:42:28 UTC (rev 2892) +++ trunk/roadmap/src/buildmap_osm_text.c 2015-06-27 23:43:09 UTC (rev 2893) @@ -1212,7 +1212,7 @@ time_t t[10]; int passid, NumNodes, NumWays; struct stat st; - wayid_t interesting_way; + wayid_t interesting_way = 0; int in_relation; int need_xml_header = 1; int need_osm_header = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-27 23:42:31
|
Revision: 2892 http://sourceforge.net/p/roadmap/code/2892 Author: pgf Date: 2015-06-27 23:42:28 +0000 (Sat, 27 Jun 2015) Log Message: ----------- roadmap_trip: fix angle calculation for voice announcements "math is hard" Modified Paths: -------------- trunk/roadmap/src/roadmap_trip.c Modified: trunk/roadmap/src/roadmap_trip.c =================================================================== --- trunk/roadmap/src/roadmap_trip.c 2015-06-26 22:00:20 UTC (rev 2891) +++ trunk/roadmap/src/roadmap_trip.c 2015-06-27 23:42:28 UTC (rev 2892) @@ -2246,9 +2246,10 @@ /* each direction represents 45 degrees (out of 360). * the "ahead" pie-shaped segment is between -22.5 and 22.5 degrees. */ + angle += 22; // close enough while (angle > 360) angle -= 360; while (angle < 0) angle += 360; - return directions[(angle * 10 + 225) / 450]; + return directions[angle / 45]; } static int roadmap_trip_2nd_point_state(void) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:22
|
Revision: 2891 http://sourceforge.net/p/roadmap/code/2891 Author: pgf Date: 2015-06-26 22:00:20 +0000 (Fri, 26 Jun 2015) Log Message: ----------- roadmap_trip: change "Okay" to "Done" when all it does is cancel in many roadmap dialogs, "cancel" and "okay" are the same thing -- all the button really does is give a consistent way to dismiss the window. rename it to "Done" so it's more obvious that one doesn't need to use it. Modified Paths: -------------- trunk/roadmap/src/roadmap_trip.c Modified: trunk/roadmap/src/roadmap_trip.c =================================================================== --- trunk/roadmap/src/roadmap_trip.c 2015-06-26 22:00:17 UTC (rev 2890) +++ trunk/roadmap/src/roadmap_trip.c 2015-06-26 22:00:20 UTC (rev 2891) @@ -1165,7 +1165,7 @@ roadmap_dialog_add_button ("Edit", roadmap_trip_waypoint_manage_dialog_edit); roadmap_dialog_add_button - ("Okay", roadmap_trip_dialog_cancel); + ("Done", roadmap_trip_dialog_cancel); roadmap_dialog_add_button ("Destination", roadmap_trip_set_nav_destination); roadmap_dialog_add_button @@ -1391,7 +1391,7 @@ roadmap_dialog_add_button ("Delete", roadmap_trip_route_manage_dialog_delete); roadmap_dialog_add_button ("Edit", roadmap_trip_route_manage_dialog_edit); roadmap_dialog_add_button ("None", roadmap_trip_route_manage_dialog_none); - roadmap_dialog_add_button ("Okay", roadmap_trip_dialog_cancel); + roadmap_dialog_add_button ("Done", roadmap_trip_dialog_cancel); roadmap_dialog_complete (0); /* No need for a keyboard. */ } @@ -1417,7 +1417,7 @@ roadmap_dialog_add_button ("Restore", roadmap_trip_route_manage_dialog_restore); - roadmap_dialog_add_button ("Okay", roadmap_trip_dialog_cancel); + roadmap_dialog_add_button ("Done", roadmap_trip_dialog_cancel); roadmap_dialog_complete (0); /* No need for a keyboard. */ } @@ -3414,7 +3414,7 @@ roadmap_dialog_new_list ("Names", ".Places"); roadmap_dialog_add_button - ("Okay", roadmap_trip_dialog_cancel); + ("Done", roadmap_trip_dialog_cancel); roadmap_dialog_complete (0); /* No need for a keyboard. */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:19
|
Revision: 2890 http://sourceforge.net/p/roadmap/code/2890 Author: pgf Date: 2015-06-26 22:00:17 +0000 (Fri, 26 Jun 2015) Log Message: ----------- roadmap_factory: fix core dump when showing all key bindings Modified Paths: -------------- trunk/roadmap/src/roadmap_factory.c Modified: trunk/roadmap/src/roadmap_factory.c =================================================================== --- trunk/roadmap/src/roadmap_factory.c 2015-06-26 22:00:14 UTC (rev 2889) +++ trunk/roadmap/src/roadmap_factory.c 2015-06-26 22:00:17 UTC (rev 2890) @@ -987,10 +987,12 @@ static void roadmap_factory_show_keymap (void) { const struct RoadMapFactoryKeyMap *binding; + int i; printf ("\nKEYMAP:\n"); - for (binding = RoadMapFactoryBindings; binding->key != NULL; ++binding) { + for (i = 0; i < RoadMapFactoryBindingsMax; ++i) { + binding = &RoadMapFactoryBindings[i]; const RoadMapAction *action = binding->action; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:16
|
Revision: 2889 http://sourceforge.net/p/roadmap/code/2889 Author: pgf Date: 2015-06-26 22:00:14 +0000 (Fri, 26 Jun 2015) Log Message: ----------- gtk2/roadmap_fileselection.c: increase usable space in dialog we lose the move/rename/newfolder buttons, but the space is more important right now. Modified Paths: -------------- trunk/roadmap/src/gtk2/roadmap_fileselection.c Modified: trunk/roadmap/src/gtk2/roadmap_fileselection.c =================================================================== --- trunk/roadmap/src/gtk2/roadmap_fileselection.c 2015-06-26 22:00:11 UTC (rev 2888) +++ trunk/roadmap/src/gtk2/roadmap_fileselection.c 2015-06-26 22:00:14 UTC (rev 2889) @@ -143,6 +143,13 @@ if (current_directory[0] != 0) { chdir (current_directory); } + + /* these buttons could be useful (rename, delete, new folder), but + * they cause less space for the filename lists, which is at a + * premium. i tend to manipulate files outside of roadmap anyway. + */ + gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION(item->dialog)); + } item->mode = mode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:13
|
Revision: 2888 http://sourceforge.net/p/roadmap/code/2888 Author: pgf Date: 2015-06-26 22:00:11 +0000 (Fri, 26 Jun 2015) Log Message: ----------- gtk2/roadmap_dialog: don't set "default" indication on okay button Modified Paths: -------------- trunk/roadmap/src/gtk2/roadmap_dialog.c Modified: trunk/roadmap/src/gtk2/roadmap_dialog.c =================================================================== --- trunk/roadmap/src/gtk2/roadmap_dialog.c 2015-06-26 22:00:08 UTC (rev 2887) +++ trunk/roadmap/src/gtk2/roadmap_dialog.c 2015-06-26 22:00:11 UTC (rev 2888) @@ -644,12 +644,8 @@ g_signal_connect (button, "clicked", (GCallback) roadmap_dialog_action, child); - GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog->w)->action_area), button, TRUE, FALSE, 0); - - gtk_widget_grab_default (button); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:10
|
Revision: 2887 http://sourceforge.net/p/roadmap/code/2887 Author: pgf Date: 2015-06-26 22:00:08 +0000 (Fri, 26 Jun 2015) Log Message: ----------- more sprites cleanup mostly removing redundant polygon closures, but also added a white separator for the halves of the big arrows. Modified Paths: -------------- trunk/roadmap/src/sprites Modified: trunk/roadmap/src/sprites =================================================================== --- trunk/roadmap/src/sprites 2015-06-26 22:00:05 UTC (rev 2886) +++ trunk/roadmap/src/sprites 2015-06-26 22:00:08 UTC (rev 2887) @@ -152,11 +152,13 @@ # visibility on low-contrast displays S OutlinedBlueDart F white 1 -P 11,19 0,-3 -11,19 0,13 11,19 +P 11,19 0,-3 -11,19 0,13 F darkblue 1 -P 0,1 6,14 0,10 0,1 +P 0,1 6,14 0,10 F aqua 1 -P 0,1 -6,14 0,10 0,1 +P 0,1 -6,14 0,10 +F white 1 +L 0,1 0,10 F black 2 L 11,19 0,-3 -11,19 0,13 11,19 @@ -168,7 +170,7 @@ S PurpleTriangle F Purple 1 -P 0,-10 -9,5 9,5 0,-10 +P 0,-10 -9,5 9,5 S CrossHair F white 3 @@ -219,7 +221,7 @@ S GreenTrianglePointer F green 2 -P 0,-9 -8,4 8,4 0,-9 +P 0,-9 -8,4 8,4 F black 1 L 0,-9 -8,4 8,4 0,-9 L 1,-8 1,-16 @@ -242,7 +244,7 @@ F black 1 L 5,5 5,-5 -5,-5 -5,5 5,5 F green 1 -P 4,4 4,-4 -4,-4 -4,4 4,4 +P 4,4 4,-4 -4,-4 -4,4 S PurpleChevron F purple 2 @@ -366,35 +368,24 @@ L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 -S XBigGreenDart -F green 1 -P -9,13 0,8 9,13 0,-13 -F black 2 -L 0,8 9,13 0,-13 -L 0,8 -9,13 0,-13 - S BigGreenDart F green 1 P 0,8 9,13 0,-13 F lightgreen 1 P 0,8 -9,13 0,-13 +F white 1 +L 0,8 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 -S xxBigGreenDart -F black 1 -P -13,13 0,12 13,13 0,-17 -F white 1 -P -11,13 0,10 11,13 0,-15 -F green 1 -P -9,13 0,8 9,13 0,-13 - S BigYellowDart F gold 1 P 0,8 9,13 0,-13 F yellow 1 P 0,8 -9,13 0,-13 +F white 1 +L 0,8 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 @@ -404,6 +395,8 @@ P 0,8 9,13 0,-13 F salmon 1 P 0,8 -9,13 0,-13 +F white 1 +L 0,8 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 @@ -564,8 +557,8 @@ C 0,0 15 F white 1 C 0,0 16 -P -5,-8 6,-8 2,8 -9,8 -5,-8 -P 6,-8 5,7 8,7 6,-8 +P -5,-8 6,-8 2,8 -9,8 +P 6,-8 5,7 8,7 F black 1 L -5,-8 6,-8 2,8 -9,8 -5,-8 L 5,7 8,7 6,-8 @@ -616,7 +609,7 @@ S Money F lightgreen 1 -P -7,-4 7,-4 7,4 -7,4 -7,-4 +P -7,-4 7,-4 7,4 -7,4 F black 1 L -7,-4 7,-4 7,4 -7,4 -7,-4 D 0,0 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:07
|
Revision: 2886 http://sourceforge.net/p/roadmap/code/2886 Author: pgf Date: 2015-06-26 22:00:05 +0000 (Fri, 26 Jun 2015) Log Message: ----------- sprites: make the GPS pointer and direction arrows more visible Modified Paths: -------------- trunk/roadmap/src/sprites Modified: trunk/roadmap/src/sprites =================================================================== --- trunk/roadmap/src/sprites 2015-06-26 22:00:02 UTC (rev 2885) +++ trunk/roadmap/src/sprites 2015-06-26 22:00:05 UTC (rev 2886) @@ -41,7 +41,7 @@ # This makes it easier to change the representation of a specific object. S GPS -A BlueDart +A OutlinedBlueDart S Friend A GreenTriangle @@ -148,16 +148,17 @@ P 0,1 6,13 0,10 -6,13 L 8,11 0,-3 -8,11 -# same as "BlueDart", but with a bigger black -# outline for visibility on low-contrast displays +# similar to "BlueDart", but set up for better +# visibility on low-contrast displays S OutlinedBlueDart -F white 2 -L 0,0 7,14 0,8 -7,14 -L 11,17 0,-3 -11,17 0,14 11,17 -F blue 1 -P 0,1 6,13 0,10 -6,13 -F black 1 -L 11,17 0,-3 -11,17 0,14 11,17 +F white 1 +P 11,19 0,-3 -11,19 0,13 11,19 +F darkblue 1 +P 0,1 6,14 0,10 0,1 +F aqua 1 +P 0,1 -6,14 0,10 0,1 +F black 2 +L 11,19 0,-3 -11,19 0,13 11,19 S GreenTriangle F white 2 @@ -365,23 +366,44 @@ L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 -S BigGreenDart +S XBigGreenDart F green 1 P -9,13 0,8 9,13 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 +S BigGreenDart +F green 1 +P 0,8 9,13 0,-13 +F lightgreen 1 +P 0,8 -9,13 0,-13 +F black 2 +L 0,8 9,13 0,-13 +L 0,8 -9,13 0,-13 + +S xxBigGreenDart +F black 1 +P -13,13 0,12 13,13 0,-17 +F white 1 +P -11,13 0,10 11,13 0,-15 +F green 1 +P -9,13 0,8 9,13 0,-13 + S BigYellowDart +F gold 1 +P 0,8 9,13 0,-13 F yellow 1 -P -9,13 0,8 9,13 0,-13 +P 0,8 -9,13 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 S BigRedDart F red 1 -P -9,13 0,8 9,13 0,-13 +P 0,8 9,13 0,-13 +F salmon 1 +P 0,8 -9,13 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:04
|
Revision: 2885 http://sourceforge.net/p/roadmap/code/2885 Author: pgf Date: 2015-06-26 22:00:02 +0000 (Fri, 26 Jun 2015) Log Message: ----------- roadmap.screenobjects: enable Direction_2nd pointer can't remember why it was disabled Modified Paths: -------------- trunk/roadmap/src/roadmap.screenobjects Modified: trunk/roadmap/src/roadmap.screenobjects =================================================================== --- trunk/roadmap/src/roadmap.screenobjects 2015-06-26 21:59:58 UTC (rev 2884) +++ trunk/roadmap/src/roadmap.screenobjects 2015-06-26 22:00:02 UTC (rev 2885) @@ -100,14 +100,14 @@ E Direction_Next A nextpoint -# # The Direction_2nd object points to waypoint after the next. -# # relative to the current direction of travel. This can be -# # useful to see which way the route will go at the next turning. -# N Direction_2nd -# S get_direction_2nd -# P -20 140 -# E Direction_2nd -# A 2ndpoint +# The Direction_2nd object points to waypoint after the next. +# relative to the current direction of travel. This can be +# useful to see which way the route will go at the next turning. +N Direction_2nd +S get_direction_2nd +P -20 140 +E Direction_2nd +A 2ndpoint # The Direction_Dest object points to the route's last waypoint, # relative to the direction of travel. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-26 22:00:01
|
Revision: 2884 http://sourceforge.net/p/roadmap/code/2884 Author: pgf Date: 2015-06-26 21:59:58 +0000 (Fri, 26 Jun 2015) Log Message: ----------- default/All: change park/nature land from green to light green Modified Paths: -------------- trunk/roadmap/src/default/All Modified: trunk/roadmap/src/default/All =================================================================== --- trunk/roadmap/src/default/All 2015-06-25 23:10:48 UTC (rev 2883) +++ trunk/roadmap/src/default/All 2015-06-26 21:59:58 UTC (rev 2884) @@ -79,7 +79,7 @@ .Declutter: 1300 .Thickness: 1 .Speed: 1 -Parks.Color: green +Parks.Color: lightgreen .Declutter: 600 .Thickness: 1 .Speed: 30 @@ -91,7 +91,7 @@ .Thickness: 2 .Declutter: 2147483647 .Speed: 1 -Nature.Color: green +Nature.Color: lightgreen .Declutter: 600 .Thickness: 1 .Speed: 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-25 23:10:50
|
Revision: 2883 http://sourceforge.net/p/roadmap/code/2883 Author: pgf Date: 2015-06-25 23:10:48 +0000 (Thu, 25 Jun 2015) Log Message: ----------- roadmap_factory: allow loading keybinding from config files new "roadmap.keys" file contains "key = action" pairs Modified Paths: -------------- trunk/roadmap/src/roadgps_start.c trunk/roadmap/src/roadmap_factory.c trunk/roadmap/src/roadmap_factory.h trunk/roadmap/src/roadmap_start.c Modified: trunk/roadmap/src/roadgps_start.c =================================================================== --- trunk/roadmap/src/roadgps_start.c 2015-06-25 23:10:44 UTC (rev 2882) +++ trunk/roadmap/src/roadgps_start.c 2015-06-25 23:10:48 UTC (rev 2883) @@ -106,8 +106,6 @@ "Q" ROADMAP_MAPPED_TO "quit", "R" ROADMAP_MAPPED_TO "record", "S" ROADMAP_MAPPED_TO "stop", - - NULL }; @@ -261,7 +259,8 @@ roadmap_config_load (); - roadmap_factory_keymap (RoadGpsStartActions, RoadGpsStartKeyBinding); + roadmap_factory_keymap (RoadGpsStartActions, RoadGpsStartKeyBinding, + sizeof(RoadGpsStartKeyBinding)/sizeof(*RoadGpsStartKeyBinding)); roadmap_option (argc, argv, 1, roadgps_start_usage); Modified: trunk/roadmap/src/roadmap_factory.c =================================================================== --- trunk/roadmap/src/roadmap_factory.c 2015-06-25 23:10:44 UTC (rev 2882) +++ trunk/roadmap/src/roadmap_factory.c 2015-06-25 23:10:48 UTC (rev 2883) @@ -38,6 +38,7 @@ #include "roadmap_help.h" #include "roadmap_path.h" #include "roadmap_input.h" +#include "roadmap_scan.h" #include "roadmap_math.h" #include "roadmap_lang.h" #include "roadmap_start.h" @@ -172,6 +173,8 @@ * @brief */ static struct RoadMapFactoryKeyMap *RoadMapFactoryBindings = NULL; +static int RoadMapFactoryBindingsAlloced = 0; +static int RoadMapFactoryBindingsMax = 0; /** * @brief @@ -193,28 +196,41 @@ * @brief * @param key */ -static void roadmap_factory_keyboard (char *key) { +static struct RoadMapFactoryKeyMap *roadmap_factory_keyboard_find (char *key) +{ - const struct RoadMapFactoryKeyMap *binding; + struct RoadMapFactoryKeyMap *binding; + int i; - if (roadmap_start_return_to_map()) return; + if (roadmap_start_return_to_map()) return NULL; - if (RoadMapFactoryBindings == NULL) return; + if (RoadMapFactoryBindings == NULL) return NULL; - for (binding = RoadMapFactoryBindings; binding->key != NULL; ++binding) { - + for (i = 0; i < RoadMapFactoryBindingsMax; ++i) { + binding = &RoadMapFactoryBindings[i]; + /* interesting: key bindings are case-insensitive */ if (strcasecmp (binding->key, key) == 0) { - if (binding->action != NULL) { - RoadMapCallback callback = binding->action->callback; - if (callback != NULL) { - (*callback) (); - break; - } - } + return binding; } } + return NULL; } +static void roadmap_factory_keyboard (char *key) { + + const struct RoadMapFactoryKeyMap *binding; + + binding = roadmap_factory_keyboard_find (key); + if (binding == NULL) return; + + if (binding->action != NULL) { + RoadMapCallback callback = binding->action->callback; + if (callback != NULL) { + (*callback) (); + } + } +} + /** * @brief * @param menu @@ -851,95 +867,118 @@ roadmap_plugin_actions_menu(roadmap_factory_handle_plugin_actions_menu); } +static char *RoadMapFactoryKeyMapFile; +static int RoadMapFactoryKeyMapLine; + +static void roadmap_factory_key_syntax(char *msg) +{ + roadmap_log(ROADMAP_WARNING, + "%s, line %d: %s", + RoadMapFactoryKeyMapFile, + RoadMapFactoryKeyMapLine, + msg); +} + /** * @brief * @param actions * @param shortcuts */ -void roadmap_factory_keymap (RoadMapAction *actions, - const char *shortcuts[]) { +int roadmap_factory_keymap (RoadMapAction *actions, + const char *shortcuts[], + int ncuts) { int i; - if (RoadMapFactoryBindings != NULL) { - roadmap_log (ROADMAP_FATAL, "RoadMap factory was called twice"); - } + if (ncuts <= 0) + return 0; - /* Count how many shortcuts we have to process. */ - for (i = 0; shortcuts[i] != NULL; ++i) ; + /* Augment the keyboard mapping table. */ - /* Create the keyboard mapping table. */ + /* assume that all the these bindings are new, not duplicates */ + RoadMapFactoryBindingsAlloced += ncuts; + RoadMapFactoryBindings = (struct RoadMapFactoryKeyMap *) + realloc(RoadMapFactoryBindings, sizeof(*RoadMapFactoryBindings) * + RoadMapFactoryBindingsAlloced); + roadmap_check_allocated(RoadMapFactoryBindings); - if (i > 0) { + for (i = 0; i < ncuts; ++i) { - int j = 0; + char *text; + char *separator; + char *p; + RoadMapAction *this_action; + struct RoadMapFactoryKeyMap *binding; + int length; - RoadMapFactoryBindings = - (struct RoadMapFactoryKeyMap *) - calloc (i+1, sizeof(struct RoadMapFactoryKeyMap)); - roadmap_check_allocated(RoadMapFactoryBindings); - for (i = 0; shortcuts[i] != NULL; ++i) { + if (!*shortcuts[i]) continue; + if (*shortcuts[i] == '#') continue; - char *text; - char *separator; - RoadMapAction *this_action; + text = strdup (shortcuts[i]); + roadmap_check_allocated(text); - text = strdup (shortcuts[i]); - roadmap_check_allocated(text); - separator = strstr (text, ROADMAP_MAPPED_TO); - if (separator != NULL) { + separator = strstr (text, ROADMAP_MAPPED_TO); + if (separator == NULL) { + roadmap_factory_key_syntax("no separator found"); + free(text); + continue; + } - char *p; - /* Separate the name of the key from the name of the action. */ + /* Separate the name of the key from the name of the action. */ + for (p = separator; *p <= ' '; --p) *p = 0; + p = separator + strlen(ROADMAP_MAPPED_TO); + while (*p <= ' ') ++p; - for (p = separator; *p <= ' '; --p) *p = 0; + length = strlen(p); + if (p[length-1] == '\n') p[length-1] = '\0'; + this_action = roadmap_factory_find_action (actions, p); - p = separator + strlen(ROADMAP_MAPPED_TO); - while (*p <= ' ') ++p; + if (this_action == NULL) { + free(text); + continue; + } - this_action = roadmap_factory_find_action (actions, p); + length = strlen(text); + if (length > RoadMapFactoryKeyLength) { + RoadMapFactoryKeyLength = length; + } + /* copy key binding strings to the action, for + * help/tip usage. but don't attach "Special-" + * bindings, since they're platform specific. + * this should probably change to allow including + * the special keys for some specified (at build + * time? at run-time?) platform. + */ + if (strncmp(text, "Special-", 8) != 0) { // not Special- + if (this_action->key) { + char keys[128]; + snprintf(keys, 128, "%s, %s", this_action->key, text); + /* this leaks if more than two keys for one + * action. oh well. + */ + this_action->key = strdup(keys); + } else { + this_action->key = text; + } + } + /* this search turns this into an O(n^^2) operation. but it's + * only keybindings */ + binding = roadmap_factory_keyboard_find (text); + if (binding) { /* the binding already exists, replace it */ + binding->action = this_action; + } else { + RoadMapFactoryBindings[RoadMapFactoryBindingsMax].key = text; + RoadMapFactoryBindings[RoadMapFactoryBindingsMax].action = this_action; + RoadMapFactoryBindingsMax++; + } + } - if (this_action != NULL) { + roadmap_main_set_keyboard (roadmap_factory_keyboard); - int length = strlen(text); - - if (length > RoadMapFactoryKeyLength) { - RoadMapFactoryKeyLength = length; - } - /* copy key binding strings to the action, for - * help/tip usage. but don't attach "Special-" - * bindings, since they're platform specific. - * this should probably change to allow including - * the special keys for some specified (at build - * time? at run-time?) platform. - */ - if (strncmp(text, "Special-", 8) != 0) { - if (this_action->key) { - char keys[128]; - snprintf(keys, 128, "%s, %s", this_action->key, text); - /* this leaks if more than two keys for one - * action. oh well. - */ - this_action->key = strdup(keys); - } else { - this_action->key = text; - } - } - RoadMapFactoryBindings[j].key = text; - RoadMapFactoryBindings[j].action = this_action; - ++j; - } else { - free(text); - } - } - } - RoadMapFactoryBindings[j].key = NULL; - - roadmap_main_set_keyboard (roadmap_factory_keyboard); - } + return 1; } /** @@ -1013,11 +1052,64 @@ } } +static void roadmap_factory_load_file (RoadMapAction *actions, const char *path) +{ + FILE *file; + char line[1024]; + const char *lines[] = { line }; + + if ((file = roadmap_file_fopen (path, "roadmap.keys", "r")) == NULL) { + roadmap_log (ROADMAP_ERROR, "cannot open file 'roadmap.keys' in %s", path); + return; + } + + RoadMapFactoryKeyMapFile = roadmap_path_join(path, "roadmap.keys"); + RoadMapFactoryKeyMapLine = 1; + + + while (!feof(file)) { + if (fgets (line, sizeof(line), file) == NULL) + break; + if (roadmap_factory_keymap (actions, lines, 1) == 0) + break; + RoadMapFactoryKeyMapLine++; + } + + fclose (file); + + free(RoadMapFactoryKeyMapFile); +} + + +void roadmap_factory_load (RoadMapAction *actions) +{ + const char *cursor; + + for (cursor = roadmap_scan ("config", "roadmap.keys"); + cursor != NULL; + cursor = roadmap_scan_next ("config", "roadmap.keys", cursor)) { + roadmap_factory_load_file (actions, cursor); + } + + for (cursor = roadmap_scan ("user", "roadmap.keys"); + cursor != NULL; + cursor = roadmap_scan_next ("user", "roadmap.keys", cursor)) { + + roadmap_factory_load_file (actions, cursor); + } + + if (RoadMapFactoryBindings == NULL) { + roadmap_log (ROADMAP_WARNING, + "roadmap_factory_load: no key roadmap.keys found"); + } + +} /** * @brief initialize */ void roadmap_factory_initialize (void) { + RoadMapFactoryKeyMapFile = "internal bindings"; } /** @@ -1025,9 +1117,9 @@ */ void roadmap_factory_shutdown (void) { - RoadMapFactoryBindings = NULL; RoadMapFactoryMenuPopupCount = 0; RoadMapFactoryBindings = NULL; + RoadMapFactoryBindingsMax = 0; RoadMapFactoryKeyLength = 0; RoadMapFactoryPopupList = NULL; } Modified: trunk/roadmap/src/roadmap_factory.h =================================================================== --- trunk/roadmap/src/roadmap_factory.h 2015-06-25 23:10:44 UTC (rev 2882) +++ trunk/roadmap/src/roadmap_factory.h 2015-06-25 23:10:48 UTC (rev 2883) @@ -66,14 +66,15 @@ const char *menu[], const char *toolbar[]); -void roadmap_factory_keymap (RoadMapAction *actions, - const char *shortcuts[]); +int roadmap_factory_keymap (RoadMapAction *actions, + const char *shortcuts[], int ncuts); void roadmap_factory_popup (const char *title, const RoadMapGuiPoint *position); void roadmap_factory_usage (const char *section, const RoadMapAction *action); void roadmap_factory_initialize (void); +void roadmap_factory_load (RoadMapAction *actions); void roadmap_factory_shutdown (void); #endif /* INCLUDE__ROADMAP_FACTORY__H */ Modified: trunk/roadmap/src/roadmap_start.c =================================================================== --- trunk/roadmap/src/roadmap_start.c 2015-06-25 23:10:44 UTC (rev 2882) +++ trunk/roadmap/src/roadmap_start.c 2015-06-25 23:10:48 UTC (rev 2883) @@ -1245,7 +1245,6 @@ "Y" ROADMAP_MAPPED_TO "savesscreenshot", /* Z Unused. */ "F11" ROADMAP_MAPPED_TO "full", - NULL }; @@ -1738,7 +1737,11 @@ roadmap_osm_initialize(); roadmap_factory_initialize(); - roadmap_factory_keymap (RoadMapStartActions, RoadMapStartKeyBinding); + /* load default bindings first */ + roadmap_factory_keymap (RoadMapStartActions, RoadMapStartKeyBinding, + sizeof(RoadMapStartKeyBinding)/sizeof(*RoadMapStartKeyBinding)); + /* then bindings from files */ + roadmap_factory_load (RoadMapStartActions); roadmap_option (argc, argv, 1, roadmap_start_usage); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-25 23:10:47
|
Revision: 2882 http://sourceforge.net/p/roadmap/code/2882 Author: pgf Date: 2015-06-25 23:10:44 +0000 (Thu, 25 Jun 2015) Log Message: ----------- gtk2/roadmap_main.c: keypad arrows now "special" for rebinding purposes Modified Paths: -------------- trunk/roadmap/src/gtk2/roadmap_main.c Modified: trunk/roadmap/src/gtk2/roadmap_main.c =================================================================== --- trunk/roadmap/src/gtk2/roadmap_main.c 2015-06-25 23:10:41 UTC (rev 2881) +++ trunk/roadmap/src/gtk2/roadmap_main.c 2015-06-25 23:10:44 UTC (rev 2882) @@ -158,16 +158,15 @@ char *key = NULL; char regular_key[2]; + // fprintf(stderr, "got 0x%x\n", event->keyval); + + switch (event->keyval) { - case GDK_Left: - case GDK_KP_Left: key = "LeftArrow"; break; - case GDK_Right: - case GDK_KP_Right: key = "RightArrow"; break; - case GDK_Up: - case GDK_KP_Up: key = "UpArrow"; break; - case GDK_Down: - case GDK_KP_Down: key = "DownArrow"; break; + case GDK_Left: key = "LeftArrow"; break; + case GDK_Right: key = "RightArrow"; break; + case GDK_Up: key = "UpArrow"; break; + case GDK_Down: key = "DownArrow"; break; case GDK_Return: key = "Enter"; break; @@ -182,6 +181,10 @@ case GDK_KP_Page_Down: key = "Special-PageDown"; break; // square case GDK_KP_Home: key = "Special-Home"; break; // X case GDK_KP_End: key = "Special-End"; break; // checkmark + case GDK_KP_Left: key = "Special-LeftArrow"; break; // joy left + case GDK_KP_Right: key = "Special-RightArrow"; break; // joy right + case GDK_KP_Up: key = "Special-UpArrow"; break; // joy up + case GDK_KP_Down: key = "Special-DownArrow"; break; // joy down case 0xffbe: key = "F1"; break; case 0xffbf: key = "F2"; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-25 23:10:44
|
Revision: 2881 http://sourceforge.net/p/roadmap/code/2881 Author: pgf Date: 2015-06-25 23:10:41 +0000 (Thu, 25 Jun 2015) Log Message: ----------- roadmap_trip: add UI commands for sequentially viewing route points Modified Paths: -------------- trunk/roadmap/src/roadmap.popup trunk/roadmap/src/roadmap_start.c trunk/roadmap/src/roadmap_trip.c trunk/roadmap/src/roadmap_trip.h Modified: trunk/roadmap/src/roadmap.popup =================================================================== --- trunk/roadmap/src/roadmap.popup 2015-06-25 23:10:37 UTC (rev 2880) +++ trunk/roadmap/src/roadmap.popup 2015-06-25 23:10:41 UTC (rev 2881) @@ -8,6 +8,9 @@ setasdestination addaswaypoint - +routeviewnext +routeviewprevious +- address intersection position @@ -31,4 +34,7 @@ - routepointahead routepointback +- +routeviewnext +routeviewprevious Modified: trunk/roadmap/src/roadmap_start.c =================================================================== --- trunk/roadmap/src/roadmap_start.c 2015-06-25 23:10:37 UTC (rev 2880) +++ trunk/roadmap/src/roadmap_start.c 2015-06-25 23:10:41 UTC (rev 2881) @@ -907,6 +907,14 @@ "Reorder the route, moving this point earlier in the route", NULL, roadmap_trip_move_routepoint_back }, + {"routeviewnext", "Select next waypoint", "Next", NULL, + "View the next waypoint in the route", NULL, + roadmap_trip_view_next_routepoint }, + + {"routeviewprevious", "Select previous waypoint", "Previous", NULL, + "View the previous waypoint in the route", NULL, + roadmap_trip_view_prev_routepoint }, + {"full", "Full Screen", "Full", "F", "Toggle the window full screen mode (if window manager permits)", NULL, roadmap_main_toggle_full_screen}, @@ -1133,6 +1141,9 @@ "routepointahead", "routepointback", + + "routeviewnext", + "routeviewprevious", #endif ROADMAP_MENU "Help", Modified: trunk/roadmap/src/roadmap_trip.c =================================================================== --- trunk/roadmap/src/roadmap_trip.c 2015-06-25 23:10:37 UTC (rev 2880) +++ trunk/roadmap/src/roadmap_trip.c 2015-06-25 23:10:41 UTC (rev 2881) @@ -797,6 +797,8 @@ #define WAYPOINT_ACTION_MOVE_BACK 1 #define WAYPOINT_ACTION_MOVE_AHEAD 2 #define WAYPOINT_ACTION_EDIT 3 +#define WAYPOINT_ACTION_FOCUS_PREV 4 +#define WAYPOINT_ACTION_FOCUS_NEXT 5 static int roadmap_trip_waypoint_manage_dialog_populate (void *which); @@ -811,6 +813,29 @@ waypoint *neighbor; switch(action) { + case WAYPOINT_ACTION_FOCUS_NEXT: + if (which != ROUTE_WAYPOINTS) + return; + if (waypointp == RoadMapTripDest) + return; + neighbor = (waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q); + goto select_neighbor; + + case WAYPOINT_ACTION_FOCUS_PREV: + if (which != ROUTE_WAYPOINTS) + return; + if (waypointp == RoadMapTripStart) + return; + neighbor = (waypoint *)ROADMAP_LIST_PREV(&waypointp->Q); + + select_neighbor: + if (!neighbor) + return; + roadmap_trip_set_selected_place(which, neighbor); + roadmap_trip_set_focus_waypoint (neighbor); + roadmap_screen_refresh (); + break; + case WAYPOINT_ACTION_MOVE_BACK: if (which != ROUTE_WAYPOINTS) return; @@ -2479,6 +2504,9 @@ distance_to_next > distance_threshold_greater) { char *dir; +if (distance_to_next < 200) +fprintf(stderr, "getting_close %d, within_waypoint %p\n", getting_close, within_waypoint); + dir = roadmap_trip_angle_to_direction(roadmap_trip_next_point_angle()); roadmap_message_set('1', dir); dir = roadmap_trip_angle_to_direction(roadmap_trip_2nd_point_angle()); @@ -3550,6 +3578,26 @@ } +void roadmap_trip_view_next_routepoint (void) { + + if (RoadMapTripSelectedPlace == NULL) + return; + + roadmap_trip_waypoint_manage_action + (RoadMapTripSelectedPlace->wpt, + RoadMapTripSelectedPlace->type, WAYPOINT_ACTION_FOCUS_NEXT); +} + +void roadmap_trip_view_prev_routepoint (void) { + + if (RoadMapTripSelectedPlace == NULL) + return; + + roadmap_trip_waypoint_manage_action + (RoadMapTripSelectedPlace->wpt, + RoadMapTripSelectedPlace->type, WAYPOINT_ACTION_FOCUS_PREV); +} + void roadmap_trip_move_routepoint_ahead (void) { if (RoadMapTripSelectedPlace == NULL) Modified: trunk/roadmap/src/roadmap_trip.h =================================================================== --- trunk/roadmap/src/roadmap_trip.h 2015-06-25 23:10:37 UTC (rev 2880) +++ trunk/roadmap/src/roadmap_trip.h 2015-06-25 23:10:41 UTC (rev 2881) @@ -118,6 +118,8 @@ void roadmap_trip_move_last_place(void); void roadmap_trip_move_routepoint_ahead (void); void roadmap_trip_move_routepoint_back (void); +void roadmap_trip_view_next_routepoint (void); +void roadmap_trip_view_prev_routepoint (void); void roadmap_trip_complete (void); int roadmap_trip_move_last_place_callback This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-25 23:10:40
|
Revision: 2880 http://sourceforge.net/p/roadmap/code/2880 Author: pgf Date: 2015-06-25 23:10:37 +0000 (Thu, 25 Jun 2015) Log Message: ----------- roadmap_trip,roadmap_voice: add more complete waypoint announcements fix announcement thresholds, and add angles from current travel to what can be announced. Modified Paths: -------------- trunk/roadmap/src/roadmap_math.c trunk/roadmap/src/roadmap_math.h trunk/roadmap/src/roadmap_trip.c trunk/roadmap/src/roadmap_voice.c Modified: trunk/roadmap/src/roadmap_math.c =================================================================== --- trunk/roadmap/src/roadmap_math.c 2015-06-23 14:02:11 UTC (rev 2879) +++ trunk/roadmap/src/roadmap_math.c 2015-06-25 23:10:37 UTC (rev 2880) @@ -1617,21 +1617,29 @@ return RoadMapContext->units->speed; } +/* takes miles/kms, returns feet/meters */ +int roadmap_math_to_trip_units (int distance) { + + return distance * RoadMapContext->units->to_trip_unit; +} +/* takes feet/meters, returns miles/kms */ int roadmap_math_to_trip_distance (int distance) { return distance / RoadMapContext->units->to_trip_unit; } +/* takes feet or meters, and returns tenths of miles or km. */ int roadmap_math_to_trip_distance_tenths (int distance) { return (10 * distance) / RoadMapContext->units->to_trip_unit; } -/** - * @brief set some distance into the message API's buffers +/** * @brief set some distance into the message API's buffers * @param which indicate which distance to set - * @param distance the value to use + * @param distance the value to use, in feet or meters + * the return buffer will be ascii, in either miles/km, with decimal, + * or in feet/meters. */ void roadmap_math_trip_set_distance(char which, int distance) { Modified: trunk/roadmap/src/roadmap_math.h =================================================================== --- trunk/roadmap/src/roadmap_math.h 2015-06-23 14:02:11 UTC (rev 2879) +++ trunk/roadmap/src/roadmap_math.h 2015-06-25 23:10:37 UTC (rev 2880) @@ -123,6 +123,7 @@ double distance, char *unitstring); int roadmap_math_distance_convert (const char *string, int *was_explicit); +int roadmap_math_to_trip_units (int distance); int roadmap_math_to_trip_distance (int distance); int roadmap_math_to_trip_distance_tenths (int distance); Modified: trunk/roadmap/src/roadmap_trip.c =================================================================== --- trunk/roadmap/src/roadmap_trip.c 2015-06-23 14:02:11 UTC (rev 2879) +++ trunk/roadmap/src/roadmap_trip.c 2015-06-25 23:10:37 UTC (rev 2880) @@ -2154,7 +2154,7 @@ * @brief this displays an arrow pointing to the next point in the trip * @return */ -static int roadmap_trip_next_point_state(void) +static int roadmap_trip_next_point_angle(void) { int angle; @@ -2169,6 +2169,12 @@ angle = roadmap_math_azymuth (&RoadMapTripGps->map, &RoadMapTripNext->pos); angle -= RoadMapTripGps->gps.steering + roadmap_math_get_orientation(); + return angle; +} + +static int roadmap_trip_next_point_state(void) +{ + int angle = roadmap_trip_next_point_angle(); return ROADMAP_STATE_ENCODE_STATE (angle, 0); } @@ -2176,7 +2182,7 @@ * @brief this displays an arrow pointing to the 2nd next point in the trip * @return */ -static int roadmap_trip_2nd_point_state(void) +static int roadmap_trip_2nd_point_angle(void) { waypoint *tmp; int angle; @@ -2197,6 +2203,32 @@ angle = roadmap_math_azymuth (&RoadMapTripGps->map, &tmp->pos); angle -= RoadMapTripGps->gps.steering + roadmap_math_get_orientation(); + return angle; +} + +static char *directions[] = { + "ahead", + "ahead right", + "right", + "back right", + "back", + "back left", + "left", + "ahead left", +}; +static char *roadmap_trip_angle_to_direction(int angle) +{ + /* each direction represents 45 degrees (out of 360). + * the "ahead" pie-shaped segment is between -22.5 and 22.5 degrees. + */ + while (angle > 360) angle -= 360; + while (angle < 0) angle += 360; + return directions[(angle * 10 + 225) / 450]; +} + +static int roadmap_trip_2nd_point_state(void) +{ + int angle = roadmap_trip_2nd_point_angle(); return ROADMAP_STATE_ENCODE_STATE (angle, 0); } @@ -2240,25 +2272,41 @@ roadmap_screen_refresh (); } -int announce_threshold_tenths[] = { - // 100mi 50mi 20mi 10mi 5mi 1mi .3mi or - // 100km 50km 20km 10km 5km 1km .3km - 1000, 500, 200, 100, 50, 10, 3, 0 -}; - -int roadmap_trip_new_threshold(int distance) +/* takes distance in feet/meters, returns new thresholds in feet/meters*/ +static void roadmap_trip_new_threshold(int distance, + int *lesserp, int *greaterp) { int i; - int *thresh = announce_threshold_tenths; - int distance_far = roadmap_math_to_trip_distance_tenths (distance); + double u, delta; + int low, high; + double threshmul[] = { 2.5, 2., 2. }; +#define STARTING_THRESHOLD .2 - for (i = 0; thresh[i]; i++) { - if (distance_far > thresh[i]) { - return thresh[i]; - } + // we want distance reports at + // 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1, .5, .2 + // the multipliers to get between these values are 2.5, 2, and 2. + // also, when approaching a waypoint, we want to announce that + // we're nearing it _on_ these mileages, not just past them. i.e., + // if the threshold is 2 miles, we don't want to cross the threshold + // and then announce "in 1.9 miles". so we add a delta or 5% to + // all the threshold values + + u = roadmap_math_to_trip_units (1); // 5280 feet, or 1000 meters + delta = u * .05; + high = (u * STARTING_THRESHOLD ) + delta; // start at .2 mile or .2 km + low = 0; + + for (i = 0; i < 10; i ++) { + if (high > distance) + break; + low = high; + high = ((high - delta) * threshmul[i % 3]) + delta; } - return 0; + + *lesserp = low; + *greaterp = high; } + /** * @brief send messages to the user indicating current state * @@ -2272,6 +2320,8 @@ * (set only when a trip is active). * Y Distance to the next waypoint which includes directions, unless the GPS is * "at" that waypoint. (set only when a trip is active). + * 1 Angle from current travel to next waypoint. + * 2 Angle from current travel to second next waypoint. */ void roadmap_trip_format_messages (void) { @@ -2282,7 +2332,9 @@ int waypoint_size; static RoadMapPosition lastgpsmap = {-1, -1}; static waypoint *within_waypoint = NULL; - static int distance_announce_threshold; + static int distance_threshold_lesser; + static int distance_threshold_greater; + static int getting_close; if (! RoadMapRouteInProgress || RoadMapCurrentRoute == NULL) { @@ -2294,6 +2346,9 @@ roadmap_message_unset ('X'); roadmap_message_unset ('Y'); + + roadmap_message_unset ('1'); + roadmap_message_unset ('2'); lastgpsmap.latitude = -1; return; } @@ -2306,6 +2361,9 @@ roadmap_message_set ('X', "??"); roadmap_message_set ('Y', "?? %s", roadmap_math_trip_unit()); + + roadmap_message_set ('1', "??"); + roadmap_message_set ('2', "??"); lastgpsmap.latitude = -1; return; } @@ -2333,7 +2391,6 @@ } else { - static int getting_close; int need_newgoal = 0; if (within_waypoint != NULL) { @@ -2355,8 +2412,6 @@ roadmap_log (ROADMAP_DEBUG, "attained waypoint %s, distance %d", RoadMapTripNext->shortname, distance_to_next); -// maybe announce "at waypoint" - within_waypoint = RoadMapTripNext; need_newgoal = 1; getting_close = 0; @@ -2420,10 +2475,19 @@ } if (lastRoadMapTripNext != RoadMapTripNext || - distance_to_next < distance_announce_threshold) { + distance_to_next < distance_threshold_lesser || + distance_to_next > distance_threshold_greater) { + char *dir; + + dir = roadmap_trip_angle_to_direction(roadmap_trip_next_point_angle()); + roadmap_message_set('1', dir); + dir = roadmap_trip_angle_to_direction(roadmap_trip_2nd_point_angle()); + roadmap_message_set('2', dir); + roadmap_voice_announce ("Waypoint", 1); - distance_announce_threshold = - roadmap_trip_new_threshold(distance_to_next); + + roadmap_trip_new_threshold(distance_to_next, + &distance_threshold_lesser, &distance_threshold_greater); lastRoadMapTripNext = RoadMapTripNext; } Modified: trunk/roadmap/src/roadmap_voice.c =================================================================== --- trunk/roadmap/src/roadmap_voice.c 2015-06-23 14:02:11 UTC (rev 2879) +++ trunk/roadmap/src/roadmap_voice.c 2015-06-25 23:10:37 UTC (rev 2880) @@ -56,7 +56,7 @@ ROADMAP_CONFIG_ITEM("Voice", "Mute"); static struct roadmap_voice_config RoadMapVoiceText[] = { - {ROADMAP_CONFIG_ITEM("Voice", "Waypoint"), "flite" _EXE " -t 'Next way point in %W'"}, + {ROADMAP_CONFIG_ITEM("Voice", "Waypoint"), "flite" _EXE " -t 'Next is %W %1, pointing %2'|flite" _EXE " -t 'Destination %D %1'"}, {ROADMAP_CONFIG_ITEM("Voice", "Approach"), "flite" _EXE " -t 'Approaching %N'"}, {ROADMAP_CONFIG_ITEM("Voice", "Current Street"), "flite" _EXE " -t 'On %N'"}, {ROADMAP_CONFIG_ITEM("Voice", "Next Intersection"), "flite" _EXE " -t 'Next intersection: %N'"}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |