From bc6f91210d3f4a7cd8b23bbcdb5fa80db74c8ef2 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 28 Jun 2007 15:39:33 +0300 Subject: [PATCH] Add DOP information text label. --- src/gps-panels.c | 12 ++++++++---- src/ui-common.c | 4 ++++ src/ui-common.h | 4 +++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gps-panels.c b/src/gps-panels.c index dd2e07c..9d37568 100644 --- a/src/gps-panels.c +++ b/src/gps-panels.c @@ -36,6 +36,7 @@ if (_gps.fix < 2) { gtk_label_set_label(GTK_LABEL(_text_lon), " --- "); gtk_label_set_label(GTK_LABEL(_text_speed), " --- "); gtk_label_set_label(GTK_LABEL(_text_alt), " --- "); + gtk_label_set_label(GTK_LABEL(_text_dop), "0/0/0"); } else { gfloat speed = _gps.speed * UNITS_CONVERT[_units]; @@ -74,6 +75,11 @@ if (_gps.fix < 2) { } gtk_label_set_label(GTK_LABEL(_text_alt), buffer); g_free(buffer); + + /* DOP */ + buffer = g_strdup_printf("%.1f/%.1f/%.1f", _gps.hdop, _gps.vdop, _gps.pdop); + gtk_label_set_label(GTK_LABEL(_text_dop), buffer); + g_free(buffer); } /* refresh sat panel */ @@ -262,10 +268,8 @@ if (widget->allocation.width > widget->allocation.height) { xoffset = 0; yoffset = (widget->allocation.height - widget->allocation.width) / 2; } -pango_font_description_set_size(_heading_panel_fontdesc, - 12 * PANGO_SCALE); -pango_layout_set_font_description(_heading_panel_layout, - _heading_panel_fontdesc); +pango_font_description_set_size(_heading_panel_fontdesc, 12 * PANGO_SCALE); +pango_layout_set_font_description(_heading_panel_layout, _heading_panel_fontdesc); pango_layout_set_alignment(_heading_panel_layout, PANGO_ALIGN_CENTER); text = g_strdup_printf("%3.0f°", _gps.heading); diff --git a/src/ui-common.c b/src/ui-common.c index b5d8b63..0c827d7 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -970,6 +970,10 @@ void mapper_init(gint argc, gchar ** argv) gtk_widget_set_size_request(GTK_WIDGET(_text_alt), -1, 30); gtk_box_pack_start(GTK_BOX(vbox), _text_alt, FALSE, TRUE, 0); + _text_dop = gtk_label_new(" --- "); + gtk_widget_set_size_request(GTK_WIDGET(_text_dop), -1, 30); + gtk_box_pack_start(GTK_BOX(vbox), _text_dop, FALSE, TRUE, 0); + label = gtk_label_new(" "); gtk_widget_set_size_request(GTK_WIDGET(label), -1, 10); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, TRUE, 0); diff --git a/src/ui-common.h b/src/ui-common.h index 9e1d059..9519773 100644 --- a/src/ui-common.h +++ b/src/ui-common.h @@ -41,8 +41,10 @@ GtkWidget *_text_lat; GtkWidget *_text_lon; GtkWidget *_text_speed; GtkWidget *_text_alt; -GtkWidget *_sat_panel; +GtkWidget *_text_dop; GtkWidget *_text_time; + +GtkWidget *_sat_panel; GtkWidget *_heading_panel; GtkWidget *_sat_details_panel; -- 2.39.5