]> err.no Git - mapper/commitdiff
misc
authorKaj-Michael Lang <milang@angel.tal.org>
Wed, 12 Sep 2007 06:48:03 +0000 (09:48 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Wed, 12 Sep 2007 06:48:03 +0000 (09:48 +0300)
src/gps-panels.c
src/gps-panels.h

index dc2711c692ac4448f492414db85a2273a2cd797c..4bc934091bfa2c1e05b6383469f3edcb1ed70139 100644 (file)
@@ -716,129 +716,126 @@ sat_details_panel_expose(GtkWidget * widget, GdkEventExpose * event)
                        (height / 6) - y / 2 + 40, _sat_details_expose_layout);
        g_free(buffer);
 
-       vprintf("%s(): return\n", __PRETTY_FUNCTION__);
        return TRUE;
 }
 
 gboolean 
 gps_display_details(void)
 {
-       gchar *buffer, litbuf[16];
-       printf("%s()\n", __PRETTY_FUNCTION__);
+gchar *buffer, litbuf[16];
 
-       if (_gps.fix < 2) {
-               /* no fix no fun */
-               gtk_label_set_label(GTK_LABEL(_sdi_lat), " --- ");
-               gtk_label_set_label(GTK_LABEL(_sdi_lon), " --- ");
-               gtk_label_set_label(GTK_LABEL(_sdi_spd), " --- ");
-               gtk_label_set_label(GTK_LABEL(_sdi_alt), " --- ");
-               gtk_label_set_label(GTK_LABEL(_sdi_hea), " --- ");
-               gtk_label_set_label(GTK_LABEL(_sdi_tim), " --:--:-- ");
-       } else {
-               /* latitude */
-               lat_format(_gps.lat, litbuf);
-               gtk_label_set_label(GTK_LABEL(_sdi_lat), litbuf);
-
-               /* longitude */
-               lon_format(_gps.lon, litbuf);
-               gtk_label_set_label(GTK_LABEL(_sdi_lon), litbuf);
-
-               /* speed */
-               gps_display_data_speed(_sdi_spd, _gps.speed);
-
-               /* altitude */
-               switch (_units) {
-               case UNITS_MI:
-               case UNITS_NM:
-                       buffer = g_strdup_printf("%.1f ft", _pos.altitude * 3.2808399f);
-                       break;
-               default:
-                       buffer = g_strdup_printf("%.1f m", _pos.altitude);
-                       break;
-               }
-               gtk_label_set_label(GTK_LABEL(_sdi_alt), buffer);
-               g_free(buffer);
+if (_gps.fix < 2) {
+       /* no fix no fun */
+       gtk_label_set_label(GTK_LABEL(_sdi_lat), " --- ");
+       gtk_label_set_label(GTK_LABEL(_sdi_lon), " --- ");
+       gtk_label_set_label(GTK_LABEL(_sdi_spd), " --- ");
+       gtk_label_set_label(GTK_LABEL(_sdi_alt), " --- ");
+       gtk_label_set_label(GTK_LABEL(_sdi_hea), " --- ");
+       gtk_label_set_label(GTK_LABEL(_sdi_tim), " --:--:-- ");
+} else {
+       /* latitude */
+       lat_format(_gps.lat, litbuf);
+       gtk_label_set_label(GTK_LABEL(_sdi_lat), litbuf);
 
-               /* heading */
-               buffer = g_strdup_printf("%0.0f° (%0.0f)", _gps.heading, fabs(_gps.heading-_gps.lheading));
-               gtk_label_set_label(GTK_LABEL(_sdi_hea), buffer);
-               g_free(buffer);
+       /* longitude */
+       lon_format(_gps.lon, litbuf);
+       gtk_label_set_label(GTK_LABEL(_sdi_lon), litbuf);
 
-               /* local time */
-               strftime(litbuf, 15, "%X", localtime(&_pos.time));
-               gtk_label_set_label(GTK_LABEL(_sdi_tim), litbuf);
-       }
+       /* speed */
+       gps_display_data_speed(_sdi_spd, _gps.speed);
 
-       /* Sat in view */
-       buffer = g_strdup_printf("%d", _gps.satinview);
-       gtk_label_set_label(GTK_LABEL(_sdi_vie), buffer);
+       /* altitude */
+       switch (_units) {
+       case UNITS_MI:
+       case UNITS_NM:
+               buffer = g_strdup_printf("%.1f ft", _pos.altitude * 3.2808399f);
+               break;
+       default:
+               buffer = g_strdup_printf("%.1f m", _pos.altitude);
+               break;
+       }
+       gtk_label_set_label(GTK_LABEL(_sdi_alt), buffer);
        g_free(buffer);
 
-       /* Sat in use */
-       buffer = g_strdup_printf("%d", _gps.satinuse);
-       gtk_label_set_label(GTK_LABEL(_sdi_use), buffer);
+       /* heading */
+       buffer = g_strdup_printf("%0.0f° (%0.0f)", _gps.heading, fabs(_gps.heading-_gps.lheading));
+       gtk_label_set_label(GTK_LABEL(_sdi_hea), buffer);
        g_free(buffer);
 
-       /* fix */
-       switch (_gps.fix) {
+       /* local time */
+       strftime(litbuf, 15, "%X", localtime(&_pos.time));
+       gtk_label_set_label(GTK_LABEL(_sdi_tim), litbuf);
+}
+
+/* Sat in view */
+buffer = g_strdup_printf("%d", _gps.satinview);
+gtk_label_set_label(GTK_LABEL(_sdi_vie), buffer);
+g_free(buffer);
+
+/* Sat in use */
+buffer = g_strdup_printf("%d", _gps.satinuse);
+gtk_label_set_label(GTK_LABEL(_sdi_use), buffer);
+g_free(buffer);
+
+/* fix */
+switch (_gps.fix) {
+case 2:
+case 3:
+       buffer = g_strdup_printf("%dD fix", _gps.fix);
+       break;
+default:
+       buffer = g_strdup_printf("nofix");
+       break;
+}
+gtk_label_set_label(GTK_LABEL(_sdi_fix), buffer);
+g_free(buffer);
+
+if (_gps.fix == 1)
+       buffer = g_strdup("none");
+else {
+       switch (_gps.fixquality) {
+       case 1:
+               buffer = g_strdup(_("SPS"));
+               break;
        case 2:
+               buffer = g_strdup(_("DGPS"));
+               break;
        case 3:
-               buffer = g_strdup_printf("%dD fix", _gps.fix);
+               buffer = g_strdup(_("PPS"));
+               break;
+       case 4:
+               buffer = g_strdup(_("Real Time Kinematic"));
+               break;
+       case 5:
+               buffer = g_strdup(_("Float RTK"));
+               break;
+       case 6:
+               buffer = g_strdup(_("Estimated"));
+               break;
+       case 7:
+               buffer = g_strdup(_("Manual"));
+               break;
+       case 8:
+               buffer = g_strdup(_("Simulation"));
                break;
        default:
-               buffer = g_strdup_printf("nofix");
+               buffer = g_strdup(_("none"));
                break;
        }
-       gtk_label_set_label(GTK_LABEL(_sdi_fix), buffer);
-       g_free(buffer);
-
-       if (_gps.fix == 1)
-               buffer = g_strdup("none");
-       else {
-               switch (_gps.fixquality) {
-               case 1:
-                       buffer = g_strdup(_("SPS"));
-                       break;
-               case 2:
-                       buffer = g_strdup(_("DGPS"));
-                       break;
-               case 3:
-                       buffer = g_strdup(_("PPS"));
-                       break;
-               case 4:
-                       buffer = g_strdup(_("Real Time Kinematic"));
-                       break;
-               case 5:
-                       buffer = g_strdup(_("Float RTK"));
-                       break;
-               case 6:
-                       buffer = g_strdup(_("Estimated"));
-                       break;
-               case 7:
-                       buffer = g_strdup(_("Manual"));
-                       break;
-               case 8:
-                       buffer = g_strdup(_("Simulation"));
-                       break;
-               default:
-                       buffer = g_strdup(_("none"));
-                       break;
-               }
-       }
-       gtk_label_set_label(GTK_LABEL(_sdi_fqu), buffer);
-       g_free(buffer);
+}
+gtk_label_set_label(GTK_LABEL(_sdi_fqu), buffer);
+g_free(buffer);
 
-       /* max speed */
-       gps_display_data_speed(_sdi_msp, _gps.maxspeed);
+/* max speed */
+gps_display_data_speed(_sdi_msp, _gps.maxspeed);
 
-       /* refresh sat panel */
-       gtk_widget_queue_draw_area(GTK_WIDGET(_sat_details_panel),
-                                  0, 0,
-                                  _sat_details_panel->allocation.width,
-                                  _sat_details_panel->allocation.height);
+/* refresh sat panel */
+gtk_widget_queue_draw_area(GTK_WIDGET(_sat_details_panel),
+                          0, 0,
+                          _sat_details_panel->allocation.width,
+                          _sat_details_panel->allocation.height);
 
-       vprintf("%s(): return\n", __PRETTY_FUNCTION__);
-       return TRUE;
+return TRUE;
 }
 
 void 
@@ -861,7 +858,6 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
        break;
 }
 gtk_widget_destroy(dialog);
-
 }
 
 void 
@@ -871,7 +867,6 @@ GtkWidget *dialog;
 GtkWidget *table;
 GtkWidget *label;
 GtkWidget *notebook;
-printf("%s()\n", __PRETTY_FUNCTION__);
 
 dialog = gtk_dialog_new_with_buttons(_("GPS Details"),
                     GTK_WINDOW(_window),
@@ -1003,6 +998,4 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
        break;
 }
 gtk_widget_destroy(dialog);
-
-vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
index a9268311d85e56b8ecf8929c5a539812fbfef29f..838d460272208b7f0551b37d368d1258fe2f006b 100644 (file)
@@ -4,5 +4,8 @@
 GtkWidget *gps_info_panel(void);
 void gps_display_data_speed(GtkWidget *widget, gfloat s);
 void gps_display_data(void);
+void gps_show_info(void);
+void gps_hide_text(void);
+void gps_details_dialog(void);
 
 #endif