navit
0.5.3-trunk
|
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <time.h>
#include <math.h>
#include "config.h"
#include "debug.h"
#include "coord.h"
#include "item.h"
#include "xmlconfig.h"
#include "log.h"
#include "plugin.h"
#include "transform.h"
#include "util.h"
#include "event.h"
#include "projection.h"
#include "point.h"
#include "graphics.h"
#include "callback.h"
#include "color.h"
#include "layout.h"
#include "vehicle.h"
#include "navit_nls.h"
Data Structures | |
struct | vehicle |
Functions | |
static void | vehicle_set_default_name (struct vehicle *this) |
static void | vehicle_draw_do (struct vehicle *this_) |
static void | vehicle_log_nmea (struct vehicle *this_, struct log *log) |
Writes to an NMEA log. More... | |
static void | vehicle_log_gpx (struct vehicle *this_, struct log *log) |
Writes a trackpoint to a GPX log. More... | |
static void | vehicle_log_textfile (struct vehicle *this_, struct log *log) |
Writes to a text log. More... | |
static void | vehicle_log_binfile (struct vehicle *this_, struct log *log) |
Writes to a binary log. More... | |
static int | vehicle_add_log (struct vehicle *this_, struct log *log) |
Registers a new log to receive data. More... | |
struct vehicle * | vehicle_new (struct attr *parent, struct attr **attrs) |
Creates a new vehicle. More... | |
void | vehicle_destroy (struct vehicle *this_) |
Destroys a vehicle. More... | |
struct attr_iter * | vehicle_attr_iter_new (void *unused) |
void | vehicle_attr_iter_destroy (struct attr_iter *iter) |
int | vehicle_get_attr (struct vehicle *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
int | vehicle_set_attr (struct vehicle *this_, struct attr *attr) |
int | vehicle_add_attr (struct vehicle *this_, struct attr *attr) |
int | vehicle_remove_attr (struct vehicle *this_, struct attr *attr) |
Generic remove function. More... | |
void | vehicle_set_cursor (struct vehicle *this_, struct cursor *cursor, int overwrite) |
void | vehicle_draw (struct vehicle *this_, struct graphics *gra, struct point *pnt, int angle, int speed) |
int | vehicle_get_cursor_data (struct vehicle *this, struct point *pnt, int *angle, int *speed) |
void | vehicle_log_gpx_add_tag (char *tag, char **logstr) |
Variables | |
struct object_func | vehicle_func |
Generic add function
this_ | A vehicle |
attr | The attribute to add |
References attr_generic_add_attr(), attr::callback, callback_list_add(), vehicle::cbl, attr::cursor, vehicle::cursor_fixed, attr::log, attr::type, attr::u, vehicle_add_log(), and vehicle_set_cursor().
Referenced by navit_add_vehicle(), and pedestrian_navit_init().
Registers a new log to receive data.
this_ | The vehicle supplying data |
log | The log to write to |
References callback_cast, callback_list_add(), callback_new_attr_2, vehicle::cbl, log_get_attr(), log_set_header(), log_set_trailer(), vehicle::log_to_cb, attr::str, attr::u, vehicle_log_binfile(), vehicle_log_gpx(), vehicle_log_nmea(), and vehicle_log_textfile().
Referenced by vehicle_add_attr().
void vehicle_attr_iter_destroy | ( | struct attr_iter * | iter | ) |
Destroys a vehicle attribute iterator
iter | a vehicle attr_iter |
References attr_iter::iter.
Referenced by NGQProxyVehicle::dropIterFunc(), and save_vehicle_xml().
struct attr_iter* vehicle_attr_iter_new | ( | void * | unused | ) |
Creates an attribute iterator to be used with vehicles
Referenced by NGQProxyVehicle::getIterFunc(), and save_vehicle_xml().
void vehicle_destroy | ( | struct vehicle * | this_ | ) |
Destroys a vehicle.
this_ | The vehicle to destroy |
References vehicle::animate_callback, vehicle::animate_timer, attr_list_free(), vehicle::bg, callback_destroy(), callback_list_destroy(), vehicle::cbl, dbg, vehicle_methods::destroy, event_remove_timeout(), vehicle::gra, graphics_free(), graphics_gc_destroy(), lvl_debug, vehicle::meth, vehicle::priv, vehicle::trans, and transform_destroy().
void vehicle_draw | ( | struct vehicle * | this_, |
struct graphics * | gra, | ||
struct point * | pnt, | ||
int | angle, | ||
int | speed | ||
) |
Draws a vehicle on top of a graphics.
this_ | The vehicle |
gra | The graphics |
pnt | Screen coordinates of the vehicle. |
angle | The angle relative to the map. |
speed | The speed of the vehicle. |
References vehicle::angle, vehicle::bg, c, vehicle::cursor, vehicle::cursor_pnt, dbg, vehicle::gra, graphics_background_gc(), graphics_gc_new(), graphics_gc_set_foreground(), graphics_init(), graphics_overlay_new(), graphics_overlay_resize(), cursor::h, lvl_debug, navit_sqrt, vehicle::need_resize, vehicle::real_h, vehicle::real_w, vehicle::speed, vehicle::trans, transform_set_screen_center(), vehicle_draw_do(), cursor::w, point::x, and point::y.
Referenced by navit_vehicle_draw().
|
static |
References vehicle::angle, itemgra::angle_range, vehicle::animate_callback, cursor::attrs, vehicle::bg, vehicle::cursor, vehicle::cursor_pnt, dbg, draw_mode_begin, draw_mode_end, vehicle::gra, graphics_draw_drag(), graphics_draw_itemgra(), graphics_draw_mode(), graphics_draw_rectangle(), label, lvl_debug, match(), range::max, range::min, p, vehicle::real_h, vehicle::real_w, vehicle::sequence, cursor::sequence_range, vehicle::speed, vehicle::trans, and transform_set_yaw().
Referenced by vehicle_draw(), and vehicle_set_cursor().
int vehicle_get_attr | ( | struct vehicle * | this_, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
Generic get function
this_ | Pointer to a vehicle structure |
type | The attribute type to look for |
attr | Pointer to a to store the attribute |
iter | A vehicle attr_iter. This is only used for generic attributes; for attributes specific to the vehicle object it is ignored. |
References attr_generic_get_attr(), vehicle::gpx_desc, attr_iter::iter, vehicle::meth, vehicle_methods::position_attr_get, vehicle::priv, attr::str, type, and attr::u.
Referenced by Backend::get_vehicles(), NGQProxyVehicle::getAttrFunc(), NGQProxyNavit::getPosition(), gui_gtk_vehicles_update(), gui_internal_add_vehicle_profile(), gui_internal_cmd2_setting_vehicle(), gui_internal_cmd_position_do(), gui_internal_cmd_set_active_profile(), gui_internal_cmd_show_nmea_data(), gui_internal_cmd_show_satellite_status(), gui_internal_menu_vehicle_settings(), gui_internal_set_position_coord(), navit_add_vehicle(), navit_cmd_map_add_curr_pos(), navit_layout_switch(), navit_set_center_cursor(), navit_set_cursors(), navit_set_vehicle(), navit_set_vehicle_by_name(), navit_vehicle_update_position(), osd_compass_draw(), osd_gps_status_draw(), osd_odometer_draw(), osd_route_guard_draw(), osd_speed_cam_draw(), osd_text_draw(), route_set_attr(), save_vehicle_xml(), statusbar_route_update(), tracking_update(), and traffic_traff_android_position_callback().
Writes to a binary log.
this_ | The vehicle supplying data |
log | The log to write to |
References c, attr::coord_geo, dbg, limit, log_flag_force_flush, log_flag_keep_buffer, log_flag_keep_pointer, log_flag_replace_buffer, log_flag_truncate, log_get_buffer(), log_write(), lvl_debug, vehicle::meth, attr::num, vehicle_methods::position_attr_get, vehicle::priv, projection_mg, transform_douglas_peucker(), transform_from_geo(), attr::u, pcoord::x, and pcoord::y.
Referenced by vehicle_add_log().
Writes a trackpoint to a GPX log.
this_ | The vehicle supplying data |
log | The log to write to |
References attr_search(), attr::attr_types, attr_types_contains_default(), callback_list_call_attr_1, vehicle::cbl, attr::coord_geo, current_to_iso8601(), g_strconcat_printf(), vehicle::gpx_desc, coord_geo::lat, coord_geo::lng, log_get_attr(), log_write(), vehicle::meth, attr::num, attr::numd, vehicle_methods::position_attr_get, vehicle::priv, attr::str, and attr::u.
Referenced by vehicle_add_log().
void vehicle_log_gpx_add_tag | ( | char * | tag, |
char ** | logstr | ||
) |
Add a tag to the extensions section of a GPX trackpoint.
tag | The tag to add |
logstr | Pointer to a pointer to a string to be inserted into the log. When calling this function, *logstr
*logstr
*logstr
|
References attr::str.
Referenced by pedestrian_log().
Writes to an NMEA log.
this_ | The vehicle supplying data |
log | The log to write to |
References log_write(), vehicle::meth, vehicle_methods::position_attr_get, vehicle::priv, attr::str, and attr::u.
Referenced by vehicle_add_log().
Writes to a text log.
this_ | The vehicle supplying data |
log | The log to write to |
References callback_list_call_attr_1, vehicle::cbl, attr::coord_geo, coord_geo::lat, coord_geo::lng, log_write(), vehicle::meth, attr::num, vehicle_methods::position_attr_get, vehicle::priv, and attr::u.
Referenced by vehicle_add_log().
Creates a new vehicle.
parent | |
attrs | Points to a null-terminated array of pointers to the attributes for the new vehicle type. |
References attr_list_dup(), attr_search(), attr::attrs, callback_list_destroy(), callback_list_new(), cbl, vehicle::cbl, center, dbg, vehicle::log_to_cb, lvl_debug, lvl_error, vehicle::meth, navit_object_ref(), vehicle::priv, projection_screen, attr::str, vehicle::trans, transform_new(), type, attr::u, vehicle_func, and vehicle_set_default_name().
Generic remove function.
Used to remove a callback from the vehicle.
this_ | A vehicle |
attr |
References attr_generic_remove_attr(), attr::callback, callback_list_remove(), vehicle::cbl, attr::log, vehicle::log_to_cb, attr::type, and attr::u.
Generic set function
this_ | A vehicle |
attr | The attribute to set |
References attr_generic_set_attr(), vehicle::gpx_desc, vehicle::meth, vehicle::priv, vehicle_methods::set_attr, attr::str, attr::type, and attr::u.
Referenced by graphics_sdl_idle(), gui_internal_cmd_set_active_profile(), navit_add_vehicle(), navit_set_attr_do(), request_vehicle_set_attr(), and NGQProxyVehicle::setAttrFunc().
Sets the cursor of a vehicle.
this_ | A vehicle |
cursor | A cursor |
References vehicle::animate_callback, vehicle::animate_timer, callback_cast, callback_destroy(), callback_new_2, vehicle::cursor, vehicle::cursor_fixed, dbg, event_add_timeout(), event_remove_timeout(), vehicle::gra, graphics_overlay_disable(), cursor::interval, lvl_debug, vehicle::need_resize, and vehicle_draw_do().
Referenced by navit_set_cursors(), and vehicle_add_attr().
|
static |
References _, attr_generic_set_attr(), attr_search(), dbg, lvl_error, attr::str, attr::type, and attr::u.
Referenced by vehicle_new().
struct object_func vehicle_func |
Referenced by object_func_lookup(), and vehicle_new().