changeset 268:9a53935c6e2d main

Latest dev changes for the ODR display
author Bob Cook <bob@bobcookdev.com>
date Mon, 02 May 2016 19:32:39 -0700
parents 51f23203883c
children 6774826fd1a5
files main/robots/odr-display/canmsgs.cpp main/robots/odr-display/display.cpp main/robots/odr-display/func.h
diffstat 3 files changed, 12 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/main/robots/odr-display/canmsgs.cpp	Sun Oct 25 13:44:20 2015 -0700
+++ b/main/robots/odr-display/canmsgs.cpp	Mon May 02 19:32:39 2016 -0700
@@ -194,20 +194,6 @@
 
 // ----------------------------------------------------------------------------------------
 
-static void update_origin_lat( const can_data_gps_data* data )
-{
-    display_update_origin_lat( data->degrees, data->min_thousandths );
-}
-
-// ----------------------------------------------------------------------------------------
-
-static void update_origin_lon( const can_data_gps_data* data )
-{
-    display_update_origin_lon( data->degrees, data->min_thousandths );
-}
-
-// ----------------------------------------------------------------------------------------
-
 static void update_target_lat( const can_data_gps_data* data )
 {
     display_update_target_lat( data->degrees, data->min_thousandths );
@@ -313,14 +299,6 @@
                 update_gps_fix( reinterpret_cast< can_data_gps_fix* >( &recvdata ) );
                 break;
 
-            case can_dataid_origin_lat:
-                update_origin_lat( reinterpret_cast< can_data_gps_data* >( &recvdata ) );
-                break;
-
-            case can_dataid_origin_long:
-                update_origin_lon( reinterpret_cast< can_data_gps_data* >( &recvdata ) );
-                break;
-
             case can_dataid_target_lat:
                 update_target_lat( reinterpret_cast< can_data_gps_data* >( &recvdata ) );
                 break;
--- a/main/robots/odr-display/display.cpp	Sun Oct 25 13:44:20 2015 -0700
+++ b/main/robots/odr-display/display.cpp	Mon May 02 19:32:39 2016 -0700
@@ -1,6 +1,6 @@
 // ----------------------------------------------------------------------------------------
 //
-//  Copyright (C) 2012-2014 Bob Cook
+//  Copyright (C) 2012-2015 Bob Cook
 //    
 //  Bob Cook Development, Robotics Library
 //  http://www.bobcookdev.com/rl/
@@ -62,9 +62,9 @@
 //     10-|        location (00)         |-
 //      1-|  N 123 45.678  W 123 45.678  |-
 //      2-|                              |-
-//      3-|     origin (123.4) target    |-
-//      4-| N 123 45.678    N 123 45.678 |-
-//      5-| W 123 45.678    W 123 45.678 |-
+//      3-|            target            |-
+//      4-|  N 123 45.678  W 123 45.678  |-
+//      5-|                              |-
 //      6-|                              |-
 //      7-|  inertial measurement unit   |-
 //      8-|   Y +000  P +00.0  R +00.0   |-
@@ -200,7 +200,7 @@
     str_write_pgm( PSTR("f:     /      r:     /"), 2, 5 );
     str_write_pgm( PSTR("front obstacles"), 7, 7 );
     str_write_pgm( PSTR("location (--)"), 8, 10 );
-    str_write_pgm( PSTR("origin         target"), 5, 13 );
+    str_write_pgm( PSTR("target"), 12, 13 );
     str_write_pgm( PSTR("inertial measurement unit"), 2, 17 );
 }
 
@@ -657,59 +657,21 @@
 
 // ----------------------------------------------------------------------------------------
 
-void display_update_origin_lat( int16_t degrees, int32_t min_thousandths )
+void display_update_target_lat( int16_t degrees, int32_t min_thousandths )
 {
     if ( degrees < 0 )
     {
-        str_write( 'S', 1, 14 );
+        str_write( 'S', 2, 14 );
         degrees *= -1;
     }
     else
     {
-        str_write( 'N', 1, 14 );
+        str_write( 'N', 2, 14 );
     }
 
     char buf[ 12 ];
     format_gps_value( degrees, min_thousandths, buf );
-    str_write( buf, 3, 14 );
-}
-
-// ----------------------------------------------------------------------------------------
-
-void display_update_origin_lon( int16_t degrees, int32_t min_thousandths )
-{
-    if ( degrees < 0 )
-    {
-        str_write( 'W', 1, 15 );
-        degrees *= -1;
-    }
-    else
-    {
-        str_write( 'E', 1, 15 );
-    }
-
-    char buf[ 12 ];
-    format_gps_value( degrees, min_thousandths, buf );
-    str_write( buf, 3, 15 );
-}
-
-// ----------------------------------------------------------------------------------------
-
-void display_update_target_lat( int16_t degrees, int32_t min_thousandths )
-{
-    if ( degrees < 0 )
-    {
-        str_write( 'S', 17, 14 );
-        degrees *= -1;
-    }
-    else
-    {
-        str_write( 'N', 17, 14 );
-    }
-
-    char buf[ 12 ];
-    format_gps_value( degrees, min_thousandths, buf );
-    str_write( buf, 19, 14 );
+    str_write( buf, 4, 14 );
 }
 
 // ----------------------------------------------------------------------------------------
@@ -718,17 +680,17 @@
 {
     if ( degrees < 0 )
     {
-        str_write( 'W', 17, 15 );
+        str_write( 'W', 16, 14 );
         degrees *= -1;
     }
     else
     {
-        str_write( 'E', 17, 15 );
+        str_write( 'E', 16, 14 );
     }
 
     char buf[ 12 ];
     format_gps_value( degrees, min_thousandths, buf );
-    str_write( buf, 19, 15 );
+    str_write( buf, 18, 14 );
 }
 
 // ----------------------------------------------------------------------------------------
--- a/main/robots/odr-display/func.h	Sun Oct 25 13:44:20 2015 -0700
+++ b/main/robots/odr-display/func.h	Mon May 02 19:32:39 2016 -0700
@@ -99,9 +99,6 @@
 void display_update_longitude( int16_t degrees, int32_t min_thousandths );
 void display_update_gps_fix( uint8_t satellites );
 
-void display_update_origin_lat( int16_t degrees, int32_t min_thousandths );
-void display_update_origin_lon( int16_t degrees, int32_t min_thousandths );
-
 void display_update_target_lat( int16_t degrees, int32_t min_thousandths );
 void display_update_target_lon( int16_t degrees, int32_t min_thousandths );