int RealtimeTrafficInfoState(){
	if (roadmap_config_match(&RouteInfoConfigDisplayTraffic, "yes"))
		return 1;
	else
		return 0;

}
static void update_events_radius(){
   const char * data = (const char *)ssd_dialog_get_data("event_radius");
   if (!(roadmap_config_match(&RoadMapConfigEventsRadius, data))){ // descriptor changed
       roadmap_config_set (&RoadMapConfigEventsRadius,data);
       OnSettingsChanged_VisabilityGroup(); // notify server of visibilaty settings change
   }
}
void RealtimeTrafficInfoPluginInit () {

   roadmap_config_declare
      ("schema", &RouteInfoConfigRouteColorGood,  "#fdf66b", NULL); //Yellow
   roadmap_config_declare
      ("schema", &RouteInfoConfigRouteColorMild,  "#f57a24", NULL); //Orange
   roadmap_config_declare
      ("schema", &RouteInfoConfigRouteColorBad,  "#FF0000", NULL); //Red

   roadmap_config_declare_enumeration
      ("preferences", &RouteInfoConfigDisplayTraffic, NULL, "yes", "no", NULL);

   pens[TRAFFIC_OK] = roadmap_canvas_create_pen ("RealtimeTrafficInfoPenGood");
   roadmap_canvas_set_foreground
      (roadmap_config_get (&RouteInfoConfigRouteColorGood));
   roadmap_canvas_set_thickness (TRAFFIC_PEN_WIDTH);

   pens[TRAFFIC_MILD] = roadmap_canvas_create_pen ("RealtimeTrafficInfoPenMild");
   roadmap_canvas_set_foreground
      (roadmap_config_get (&RouteInfoConfigRouteColorMild));
   roadmap_canvas_set_thickness (TRAFFIC_PEN_WIDTH);

   pens[TRAFFIC_BAD] = roadmap_canvas_create_pen ("RealtimeTrafficInfoPenBad");
   roadmap_canvas_set_foreground
      (roadmap_config_get (&RouteInfoConfigRouteColorBad));
   roadmap_canvas_set_thickness (TRAFFIC_PEN_WIDTH);

   speed_text_pen = 	roadmap_canvas_create_pen("SpeedText");
	roadmap_canvas_set_foreground("#000000");

   if (roadmap_config_match(&RouteInfoConfigDisplayTraffic, "yes")){
   	RealtimeTrafficInfoRegister();
   	Realtime_SendTrafficInfo(1);
   }
}
/*
 * Has to be called after the geo config in order to be able to determine
 * the proper default values for the net monitor ( Israel - true )
 *
 */
void roadmap_net_mon_initialize (void) {

   const char* netmon_enabled_default = roadmap_lang_rtl() ? "yes" : "no";
   /*
    * Initialize the network monitor status. In Israel the default is true.
    */
   roadmap_config_declare
      ( "user", &RoadMapConfigNetMonitorEnabled, netmon_enabled_default, NULL );
   RoadMapNetMonEnabled = roadmap_config_match( &RoadMapConfigNetMonitorEnabled, "yes" );
}
Exemple #5
0
/***********************************************************
 *	Name 		: roadmap_device_backlight_monitor
 *	Purpose 	: Monitors the movement of the device according to gps positions. If staying in the same point and
 *					backlight is off - use the device settings. Otherwise keep the screen bright
 *
 */
static void roadmap_device_backlight_monitor( time_t gps_time, const RoadMapGpsPrecision *dilution, const RoadMapGpsPosition *position)
{
    RoadMapPosition last_pos;
    RoadMapPosition cur_pos;
    int cur_distance;

    /*
     * If ALWAYS ON - Nothing to do
     */
    if ( roadmap_config_match( &RoadMapConfigBackLight, "yes" ) )
    {
        gsLastMovementTime = 0;
        return;
    }

    /* First point */
    if ( gsLastMovementTime == 0 )
    {
        gsLastMovementPos = *position;
        gsLastMovementTime = gps_time;
        return;
    }

    memcpy( &last_pos, &gsLastMovementPos, sizeof( RoadMapPosition ) );
    memcpy( &cur_pos, position, sizeof( RoadMapPosition ) );
    cur_distance = roadmap_math_distance( &last_pos, &cur_pos );

    if ( gsBacklightOnActive ) /* Currently set on - check if still moving */
    {
        if ( cur_distance < RM_BACKLIGHT_AUTO_OFF_MOVEMENT &&
                ( ( gps_time - gsLastMovementTime ) > RM_BACKLIGHT_AUTO_OFF_TIMEOUT ) )
        {
            /* Switch the state to off (system settings) */
            roadmap_device_set_backlight_( RM_BACKLIGHT_OFF );
        }
    }
    else	/* Currently backlight is off - check if started to move */
    {
        if ( cur_distance > RM_BACKLIGHT_AUTO_OFF_MOVEMENT )
        {
            /* Switch the state to on */
            roadmap_device_set_backlight_( RM_BACKLIGHT_ON );
        }
    }

    /* Set the last movement point and time */
    if ( cur_distance > RM_BACKLIGHT_AUTO_OFF_MOVEMENT )
    {
        gsLastMovementPos = *position;
        gsLastMovementTime = gps_time;
    }
    return;
}
void RealtimeRoadToggleShowTraffic(){
   if (roadmap_config_match(&RouteInfoConfigDisplayTraffic, "yes")){
		 roadmap_config_set (&RouteInfoConfigDisplayTraffic,"no");
		 Realtime_SendTrafficInfo(0);

		 //RealtimeTrafficInfoUregister(plugId);
		 //plugId = -1;
   }
   else{
		 roadmap_config_set (&RouteInfoConfigDisplayTraffic,"yes");
		 Realtime_SendTrafficInfo(1);
		//RealtimeTrafficInfoRegister();
   }
  roadmap_screen_redraw();
}
/***********************************************************
 *	Name 		: roadmap_device_initialize
 *	Purpose 	: Loads the backlight parameter from the configuration
 * 					and updates the application. Returns the loaded value
 */
int roadmap_device_initialize( void )
{
	CFreeMapAppUi* pAppUi;
	TBool isAlwaysOn;

	// Load the configuration
    roadmap_config_declare
       ("user", &RoadMapConfigBackLight, "yes", NULL);
    isAlwaysOn = roadmap_config_match( &RoadMapConfigBackLight, "yes" );

	// Update the UI object
	pAppUi = static_cast<CFreeMapAppUi*>( CEikonEnv::Static()->EikAppUi() );
	pAppUi->SetBackLiteOn( ( TBool ) isAlwaysOn );

	// Log the operation
	roadmap_log( ROADMAP_DEBUG, "roadmap_backlight_initialize() - Current setting : %s",
													roadmap_config_get( &RoadMapConfigBackLight ) );

	return isAlwaysOn;

}
Exemple #8
0
int ticker_cfg_on (void) {
   return (roadmap_config_match(&ShowTickerCfg, "yes"));
}
BOOL isDisplayingTrafficInfoOn(){
	if (roadmap_config_match(&RouteInfoConfigDisplayTraffic, "yes"))
		return TRUE;
	else
		return FALSE;
}
Exemple #10
0
static int auto_night_mode_cfg_on (void) {
   return (roadmap_config_match(&RoadMapConfigAutoNightMode, "yes"));
}
Exemple #11
0
int  config_audio_alerts_enabled (void) {
    return(roadmap_config_match(&AlertsAudioEnabledCfg, "yes"));
}
Exemple #12
0
void roadmap_factory (const char           *name,
                      const RoadMapAction  *actions,
                      const char           *menu[],
                      const char           *toolbar[]) {

   int i;
   int prefix = strlen(ROADMAP_MENU);

   int use_toolbar =
            roadmap_config_match (&RoadMapConfigGeneralToolbar, "yes");

   int use_icons =
            roadmap_config_match (&RoadMapConfigGeneralIcons, "yes");

   RoadMapMenu gui_menu = NULL;

   for (i = 0; menu[i] != NULL; ++i) {

      const char *item = menu[i];

      if (item == RoadMapFactorySeparator) {

         roadmap_main_add_separator (gui_menu);

      } else if (item == RoadMapFactoryHelpTopics) {

         roadmap_factory_add_help (gui_menu);

      } else if (strncmp (item, ROADMAP_MENU, prefix) == 0) {

         gui_menu = roadmap_main_new_menu ();
         roadmap_main_add_menu (gui_menu, roadmap_lang_get (item + prefix));

      } else {
         const RoadMapAction *this_action;

         this_action = roadmap_factory_find_action (actions, item);
         if (this_action != NULL) {
            roadmap_main_add_menu_item
                              (gui_menu,
                               roadmap_lang_get (this_action->label_long),
                               roadmap_lang_get (this_action->tip),
                               this_action->callback);
         }
      }
   }

   if (use_toolbar) {

      const char **usertoolbar =
         roadmap_factory_user_config (name, "toolbar", actions);

      if (usertoolbar == NULL) usertoolbar = toolbar;

      for (i = 0; usertoolbar[i] != NULL; ++i) {

         const char *item = usertoolbar[i];

         if (item == RoadMapFactorySeparator) {

            roadmap_main_add_tool_space ();

         } else {

            const RoadMapAction *this_action;

            this_action = roadmap_factory_find_action (actions, item);

            if (this_action != NULL) {
               roadmap_main_add_tool (roadmap_factory_terse(this_action),
                                      (use_icons) ? this_action->name : NULL,
                                      this_action->tip,
                                      this_action->callback);
            }
         }
      }
   }

   /*
   if (RoadMapFactoryBindings != NULL) {
      roadmap_main_set_keyboard
         (RoadMapFactoryBindings, roadmap_factory_keyboard);
   }
   */
}
Exemple #13
0
/*
 * Returns TRUE iff the descriptor is enabled
 */
BOOL roadmap_map_settings_isEnabled(RoadMapConfigDescriptor descriptor){
	if(roadmap_config_match(&descriptor, "yes")){
		return TRUE;
	}
	return FALSE;
}