Thread: [Gpredict-svn] SF.net SVN: gpredict:[731] branches/gpsd_testing/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <aa...@us...> - 2011-01-05 23:47:48
|
Revision: 731 http://gpredict.svn.sourceforge.net/gpredict/?rev=731&view=rev Author: aa1vs Date: 2011-01-05 23:47:41 +0000 (Wed, 05 Jan 2011) Log Message: ----------- Update AOS information when qth changes and make distinction between qth_data and qth_data_update in function names Modified Paths: -------------- branches/gpsd_testing/src/gtk-sat-module.c branches/gpsd_testing/src/qth-data.c branches/gpsd_testing/src/qth-data.h Modified: branches/gpsd_testing/src/gtk-sat-module.c =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.c 2011-01-04 02:57:02 UTC (rev 730) +++ branches/gpsd_testing/src/gtk-sat-module.c 2011-01-05 23:47:41 UTC (rev 731) @@ -294,7 +294,7 @@ return NULL; } /*initialize the qth engine*/ - qth_data_init(GTK_SAT_MODULE(widget)->qth); + qth_data_update_init(GTK_SAT_MODULE(widget)->qth); /* module state */ if ((g_key_file_has_key (GTK_SAT_MODULE (widget)->cfgdata, @@ -816,7 +816,14 @@ mod->event_count = 0; } /*update the qth position*/ - qth_data_update(mod->qth,mod->tmgCdnum); + /*if new position update stuff*/ + /*should probably have window around qth to reduce distance*/ + if(qth_data_update(mod->qth,mod->tmgCdnum)) { + /* reset counter, this will make gtk_sat_module_update_sat + recalculate events + */ + mod->event_count = 0; + } @@ -1034,7 +1041,7 @@ /** \brief Module options * * Invoke module-wide popup menu - */ + */ static void gtk_sat_module_popup_cb (GtkWidget *button, gpointer data) { Modified: branches/gpsd_testing/src/qth-data.c =================================================================== --- branches/gpsd_testing/src/qth-data.c 2011-01-04 02:57:02 UTC (rev 730) +++ branches/gpsd_testing/src/qth-data.c 2011-01-05 23:47:41 UTC (rev 731) @@ -371,7 +371,9 @@ void qth_data_free (qth_t *qth) { - qth_data_stop(qth); + /*stop any updating*/ + qth_data_update_stop(qth); + if (qth->name) { g_free (qth->name); qth->name = NULL; @@ -404,6 +406,11 @@ g_free (qth); } + +/** \brief Update the qth data by whatever method is appropriate. + * \param qth the qth data structure to update + * \param qth the time at which the qth is to be computed. this may be ignored by gps updates. + */ gboolean qth_data_update(qth_t * qth, gdouble t) { switch (qth->type) { case QTH_STATIC_TYPE: @@ -441,7 +448,13 @@ } } -gboolean qth_data_init(qth_t * qth) { +/** \brief Initialize whatever structures inside the qth_t stucture for later updates. + * \param qth the qth data structure to update + * + *Initial intention of this is to open sockets and ports to gpsd + *and other like services to update the qth position. + */ +gboolean qth_data_update_init(qth_t * qth) { char * server="127.0.0.1"; char *port="2947"; qth->type = QTH_GPSD_TYPE; @@ -470,7 +483,13 @@ return TRUE; } -void qth_data_stop (qth_t *qth) { +/** \brief Shutdown and free structures inside the qth_t stucture were used for updates. + * \param qth the qth data structure to update + * + *Initial intention of this is to open sockets and ports to gpsd + *and other like services to update the qth position. + */ +void qth_data_update_stop (qth_t *qth) { switch (qth->type) { //case QTH_STATIC_TYPE: // break; @@ -491,6 +510,9 @@ } } +/** \brief Load initial values into the qth_t data structure + * \param qth the qth data structure to update + */ void qth_init(qth_t* qth) { qth->lat=0; qth->lon=0; @@ -500,6 +522,11 @@ qth->name=NULL; qth->loc=NULL; } + +/** \brief Load safe values into the qth_t data structure + * \param qth the qth data structure to update + * This can be used if some operation is suspected of corrupting the structure or entering invalid data. Originally it is based on code that reset values if a load/read of a .qth failed. + */ void qth_safe(qth_t* qth) { qth->name = g_strdup (_("Error")); qth->loc = g_strdup (_("Error")); Modified: branches/gpsd_testing/src/qth-data.h =================================================================== --- branches/gpsd_testing/src/qth-data.h 2011-01-04 02:57:02 UTC (rev 730) +++ branches/gpsd_testing/src/qth-data.h 2011-01-05 23:47:41 UTC (rev 731) @@ -58,7 +58,7 @@ gint qth_data_save (const gchar *filename, qth_t *qth); void qth_data_free (qth_t *qth); gboolean qth_data_update(qth_t *qth, gdouble t); -gboolean qth_data_init(qth_t *qth); -void qth_data_stop(qth_t *qth); +gboolean qth_data_update_init(qth_t *qth); +void qth_data_update_stop(qth_t *qth); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-08 18:26:30
|
Revision: 732 http://gpredict.svn.sourceforge.net/gpredict/?rev=732&view=rev Author: aa1vs Date: 2011-01-08 18:26:24 +0000 (Sat, 08 Jan 2011) Log Message: ----------- Make gpsd code safer for multiple modules. Add position comparison for event updates. Modified Paths: -------------- branches/gpsd_testing/src/gtk-sat-map.c branches/gpsd_testing/src/gtk-sat-module.c branches/gpsd_testing/src/gtk-sat-module.h branches/gpsd_testing/src/qth-data.c branches/gpsd_testing/src/qth-data.h Modified: branches/gpsd_testing/src/gtk-sat-map.c =================================================================== --- branches/gpsd_testing/src/gtk-sat-map.c 2011-01-05 23:47:41 UTC (rev 731) +++ branches/gpsd_testing/src/gtk-sat-map.c 2011-01-08 18:26:24 UTC (rev 732) @@ -609,12 +609,41 @@ guint h, m, s; gchar *ch, *cm, *cs; gfloat x,y; + gdouble oldx,oldy; + /* check whether there are any pending resize requests */ if (satmap->resize) update_map_size (satmap); - /* check refresh rate and refresh sats if time */ + /* check if qth has moved significantly if so move it*/ + lonlat_to_xy (satmap, satmap->qth->lon, satmap->qth->lat, &x, &y); + g_object_get (satmap->qthmark, + "x", &oldx, + "y", &oldy, + NULL); + + if ((fabs (oldx-x) >= 2*MARKER_SIZE_HALF) || + (fabs (oldy-y) >= 2*MARKER_SIZE_HALF)) { + + /* update qth mark */ + g_object_set (satmap->qthmark, + "x", x - MARKER_SIZE_HALF, + "y", y - MARKER_SIZE_HALF, + NULL); + g_object_set (satmap->qthlabel, + "x", x, + "y", y+2, + NULL); + + /* QTH info */ + g_object_set (satmap->locnam, + "x", (gdouble) satmap->x0 + 2, + "y", (gdouble) satmap->y0 + 1, + NULL); + } + + /* check refresh rate and refresh sats/qth if time */ if (satmap->counter < satmap->refresh) { satmap->counter++; } @@ -622,7 +651,9 @@ /* reset data */ satmap->counter = 1; satmap->naos = 2458849.5; + /* QTH */ + /*update for accuracy*/ lonlat_to_xy (satmap, satmap->qth->lon, satmap->qth->lat, &x, &y); g_object_set (satmap->qthmark, "x", x - MARKER_SIZE_HALF, Modified: branches/gpsd_testing/src/gtk-sat-module.c =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.c 2011-01-05 23:47:41 UTC (rev 731) +++ branches/gpsd_testing/src/gtk-sat-module.c 2011-01-08 18:26:24 UTC (rev 732) @@ -293,7 +293,7 @@ return NULL; } - /*initialize the qth engine*/ + /*initialize the qth engine and get position*/ qth_data_update_init(GTK_SAT_MODULE(widget)->qth); /* module state */ @@ -816,17 +816,22 @@ mod->event_count = 0; } /*update the qth position*/ - /*if new position update stuff*/ - /*should probably have window around qth to reduce distance*/ if(qth_data_update(mod->qth,mod->tmgCdnum)) { - /* reset counter, this will make gtk_sat_module_update_sat - recalculate events - */ - mod->event_count = 0; + /*only trigger an update if adequate movement has occurred*/ + /*FIXME position threshhold should be configurable*/ + if (qth_small_dist(mod->qth,mod->qth_event)>1.0) { + /* reset counter, this will make gtk_sat_module_update_sat + recalculate events + */ + mod->event_count = 0; + } } - + /*if the events are going to be recalculated store the position*/ + if (mod->event_count == 0){ + qth_small_save(mod->qth,&(mod->qth_event)); + } /* update satellite data */ g_hash_table_foreach (mod->satellites, gtk_sat_module_update_sat, @@ -977,7 +982,7 @@ } - /*** FIXME: we don't need to do this every time! */ + /*data may have been updated by gpsd*/ obs_geodetic.lon = module->qth->lon * de2ra; obs_geodetic.lat = module->qth->lat * de2ra; obs_geodetic.alt = module->qth->alt / 1000.0; Modified: branches/gpsd_testing/src/gtk-sat-module.h =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.h 2011-01-05 23:47:41 UTC (rev 731) +++ branches/gpsd_testing/src/gtk-sat-module.h 2011-01-08 18:26:24 UTC (rev 732) @@ -117,7 +117,7 @@ GKeyFile *cfgdata; /*!< Configuration data. */ qth_t *qth; /*!< QTH information. */ - + qth_small_t qth_event; /*!< QTH information for last AOS/LOS update. */ GHashTable *satellites; /*!< Satellites. */ guint32 timeout; /*!< Timeout value [msec] */ Modified: branches/gpsd_testing/src/qth-data.c =================================================================== --- branches/gpsd_testing/src/qth-data.c 2011-01-05 23:47:41 UTC (rev 731) +++ branches/gpsd_testing/src/qth-data.c 2011-01-08 18:26:24 UTC (rev 732) @@ -38,6 +38,7 @@ #include "config-keys.h" #include "orbit-tools.h" #include "time-tools.h" +#include "locator.h" #if HAS_LIBGPS #include <gps.h> #endif @@ -412,40 +413,47 @@ * \param qth the time at which the qth is to be computed. this may be ignored by gps updates. */ gboolean qth_data_update(qth_t * qth, gdouble t) { + gboolean retval = FALSE; switch (qth->type) { case QTH_STATIC_TYPE: - return FALSE; + /*never changes*/ break; case QTH_GPSD_TYPE: - if (qth->gps_data==NULL) { - return FALSE; - } else { + if (qth->gps_data!=NULL) { #if HAS_LIBGPS if(gps_waiting(qth->gps_data) == 1) { - if(gps_poll(qth->gps_data)==0){ - if (qth->gps_data->fix.mode>=2) { - qth->lat = qth->gps_data->fix.latitude; - qth->lon = qth->gps_data->fix.longitude; + if(gps_poll(qth->gps_data) == 0){ + if (qth->gps_data->fix.mode >= MODE_2D) { + if (qth->lat != qth->gps_data->fix.latitude) { + qth->lat = qth->gps_data->fix.latitude; + retval = TRUE; + } + if (qth->lon!=qth->gps_data->fix.longitude) { + qth->lon = qth->gps_data->fix.longitude; + retval = TRUE; + } } - if (qth->gps_data->fix.mode==3) { - qth->alt=qth->gps_data->fix.altitude; + if (qth->gps_data->fix.mode == MODE_3D) { + if (qth->alt != qth->gps_data->fix.altitude) { + qth->alt = qth->gps_data->fix.altitude; + retval = TRUE; + } + } else { + if (qth->alt != 0) { + qth->alt = 0; + retval = TRUE; + } } } - return (TRUE); - } else { - return FALSE; - } - -#else - return FALSE; + } #endif } - break; default: break; } + return retval; } /** \brief Initialize whatever structures inside the qth_t stucture for later updates. @@ -465,8 +473,10 @@ case QTH_GPSD_TYPE: #if HAS_LIBGPS /* open the connection to gpsd and start the stream */ - qth->gps_data=gps_open(server,port); - if (qth->gps_data==NULL) { + //qth->gps_data=gps_open(server,port); + qth->gps_data=g_try_new0(struct gps_data_t,1); + + if (gps_open_r(server,port,qth->gps_data)==-1) { printf("Could not open gps\n"); return FALSE; } else { @@ -491,8 +501,9 @@ */ void qth_data_update_stop (qth_t *qth) { switch (qth->type) { - //case QTH_STATIC_TYPE: - // break; + case QTH_STATIC_TYPE: + /*nothing to do. the data never updates*/ + break; case QTH_GPSD_TYPE: /* close gpsd socket */ @@ -537,3 +548,26 @@ qth->gps_data=NULL; } +/** \brief Copy values from qth structure to qth_small structure + * \param qth the qth data structure to backup + * \param qth_small the data structure to store values + * This is intended for copying only the minimal qth data to a structure for tagging and later comparison. + */ +void qth_small_save(qth_t*qth,qth_small_t *qth_small){ + qth_small->lat=qth->lat; + qth_small->lon=qth->lon; + qth_small->alt=qth->alt; +} + +/** \brief Compute the distance between a location in a qth_t structure and qth_small_t structure. + * \param qth the qth data structure + * \param qth_small the data structure + * This is intended for measuring distance between the current qth and the position that tagged some data in qth_small. + */ +double qth_small_dist(qth_t *qth,qth_small_t qth_small){ + double distance,azimuth; + /* FIXME Is this the right coordinate system to use? */ + /* a 3d coordinate system might make more sense long term */ + qrb(qth->lon,qth->lat,qth_small.lon,qth_small.lat,&distance,&azimuth); + return(distance); +} Modified: branches/gpsd_testing/src/qth-data.h =================================================================== --- branches/gpsd_testing/src/qth-data.h 2011-01-05 23:47:41 UTC (rev 731) +++ branches/gpsd_testing/src/qth-data.h 2011-01-08 18:26:24 UTC (rev 732) @@ -48,6 +48,15 @@ GKeyFile *data; /*!< Raw data from cfg file. */ } qth_t; +/** \brief Compact QTH data structure for tagging data and comparing. */ +typedef struct { + gdouble lat; /*!< Latitude in dec. deg. North. */ + gdouble lon; /*!< Longitude in dec. deg. East. */ + gint alt; /*!< Altitude above sea level in meters. */ +} qth_small_t; + + + enum { QTH_STATIC_TYPE=0, QTH_GPSD_TYPE @@ -60,5 +69,8 @@ gboolean qth_data_update(qth_t *qth, gdouble t); gboolean qth_data_update_init(qth_t *qth); void qth_data_update_stop(qth_t *qth); - +double qth_small_dist(qth_t *qth,qth_small_t qth_small); +void qth_small_save(qth_t *qth,qth_small_t *qth_small); +void qth_init(qth_t* qth); +void qth_safe(qth_t* qth); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-08 19:51:26
|
Revision: 733 http://gpredict.svn.sourceforge.net/gpredict/?rev=733&view=rev Author: aa1vs Date: 2011-01-08 19:51:20 +0000 (Sat, 08 Jan 2011) Log Message: ----------- Fix segfault when gpsd not connected. Make gtk-polar-view update pass if qth has moved significantly. Add qth_small_t element to pass to check if pass data is old. Modified Paths: -------------- branches/gpsd_testing/src/gtk-polar-view.c branches/gpsd_testing/src/predict-tools.c branches/gpsd_testing/src/predict-tools.h branches/gpsd_testing/src/qth-data.c Modified: branches/gpsd_testing/src/gtk-polar-view.c =================================================================== --- branches/gpsd_testing/src/gtk-polar-view.c 2011-01-08 18:26:24 UTC (rev 732) +++ branches/gpsd_testing/src/gtk-polar-view.c 2011-01-08 19:51:20 UTC (rev 733) @@ -846,6 +846,7 @@ /* free pass info */ free_pass (obj->pass); + obj->pass=NULL; /* if this was the selected satellite we need to clear the info text @@ -914,8 +915,38 @@ g_free (text); } + if (obj->pass) { + if (qth_small_dist(polv->qth,(obj->pass->qth_comp))>1.0){ + root = goo_canvas_get_root_item_model (GOO_CANVAS (polv->canvas)); + /* remove sky track */ + if (obj->showtrack) { + idx = goo_canvas_item_model_find_child (root, obj->track); + if (idx != -1) + goo_canvas_item_model_remove_child (root, idx); + + for (i = 0; i < TRACK_TICK_NUM; i++) { + idx = goo_canvas_item_model_find_child (root, obj->trtick[i]); + if (idx != -1) + goo_canvas_item_model_remove_child (root, idx); + } + } + + /* free pass info */ + free_pass (obj->pass); + obj->pass=NULL; + + /*compute new pass */ + obj->pass = get_current_pass (sat, polv->qth, now); + /* Finally, create the sky track if necessary */ + if (obj->showtrack) + create_track (polv, obj, sat); + + } + } g_free (losstr); g_free (catnum); // FIXME: why free here, what about else? + + } else { /* add sat to canvas */ Modified: branches/gpsd_testing/src/predict-tools.c =================================================================== --- branches/gpsd_testing/src/predict-tools.c 2011-01-08 18:26:24 UTC (rev 732) +++ branches/gpsd_testing/src/predict-tools.c 2011-01-08 19:51:20 UTC (rev 733) @@ -595,6 +595,9 @@ iter++; } } + + /*copy qth data into the pass for later comparisons*/ + qth_small_save(qth,&(pass->qth_comp)); return pass; } @@ -1012,6 +1015,9 @@ pass->tca = tca; } + + /*copy qth data into the pass for later comparisons*/ + qth_small_save(qth,&(pass->qth_comp)); return pass; } Modified: branches/gpsd_testing/src/predict-tools.h =================================================================== --- branches/gpsd_testing/src/predict-tools.h 2011-01-08 18:26:24 UTC (rev 732) +++ branches/gpsd_testing/src/predict-tools.h 2011-01-08 19:51:20 UTC (rev 733) @@ -49,6 +49,7 @@ gdouble maxel_az; /*!< Azimuth at maximum elevation */ gchar vis[4]; /*!< Visibility string, e.g. VSE, -S-, V-- */ GSList *details; /*!< List of pass_detail_t entries */ + qth_small_t qth_comp; /*!< Short version of qth at time computed */ } pass_t; Modified: branches/gpsd_testing/src/qth-data.c =================================================================== --- branches/gpsd_testing/src/qth-data.c 2011-01-08 18:26:24 UTC (rev 732) +++ branches/gpsd_testing/src/qth-data.c 2011-01-08 19:51:20 UTC (rev 733) @@ -472,18 +472,20 @@ break; case QTH_GPSD_TYPE: #if HAS_LIBGPS - /* open the connection to gpsd and start the stream */ - //qth->gps_data=gps_open(server,port); + /* open the connection to gpsd and start the stream */ + //qth->gps_data=gps_open(server,port); qth->gps_data=g_try_new0(struct gps_data_t,1); if (gps_open_r(server,port,qth->gps_data)==-1) { - printf("Could not open gps\n"); - return FALSE; - } else { - (void)gps_stream(qth->gps_data, WATCH_ENABLE, NULL); - } + free(qth->gps_data); + qth->gps_data=NULL; + printf("Could not open gps\n"); + return FALSE; + } else { + (void)gps_stream(qth->gps_data, WATCH_ENABLE, NULL); + } #else - return FALSE; + return FALSE; #endif break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-10 04:26:59
|
Revision: 734 http://gpredict.svn.sourceforge.net/gpredict/?rev=734&view=rev Author: aa1vs Date: 2011-01-10 04:26:53 +0000 (Mon, 10 Jan 2011) Log Message: ----------- Add position based updates for sky-at-a-glance. Move qth updates so they occur all the time. Modified Paths: -------------- branches/gpsd_testing/src/gtk-polar-view.c branches/gpsd_testing/src/gtk-sat-module.c branches/gpsd_testing/src/gtk-sat-module.h Modified: branches/gpsd_testing/src/gtk-polar-view.c =================================================================== --- branches/gpsd_testing/src/gtk-polar-view.c 2011-01-08 19:51:20 UTC (rev 733) +++ branches/gpsd_testing/src/gtk-polar-view.c 2011-01-10 04:26:53 UTC (rev 734) @@ -915,10 +915,13 @@ g_free (text); } + /*check if pass was computed near current qth otherwise update*/ if (obj->pass) { + /* FIXME once again threshold should be user configurable*/ if (qth_small_dist(polv->qth,(obj->pass->qth_comp))>1.0){ + root = goo_canvas_get_root_item_model (GOO_CANVAS (polv->canvas)); - /* remove sky track */ + /* remove sky track */ if (obj->showtrack) { idx = goo_canvas_item_model_find_child (root, obj->track); if (idx != -1) @@ -937,10 +940,11 @@ /*compute new pass */ obj->pass = get_current_pass (sat, polv->qth, now); - /* Finally, create the sky track if necessary */ + + /* Finally, create the sky track if necessary */ if (obj->showtrack) create_track (polv, obj, sat); - + } } g_free (losstr); Modified: branches/gpsd_testing/src/gtk-sat-module.c =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.c 2011-01-08 19:51:20 UTC (rev 733) +++ branches/gpsd_testing/src/gtk-sat-module.c 2011-01-10 04:26:53 UTC (rev 734) @@ -748,8 +748,10 @@ GdkWindowState state; gdouble delta; guint i; + /*update the qth position*/ + if(qth_data_update(mod->qth,mod->tmgCdnum)) { - + } /* in docked state, update only if tab is visible */ switch (mod->state) { @@ -815,8 +817,6 @@ */ mod->event_count = 0; } - /*update the qth position*/ - if(qth_data_update(mod->qth,mod->tmgCdnum)) { /*only trigger an update if adequate movement has occurred*/ /*FIXME position threshhold should be configurable*/ if (qth_small_dist(mod->qth,mod->qth_event)>1.0) { @@ -825,9 +825,9 @@ */ mod->event_count = 0; } - } + /*if the events are going to be recalculated store the position*/ if (mod->event_count == 0){ qth_small_save(mod->qth,&(mod->qth_event)); @@ -1504,8 +1504,12 @@ /** \brief Update GtkSkyGlance view * \param module Pointer to the GtkSatModule widget * - * This function checks how long ago the GtkSkyGlance widget has been updated - * and performs an update if necessary. The current timeout is set to 60 sec. + * This function checks to see if the sky-at-a-glance display needs to be updated + * due to time or qth moving. It checks how long ago the GtkSkyGlance widget was + * updated and performs an update if necessary. The current timeout is set to 60 sec. + * It also checks how far away the qth is from where the GtkSkyGlance + * widget was last updated and triggers an update if necessary. The current + * distance is set to 1km. * * This is a cheap/lazy implementation of automatic update. Instead of * performing a real update by "moving" the objects on the GtkSkyGlance canvas, @@ -1518,9 +1522,18 @@ */ static void update_skg (GtkSatModule *module) { - + gboolean update_needed=FALSE; /* threshold is ~60 seconds */ - if G_UNLIKELY(fabs(module->tmgCdnum - module->lastSkgUpd) > 7.0e-4) { + if (G_UNLIKELY(fabs(module->tmgCdnum - module->lastSkgUpd) > 7.0e-4)) { + update_needed=TRUE; + } + /* threshold is 1km */ + if (G_UNLIKELY(qth_small_dist(module->qth, module->lastSkgUpdqth) >1.0)) { + update_needed=TRUE; + } + + + if (G_UNLIKELY(update_needed==TRUE)) { sat_log_log (SAT_LOG_LEVEL_MSG, _("%s: Updating GtkSkyGlance for %s"), @@ -1532,5 +1545,6 @@ gtk_widget_show_all (module->skg); module->lastSkgUpd = module->tmgCdnum; + qth_small_save(module->qth,&(module->lastSkgUpdqth)); } } Modified: branches/gpsd_testing/src/gtk-sat-module.h =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.h 2011-01-08 19:51:20 UTC (rev 733) +++ branches/gpsd_testing/src/gtk-sat-module.h 2011-01-10 04:26:53 UTC (rev 734) @@ -103,6 +103,7 @@ GtkWidget *skgwin; /*!< Sky at glance window */ GtkWidget *skg; /*!< Sky at glance widget */ gdouble lastSkgUpd; /*!< Daynum of last GtkSkyGlance update */ + qth_small_t lastSkgUpdqth; /*!< QTH information for last GtkSkyGlance update. */ GtkWidget *header; guint head_count; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-19 12:20:37
|
Revision: 738 http://gpredict.svn.sourceforge.net/gpredict/?rev=738&view=rev Author: aa1vs Date: 2011-01-19 12:20:30 +0000 (Wed, 19 Jan 2011) Log Message: ----------- Added initial GPSD API version 5 support. Added engineering gui support for GPSD. Modified Paths: -------------- branches/gpsd_testing/src/gtk-sat-module.c branches/gpsd_testing/src/qth-data.c branches/gpsd_testing/src/qth-data.h branches/gpsd_testing/src/sat-pref-qth-editor.c branches/gpsd_testing/src/sat-pref-qth.c Modified: branches/gpsd_testing/src/gtk-sat-module.c =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.c 2011-01-16 19:24:25 UTC (rev 737) +++ branches/gpsd_testing/src/gtk-sat-module.c 2011-01-19 12:20:30 UTC (rev 738) @@ -1353,9 +1353,9 @@ time_t t; guint size; gchar buff[TIME_FORMAT_MAX_LENGTH+1]; + gchar *buff2; - t = (module->tmgCdnum - 2440587.5)*86400.; fmtstr = sat_cfg_get_str (SAT_CFG_STR_TIME_FORMAT); @@ -1370,8 +1370,17 @@ buff[size]='\0'; else buff[TIME_FORMAT_MAX_LENGTH]='\0'; + + if (module->qth->type==QTH_GPSD_TYPE) { + buff2=g_strdup_printf("%s GPS %0.0f seconds old", buff,fabs(module->tmgCdnum-module->qth->gpsd_update)); + gtk_label_set_text (GTK_LABEL (module->header), buff2); + g_free(buff2); + } + else + gtk_label_set_text (GTK_LABEL (module->header), buff); + - gtk_label_set_text (GTK_LABEL (module->header), buff); + g_free (fmtstr); if (module->tmgActive) Modified: branches/gpsd_testing/src/qth-data.c =================================================================== --- branches/gpsd_testing/src/qth-data.c 2011-01-16 19:24:25 UTC (rev 737) +++ branches/gpsd_testing/src/qth-data.c 2011-01-19 12:20:30 UTC (rev 738) @@ -493,6 +493,7 @@ #if HAS_LIBGPS switch (GPSD_API_MAJOR_VERSION){ case 4: +#if GPSD_API_MAJOR_VERSION==4 if(gps_waiting(qth->gps_data) == 1) { if(gps_poll(qth->gps_data) == 0){ /*handling packet_set inline with @@ -524,16 +525,56 @@ } } } +#endif break; + case 5: +#if GPSD_API_MAJOR_VERSION==5 + if(gps_waiting(qth->gps_data) == 1) { + if(gps_read(qth->gps_data) == 0){ + /*handling packet_set inline with + http://gpsd.berlios.de/client-howto.html + */ + if (qth->gps_data->set&PACKET_SET) { + if (qth->gps_data->fix.mode >= MODE_2D) { + if (qth->lat != qth->gps_data->fix.latitude) { + qth->lat = qth->gps_data->fix.latitude; + retval = TRUE; + } + if (qth->lon!=qth->gps_data->fix.longitude) { + qth->lon = qth->gps_data->fix.longitude; + retval = TRUE; + } + } + + if (qth->gps_data->fix.mode == MODE_3D) { + if (qth->alt != qth->gps_data->fix.altitude) { + qth->alt = qth->gps_data->fix.altitude; + retval = TRUE; + } + } else { + if (qth->alt != 0) { + qth->alt = 0; + retval = TRUE; + } + } + } + } + } +#endif + break; default: break; } #endif + if (retval == TRUE){ + qth->gpsd_update = t; + } } break; default: break; } + /*check that data is valid*/ qth_validate(qth); return retval; } @@ -557,8 +598,8 @@ #if HAS_LIBGPS switch (GPSD_API_MAJOR_VERSION) { case 4: +#if GPSD_API_MAJOR_VERSION==4 /* open the connection to gpsd and start the stream */ - //qth->gps_data=gps_open(server,port); qth->gps_data = g_try_new0(struct gps_data_t,1); port=g_strdup_printf("%d",qth->gpsd_port); if (gps_open_r(qth->gpsd_server,port,qth->gps_data)==-1) { @@ -573,7 +614,27 @@ retval = TRUE; } g_free(port); +#endif break; + case 5: +#if GPSD_API_MAJOR_VERSION==5 + /* open the connection to gpsd and start the stream */ + qth->gps_data = g_try_new0(struct gps_data_t,1); + port=g_strdup_printf("%d",qth->gpsd_port); + if (gps_open(qth->gpsd_server,port,qth->gps_data)==-1) { + free(qth->gps_data); + qth->gps_data = NULL; + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Could not open gpsd at %s:%d"), + __FUNCTION__, qth->gpsd_server, qth->gpsd_port); + retval = FALSE; + } else { + (void)gps_stream(qth->gps_data, WATCH_ENABLE, NULL); + retval = TRUE; + } + g_free(port); +#endif + break; default: sat_log_log (SAT_LOG_LEVEL_ERROR, _("%s: Unsupported gpsd api major version (%d)"), @@ -614,6 +675,9 @@ case 4: gps_close(qth->gps_data); break; + case 5: + gps_close(qth->gps_data); + break; default: break; } Modified: branches/gpsd_testing/src/qth-data.h =================================================================== --- branches/gpsd_testing/src/qth-data.h 2011-01-16 19:24:25 UTC (rev 737) +++ branches/gpsd_testing/src/qth-data.h 2011-01-19 12:20:30 UTC (rev 738) @@ -47,6 +47,7 @@ gint type; /*!< QTH type (static,gpsd). */ gchar *gpsd_server; /*!< GPSD Server name. */ gint gpsd_port; /*!< GPSD Server port. */ + gdouble gpsd_update; /*!< Time last GPSD update was received. */ struct gps_data_t *gps_data; /*!< gpsd data structure. */ GKeyFile *data; /*!< Raw data from cfg file. */ } qth_t; Modified: branches/gpsd_testing/src/sat-pref-qth-editor.c =================================================================== --- branches/gpsd_testing/src/sat-pref-qth-editor.c 2011-01-16 19:24:25 UTC (rev 737) +++ branches/gpsd_testing/src/sat-pref-qth-editor.c 2011-01-19 12:20:30 UTC (rev 738) @@ -79,6 +79,7 @@ static GtkWidget *ns,*ew; static GtkWidget *qra; /* QRA locator */ +static GtkWidget *type; /* GPSD type */ static GtkWidget *server; /* GPSD Server */ static GtkWidget *port; /* GPSD Port */ static gulong latsigid,lonsigid,nssigid,ewsigid,qrasigid; @@ -358,13 +359,25 @@ G_CALLBACK (select_location), GUINT_TO_POINTER (SELECTION_MODE_WX)); gtk_table_attach_defaults (GTK_TABLE (table), wxbut, 3, 4, 7, 8); + /* GPSD enabled*/ + label = gtk_label_new (_("QTHtype")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11); + + type = gtk_spin_button_new_with_range (0, 1, 1); + gtk_spin_button_set_increments (GTK_SPIN_BUTTON (type), 1, 1); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (type), TRUE); + gtk_tooltips_set_tip (tooltips, type, + _("zero for old, 1 for gpsd"), + NULL); + gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 10, 11); /* GPSD Server */ label = gtk_label_new (_("GPSD Server")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9); server = gtk_entry_new (); - gtk_entry_set_max_length (GTK_ENTRY (server), 6); + gtk_entry_set_max_length (GTK_ENTRY (server), 6000); tooltips = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips, server, _("GPSD Server."), @@ -409,9 +422,11 @@ gdouble qthlon; /* longitude */ guint qthalt; /* altitude */ gchar *qthwx; /* weather station */ + gchar *qthgpsdserver; /* gpsdserver */ + guint qthtype; /* type */ + guint qthgpsdport; /* gpsdport */ - selection = gtk_tree_view_get_selection (treeview); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { @@ -425,6 +440,9 @@ QTH_LIST_COL_LON, &qthlon, QTH_LIST_COL_ALT, &qthalt, QTH_LIST_COL_WX, &qthwx, + QTH_LIST_COL_GPSD_SERVER, &qthgpsdserver, + QTH_LIST_COL_GPSD_PORT, &qthgpsdport, + QTH_LIST_COL_TYPE, &qthtype, -1); /* update widgets and free memory afterwards */ @@ -446,6 +464,10 @@ gtk_entry_set_text (GTK_ENTRY (wx), qthwx); g_free (qthwx); } + if (qthgpsdserver) { + gtk_entry_set_text (GTK_ENTRY (server), qthgpsdserver); + g_free (qthgpsdserver); + } if (qthlat < 0.00) gtk_combo_box_set_active (GTK_COMBO_BOX (ns), 1); @@ -462,6 +484,8 @@ gtk_spin_button_set_value (GTK_SPIN_BUTTON (lon), fabs (qthlon)); gtk_spin_button_set_value (GTK_SPIN_BUTTON (alt), qthalt); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (port), qthgpsdport); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (type), qthtype); sat_log_log (SAT_LOG_LEVEL_DEBUG, _("%s:%d: Loaded %s for editing:\n"\ @@ -517,9 +541,12 @@ const gchar *qthloc; const gchar *qthdesc; const gchar *qthwx; + const gchar *qthgpsdserver; gdouble qthlat; gdouble qthlon; guint qthalt; + guint qthtype; + guint qthgpsdport; const gchar *qthqra; @@ -529,6 +556,7 @@ qthloc = gtk_entry_get_text (GTK_ENTRY (location)); qthdesc = gtk_entry_get_text (GTK_ENTRY (desc)); qthwx = gtk_entry_get_text (GTK_ENTRY (wx)); + qthgpsdserver = gtk_entry_get_text (GTK_ENTRY (server)); qthlat = gtk_spin_button_get_value (GTK_SPIN_BUTTON (lat)); if (gtk_combo_box_get_active (GTK_COMBO_BOX (ns))) @@ -539,6 +567,8 @@ qthlon = -qthlon; qthalt = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (alt)); + qthgpsdport = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (port)); + qthtype = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (type)); /* get liststore */ liststore = GTK_LIST_STORE (gtk_tree_view_get_model (treeview)); @@ -574,6 +604,9 @@ QTH_LIST_COL_LON, qthlon, QTH_LIST_COL_ALT, qthalt, QTH_LIST_COL_WX, qthwx, + QTH_LIST_COL_GPSD_SERVER, qthgpsdserver, + QTH_LIST_COL_GPSD_PORT, qthgpsdport, + QTH_LIST_COL_TYPE, qthtype, -1); qthqra = gtk_entry_get_text (GTK_ENTRY (qra)); Modified: branches/gpsd_testing/src/sat-pref-qth.c =================================================================== --- branches/gpsd_testing/src/sat-pref-qth.c 2011-01-16 19:24:25 UTC (rev 737) +++ branches/gpsd_testing/src/sat-pref-qth.c 2011-01-19 12:20:30 UTC (rev 738) @@ -225,13 +225,13 @@ /* alt column */ renderer = gtk_cell_renderer_text_new (); if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_IMPERIAL)) { - column = gtk_tree_view_column_new_with_attributes (_("Alt (ft)"), + column = gtk_tree_view_column_new_with_attributes (_("Alt\n(ft)"), renderer, "text", QTH_LIST_COL_ALT, NULL); } else { - column = gtk_tree_view_column_new_with_attributes (_("Alt (m)"), renderer, + column = gtk_tree_view_column_new_with_attributes (_("Alt\n(m)"), renderer, "text", QTH_LIST_COL_ALT, NULL); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-25 23:17:49
|
Revision: 743 http://gpredict.svn.sourceforge.net/gpredict/?rev=743&view=rev Author: aa1vs Date: 2011-01-25 23:17:43 +0000 (Tue, 25 Jan 2011) Log Message: ----------- Separated gps updates from gps connect attempts. Added watchdog around gps_read/gps_poll code to address gpsd behavior. Modified Paths: -------------- branches/gpsd_testing/src/qth-data.c branches/gpsd_testing/src/qth-data.h Modified: branches/gpsd_testing/src/qth-data.c =================================================================== --- branches/gpsd_testing/src/qth-data.c 2011-01-24 17:02:05 UTC (rev 742) +++ branches/gpsd_testing/src/qth-data.c 2011-01-25 23:17:43 UTC (rev 743) @@ -484,17 +484,36 @@ */ gboolean qth_data_update(qth_t * qth, gdouble t) { gboolean retval = FALSE; + guint num_loops=0; switch (qth->type) { case QTH_STATIC_TYPE: /*never changes*/ break; case QTH_GPSD_TYPE: + if (((t-qth->gpsd_update)>30.0/86400.0)&&(t-qth->gpsd_connected>30.0/86400.0)){ + /*if needed restart the gpsd interface*/ + qth_data_update_stop(qth); + qth_data_update_init(qth); + qth->gpsd_connected=t; + + } + if (qth->gps_data!=NULL) { #if HAS_LIBGPS switch (GPSD_API_MAJOR_VERSION){ case 4: #if GPSD_API_MAJOR_VERSION==4 - if(gps_waiting(qth->gps_data) == 1) { + while(gps_waiting(qth->gps_data) == TRUE) { + /* this is a watchdog in case there is a problem with the gpsd code.*/ + /* if the server was up and has failed then gps_waiting in 2.92 confirmed */ + /* will return 1 (supposedly fixed in later versions.)*/ + /* if we do not do this as a while loop, the gpsd packets can backup */ + /* and no longer be in sync with the gps receiver*/ + num_loops++; + if (num_loops>10000){ + retval=FALSE; + break; + } if(gps_poll(qth->gps_data) == 0){ /*handling packet_set inline with http://gpsd.berlios.de/client-howto.html @@ -529,7 +548,12 @@ break; case 5: #if GPSD_API_MAJOR_VERSION==5 - if(gps_waiting(qth->gps_data) == 1) { + while(gps_waiting(qth->gps_data) == 1) { + num_loops++; + if (num_loops>10000){ + retval=FALSE; + break; + } if(gps_read(qth->gps_data) == 0){ /*handling packet_set inline with http://gpsd.berlios.de/client-howto.html Modified: branches/gpsd_testing/src/qth-data.h =================================================================== --- branches/gpsd_testing/src/qth-data.h 2011-01-24 17:02:05 UTC (rev 742) +++ branches/gpsd_testing/src/qth-data.h 2011-01-25 23:17:43 UTC (rev 743) @@ -48,6 +48,7 @@ gchar *gpsd_server; /*!< GPSD Server name. */ gint gpsd_port; /*!< GPSD Server port. */ gdouble gpsd_update; /*!< Time last GPSD update was received. */ + gdouble gpsd_connected; /*!< Time last GPSD update was last attempted to connect. */ struct gps_data_t *gps_data; /*!< gpsd data structure. */ GKeyFile *data; /*!< Raw data from cfg file. */ } qth_t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-26 22:45:50
|
Revision: 744 http://gpredict.svn.sourceforge.net/gpredict/?rev=744&view=rev Author: aa1vs Date: 2011-01-26 22:45:43 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Code cleanup Modified Paths: -------------- branches/gpsd_testing/src/gtk-sat-module.c branches/gpsd_testing/src/qth-data.c Modified: branches/gpsd_testing/src/gtk-sat-module.c =================================================================== --- branches/gpsd_testing/src/gtk-sat-module.c 2011-01-25 23:17:43 UTC (rev 743) +++ branches/gpsd_testing/src/gtk-sat-module.c 2011-01-26 22:45:43 UTC (rev 744) @@ -802,7 +802,7 @@ /* time to update header? */ mod->head_count++; - if (mod->head_count == mod->head_timeout) { + if (mod->head_count >= mod->head_timeout) { /* reset counter */ mod->head_count = 0; @@ -818,17 +818,15 @@ */ mod->event_count = 0; } - /*only trigger an update if adequate movement has occurred*/ - /*FIXME position threshhold should be configurable*/ - if (qth_small_dist(mod->qth,mod->qth_event)>1.0) { - /* reset counter, this will make gtk_sat_module_update_sat - recalculate events - */ - mod->event_count = 0; - } - - - + /*only trigger an update if adequate movement has occurred*/ + /*FIXME position threshhold should be configurable*/ + if (qth_small_dist(mod->qth,mod->qth_event)>1.0) { + /* reset counter, this will make gtk_sat_module_update_sat + recalculate events + */ + mod->event_count = 0; + } + /*if the events are going to be recalculated store the position*/ if (mod->event_count == 0){ qth_small_save(mod->qth,&(mod->qth_event)); Modified: branches/gpsd_testing/src/qth-data.c =================================================================== --- branches/gpsd_testing/src/qth-data.c 2011-01-25 23:17:43 UTC (rev 743) +++ branches/gpsd_testing/src/qth-data.c 2011-01-26 22:45:43 UTC (rev 744) @@ -728,6 +728,8 @@ qth->loc=NULL; qth->gpsd_port=0; qth->gpsd_server=NULL; + qth->gpsd_update=0.0; + qth->gpsd_connected=0.0; } /** \brief Load safe values into the qth_t data structure This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-01-27 01:49:34
|
Revision: 747 http://gpredict.svn.sourceforge.net/gpredict/?rev=747&view=rev Author: aa1vs Date: 2011-01-27 01:49:27 +0000 (Thu, 27 Jan 2011) Log Message: ----------- Merged trunk changes into branch Fixed segfault when pass recomputed on position returns a null. Modified Paths: -------------- branches/gpsd_testing/src/gtk-polar-plot.c branches/gpsd_testing/src/gtk-rot-ctrl.c branches/gpsd_testing/src/tle-update.c Property Changed: ---------------- branches/gpsd_testing/src/gtk-rig-ctrl.c branches/gpsd_testing/src/gtk-rig-ctrl.h branches/gpsd_testing/src/gtk-rot-ctrl.c branches/gpsd_testing/src/gtk-rot-ctrl.h Modified: branches/gpsd_testing/src/gtk-polar-plot.c =================================================================== --- branches/gpsd_testing/src/gtk-polar-plot.c 2011-01-27 00:36:02 UTC (rev 746) +++ branches/gpsd_testing/src/gtk-polar-plot.c 2011-01-27 01:49:27 UTC (rev 747) @@ -937,8 +937,9 @@ points->coords[2*i+1] = (double) y; if (!(i % tres)) { - /* create a time tick */ - pv->trtick[ttidx] = create_time_tick (pv, detail->time, x, y); + if (ttidx<TRACK_TICK_NUM) + /* create a time tick */ + pv->trtick[ttidx] = create_time_tick (pv, detail->time, x, y); ttidx++; } } @@ -1054,9 +1055,11 @@ x += 5; } /* update time tick */ - g_object_set (pv->trtick[ttidx], - "x", (gdouble) x, "y", (gdouble) y, - NULL); + if (ttidx<TRACK_TICK_NUM){ + g_object_set (pv->trtick[ttidx], + "x", (gdouble) x, "y", (gdouble) y, + NULL); + } ttidx++; } } Property changes on: branches/gpsd_testing/src/gtk-rig-ctrl.c ___________________________________________________________________ Modified: svn:mergeinfo - /branches/continuous_network/src/gtk-rig-ctrl.c:655-689 + /branches/continuous_network/src/gtk-rig-ctrl.c:655-689 /trunk/src/gtk-rig-ctrl.c:728-746 Property changes on: branches/gpsd_testing/src/gtk-rig-ctrl.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/continuous_network/src/gtk-rig-ctrl.h:655-689 + /branches/continuous_network/src/gtk-rig-ctrl.h:655-689 /trunk/src/gtk-rig-ctrl.h:728-746 Modified: branches/gpsd_testing/src/gtk-rot-ctrl.c =================================================================== --- branches/gpsd_testing/src/gtk-rot-ctrl.c 2011-01-27 00:36:02 UTC (rev 746) +++ branches/gpsd_testing/src/gtk-rot-ctrl.c 2011-01-27 01:49:27 UTC (rev 747) @@ -304,19 +304,22 @@ g_free (buff); update_count_down (ctrl, t); - - - /* update next pass if necessary */ - if (ctrl->pass != NULL) { - /*if the current pass is too far away*/ + + /*if the current pass is too far away*/ + if ((ctrl->pass!=NULL)&& (ctrl->qth!=NULL)) if (qth_small_dist(ctrl->qth,ctrl->pass->qth_comp)>1.0){ free_pass (ctrl->pass); ctrl->pass=NULL; ctrl->pass = get_pass (ctrl->target, ctrl->qth, t, 3.0); - set_flipped_pass(ctrl); - /* update polar plot */ - gtk_polar_plot_set_pass (GTK_POLAR_PLOT (ctrl->plot), ctrl->pass); + if (ctrl->pass) { + set_flipped_pass(ctrl); + /* update polar plot */ + gtk_polar_plot_set_pass (GTK_POLAR_PLOT (ctrl->plot), ctrl->pass); + } } + + /* update next pass if necessary */ + if (ctrl->pass != NULL) { /*if we are not in the current pass*/ if ((ctrl->pass->aos>t)||(ctrl->pass->los<t)){ /* the pass may not have met the minimum @@ -880,7 +883,6 @@ gdouble setaz=0.0, setel=0.0; gchar *text; gboolean error = FALSE; - gboolean update_flag=FALSE; sat_t sat_working, *sat; /*parameters for path predictions*/ gdouble time_delta; @@ -904,18 +906,15 @@ if (ctrl->t < ctrl->pass->aos) { setaz=ctrl->pass->aos_az; setel=0; - update_flag=TRUE; } else if (ctrl->t > ctrl->pass->los) { setaz=ctrl->pass->los_az; setel=0; - update_flag=TRUE; } } } else { setaz=ctrl->target->az; setel=ctrl->target->el; - update_flag=TRUE; } /* if this is a flipped pass and the rotor supports it*/ if ((ctrl->flipped)&&(ctrl->conf->maxel>=180.0)){ @@ -1011,7 +1010,7 @@ else sat->az += 180.0; } - if ((ctrl->conf->aztype == ROT_AZ_TYPE_180) && (setaz > 180.0)) { + if ((ctrl->conf->aztype == ROT_AZ_TYPE_180) && (sat->az > 180.0)) { sat->az = sat->az - 360.0; } if ((sat->el < 0.0)||(sat->el > 180.0)|| @@ -1033,6 +1032,19 @@ setaz = sat->az; } } + /*need to do this here in case the step size is too small*/ + if ((ctrl->flipped) && (ctrl->conf->maxel >= 180.0)){ + setel = 180.0-setel; + if (setaz > 180.0) + setaz -= 180.0; + else + setaz += 180.0; + } + + if ((ctrl->conf->aztype == ROT_AZ_TYPE_180) && (setaz > 180.0)) { + setaz = setaz - 360.0; + } + /* send controller values to rotator device */ /* this is the newly computed value which should be ahead of the current position */ if (!set_pos (ctrl, setaz, setel)) { Property changes on: branches/gpsd_testing/src/gtk-rot-ctrl.c ___________________________________________________________________ Modified: svn:mergeinfo - /branches/continuous_network/src/gtk-rot-ctrl.c:655-689 + /branches/continuous_network/src/gtk-rot-ctrl.c:655-689 /trunk/src/gtk-rot-ctrl.c:728-746 Property changes on: branches/gpsd_testing/src/gtk-rot-ctrl.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/continuous_network/src/gtk-rot-ctrl.h:655-689 + /branches/continuous_network/src/gtk-rot-ctrl.h:655-689 /trunk/src/gtk-rot-ctrl.h:728-746 Modified: branches/gpsd_testing/src/tle-update.c =================================================================== --- branches/gpsd_testing/src/tle-update.c 2011-01-27 00:36:02 UTC (rev 746) +++ branches/gpsd_testing/src/tle-update.c 2011-01-27 01:49:27 UTC (rev 747) @@ -730,17 +730,18 @@ static gboolean is_tle_file (const gchar *dir, const gchar *fnam) { gchar *path; + gchar *fname_lower; gboolean fileIsOk = FALSE; - path = g_strconcat (dir, G_DIR_SEPARATOR_S, fnam, NULL); + fname_lower=g_ascii_strdown(fnam,-1); if (g_file_test (path, G_FILE_TEST_IS_REGULAR) && - (g_str_has_suffix(fnam, ".tle") || g_str_has_suffix(fnam, ".txt"))) + (g_str_has_suffix(fname_lower, ".tle") || g_str_has_suffix(fname_lower, ".txt"))) { fileIsOk = TRUE; } - + g_free (fname_lower); g_free (path); return fileIsOk; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-03-06 02:54:16
|
Revision: 781 http://gpredict.svn.sourceforge.net/gpredict/?rev=781&view=rev Author: aa1vs Date: 2011-03-06 02:54:10 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Change GPSD selection to combo_box Modified Paths: -------------- branches/gpsd_testing/src/qth-editor.c branches/gpsd_testing/src/sat-pref-qth-editor.c Modified: branches/gpsd_testing/src/qth-editor.c =================================================================== --- branches/gpsd_testing/src/qth-editor.c 2011-03-02 11:14:35 UTC (rev 780) +++ branches/gpsd_testing/src/qth-editor.c 2011-03-06 02:54:10 UTC (rev 781) @@ -2,7 +2,7 @@ /* Gpredict: Real-time satellite tracking and orbit prediction program - Copyright (C) 2001-2009 Alexandru Csete, OZ9AEC. + Copyright (C) 2001-2011 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <oz...@gm...> @@ -377,21 +377,22 @@ gtk_table_attach_defaults (GTK_TABLE (table), wxbut, 3, 4, 7, 8); /* GPSD enabled*/ - label = gtk_label_new (_("QTHtype")); + label = gtk_label_new (_("QTH Type")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9); - type = gtk_spin_button_new_with_range (0, 1, 1); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON (type), 1, 1); - gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (type), TRUE); + type = gtk_combo_box_new_text(); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), "Static"); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), "GPSD"); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); gtk_tooltips_set_tip (tooltips, type, - _("zero for old, 1 for gpsd"), + _("A qth can be static, ie. it does not change, or gpsd based for computers with gps attached."), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 10, 11); + gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 8, 9); /* GPSD Server */ label = gtk_label_new (_("GPSD Server")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 9, 10); server = gtk_entry_new (); gtk_entry_set_max_length (GTK_ENTRY (server), 6000); @@ -399,20 +400,20 @@ gtk_tooltips_set_tip (tooltips, server, _("GPSD Server."), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), server, 1, 2, 8, 9); + gtk_table_attach_defaults (GTK_TABLE (table), server, 1, 2, 9, 10); /* GPSD Port*/ label = gtk_label_new (_("GPSD Port")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 9, 10); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11); port = gtk_spin_button_new_with_range (0, 32768, 1); gtk_spin_button_set_increments (GTK_SPIN_BUTTON (port), 1, 100); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (port), TRUE); gtk_tooltips_set_tip (tooltips, port, - _("Set the port for GPSD to use"), + _("Set the port for GPSD to use. Default for gpsd is 2947."), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), port, 1, 2, 9, 10); + gtk_table_attach_defaults (GTK_TABLE (table), port, 1, 2, 10, 11); if (qth->name != NULL) @@ -531,9 +532,10 @@ qthalt = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (alt)); qthqra = gtk_entry_get_text (GTK_ENTRY (qra)); - gpsdenabled = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (type)); + gpsdenabled = gtk_combo_box_get_active ( GTK_COMBO_BOX (type) ); gpsdserver = gtk_entry_get_text (GTK_ENTRY (server)); gpsdport = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (port)); + /* clear qth struct if not empty */ /* if (qth->name != NULL) */ /* g_free (qth->name); */ Modified: branches/gpsd_testing/src/sat-pref-qth-editor.c =================================================================== --- branches/gpsd_testing/src/sat-pref-qth-editor.c 2011-03-02 11:14:35 UTC (rev 780) +++ branches/gpsd_testing/src/sat-pref-qth-editor.c 2011-03-06 02:54:10 UTC (rev 781) @@ -360,21 +360,22 @@ GUINT_TO_POINTER (SELECTION_MODE_WX)); gtk_table_attach_defaults (GTK_TABLE (table), wxbut, 3, 4, 7, 8); /* GPSD enabled*/ - label = gtk_label_new (_("QTHtype")); + label = gtk_label_new (_("QTH Type")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9); - type = gtk_spin_button_new_with_range (0, 1, 1); - gtk_spin_button_set_increments (GTK_SPIN_BUTTON (type), 1, 1); - gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (type), TRUE); + type = gtk_combo_box_new_text(); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), "Static"); + gtk_combo_box_append_text (GTK_COMBO_BOX (type), "GPSD"); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), 0); gtk_tooltips_set_tip (tooltips, type, - _("zero for old, 1 for gpsd"), + _("A qth can be static, ie. it does not change, or gpsd based for computers with gps attached."), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 10, 11); + gtk_table_attach_defaults (GTK_TABLE (table), type, 1, 2, 8, 9); /* GPSD Server */ label = gtk_label_new (_("GPSD Server")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 8, 9); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 9, 10); server = gtk_entry_new (); gtk_entry_set_max_length (GTK_ENTRY (server), 6000); @@ -382,20 +383,20 @@ gtk_tooltips_set_tip (tooltips, server, _("GPSD Server."), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), server, 1, 2, 8, 9); + gtk_table_attach_defaults (GTK_TABLE (table), server, 1, 2, 9, 10); /* GPSD Port*/ label = gtk_label_new (_("GPSD Port")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 9, 10); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 10, 11); port = gtk_spin_button_new_with_range (0, 32768, 1); gtk_spin_button_set_increments (GTK_SPIN_BUTTON (port), 1, 100); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (port), TRUE); gtk_tooltips_set_tip (tooltips, port, - _("Set the port for GPSD to use"), + _("Set the port for GPSD to use. Default for gpsd is 2947."), NULL); - gtk_table_attach_defaults (GTK_TABLE (table), port, 1, 2, 9, 10); + gtk_table_attach_defaults (GTK_TABLE (table), port, 1, 2, 10, 11); if (!new) @@ -485,7 +486,7 @@ gtk_spin_button_set_value (GTK_SPIN_BUTTON (alt), qthalt); gtk_spin_button_set_value (GTK_SPIN_BUTTON (port), qthgpsdport); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (type), qthtype); + gtk_combo_box_set_active (GTK_COMBO_BOX (type), qthtype); sat_log_log (SAT_LOG_LEVEL_DEBUG, _("%s:%d: Loaded %s for editing:\n"\ @@ -568,7 +569,7 @@ qthalt = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (alt)); qthgpsdport = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (port)); - qthtype = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (type)); + qthtype = gtk_combo_box_get_active ( GTK_COMBO_BOX (type)); /* get liststore */ liststore = GTK_LIST_STORE (gtk_tree_view_get_model (treeview)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |