(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
break;
}
gtk_widget_destroy(dialog);
-
}
void
GtkWidget *table;
GtkWidget *label;
GtkWidget *notebook;
-printf("%s()\n", __PRETTY_FUNCTION__);
dialog = gtk_dialog_new_with_buttons(_("GPS Details"),
GTK_WINDOW(_window),
break;
}
gtk_widget_destroy(dialog);
-
-vprintf("%s(): return\n", __PRETTY_FUNCTION__);
}