@ -3,6 +3,7 @@ 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  <QDir>  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  <QVBoxLayout>  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "selfdrive/ui/qt/maps/map_helpers.h"  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					# include  "selfdrive/ui/ui.h"  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					const  QString  ICON_SUFFIX  =  " .png " ;  
				
			 
			
		
	
	
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
				
				 
				 
				
					@ -63,18 +64,6 @@ void MapInstructions::buildPixmapCache() { 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  }   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					}  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					QString  MapInstructions : : getDistance ( float  d )  {  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  d  =  std : : max ( d ,  0.0f ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  if  ( uiState ( ) - > scene . is_metric )  {   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					    return  ( d  >  500 )  ?  QString : : number ( d  /  1000 ,  ' f ' ,  1 )  +  tr ( "  km " )   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					                     :  QString : : number ( 50  *  qRound ( d  /  50 ) )  +  tr ( "  m " ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  }  else  {   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					    float  feet  =  d  *  METER_TO_FOOT ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					    return  ( feet  >  500 )  ?  QString : : number ( d  *  METER_TO_MILE ,  ' f ' ,  1 )  +  tr ( "  mi " )   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					                        :  QString : : number ( 50  *  qRound ( feet  /  50 ) )  +  tr ( "  ft " ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  }   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					}  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					void  MapInstructions : : updateInstructions ( cereal : : NavInstruction : : Reader  instruction )  {  
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  setUpdatesEnabled ( false ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
	
		
			
				
					
						
						
						
							
								 
							 
						
					 
				
				 
				 
				
					@ -85,7 +74,9 @@ void MapInstructions::updateInstructions(cereal::NavInstruction::Reader instruct 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  primary - > setText ( primary_str ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  secondary - > setVisible ( secondary_str . length ( )  >  0 ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  secondary - > setText ( secondary_str ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  distance - > setText ( getDistance ( instruction . getManeuverDistance ( ) ) ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  auto  distance_str_pair  =  map_format_distance ( instruction . getManeuverDistance ( ) ,  uiState ( ) - > scene . is_metric ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  distance - > setText ( QString ( " %1 %2 " ) . arg ( distance_str_pair . first ,  distance_str_pair . second ) ) ;   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					
 
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  // Show arrow with direction
   
				
			 
			
		
	
		
			
				
					 
					 
				
				 
				 
				
					  QString  type  =  QString : : fromStdString ( instruction . getManeuverType ( ) ) ;