Thread: [Gpredict-svn] SF.net SVN: gpredict:[825] trunk (Page 9)
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <aa...@us...> - 2011-05-26 13:00:56
|
Revision: 825 http://gpredict.svn.sourceforge.net/gpredict/?rev=825&view=rev Author: aa1vs Date: 2011-05-26 13:00:50 +0000 (Thu, 26 May 2011) Log Message: ----------- Save selected satellite in single satellite view. Modified Paths: -------------- trunk/ChangeLog trunk/src/config-keys.h trunk/src/gtk-sat-module.c trunk/src/gtk-single-sat.c trunk/src/sat-cfg.c trunk/src/sat-cfg.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-05-24 12:25:51 UTC (rev 824) +++ trunk/ChangeLog 2011-05-26 13:00:50 UTC (rev 825) @@ -1,3 +1,14 @@ +2011-05-26 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-single-sat.c + * src/config-keys.h + * src/sat-cfg.c + * src/sat-cfg.h + * src/gtk-sat-module.c + * src/gtk-single-sat.c + Save selected satellite in single sat view. + Part of Feature Request: 3179738 + 2011-05-14 Charles Suprin <hamaa1vs at gmail.com> * data/trsp/25338.trsp Modified: trunk/src/config-keys.h =================================================================== --- trunk/src/config-keys.h 2011-05-24 12:25:51 UTC (rev 824) +++ trunk/src/config-keys.h 2011-05-26 13:00:50 UTC (rev 825) @@ -130,6 +130,7 @@ #define MOD_CFG_SINGLE_SAT_SECTION "SINGLE_SAT" #define MOD_CFG_SINGLE_SAT_REFRESH "REFRESH" #define MOD_CFG_SINGLE_SAT_FIELDS "FIELDS" +#define MOD_CFG_SINGLE_SAT_SELECT "SELECTED" /* event list */ #define MOD_CFG_EVENT_LIST_SECTION "EVENT_LIST" Modified: trunk/src/gtk-sat-module.c =================================================================== --- trunk/src/gtk-sat-module.c 2011-05-24 12:25:51 UTC (rev 824) +++ trunk/src/gtk-sat-module.c 2011-05-26 13:00:50 UTC (rev 825) @@ -206,6 +206,8 @@ { GtkSatModule *module = GTK_SAT_MODULE (object); + /*save the configuration*/ + mod_cfg_save (module->name, module->cfgdata); /* stop timeout */ if (module->timerid > 0) @@ -977,9 +979,18 @@ sat->aos = find_aos (sat, module->qth, daynum, maxdt); sat->los = find_los (sat, module->qth, daynum, maxdt); + } + /*update aos if it was known and is stale*/ + if (sat->aos > 0 && sat->aos < daynum) { + maxdt = (gdouble) sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD); + sat->aos = find_aos (sat, module->qth, daynum, maxdt); + } + /*update los if it was known is stale*/ + if (sat->los > 0 && sat->los < daynum) { + maxdt = (gdouble) sat_cfg_get_int (SAT_CFG_INT_PRED_LOOK_AHEAD); + sat->los = find_los (sat, module->qth, daynum, maxdt); } - /*data may have been updated by gpsd*/ obs_geodetic.lon = module->qth->lon * de2ra; obs_geodetic.lat = module->qth->lat * de2ra; @@ -1079,9 +1090,6 @@ _("%s: Module %s recevied CLOSE signal."), __FUNCTION__, name); - /* save configuration to ensure that dynamic data like state is stored */ - mod_cfg_save (module->name, module->cfgdata); - switch (module->state) { case GTK_SAT_MOD_STATE_DOCKED: @@ -1163,7 +1171,11 @@ __FUNCTION__, name, module->state); break; } + /* save configuration to ensure that dynamic data like state is stored */ + mod_cfg_save (module->name, module->cfgdata); + + /* appearantly, module will be destroyed when removed from notebook */ /* gtk_widget_destroy (GTK_WIDGET (module)); */ Modified: trunk/src/gtk-single-sat.c =================================================================== --- trunk/src/gtk-single-sat.c 2011-05-24 12:25:51 UTC (rev 824) +++ trunk/src/gtk-single-sat.c 2011-05-26 13:00:50 UTC (rev 825) @@ -197,6 +197,10 @@ static void gtk_single_sat_destroy (GtkObject *object) { + GtkSingleSat *ssat = GTK_SINGLE_SAT(object); + sat_t *sat = SAT (g_slist_nth_data (ssat->sats, ssat->selected)); + g_key_file_set_integer (ssat->cfgdata,MOD_CFG_SINGLE_SAT_SECTION,MOD_CFG_SINGLE_SAT_SELECT,sat->tle.catnr); + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -213,9 +217,8 @@ sat_t *sat; gchar *title; guint i; + gint selectedcatnum; - - widget = g_object_new (GTK_TYPE_SINGLE_SAT, NULL); GTK_SINGLE_SAT (widget)->update = gtk_single_sat_update; @@ -244,7 +247,12 @@ MOD_CFG_SINGLE_SAT_REFRESH, SAT_CFG_INT_SINGLE_SAT_REFRESH); GTK_SINGLE_SAT (widget)->counter = 1; - + + /* get selected catnum if available */ + selectedcatnum = mod_cfg_get_int (cfgdata, + MOD_CFG_SINGLE_SAT_SECTION, + MOD_CFG_SINGLE_SAT_SELECT, + SAT_CFG_INT_SINGLE_SAT_SELECT); /* popup button */ GTK_SINGLE_SAT (widget)->popup_button = gpredict_mini_mod_button ("gpredict-mod-popup.png", @@ -321,6 +329,9 @@ gtk_widget_show_all (widget); + if (selectedcatnum) { + gtk_single_sat_select_sat ( widget, selectedcatnum ); + } return widget; } Modified: trunk/src/sat-cfg.c =================================================================== --- trunk/src/sat-cfg.c 2011-05-24 12:25:51 UTC (rev 824) +++ trunk/src/sat-cfg.c 2011-05-26 13:00:50 UTC (rev 825) @@ -174,6 +174,7 @@ { "MODULES", "POLAR_INFO_COLOUR", 0x00007FFF}, { "MODULES", "SINGLE_SAT_REFRESH", 1}, { "MODULES", "SINGLE_SAT_FIELDS", SINGLE_SAT_FIELD_DEF}, + { "MODULES", "SINGLE_SAT_SELECTED", 0}, { "MODULES", "EVENT_LIST_REFRESH", 1}, { "PREDICT", "MINIMUM_ELEV", 5}, { "PREDICT", "NUMBER_OF_PASSES", 10}, Modified: trunk/src/sat-cfg.h =================================================================== --- trunk/src/sat-cfg.h 2011-05-24 12:25:51 UTC (rev 824) +++ trunk/src/sat-cfg.h 2011-05-26 13:00:50 UTC (rev 825) @@ -96,6 +96,7 @@ SAT_CFG_INT_POLAR_INFO_COL, /*!< Info colour. */ SAT_CFG_INT_SINGLE_SAT_REFRESH, /*!< Single-sat refresh rate (cycle). */ SAT_CFG_INT_SINGLE_SAT_FIELDS, /*!< Single-sat fields. */ + SAT_CFG_INT_SINGLE_SAT_SELECT, /*!< Single-sat selected satellite. */ SAT_CFG_INT_EVENT_LIST_REFRESH, /*!< Event list refresh rate (cycle). */ SAT_CFG_INT_PRED_MIN_EL, /*!< Minimum elevation for passes. */ SAT_CFG_INT_PRED_NUM_PASS, /*!< Number of passes to predict. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-05-30 11:17:01
|
Revision: 827 http://gpredict.svn.sourceforge.net/gpredict/?rev=827&view=rev Author: aa1vs Date: 2011-05-30 11:16:51 +0000 (Mon, 30 May 2011) Log Message: ----------- Fix Bug 3309110: 100% on manual time adjustment. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/gtk-sat-module-tmg.c trunk/src/sgpsdp/sgp4sdp4.h trunk/src/sgpsdp/sgp_time.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/ChangeLog 2011-05-30 11:16:51 UTC (rev 827) @@ -1,3 +1,13 @@ +2011-05-31 Charles Suprin <hamaa1vs at gmail.com> + + * src/sgpsdp/sgp_time.c + * src/sgpsdp/sgp4sdp4.h + * src/gtk-sat-module-tmg.c + Fix discrepancy in year convention with Time_to_UTC between Julian_Date + convention and mktime convention. + Fixes Bug 3309110: 100% on manual time adjustment. + Fixes part of Ubuntu Bug #789691. + 2011-05-26 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-single-sat.c Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/NEWS 2011-05-30 11:16:51 UTC (rev 827) @@ -5,8 +5,9 @@ - Feature request 2130926: Change frequency using mouse wheel. Also for rotator controller. - Applied and extended patch 3237220: natural sort for sat list in module config - Improve handling of decayed satellites. -- Fixed bug 3250344: Win32 uild not working with hamlib. +- Fixed bug 3250344: Win32 build not working with hamlib. - Fixed bug 3294829: Program name wrong in desktop files. +- Fixed bug 3309110: 100% on manual time adjustment. Changes in version 1.3 (1 Mar 2011) Modified: trunk/src/gtk-sat-module-tmg.c =================================================================== --- trunk/src/gtk-sat-module-tmg.c 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/src/gtk-sat-module-tmg.c 2011-05-30 11:16:51 UTC (rev 827) @@ -483,7 +483,6 @@ gdouble slider; gdouble jd; - /* update time only if we are in manual time control */ if (!mod->throttle && !mod->reset) { @@ -513,7 +512,7 @@ /* convert UTC time to Julian Date */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) { /* convert local time to UTC */ - utim = Time_to_UTC (&tim); + Time_to_UTC (&tim, &utim); /* Convert to JD */ jd = Julian_Date (&utim); @@ -814,7 +813,7 @@ /* convert UTC time to Julian Date */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) { /* convert local time to UTC */ - utim = Time_to_UTC (&tim); + Time_to_UTC (&tim, &utim); /* Convert to JD */ jd = Julian_Date (&utim); @@ -869,7 +868,7 @@ /* convert UTC time to Julian Date */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) { /* convert local time to UTC */ - utim = Time_to_UTC (&tim); + Time_to_UTC (&tim, &utim); /* Convert to JD */ jd = Julian_Date (&utim); Modified: trunk/src/sgpsdp/sgp4sdp4.h =================================================================== --- trunk/src/sgpsdp/sgp4sdp4.h 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/src/sgpsdp/sgp4sdp4.h 2011-05-30 11:16:51 UTC (rev 827) @@ -347,7 +347,7 @@ double Julian_Date(struct tm *cdate); void Date_Time(double jd, struct tm *cdate); int Check_Date(struct tm *cdate); -struct tm Time_to_UTC(struct tm *cdate); +void Time_to_UTC(struct tm *cdate, struct tm *odate); struct tm Time_from_UTC(struct tm *cdate); double JD_to_UTC(double jt); double JD_from_UTC(double jt); Modified: trunk/src/sgpsdp/sgp_time.c =================================================================== --- trunk/src/sgpsdp/sgp_time.c 2011-05-26 21:54:12 UTC (rev 826) +++ trunk/src/sgpsdp/sgp_time.c 2011-05-30 11:16:51 UTC (rev 827) @@ -241,13 +241,23 @@ /* The procedures JD_to_UTC and JD_from_UTC are used to */ /* do the same thing working directly with Julian dates. */ -struct tm -Time_to_UTC(struct tm *cdate) +void +Time_to_UTC(struct tm *cdate, struct tm *odate) { time_t tdate; - + /* + functions such as Julian_Date work with tm_year in being + the year since 0 AD and mktime uses it as the year since 1900 + + tm_isdst = -1 forces the mktime call to lookup the daylight + savings for the current timezone instead of using whatever + was in the structure when it was created. + */ + cdate->tm_year -= 1900; + cdate->tm_isdst = -1; tdate = mktime(cdate); - return( *gmtime(&tdate) ); + gmtime_r(&tdate,odate); + odate->tm_year += 1900; } /*Procedure Time_to_UTC*/ /*------------------------------------------------------------------*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2011-06-04 23:37:27
|
Revision: 829 http://gpredict.svn.sourceforge.net/gpredict/?rev=829&view=rev Author: csete Date: 2011-06-04 23:37:21 +0000 (Sat, 04 Jun 2011) Log Message: ----------- Attempt to fix bug #3272993: Issue controlling Yaesu FT-847. Coding style clean up. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-rig-ctrl.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-06-04 21:23:11 UTC (rev 828) +++ trunk/ChangeLog 2011-06-04 23:37:21 UTC (rev 829) @@ -1,3 +1,10 @@ +2011-06-04 Alexandru Csete <oz9aec at gmail.com> + + * src/gtk-rig-ctrl.c: + Attempt to fix bug #3272993: Issue controlling Yaesu FT-847. + Coding style clean up. + + 2011-06-04 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-sat-map.c @@ -4,6 +11,7 @@ * src/gtk-polar-view.c Reset satellite when reseting NAOS in sat-map and polar views. + 2011-05-31 Charles Suprin <hamaa1vs at gmail.com> * src/sgpsdp/sgp_time.c @@ -14,6 +22,7 @@ Fixes Bug 3309110: 100% on manual time adjustment. Fixes part of Ubuntu Bug #789691. + 2011-05-26 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-single-sat.c @@ -25,6 +34,7 @@ Save selected satellite in single sat view. Part of Feature Request: 3179738 + 2011-05-14 Charles Suprin <hamaa1vs at gmail.com> * data/trsp/25338.trsp @@ -32,6 +42,7 @@ * data/trsp/27543.trsp Update NOAA-15,-16,-17 transponder frequencies. + 2011-05-01 Alexandru Csete <oz9aec at gmail.com> * src/gtk-sat-module-popup.c Modified: trunk/src/gtk-rig-ctrl.c =================================================================== --- trunk/src/gtk-rig-ctrl.c 2011-06-04 21:23:11 UTC (rev 828) +++ trunk/src/gtk-rig-ctrl.c 2011-06-04 23:37:21 UTC (rev 829) @@ -118,6 +118,7 @@ static gboolean get_ptt (GtkRigCtrl *ctrl, gint sock); static gboolean set_ptt (GtkRigCtrl *ctrl, gint sock, gboolean ptt); static gboolean set_vfo (GtkRigCtrl *ctrl, vfo_t vfo); +static gboolean setup_split(GtkRigCtrl *ctrl); static void update_count_down (GtkRigCtrl *ctrl, gdouble t); static gboolean open_rigctld_socket(radio_conf_t *conf, gint *sock); static gboolean close_rigctld_socket(gint *sock); @@ -1248,6 +1249,8 @@ break; case RIG_TYPE_DUPLEX: + /* set rig into SAT mode (hamlib needs it even if rig already in SAT) */ + setup_split(ctrl); exec_duplex_cycle (ctrl); break; @@ -1269,6 +1272,53 @@ } +/** \brief Setup VFOs for split operation (simplex or duplex) + * \param ctrl Pointer to the GtkRigCtrl structure. + * \return TRUE if the operation was succesful, FALSE if an error occurred. + * + * This function is used to setup the VFOs for split operation. For full + * duplex radios this will enable the SAT mode (True for FT847 but TBC for others). + * See bug #3272993 + */ +static gboolean setup_split(GtkRigCtrl *ctrl) +{ + gchar *buff; + gchar buffback[128]; + gboolean retcode; + + /* select TX VFO */ + switch (ctrl->conf->vfoUp) { + case VFO_A: + buff = g_strdup("S 1 A\x0a"); + break; + + case VFO_B: + buff = g_strdup("S 1 B\x0a"); + break; + + case VFO_MAIN: + buff = g_strdup("S 1 Main\x0a"); + break; + + case VFO_SUB: + buff = g_strdup("S 1 Sub\x0a"); + break; + + default: + sat_log_log(SAT_LOG_LEVEL_ERROR, + _("%s called but TX VFO is %d."), __FUNCTION__, ctrl->conf->vfoUp); + return FALSE; + } + + retcode=send_rigctld_command(ctrl, ctrl->sock, buff, buffback, 128); + + g_free(buff); + + return(check_set_response(buffback, retcode, __FUNCTION__)); + +} + + /** \brief Manage downlink frequency change callbacks. * \param knob Pointer to the GtkFreqKnob widget that received the signal. * \param data Pointer to the GtkRigCtrl structure. @@ -1709,22 +1759,20 @@ * \param ctrl Pointer to the GtkRigCtrl widget. * * This function executes a controller cycle when the device is of RIG_TYPE_DUPLEX. + * The RIG should already be in SAT mode. */ static void exec_duplex_cycle (GtkRigCtrl *ctrl) -{ +{ if (ctrl->engaged) { - /* Downlink */ - set_vfo (ctrl, ctrl->conf->vfoDown); exec_rx_cycle (ctrl); - - /* Uplink */ - set_vfo (ctrl, ctrl->conf->vfoUp); - exec_tx_cycle (ctrl); + exec_toggle_tx_cycle (ctrl); } else { /* still execute cycles to update UI widgets - no data will be sent to RIG */ + * no data will be sent to RIG */ exec_rx_cycle (ctrl); + /* toggle_tx does nothing when not engaged + * (was originally written for FT-817-like rigs) */ exec_tx_cycle (ctrl); } } @@ -2732,16 +2780,28 @@ return TRUE; } -/*simple function to sort the list of satellites in the combo box.*/ -static gint sat_name_compare (sat_t* a,sat_t*b){ +/** \brief Simple function to sort the list of satellites in the combo box. + * \return TBC + */ +static gint sat_name_compare (sat_t *a, sat_t *b) +{ return (gpredict_strcmp(a->nickname,b->nickname)); } -static gint rig_name_compare (const gchar* a,const gchar *b){ +/** \brief Simple function to sort the list of rigs in the combo box. + * \return TBC + */ +static gint rig_name_compare (const gchar *a, const gchar *b){ return (gpredict_strcmp(a,b)); } -static inline gboolean check_set_response (gchar *buffback,gboolean retcode,const gchar *function){ +/** \brief Check hamlib rigctld response + * \param buffback + * \param retcode + * \param function + * \return TRUE if the check was successful? + */ +static inline gboolean check_set_response (gchar *buffback, gboolean retcode, const gchar *function){ if (retcode==TRUE) if (strncmp(buffback,"RPRT 0",6)!=0) { sat_log_log (SAT_LOG_LEVEL_ERROR, @@ -2753,6 +2813,12 @@ return retcode; } +/** \brief Check hamlib rigctld response + * \param buffback + * \param retcode + * \param function + * \return TRUE if the check was successful? + */ static inline gboolean check_get_response (gchar *buffback,gboolean retcode,const gchar *function){ if (retcode==TRUE) if (strncmp(buffback,"RPRT",4)==0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-06-19 13:00:29
|
Revision: 832 http://gpredict.svn.sourceforge.net/gpredict/?rev=832&view=rev Author: aa1vs Date: 2011-06-19 13:00:23 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Remove decayed satellite object from hash. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-map.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-06-08 02:22:04 UTC (rev 831) +++ trunk/ChangeLog 2011-06-19 13:00:23 UTC (rev 832) @@ -1,3 +1,9 @@ +2011-06-19 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-sat-map.c + Remove decayed satellite object from hash. + + 2011-06-07 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-polar-view.c: Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2011-06-08 02:22:04 UTC (rev 831) +++ trunk/src/gtk-sat-map.c 2011-06-19 13:00:23 UTC (rev 832) @@ -1962,6 +1962,8 @@ idx = goo_canvas_item_model_find_child (root,obj->range2); if (idx !=-1) goo_canvas_item_model_remove_child (root, idx); + g_hash_table_remove (satmap->obj, catnum); + g_free (obj); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-06-26 16:38:39
|
Revision: 836 http://gpredict.svn.sourceforge.net/gpredict/?rev=836&view=rev Author: aa1vs Date: 2011-06-26 16:38:33 +0000 (Sun, 26 Jun 2011) Log Message: ----------- Fixed log retention and deletion. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/sat-log.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-06-26 03:58:08 UTC (rev 835) +++ trunk/ChangeLog 2011-06-26 16:38:33 UTC (rev 836) @@ -1,3 +1,9 @@ +2011-06-26 Charles Suprin <hamaa1vs at gmail.com> + + * src/sat-log.c + Fix log retention and deletion. + + 2011-06-25 Charles Suprin <hamaa1vs at gmail.com> * src/qth-data.c Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-06-26 03:58:08 UTC (rev 835) +++ trunk/NEWS 2011-06-26 16:38:33 UTC (rev 836) @@ -9,6 +9,7 @@ - Fixed bug 3294829: Program name wrong in desktop files. - Fixed bug 3309110: 100% on manual time adjustment. - Fixed bug 3272993: Issue controlling Yaesu FT-847. +- Fixed bug 3334657: Old log files not being saved. Changes in version 1.3 (1 Mar 2011) Modified: trunk/src/sat-log.c =================================================================== --- trunk/src/sat-log.c 2011-06-26 03:58:08 UTC (rev 835) +++ trunk/src/sat-log.c 2011-06-26 16:38:33 UTC (rev 836) @@ -146,16 +146,15 @@ void sat_log_close () { - if (initialised) { - sat_log_log (SAT_LOG_LEVEL_MSG, - _("%s: Session ended"), __FUNCTION__); + if (initialised) { + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Session ended"), __FUNCTION__); g_io_channel_shutdown (logfile, TRUE, NULL); g_io_channel_unref (logfile); logfile = NULL; - initialised = FALSE; - if (sat_cfg_get_bool (SAT_CFG_BOOL_KEEP_LOG_FILES)) { - log_rotate (); - } + initialised = FALSE; + /* Always call log_rotate to get rid of old logs */ + log_rotate (); } } @@ -290,32 +289,32 @@ glong then; /* time in sec corresponding to age */ gchar *confdir,*dirname,*fname1,*fname2; - - /* initialise some vars */ - g_get_current_time (&now); + /* get cleaning age; if age non-zero do not rename log */ + age = sat_cfg_get_int (SAT_CFG_INT_LOG_CLEAN_AGE); + + /* initialise some vars */ + g_get_current_time (&now); confdir = get_user_conf_dir (); dirname = g_strconcat (confdir, G_DIR_SEPARATOR_S, "logs", NULL); - fname1 = g_strconcat (dirname, G_DIR_SEPARATOR_S, "gpredict.log", NULL); - fname2 = g_strdup_printf ("%s%sgpredict-%ld.log", - dirname, G_DIR_SEPARATOR_S, now.tv_sec); + fname1 = g_strconcat (dirname, G_DIR_SEPARATOR_S, "gpredict.log", NULL); + fname2 = g_strdup_printf ("%s%sgpredict-%ld.log", + dirname, G_DIR_SEPARATOR_S, now.tv_sec); + + if (age > 0) + g_rename (fname1, fname2); + - g_rename (fname1, fname2); - - - /* get cleaning age; if age non-zero perform cleaning */ - age = sat_cfg_get_int (SAT_CFG_INT_LOG_CLEAN_AGE); - if (age > 0) { - - /* calculate age for files that should be removed */ - then = now.tv_sec - age; - clean_log_dir (dirname, then); - - } - - g_free (dirname); - g_free (fname1); - g_free (fname2); + /* calculate age for files that should be removed */ + then = now.tv_sec - age; + + /* cleanup every time as old log files should be deleted if they exist */ + clean_log_dir (dirname, then); + + + g_free (dirname); + g_free (fname1); + g_free (fname2); g_free (confdir); } @@ -353,7 +352,7 @@ vbuf = g_strsplit_set (fname, "-.", -1); - g_print ("%s <=> %s\n", vbuf[1], ages); + //g_print ("%s <=> %s\n", vbuf[1], ages); /* Remove file if too old */ if (g_ascii_strcasecmp (vbuf[1], ages) <= 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-06-30 01:46:04
|
Revision: 837 http://gpredict.svn.sourceforge.net/gpredict/?rev=837&view=rev Author: aa1vs Date: 2011-06-30 01:45:58 +0000 (Thu, 30 Jun 2011) Log Message: ----------- Fix SEGFAULT in tle-update.c when unable to open file for writing in network updates. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-06-26 16:38:33 UTC (rev 836) +++ trunk/ChangeLog 2011-06-30 01:45:58 UTC (rev 837) @@ -1,3 +1,9 @@ +2011-06-29 Charles Suprin <hamaa1vs at gmail.com> + + * src/tle-update.c + Fix SEGFAULT in tle-update.c when unable to open file for writing in network updates. + + 2011-06-26 Charles Suprin <hamaa1vs at gmail.com> * src/sat-log.c Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-06-26 16:38:33 UTC (rev 836) +++ trunk/src/tle-update.c 2011-06-30 01:45:58 UTC (rev 837) @@ -599,25 +599,28 @@ "cache", G_DIR_SEPARATOR_S, files[i], NULL); outfile = g_fopen (locfile, "wb"); - curl_easy_setopt (curl, CURLOPT_WRITEDATA, outfile); - curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, my_write_func); + if (outfile != NULL) { + curl_easy_setopt (curl, CURLOPT_WRITEDATA, outfile); + curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, my_write_func); + + /* get file */ + res = curl_easy_perform (curl); + + if (res != CURLE_OK) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Error fetching %s (%s)"), + __FUNCTION__, curfile, curl_easy_strerror (res)); + error = TRUE; + } + else { + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Successfully fetched %s"), + __FUNCTION__, curfile); + success++; + } + fclose (outfile); - /* get file */ - res = curl_easy_perform (curl); - - if (res != CURLE_OK) { - sat_log_log (SAT_LOG_LEVEL_ERROR, - _("%s: Error fetching %s (%s)"), - __FUNCTION__, curfile, curl_easy_strerror (res)); - error = TRUE; } - else { - sat_log_log (SAT_LOG_LEVEL_MSG, - _("%s: Successfully fetched %s"), - __FUNCTION__, curfile); - success++; - } - /* update progress indicator */ if (!silent && (progress != NULL)) { @@ -636,7 +639,6 @@ g_free (userconfdir); g_free (curfile); g_free (locfile); - fclose (outfile); } curl_easy_cleanup (curl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-07-02 19:55:22
|
Revision: 839 http://gpredict.svn.sourceforge.net/gpredict/?rev=839&view=rev Author: aa1vs Date: 2011-07-02 19:55:16 +0000 (Sat, 02 Jul 2011) Log Message: ----------- Add check on mod->grid allocation. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-module.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-07-02 15:51:44 UTC (rev 838) +++ trunk/ChangeLog 2011-07-02 19:55:16 UTC (rev 839) @@ -3,7 +3,10 @@ * src/gtk-sat-map.c Add check on satellite map object allocation. + * src/gtk-sat-module.c + Add check on mod->grid allocation. + 2011-06-29 Charles Suprin <hamaa1vs at gmail.com> * src/tle-update.c Modified: trunk/src/gtk-sat-module.c =================================================================== --- trunk/src/gtk-sat-module.c 2011-07-02 15:51:44 UTC (rev 838) +++ trunk/src/gtk-sat-module.c 2011-07-02 19:55:16 UTC (rev 839) @@ -619,13 +619,19 @@ /* number of views: we have five numbers per view (type,left,right,top,bottom) */ module->nviews = length / 5; module->grid = g_try_new0 (gint, length); - - /* FIXME: we should check module->grid != NULL */ - - /* convert chars to integers */ - for (i = 0; i < length; i++) { - module->grid[i] = (gint) g_ascii_strtoll (buffv[i], NULL, 0); - //g_print ("%d: %s => %d\n", i, buffv[i], module->grid[i]); + + /* if we cannot allocate memory for the grid zero the views out and log */ + if ( module->grid != NULL ) { + /* convert chars to integers */ + for (i = 0; i < length; i++) { + module->grid[i] = (gint) g_ascii_strtoll (buffv[i], NULL, 0); + //g_print ("%d: %s => %d\n", i, buffv[i], module->grid[i]); + } + } else { + module->nviews = 0; + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Unable to allocate memory for grid."), + __FUNCTION__); } g_strfreev (buffv); @@ -1566,8 +1572,7 @@ guint i; guint xmax = 0; guint ymax = 0; - - + for (i = 0; i < module->nviews; i++) { xmax = MAX(xmax,module->grid[5*i+2]); ymax = MAX(ymax,module->grid[5*i+4]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-07-03 23:55:53
|
Revision: 841 http://gpredict.svn.sourceforge.net/gpredict/?rev=841&view=rev Author: aa1vs Date: 2011-07-03 23:55:47 +0000 (Sun, 03 Jul 2011) Log Message: ----------- Add tle filename as description in new .cat files instead of catalog number. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-07-03 14:05:23 UTC (rev 840) +++ trunk/ChangeLog 2011-07-03 23:55:47 UTC (rev 841) @@ -6,6 +6,10 @@ Show catalog number in satellite selector. Address 3322786: Show More Information in Edit Module Sat Selection. + * src/tle-update.c + Add tle filename as description in new .cat files instead of catalog number. + + 2011-07-01 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-sat-map.c Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-07-03 14:05:23 UTC (rev 840) +++ trunk/src/tle-update.c 2011-07-03 23:55:47 UTC (rev 841) @@ -379,7 +379,6 @@ gchar *cfgstr, *cfgfile; gsize length, written; GError *err = NULL; - /* check if sat is new */ if (ntle->isnew) { @@ -441,11 +440,16 @@ /* finally, new satellite must be added to proper category */ gchar *catfile; gchar **buff; + gint statretval; + struct stat temp; buff = g_strsplit (ntle->srcfile, ".", 0); cfgfile = g_strconcat (buff[0], ".cat", NULL); catfile = sat_file_name (cfgfile); + /* call stat on file before opening it incase file does + not exist and we need to add a group name. */ + statretval = stat (catfile,&temp); /* g_io_channel */ satfile = g_io_channel_new_file (catfile, "a", &err); @@ -456,6 +460,15 @@ g_clear_error (&err); } else { + if (statretval == -1) { + /* file did not exist before creating handle */ + /* use the file name as the group description */ + cfgstr = g_strdup_printf ("%s\n", buff[0]); + g_io_channel_write_chars (satfile, cfgstr, -1, NULL, &err); + g_free (cfgstr); + + } + cfgstr = g_strdup_printf ("%d\n", ntle->catnum); g_io_channel_write_chars (satfile, cfgstr, -1, NULL, &err); g_io_channel_shutdown (satfile, TRUE, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-07-04 00:05:17
|
Revision: 842 http://gpredict.svn.sourceforge.net/gpredict/?rev=842&view=rev Author: aa1vs Date: 2011-07-04 00:05:11 +0000 (Mon, 04 Jul 2011) Log Message: ----------- Add check on polarview object allocation. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-polar-view.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-07-03 23:55:47 UTC (rev 841) +++ trunk/ChangeLog 2011-07-04 00:05:11 UTC (rev 842) @@ -9,6 +9,8 @@ * src/tle-update.c Add tle filename as description in new .cat files instead of catalog number. + * src/gtk-polar-view.c + Add check on polarview object allocation. 2011-07-01 Charles Suprin <hamaa1vs at gmail.com> Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-07-03 23:55:47 UTC (rev 841) +++ trunk/src/gtk-polar-view.c 2011-07-04 00:05:11 UTC (rev 842) @@ -939,61 +939,73 @@ else { /* add sat to canvas */ obj = g_try_new (sat_obj_t, 1); - obj->selected = FALSE; - obj->showtrack = polv->showtrack; - obj->istarget = FALSE; - root = goo_canvas_get_root_item_model (GOO_CANVAS (polv->canvas)); - - colour = mod_cfg_get_int (polv->cfgdata, - MOD_CFG_POLAR_SECTION, - MOD_CFG_POLAR_SAT_COL, - SAT_CFG_INT_POLAR_SAT_COL); - - /* create tooltip */ - tooltip = g_strdup_printf("<big><b>%s</b>\n</big>"\ - "<tt>Az: %5.1f\302\260\n" \ - "El: %5.1f\302\260\n" \ - "</tt>", - sat->nickname, - sat->az, sat->el); - - obj->marker = goo_canvas_rect_model_new (root, - x - MARKER_SIZE_HALF, - y - MARKER_SIZE_HALF, - 2*MARKER_SIZE_HALF, - 2*MARKER_SIZE_HALF, - "fill-color-rgba", colour, - "stroke-color-rgba", colour, - "tooltip", tooltip, - NULL); - obj->label = goo_canvas_text_model_new (root, sat->nickname, - x, - y+2, - -1, - GTK_ANCHOR_NORTH, - "font", "Sans 8", - "fill-color-rgba", colour, - "tooltip", tooltip, - NULL); - - g_free (tooltip); - - goo_canvas_item_model_raise (obj->marker, NULL); - goo_canvas_item_model_raise (obj->label, NULL); - - g_object_set_data (G_OBJECT (obj->marker), "catnum", GINT_TO_POINTER(*catnum)); - g_object_set_data (G_OBJECT (obj->label), "catnum", GINT_TO_POINTER(*catnum)); - - /* get info about the current pass */ - obj->pass = get_current_pass (sat, polv->qth, now); - - /* add sat to hash table */ - g_hash_table_insert (polv->obj, catnum, obj); - - /* Finally, create the sky track if necessary */ - if (obj->showtrack) - create_track (polv, obj, sat); + if ( obj != NULL) { + /* space was allocated now use it */ + obj->selected = FALSE; + obj->showtrack = polv->showtrack; + obj->istarget = FALSE; + + root = goo_canvas_get_root_item_model (GOO_CANVAS (polv->canvas)); + + colour = mod_cfg_get_int (polv->cfgdata, + MOD_CFG_POLAR_SECTION, + MOD_CFG_POLAR_SAT_COL, + SAT_CFG_INT_POLAR_SAT_COL); + + /* create tooltip */ + tooltip = g_strdup_printf("<big><b>%s</b>\n</big>" \ + "<tt>Az: %5.1f\302\260\n" \ + "El: %5.1f\302\260\n" \ + "</tt>", + sat->nickname, + sat->az, sat->el); + + obj->marker = goo_canvas_rect_model_new (root, + x - MARKER_SIZE_HALF, + y - MARKER_SIZE_HALF, + 2*MARKER_SIZE_HALF, + 2*MARKER_SIZE_HALF, + "fill-color-rgba", colour, + "stroke-color-rgba", colour, + "tooltip", tooltip, + NULL); + obj->label = goo_canvas_text_model_new (root, sat->nickname, + x, + y+2, + -1, + GTK_ANCHOR_NORTH, + "font", "Sans 8", + "fill-color-rgba", colour, + "tooltip", tooltip, + NULL); + + g_free (tooltip); + + goo_canvas_item_model_raise (obj->marker, NULL); + goo_canvas_item_model_raise (obj->label, NULL); + + g_object_set_data (G_OBJECT (obj->marker), "catnum", GINT_TO_POINTER(*catnum)); + g_object_set_data (G_OBJECT (obj->label), "catnum", GINT_TO_POINTER(*catnum)); + + /* get info about the current pass */ + obj->pass = get_current_pass (sat, polv->qth, now); + + /* add sat to hash table */ + g_hash_table_insert (polv->obj, catnum, obj); + + /* Finally, create the sky track if necessary */ + if (obj->showtrack) + create_track (polv, obj, sat); + + } else { + /* obj == NULL */ + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Cannot allocate memory for satellite %d."), + __FUNCTION__, sat->tle.catnr); + return; + + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-07-24 01:17:26
|
Revision: 876 http://gpredict.svn.sourceforge.net/gpredict/?rev=876&view=rev Author: aa1vs Date: 2011-07-24 01:17:14 +0000 (Sun, 24 Jul 2011) Log Message: ----------- Save and restore current module on closing. Modified Paths: -------------- trunk/ChangeLog trunk/src/mod-mgr.c trunk/src/sat-cfg.c trunk/src/sat-cfg.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-07-16 01:02:39 UTC (rev 875) +++ trunk/ChangeLog 2011-07-24 01:17:14 UTC (rev 876) @@ -1,3 +1,10 @@ +2011-07-23 Charles Suprin <hamaa1vs at gmail.com> + + * src/sat-cfg.[ch] + * src/mod-mgr.c + Save and restore the current module on closing. + + 2011-07-07 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-polar-view.c Modified: trunk/src/mod-mgr.c =================================================================== --- trunk/src/mod-mgr.c 2011-07-16 01:02:39 UTC (rev 875) +++ trunk/src/mod-mgr.c 2011-07-24 01:17:14 UTC (rev 876) @@ -101,6 +101,7 @@ GtkWidget *module; gchar *modfile; gchar *confdir; + gint page; /* create notebook */ nbook = gtk_notebook_new (); @@ -112,6 +113,7 @@ /* get list of modules which should be open */ openmods = sat_cfg_get_str (SAT_CFG_STR_OPEN_MODULES); + page = sat_cfg_get_int (SAT_CFG_INT_MODULE_CURRENT_PAGE); if (openmods) { mods = g_strsplit (openmods, ";", 0); @@ -147,12 +149,19 @@ sat_log_log (SAT_LOG_LEVEL_ERROR, _("%s: Failed to restore %s"), __FUNCTION__, mods[i]); + + /* try to smartly handle disappearing modules */ + page--; } g_free (modfile); } + /* set to the page open when gpredict was closed */ + if (page >=0) + gtk_notebook_set_current_page (GTK_NOTEBOOK (nbook), page); + g_strfreev (mods); g_free (openmods); @@ -320,6 +329,7 @@ GtkWidget *module; gchar *mods = NULL; gchar *buff; + gint page; if (!nbook) { @@ -362,11 +372,15 @@ __FUNCTION__, GTK_SAT_MODULE (module)->name); } + + /* store the currently open page number */ + page = gtk_notebook_get_current_page (GTK_NOTEBOOK (nbook)); sat_log_log (SAT_LOG_LEVEL_MSG, _("%s: Saved states for %d modules."), __FUNCTION__, num); sat_cfg_set_str (SAT_CFG_STR_OPEN_MODULES, mods); + sat_cfg_set_int (SAT_CFG_INT_MODULE_CURRENT_PAGE, page); g_free (mods); } Modified: trunk/src/sat-cfg.c =================================================================== --- trunk/src/sat-cfg.c 2011-07-16 01:02:39 UTC (rev 875) +++ trunk/src/sat-cfg.c 2011-07-24 01:17:14 UTC (rev 876) @@ -148,6 +148,7 @@ { "MODULES", "VIEW_1", GTK_SAT_MOD_VIEW_MAP}, /* FIXME */ { "MODULES", "VIEW_2", GTK_SAT_MOD_VIEW_POLAR}, /* FIXME */ { "MODULES", "VIEW_3", GTK_SAT_MOD_VIEW_SINGLE}, /* FIXME */ + { "GLOBAL", "CURRENT_PAGE", -1}, /* FIXME */ { "GLOBAL", "WARP", 1}, { "MODULES", "LIST_REFRESH", 1}, { "MODULES", "LIST_COLUMNS", LIST_COLUMNS_DEFAULTS}, Modified: trunk/src/sat-cfg.h =================================================================== --- trunk/src/sat-cfg.h 2011-07-16 01:02:39 UTC (rev 875) +++ trunk/src/sat-cfg.h 2011-07-24 01:17:14 UTC (rev 876) @@ -70,6 +70,7 @@ SAT_CFG_INT_MODULE_VIEW_1, /*!< Type of view 1 */ SAT_CFG_INT_MODULE_VIEW_2, /*!< Type of view 2 */ SAT_CFG_INT_MODULE_VIEW_3, /*!< Type of view 3 */ + SAT_CFG_INT_MODULE_CURRENT_PAGE, /*!< Number of integer parameters. */ SAT_CFG_INT_WARP_FACTOR, /*!< Time compression factor. */ SAT_CFG_INT_LIST_REFRESH, /*!< List refresh rate (cycle). */ SAT_CFG_INT_LIST_COLUMNS, /*!< List column visibility. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-08-05 00:47:05
|
Revision: 881 http://gpredict.svn.sourceforge.net/gpredict/?rev=881&view=rev Author: aa1vs Date: 2011-08-05 00:46:59 +0000 (Fri, 05 Aug 2011) Log Message: ----------- Remember ground tracks and highlight coverages in map view. Modified Paths: -------------- trunk/ChangeLog trunk/src/config-keys.h trunk/src/gtk-sat-map-popup.c trunk/src/gtk-sat-map.c trunk/src/gtk-sat-map.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-07-31 12:26:07 UTC (rev 880) +++ trunk/ChangeLog 2011-08-05 00:46:59 UTC (rev 881) @@ -1,3 +1,13 @@ +2011-08-04 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/gtk-sat-map.c + * src/gtk-sat-map.h + * src/gtk-sat-map-popup.c + * src/config-keys.h + Remember ground tracks and highlight coverages in map view. + Feature Request: 3179738 + 2011-07-31 Charles Suprin <hamaa1vs at gmail.com> * src/gtk-rot-knob.c Modified: trunk/src/config-keys.h =================================================================== --- trunk/src/config-keys.h 2011-07-31 12:26:07 UTC (rev 880) +++ trunk/src/config-keys.h 2011-08-05 00:46:59 UTC (rev 881) @@ -106,6 +106,8 @@ #define MOD_CFG_MAP_TRACK_NUM "TRACK_NUMBER" #define MOD_CFG_MAP_KEEP_RATIO "KEEP_RATIO" #define MOD_CFG_MAP_SHADOW_ALPHA "SHADOW_ALPHA" +#define MOD_CFG_MAP_SHOWTRACKS "SHOWTRACKS" +#define MOD_CFG_MAP_HIDECOVS "HIDECOVS" /* polar view specific */ #define MOD_CFG_POLAR_SECTION "POLAR" Modified: trunk/src/gtk-sat-map-popup.c =================================================================== --- trunk/src/gtk-sat-map-popup.c 2011-07-31 12:26:07 UTC (rev 880) +++ trunk/src/gtk-sat-map-popup.c 2011-08-05 00:46:59 UTC (rev 881) @@ -183,12 +183,14 @@ coverage_toggled (GtkCheckMenuItem *item, gpointer data) { sat_map_obj_t *obj = NULL; + sat_t *sat; GtkSatMap *satmap = GTK_SAT_MAP(data); guint32 covcol; - + /* get satellite object */ obj = SAT_MAP_OBJ(g_object_get_data (G_OBJECT (item), "obj")); + sat = SAT(g_object_get_data (G_OBJECT (item), "sat")); if (obj == NULL) { sat_log_log (SAT_LOG_LEVEL_BUG, @@ -201,6 +203,17 @@ obj->showcov = !obj->showcov; gtk_check_menu_item_set_active (item, obj->showcov); + if (obj->showcov) { + /* remove it from the storage structure */ + g_hash_table_remove (satmap->hidecovs, + &(sat->tle.catnr)); + + } else { + g_hash_table_insert (satmap->hidecovs, + &(sat->tle.catnr), + (gpointer)0x1); + } + /* set or clear coverage colour */ if (obj->showcov) { covcol = mod_cfg_get_int (satmap->cfgdata, @@ -257,11 +270,20 @@ if (obj->showtrack) { /* create ground track */ ground_track_create (satmap, sat, qth, obj); + + /* add it to the storage structure */ + g_hash_table_insert (satmap->showtracks, + &(sat->tle.catnr), + (gpointer)0x1); } else { /* delete ground track with clear_ssp = TRUE */ ground_track_delete (satmap, sat, qth, obj, TRUE); + + /* remove it from the storage structure */ + g_hash_table_remove (satmap->showtracks, + &(sat->tle.catnr)); } } Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2011-07-31 12:26:07 UTC (rev 880) +++ trunk/src/gtk-sat-map.c 2011-08-05 00:46:59 UTC (rev 881) @@ -107,6 +107,10 @@ static void draw_grid_lines (GtkSatMap *satmap, GooCanvasItemModel *root); static void redraw_grid_lines (GtkSatMap *satmap); static gchar *aoslos_time_to_str (GtkSatMap *satmap, sat_t *sat); +static void gtk_sat_map_load_showtracks (GtkSatMap *map); +static void gtk_sat_map_load_hide_coverages (GtkSatMap *map); +static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest); +static void store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey); static GtkVBoxClass *parent_class = NULL; static GooCanvasPoints *points1; @@ -171,6 +175,8 @@ satmap->sats = NULL; satmap->qth = NULL; satmap->obj = NULL; + satmap->showtracks= g_hash_table_new_full(g_int_hash,g_int_equal,NULL,NULL); + satmap->hidecovs = g_hash_table_new_full(g_int_hash,g_int_equal,NULL,NULL); satmap->naos = 0.0; satmap->ncat = 0; satmap->tstamp = 2458849.5; @@ -193,6 +199,18 @@ static void gtk_sat_map_destroy (GtkObject *object) { + gint *showtrack; + gint *something; + gint i,length; + store_binary_hash_cfgdata(GTK_SAT_MAP(object)->cfgdata, + GTK_SAT_MAP(object)->showtracks, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOWTRACKS); + store_binary_hash_cfgdata(GTK_SAT_MAP(object)->cfgdata, + GTK_SAT_MAP(object)->hidecovs, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_HIDECOVS); + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -293,6 +311,11 @@ g_object_unref (root); + /* load the satellites we want to show tracks for */ + gtk_sat_map_load_showtracks (GTK_SAT_MAP(satmap)); + /* load the satellites we want to show tracks for */ + gtk_sat_map_load_hide_coverages (GTK_SAT_MAP(satmap)); + /* plot each sat on the canvas */ g_hash_table_foreach (GTK_SAT_MAP (satmap)->sats, plot_sat, GTK_SAT_MAP (satmap)); @@ -1805,8 +1828,18 @@ } obj->selected = FALSE; - obj->showtrack = FALSE; - obj->showcov = TRUE; + + if (g_hash_table_lookup(satmap->showtracks,catnum)==NULL) { + obj->showtrack = FALSE; + } else { + obj->showtrack = TRUE; + } + + if (g_hash_table_lookup(satmap->hidecovs,catnum)==NULL) { + obj->showcov = TRUE; + } else { + obj->showcov = FALSE; + } obj->istarget = FALSE; obj->oldrcnum = 0; obj->newrcnum = 0; @@ -1827,7 +1860,18 @@ MOD_CFG_MAP_SECTION, MOD_CFG_MAP_SAT_COV_COL, SAT_CFG_INT_MAP_SAT_COV_COL); + /* coverage color */ + if (obj->showcov) { + covcol = mod_cfg_get_int (satmap->cfgdata, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SAT_COV_COL, + SAT_CFG_INT_MAP_SAT_COV_COL); + } + else { + covcol = 0x00000000; + } + /* shadow colour (only alpha channel) */ shadowcol = mod_cfg_get_int (satmap->cfgdata, MOD_CFG_MAP_SECTION, @@ -2551,3 +2595,100 @@ return text; } + +/** \brief Load the satellites that we should show tracks for */ +static void +gtk_sat_map_load_showtracks (GtkSatMap *satmap) +{ + load_integer_list_boolean(satmap->cfgdata, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOWTRACKS, + satmap->showtracks); +} + +/** \brief Load the satellites that we should not highlight coverage */ +static void +gtk_sat_map_load_hide_coverages (GtkSatMap *satmap) +{ + load_integer_list_boolean(satmap->cfgdata, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_HIDECOVS, + satmap->hidecovs); +} + +/** \brief Load an integer list into a hash table that uses the + data in the hash as a boolean +*/ +static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest) { + gint *sats = NULL; + gsize length; + GError *error = NULL; + guint i; + guint *tkey; + + sats = g_key_file_get_integer_list (cfgdata, + section, + key, + &length, + &error); + if (error != NULL) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to get list of satellites (%s)"), + __FUNCTION__, error->message); + + g_clear_error (&error); + + /* GLib API says nothing about the contents in case of error */ + if (sats) { + g_free (sats); + } + + return; + } + + /* read each satellite into hash table */ + for (i = 0; i < length; i++) { + tkey = g_new0 (guint, 1); + *tkey = sats[i]; + //printf("loading sat %d\n",sats[i]); + if (g_hash_table_lookup (dest, tkey) == NULL) { + /* just add a one to the value so there is presence indicator */ + g_hash_table_insert (dest, + tkey, + (gpointer)0x1); + } + } + g_free(sats); +} + +/** \brief Convert the "boolean" hash back into an integer list and save it. */ +static void +store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) +{ + gint *showtrack; + gint *something; + gint i,length; + GList *keys = g_hash_table_get_keys(hash); + + length = g_list_length(keys); + if (g_list_length(keys)>0) { + + showtrack = g_try_new0(gint,g_list_length(keys)); + for (i=0;i<length;i++) { + something=g_list_nth_data(keys,i); + showtrack[i]=*something; + } + g_key_file_set_integer_list (cfgdata, + cfgsection, + cfgkey, + showtrack, + g_list_length(keys) + ); + + } else { + g_key_file_remove_key(cfgdata, + cfgsection, + cfgkey, + NULL); + } +} Modified: trunk/src/gtk-sat-map.h =================================================================== --- trunk/src/gtk-sat-map.h 2011-07-31 12:26:07 UTC (rev 880) +++ trunk/src/gtk-sat-map.h 2011-08-05 00:46:59 UTC (rev 881) @@ -140,6 +140,8 @@ qth_t *qth; /*!< Pointer to current location. */ GHashTable *obj; /*!< Canvas items representing each satellite. */ + GHashTable *showtracks; /*!< A hash of satellites to show tracks for. */ + GHashTable *hidecovs; /*!< A hash of satellites to hide coverage for. */ guint x0; /*!< X0 of the canvas map. */ guint y0; /*!< Y0 of the canvas map. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-08-21 13:42:38
|
Revision: 888 http://gpredict.svn.sourceforge.net/gpredict/?rev=888&view=rev Author: aa1vs Date: 2011-08-21 13:42:32 +0000 (Sun, 21 Aug 2011) Log Message: ----------- Eliminates use of deprecated tooltips code. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-tree.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-08-21 13:40:23 UTC (rev 887) +++ trunk/ChangeLog 2011-08-21 13:42:32 UTC (rev 888) @@ -4,7 +4,11 @@ * src/tle-update.c Eliminates memory leak and cut and paste error and removes whitespace around tle before importing. + * ChangeLog + * src/gtk-sat-tree.c + Eliminates use of deprecated tooltips code. + 2011-08-20 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-sat-tree.c =================================================================== --- trunk/src/gtk-sat-tree.c 2011-08-21 13:40:23 UTC (rev 887) +++ trunk/src/gtk-sat-tree.c 2011-08-21 13:42:32 UTC (rev 888) @@ -265,17 +265,13 @@ /* expand and collabse buttons */ expbut = gtk_button_new_with_label (_("Expand")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, expbut, - _("Expand all nodes in the tree to make it searchable"), - NULL); + gtk_widget_set_tooltip_text (expbut, + _("Expand all nodes in the tree to make it searchable")); g_signal_connect (expbut, "clicked", G_CALLBACK (expand_cb), sat_tree); colbut = gtk_button_new_with_label (_("Collapse")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, colbut, - _("Collapse all nodes in the tree"), - NULL); + gtk_widget_set_tooltip_text (colbut, + _("Collapse all nodes in the tree")); g_signal_connect (colbut, "clicked", G_CALLBACK (collapse_cb), sat_tree); hbox = gtk_hbutton_box_new (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-08-21 13:43:35
|
Revision: 889 http://gpredict.svn.sourceforge.net/gpredict/?rev=889&view=rev Author: aa1vs Date: 2011-08-21 13:43:29 +0000 (Sun, 21 Aug 2011) Log Message: ----------- Updates TODO. Modified Paths: -------------- trunk/ChangeLog trunk/TODO Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-08-21 13:42:32 UTC (rev 888) +++ trunk/ChangeLog 2011-08-21 13:43:29 UTC (rev 889) @@ -8,6 +8,9 @@ * src/gtk-sat-tree.c Eliminates use of deprecated tooltips code. + * ChangeLog + * TODO + Updates TODO. 2011-08-20 Charles Suprin <hamaa1vs at gmail.com> Modified: trunk/TODO =================================================================== --- trunk/TODO 2011-08-21 13:42:32 UTC (rev 888) +++ trunk/TODO 2011-08-21 13:43:29 UTC (rev 889) @@ -23,8 +23,6 @@ * Predict satellite parameters over a given time period (Tools). * Solar illumination prediction. * Treat Sun and Moon as satellites. -* Improve time controller to have tuning-like behaviour, i.e. when - minutes flip from 59 to 0 the hour is incremented. * Toggle the ground track on and off for all the satellites on the map. * New layout engine allowing any number of views per module. * SpaceView: New view show the satellites using a movable camera in space. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-04 23:14:13
|
Revision: 894 http://gpredict.svn.sourceforge.net/gpredict/?rev=894&view=rev Author: aa1vs Date: 2011-09-04 23:14:07 +0000 (Sun, 04 Sep 2011) Log Message: ----------- Cleanup comments and code with satellite status updates. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-01 11:39:20 UTC (rev 893) +++ trunk/ChangeLog 2011-09-04 23:14:07 UTC (rev 894) @@ -1,3 +1,10 @@ +2011-09-04 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/tle-update.c + Cleanup comments and code with satellite status updates. + + 2011-09-01 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-01 11:39:20 UTC (rev 893) +++ trunk/src/tle-update.c 2011-09-04 23:14:07 UTC (rev 894) @@ -889,9 +889,11 @@ /* add data to hash table */ key = g_try_new0 (guint, 1); *key = catnr; - + + ntle = g_hash_table_lookup (data, key); + /* check if satellite already in hash table */ - if (g_hash_table_lookup (data, key) == NULL) { + if ( ntle == NULL) { /* create new_tle structure */ ntle = g_try_new (new_tle_t, 1); @@ -908,23 +910,26 @@ retcode++; } else { - /* if the satellite in the hash is older than - the one just loaded, copy the values over. */ - ntle = g_hash_table_lookup (data, key); + /* satellite is already in hash */ + /* apply various merge routines */ if (ntle->epoch == tle.epoch) { - if (ntle->status!=tle.status) { - if (tle.status != OP_STAT_UNKNOWN) { - if (ntle->status!= OP_STAT_UNKNOWN) { - sat_log_log (SAT_LOG_LEVEL_ERROR, - _("%s:%s: Two different statuses for the same satellite at the same time."), - __FILE__, __FUNCTION__); - - } - ntle->status = tle.status; + /* if satellite epoch has the same time, merge status as appropriate */ + if ( (ntle->status != tle.status) && ( ntle->status != OP_STAT_UNKNOWN )) { + /* update status */ + ntle->status = tle.status; + if ( tle.status != OP_STAT_UNKNOWN ) { + /* log if there is something funny about the data coming in */ + sat_log_log (SAT_LOG_LEVEL_WARN, + _("%s:%s: Two different statuses for %s:%d at the same time."), + __FILE__, __FUNCTION__, ntle->satname,ntle->catnum); + } } } - else if (ntle->epoch <tle.epoch) { + else if ( ntle->epoch < tle.epoch ) { + /* if the satellite in the hash is older than + the one just loaded, copy the values over. */ + ntle->catnum = catnr; ntle->epoch = tle.epoch; ntle->status = tle.status; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-07 01:17:36
|
Revision: 895 http://gpredict.svn.sourceforge.net/gpredict/?rev=895&view=rev Author: aa1vs Date: 2011-09-07 01:17:30 +0000 (Wed, 07 Sep 2011) Log Message: ----------- Save status for new satellites. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-04 23:14:07 UTC (rev 894) +++ trunk/ChangeLog 2011-09-07 01:17:30 UTC (rev 895) @@ -1,3 +1,10 @@ +2011-09-07 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/tle-update.c + Save status for new satellites. + + 2011-09-04 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-04 23:14:07 UTC (rev 894) +++ trunk/src/tle-update.c 2011-09-07 01:17:30 UTC (rev 895) @@ -395,6 +395,7 @@ g_key_file_set_string (satdata, "Satellite", "NICKNAME", ntle->satname); g_key_file_set_string (satdata, "Satellite", "TLE1", ntle->line1); g_key_file_set_string (satdata, "Satellite", "TLE2", ntle->line2); + g_key_file_set_integer (satdata, "Satellite", "STATUS", ntle->status); /* convert data to text */ cfgstr = g_key_file_to_data (satdata, &length, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-07 23:32:04
|
Revision: 896 http://gpredict.svn.sourceforge.net/gpredict/?rev=896&view=rev Author: aa1vs Date: 2011-09-07 23:31:58 +0000 (Wed, 07 Sep 2011) Log Message: ----------- Update progress bar calculation for tle update. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-07 01:17:30 UTC (rev 895) +++ trunk/ChangeLog 2011-09-07 23:31:58 UTC (rev 896) @@ -2,6 +2,13 @@ * ChangeLog * src/tle-update.c + Update progress bar calculation for tle update. + + +2011-09-07 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/tle-update.c Save status for new satellites. Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-07 01:17:30 UTC (rev 895) +++ trunk/src/tle-update.c 2011-09-07 23:31:58 UTC (rev 896) @@ -296,15 +296,31 @@ } if (progress != NULL) { - - /* calculate and saturate fraction - (number of sats in TLE files is greater - than the number of sats in link table) - */ - fraction = start + (1.0-start) * ((gdouble) total) / ((gdouble) num); - if (fraction >= 0.95) - fraction = 0.98; - + /* two different calculations for completeness depending on whether + we are adding new satellites or not. */ + if (sat_cfg_get_bool (SAT_CFG_BOOL_TLE_ADD_NEW)) { + /* In this case we are possibly processing more than num satellites + How many more? We do not know yet. Worst case is g_hash_table_size more. + + As we update skipped and updated we can reduce the denominator count + as those are in both pools (files and hash table). When we have processed + all the files, updated and skipped are completely correct and the progress + is correct. It may be correct sooner if the missed satellites are the + last files to process. + + Until then, if we eliminate the ones that are updated and skipped from being + double counted, our progress will shown will always be less or equal to our + true progress since the denominator will be larger than is correct. + + Advantages to this are that the progress bar does not stall close to + finished when there are a large number of new satellites. + */ + fraction = start + (1.0-start) * ((gdouble) total) / + ((gdouble) num + g_hash_table_size(data) - updated - skipped); + } else { + /* here we only process satellites we have have files for so divide by num */ + fraction = start + (1.0-start) * ((gdouble) total) / ((gdouble) num); + } gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), fraction); @@ -644,7 +660,7 @@ if (!silent && (progress != NULL)) { /* complete download corresponds to 50% */ - fraction = start + (0.5-start) * i / (2.0 * numfiles); + fraction = start + (0.5-start) * i / (1.0 * numfiles); gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), fraction); /* Force the drawing queue to be processed otherwise there will This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-18 14:09:32
|
Revision: 897 http://gpredict.svn.sourceforge.net/gpredict/?rev=897&view=rev Author: aa1vs Date: 2011-09-18 14:09:26 +0000 (Sun, 18 Sep 2011) Log Message: ----------- Remove error message if latitude, longitude, or altitude is zero. Modified Paths: -------------- trunk/ChangeLog trunk/src/qth-data.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-07 23:31:58 UTC (rev 896) +++ trunk/ChangeLog 2011-09-18 14:09:26 UTC (rev 897) @@ -1,3 +1,10 @@ +2011-09-18 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/qth-data.c + Remove error message if latitude, longitude, or altitude is zero. + + 2011-09-07 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/qth-data.c =================================================================== --- trunk/src/qth-data.c 2011-09-07 23:31:58 UTC (rev 896) +++ trunk/src/qth-data.c 2011-09-18 14:09:26 UTC (rev 897) @@ -766,20 +766,20 @@ */ void qth_validate(qth_t*qth){ /* check that the values are not set to nonsense such as nan or inf. if so error it and set to zero. */ - if (!isnormal(qth->lat)){ + if (!isnormal(qth->lat) && (qth->lat != 0)){ sat_log_log (SAT_LOG_LEVEL_ERROR, _("%s: QTH data had bogus lat %f"), __FUNCTION__,qth->lat); qth->lat=0.0; } - if (!isnormal(qth->lon)){ + if (!isnormal(qth->lon) && (qth->lon != 0)){ sat_log_log (SAT_LOG_LEVEL_ERROR, _("%s: QTH data had bogus lon %f"), __FUNCTION__,qth->lon); qth->lon=0.0; } - if (!isnormal(qth->alt)){ + if (!isnormal(qth->alt) && (qth->alt != 0)){ sat_log_log (SAT_LOG_LEVEL_ERROR, _("%s: QTH data had bogus alt %f"), __FUNCTION__,qth->alt); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-19 12:01:10
|
Revision: 898 http://gpredict.svn.sourceforge.net/gpredict/?rev=898&view=rev Author: aa1vs Date: 2011-09-19 12:00:59 +0000 (Mon, 19 Sep 2011) Log Message: ----------- Speed up tle-update by updating the gui less frequently. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-18 14:09:26 UTC (rev 897) +++ trunk/ChangeLog 2011-09-19 12:00:59 UTC (rev 898) @@ -1,6 +1,13 @@ 2011-09-18 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog + * src/tle-update.c + Speed up tle-update by updating the gui less frequently. + + +2011-09-18 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog * src/qth-data.c Remove error message if latitude, longitude, or altitude is zero. Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-18 14:09:26 UTC (rev 897) +++ trunk/src/tle-update.c 2011-09-19 12:00:59 UTC (rev 898) @@ -326,18 +326,28 @@ } - /* Force the drawing queue to be processed otherwise there will - not be any visual feedback, ie. frozen GUI - - see Gtk+ FAQ http://www.gtk.org/faq/#AEN602 - */ - while (g_main_context_iteration (NULL, FALSE)); - - /* give user a chance to follow progress */ - g_usleep (G_USEC_PER_SEC / 1000); + /* update the gui only every so often to speed up the process */ + /* 47 was selected empirically to balance the update looking smooth but not take too much time. */ + /* it also tumbles all digits in the numbers so that there is no obvious pattern. */ + /* on a developer machine this improved an update from 5 minutes to under 20 seconds. */ + if (total%47 == 0) { + /* Force the drawing queue to be processed otherwise there will + not be any visual feedback, ie. frozen GUI + - see Gtk+ FAQ http://www.gtk.org/faq/#AEN602 + */ + while (g_main_context_iteration (NULL, FALSE)); + + /* give user a chance to follow progress */ + g_usleep (G_USEC_PER_SEC / 1000); + } } } } + + /* force gui update */ + while (g_main_context_iteration (NULL, FALSE)); + /* close directory handle */ g_dir_close (loc_dir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-19 21:24:09
|
Revision: 899 http://gpredict.svn.sourceforge.net/gpredict/?rev=899&view=rev Author: aa1vs Date: 2011-09-19 21:24:02 +0000 (Mon, 19 Sep 2011) Log Message: ----------- Process bare tle's based on checksums. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-19 12:00:59 UTC (rev 898) +++ trunk/ChangeLog 2011-09-19 21:24:02 UTC (rev 899) @@ -1,3 +1,10 @@ +2011-09-19 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/tle-update.c + Process bare tle's based on checksums. + + 2011-09-18 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-09-19 12:00:59 UTC (rev 898) +++ trunk/NEWS 2011-09-19 21:24:02 UTC (rev 899) @@ -4,6 +4,7 @@ - Feature request 3141555: gpsd support. - Feature request 2130926: Change frequency using mouse wheel. Also for rotator controller. - Feature request 3322786: Show More Information in Edit Module Sat Selection. +- Feature request 3314813: Resolves Requested TLE files from Celestrak. - Applied and extended patch 3237220: natural sort for sat list in module config - Improve handling of decayed satellites. - Fixed bug 3250344: Win32 build not working with hamlib. Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-19 12:00:59 UTC (rev 898) +++ trunk/src/tle-update.c 2011-09-19 21:24:02 UTC (rev 899) @@ -811,11 +811,15 @@ tle_t tle; gchar *path; gchar tle_str[3][80]; + gchar tle_working[3][80]; + gchar linetmp[80]; + guint linesneeded = 3; gchar catstr[6]; + gchar idstr[7]="\0\0\0\0\0\0\0",idyearstr[3]; gchar *b; FILE *fp; gint retcode = 0; - guint catnr,i; + guint catnr,i,idyear; guint *key = NULL; /* category sync related */ @@ -877,16 +881,90 @@ /* read 3 lines at a time */ - while (fgets (tle_str[0], 80, fp)) { - /* read second and third lines */ - b = fgets (tle_str[1], 80, fp); - b = fgets (tle_str[2], 80, fp); - + while (fgets (linetmp, 80, fp)) { + /*read in the number of lines needed to potentially get to a new tle*/ + switch (linesneeded) { + case 3: + strncpy(tle_working[0],linetmp,80); + b = fgets (tle_working[1], 80, fp); + b = fgets (tle_working[2], 80, fp); + break; + case 2: + strncpy(tle_working[0],tle_working[2],80); + strncpy(tle_working[1],linetmp,80); + b = fgets (tle_working[2], 80, fp); + break; + case 1: + strncpy(tle_working[0],tle_working[1],80); + strncpy(tle_working[1],tle_working[2],80); + strncpy(tle_working[2],linetmp,80); + break; + default: + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%s: Something wrote linesneeded to an illegal value %d"), + __FILE__, __FUNCTION__, linesneeded); + break; + } /* remove leading and trailing whitespace to be more forgiving */ - g_strstrip(tle_str[0]); - g_strstrip(tle_str[1]); - g_strstrip(tle_str[2]); + g_strstrip(tle_working[0]); + g_strstrip(tle_working[1]); + g_strstrip(tle_working[2]); + /* there are three possibilities at this point */ + /* first is that line 0 is a name and normal text for three line element and that lines 1 and 2 + are the corresponding tle */ + /* second is that line 0 and line 1 are a tle for a bare tle */ + /* third is that neither of these is true and we are consuming either text at the top of the + file or a text file that happens to be in the update directory + */ + if (Checksum_Good(tle_working[1]) && (tle_working[1][0]=='1')) { + sat_log_log (SAT_LOG_LEVEL_DEBUG, + _("%s:%s: Processing a three line TLE"), + __FILE__, __FUNCTION__); + + /* it appears that the first line may be a name followed by a tle */ + strncpy(tle_str[0],tle_working[0],80); + strncpy(tle_str[1],tle_working[1],80); + strncpy(tle_str[2],tle_working[2],80); + /* we consumed three lines so we need three lines */ + linesneeded = 3; + + } else if (Checksum_Good(tle_working[0]) && (tle_working[0][0]=='1')) { + sat_log_log (SAT_LOG_LEVEL_DEBUG, + _("%s:%s: Processing a bare two line TLE"), + __FILE__, __FUNCTION__); + + /* first line appears to belong to the start of bare TLE */ + /* put in a dummy name of form yyyy-nnaa base on international id */ + /* this special form will be overwritten if a three line tle ever has another name */ + + strncpy(idstr,&tle_working[0][11],6); + g_strstrip(idstr); + strncpy(idyearstr,&tle_working[0][9],2); + idstr[6]= '\0'; + idyearstr[2]= '\0'; + idyear = g_ascii_strtod(idyearstr,NULL); + + /* there is a two digit year field that started around sputnik */ + if (idyear >= 57) + idyear += 1900; + else + idyear += 2000; + + snprintf(tle_str[0],79,"%d-%s",idyear,idstr); + strncpy(tle_str[1],tle_working[0],80); + strncpy(tle_str[2],tle_working[1],80); + + /* we consumed two lines so we need two lines */ + linesneeded = 2; + } else { + /* we appear to have junk + read another line in and do nothing else */ + linesneeded = 1; + continue; + } + + tle_str[1][69] = '\0'; tle_str[2][69] = '\0'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-21 20:05:12
|
Revision: 901 http://gpredict.svn.sourceforge.net/gpredict/?rev=901&view=rev Author: aa1vs Date: 2011-09-21 20:05:06 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Corrects satellite name not being update correctly when a satellite occurs with international ID and name in same update. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-21 02:35:04 UTC (rev 900) +++ trunk/ChangeLog 2011-09-21 20:05:06 UTC (rev 901) @@ -1,3 +1,10 @@ +2011-09-21 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/tle-update.c + Corrects satellite name not being update correctly when a satellite occurs with international ID and name in same update. + + 2011-09-20 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-21 02:35:04 UTC (rev 900) +++ trunk/src/tle-update.c 2011-09-21 20:05:06 UTC (rev 901) @@ -1017,6 +1017,8 @@ else { /* satellite is already in hash */ /* apply various merge routines */ + + /*time merge */ if (ntle->epoch == tle.epoch) { /* if satellite epoch has the same time, merge status as appropriate */ if ( (ntle->status != tle.status) && ( ntle->status != OP_STAT_UNKNOWN )) { @@ -1038,8 +1040,6 @@ ntle->catnum = catnr; ntle->epoch = tle.epoch; ntle->status = tle.status; - g_free (ntle->satname); - ntle->satname = g_strdup (g_strchomp(tle_str[0])); g_free (ntle->line1); ntle->line1 = g_strdup (tle_str[1]); g_free (ntle->line2); @@ -1048,8 +1048,18 @@ ntle->srcfile = g_strdup (fnam); ntle->isnew = TRUE; /* flag will be reset when using data */ } + + /* merge based on name */ + if ((!g_regex_match_simple ("\\d{4,}-\\d{3,}",ntle->satname,0,0)) && + (!g_regex_match_simple ("\\d{4,}-\\d{3,}",tle_str[0],0,0))) { + g_free (ntle->satname); + ntle->satname = g_strdup (g_strchomp(tle_str[0])); + } + /* free the key since we do not commit it to the cache */ g_free (key); + + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-21 20:25:14
|
Revision: 902 http://gpredict.svn.sourceforge.net/gpredict/?rev=902&view=rev Author: aa1vs Date: 2011-09-21 20:25:08 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Corrects satellite status not being updated correctly when a .sat and update data have different status. Modified Paths: -------------- trunk/ChangeLog trunk/src/tle-update.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-21 20:05:06 UTC (rev 901) +++ trunk/ChangeLog 2011-09-21 20:25:08 UTC (rev 902) @@ -2,9 +2,13 @@ * ChangeLog * src/tle-update.c - Corrects satellite name not being update correctly when a satellite occurs with international ID and name in same update. + Corrects satellite name not being updated correctly when a satellite occurs with international ID and name in same update. + * ChangeLog + * src/tle-update.c + Corrects satellite status not being updated correctly when a .sat and update data have different status. + 2011-09-20 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/tle-update.c =================================================================== --- trunk/src/tle-update.c 2011-09-21 20:05:06 UTC (rev 901) +++ trunk/src/tle-update.c 2011-09-21 20:25:08 UTC (rev 902) @@ -1250,15 +1250,6 @@ g_free(satname); g_free(satnickname); - if ( status != ntle->status ){ - - sat_log_log (SAT_LOG_LEVEL_MSG, - _("%s: Data for %d updated for operational status."), - __FUNCTION__, catnr); - g_key_file_set_integer (satdata, "Satellite", "STATUS", ntle->status); - updateddata = TRUE; - } - if (tle.epoch < ntle->epoch) { /* new data is newer than what we already have */ /* store new data */ @@ -1267,8 +1258,17 @@ __FUNCTION__, catnr); g_key_file_set_string (satdata, "Satellite", "TLE1", ntle->line1); g_key_file_set_string (satdata, "Satellite", "TLE2", ntle->line2); + g_key_file_set_integer (satdata, "Satellite", "STATUS", ntle->status); updateddata = TRUE; + } else if (tle.epoch == ntle->epoch) { + if ((status != ntle->status) && (ntle->status != OP_STAT_UNKNOWN)){ + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Data for %d updated for operational status."), + __FUNCTION__, catnr); + g_key_file_set_integer (satdata, "Satellite", "STATUS", ntle->status); + updateddata = TRUE; + } } if (updateddata ==TRUE) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-23 00:13:14
|
Revision: 903 http://gpredict.svn.sourceforge.net/gpredict/?rev=903&view=rev Author: aa1vs Date: 2011-09-23 00:13:07 +0000 (Fri, 23 Sep 2011) Log Message: ----------- Saves polarview showtrack information from one session to another. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-polar-view-popup.c trunk/src/gtk-polar-view.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-21 20:25:08 UTC (rev 902) +++ trunk/ChangeLog 2011-09-23 00:13:07 UTC (rev 903) @@ -1,3 +1,11 @@ +2011-09-22 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/gtk-polar-view.c + * src/gtk-polar-view-popup.c + Saves polarview showtrack information from one session to another. + + 2011-09-21 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/gtk-polar-view-popup.c =================================================================== --- trunk/src/gtk-polar-view-popup.c 2011-09-21 20:25:08 UTC (rev 902) +++ trunk/src/gtk-polar-view-popup.c 2011-09-23 00:13:07 UTC (rev 903) @@ -208,7 +208,16 @@ if (obj->showtrack) { /* add sky track */ + + /* add it to the storage structure */ + g_hash_table_insert (pv->showtracks_on, + &(sat->tle.catnr), + NULL); + /* remove it from the don't show */ + g_hash_table_remove (pv->showtracks_off, + &(sat->tle.catnr)); + /* create points */ num = g_slist_length (obj->pass->details); if (num == 0) { @@ -273,6 +282,13 @@ } else { + /* add it to the hide */ + g_hash_table_insert (pv->showtracks_off, + &(sat->tle.catnr), + NULL); + /* remove it from the show */ + g_hash_table_remove (pv->showtracks_on, + &(sat->tle.catnr)); /* delete sky track */ idx = goo_canvas_item_model_find_child (root, obj->track); Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-09-21 20:25:08 UTC (rev 902) +++ trunk/src/gtk-polar-view.c 2011-09-23 00:13:07 UTC (rev 903) @@ -92,8 +92,11 @@ static GooCanvasItemModel* create_canvas_model (GtkPolarView *polv); static void get_canvas_bg_color (GtkPolarView *polv, GdkColor *color); static gchar *los_time_to_str (GtkPolarView *polv, sat_t *sat); +static void gtk_polar_view_store_showtracks (GtkPolarView *pv); +static void gtk_polar_view_load_showtracks (GtkPolarView *pv); +static void store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) ; +static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest); - static GtkVBoxClass *parent_class = NULL; @@ -172,6 +175,7 @@ static void gtk_polar_view_destroy (GtkObject *object) { + gtk_polar_view_store_showtracks ( GTK_POLAR_VIEW(object)); (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -249,6 +253,7 @@ MOD_CFG_POLAR_SECTION, MOD_CFG_POLAR_SHOW_EXTRA_AZ_TICKS, SAT_CFG_BOOL_POL_SHOW_EXTRA_AZ_TICKS); + gtk_polar_view_load_showtracks (GTK_POLAR_VIEW(polv)); /* create the canvas */ GTK_POLAR_VIEW (polv)->canvas = goo_canvas_new (); @@ -1002,9 +1007,19 @@ NULL); g_free (tooltip); + if (goo_canvas_item_model_find_child(root, obj->marker) != -1) + goo_canvas_item_model_raise (obj->marker, NULL); + else + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: marker added to polarview not showing %d."), + __FUNCTION__, *catnum); - goo_canvas_item_model_raise (obj->marker, NULL); - goo_canvas_item_model_raise (obj->label, NULL); + if (goo_canvas_item_model_find_child(root, obj->label) != -1) + goo_canvas_item_model_raise (obj->label, NULL); + else + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: label added to polarview not showing %d."), + __FUNCTION__, *catnum); g_object_set_data (G_OBJECT (obj->marker), "catnum", GINT_TO_POINTER(*catnum)); g_object_set_data (G_OBJECT (obj->label), "catnum", GINT_TO_POINTER(*catnum)); @@ -1745,3 +1760,112 @@ return text; } + +static void +gtk_polar_view_store_showtracks (GtkPolarView *pv) { + store_binary_hash_cfgdata(pv->cfgdata, + pv->showtracks_on, + MOD_CFG_POLAR_SECTION, + MOD_CFG_POLAR_SHOWTRACKS); + store_binary_hash_cfgdata(pv->cfgdata, + pv->showtracks_off, + MOD_CFG_POLAR_SECTION, + MOD_CFG_POLAR_HIDETRACKS); +} + +/** \brief Load the satellites that we should not highlight coverage */ +static void +gtk_polar_view_load_showtracks (GtkPolarView *pv) +{ + load_integer_list_boolean(pv->cfgdata, + MOD_CFG_POLAR_SECTION, + MOD_CFG_POLAR_HIDETRACKS, + pv->showtracks_off); + + load_integer_list_boolean(pv->cfgdata, + MOD_CFG_POLAR_SECTION, + MOD_CFG_POLAR_SHOWTRACKS, + pv->showtracks_on); + +} + +/** \brief Load an integer list into a hash table that uses the + existinence of datain the hash as a boolean. + It loads NULL's into the hash table. +*/ +static void load_integer_list_boolean (GKeyFile *cfgdata,const gchar* section,const gchar *key,GHashTable *dest) { + gint *sats = NULL; + gsize length; + GError *error = NULL; + guint i; + guint *tkey; + + sats = g_key_file_get_integer_list (cfgdata, + section, + key, + &length, + &error); + if (error != NULL) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to get list of satellites (%s)"), + __FUNCTION__, error->message); + + g_clear_error (&error); + + /* GLib API says nothing about the contents in case of error */ + if (sats) { + g_free (sats); + } + + return; + } + + /* read each satellite into hash table */ + for (i = 0; i < length; i++) { + tkey = g_new0 (guint, 1); + *tkey = sats[i]; + //printf("loading sat %d\n",sats[i]); + if (!(g_hash_table_lookup_extended (dest, tkey, NULL, NULL))) { + /* just add a one to the value so there is presence indicator */ + g_hash_table_insert (dest, + tkey, + NULL); + } + } + g_free(sats); +} + +/** \brief Convert the "boolean" hash back into an integer list and + save it to the cfgdata. */ +static void +store_binary_hash_cfgdata (GKeyFile *cfgdata, GHashTable *hash, const gchar *cfgsection, const gchar *cfgkey) +{ + gint *showtrack; + gint *something; + gint i,length; + GList *keys = g_hash_table_get_keys(hash); + + length = g_list_length(keys); + if (g_list_length(keys)>0) { + + showtrack = g_try_new0(gint,g_list_length(keys)); + for (i=0;i<length;i++) { + something=g_list_nth_data(keys,i); + showtrack[i]=*something; + } + g_key_file_set_integer_list (cfgdata, + cfgsection, + cfgkey, + showtrack, + g_list_length(keys) + ); + + } else { + g_key_file_remove_key(cfgdata, + cfgsection, + cfgkey, + NULL); + } + + g_list_free (keys); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-28 22:22:32
|
Revision: 909 http://gpredict.svn.sourceforge.net/gpredict/?rev=909&view=rev Author: aa1vs Date: 2011-09-28 22:22:25 +0000 (Wed, 28 Sep 2011) Log Message: ----------- Save and restore sort information for event lists. Modified Paths: -------------- trunk/ChangeLog trunk/src/config-keys.h trunk/src/gtk-event-list.c trunk/src/gtk-event-list.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-25 13:27:19 UTC (rev 908) +++ trunk/ChangeLog 2011-09-28 22:22:25 UTC (rev 909) @@ -1,3 +1,12 @@ +2011-09-28 Charles Suprin <hamaa1vs at gmail.com> + + * ChangeLog + * src/config-keys.c + * src/gtk-event-list.c + * src/gtk-event-list.h + Save and restore sort information for event lists. + + 2011-09-25 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/config-keys.h =================================================================== --- trunk/src/config-keys.h 2011-09-25 13:27:19 UTC (rev 908) +++ trunk/src/config-keys.h 2011-09-28 22:22:25 UTC (rev 909) @@ -138,6 +138,7 @@ /* event list */ #define MOD_CFG_EVENT_LIST_SECTION "EVENT_LIST" #define MOD_CFG_EVENT_LIST_REFRESH "REFRESH" +#define MOD_CFG_EVENT_LIST_SORT_COLUMN "SORT_COLUMN" +#define MOD_CFG_EVENT_LIST_SORT_ORDER "SORT_ORDER" - #endif Modified: trunk/src/gtk-event-list.c =================================================================== --- trunk/src/gtk-event-list.c 2011-09-25 13:27:19 UTC (rev 908) +++ trunk/src/gtk-event-list.c 2011-09-28 22:22:25 UTC (rev 909) @@ -211,6 +211,14 @@ static void gtk_event_list_destroy (GtkObject *object) { + GtkEventList *evlist = GTK_EVENT_LIST(object); + + g_key_file_set_integer(evlist->cfgdata, MOD_CFG_EVENT_LIST_SECTION, MOD_CFG_EVENT_LIST_SORT_COLUMN, evlist->sort_column); + + g_key_file_set_integer(evlist->cfgdata, MOD_CFG_EVENT_LIST_SECTION, MOD_CFG_EVENT_LIST_SORT_ORDER, evlist->sort_order); + + + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -232,7 +240,6 @@ GtkTreeViewColumn *column; /* FIXME */ - (void) cfgdata; /* avoid unused warning compiler warning. */ (void) columns; /* avoid unused warning compiler warning. */ widget = g_object_new (GTK_TYPE_EVENT_LIST, NULL); @@ -242,7 +249,37 @@ /* Read configuration data. */ /* ... */ + evlist->cfgdata = cfgdata; + /* read initial sorting criteria */ + evlist->sort_column = EVENT_LIST_COL_TIME; + evlist->sort_order = GTK_SORT_ASCENDING; + if (g_key_file_has_key (evlist->cfgdata,MOD_CFG_EVENT_LIST_SECTION, + MOD_CFG_EVENT_LIST_SORT_COLUMN, NULL)) { + evlist->sort_column = g_key_file_get_integer (evlist->cfgdata, + MOD_CFG_EVENT_LIST_SECTION, + MOD_CFG_EVENT_LIST_SORT_COLUMN, + NULL); + if ((evlist->sort_column >EVENT_LIST_COL_NUMBER) + ||(evlist->sort_column<0)) { + evlist->sort_column = EVENT_LIST_COL_TIME; + } + } + if (g_key_file_has_key (evlist->cfgdata, + MOD_CFG_EVENT_LIST_SECTION, + MOD_CFG_EVENT_LIST_SORT_ORDER, + NULL)) { + evlist->sort_order = g_key_file_get_integer (evlist->cfgdata, + MOD_CFG_EVENT_LIST_SECTION, + MOD_CFG_EVENT_LIST_SORT_ORDER, + NULL); + if ((evlist->sort_order >1)||(evlist->sort_order<0)) { + evlist->sort_order=GTK_SORT_ASCENDING; + } + } + + + evlist->satellites = sats; evlist->qth = qth; @@ -299,8 +336,8 @@ /* initial sorting criteria */ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), - EVENT_LIST_COL_TIME, - GTK_SORT_ASCENDING), + evlist->sort_column, + evlist->sort_order), g_object_unref (model); @@ -393,6 +430,12 @@ /* get and tranverse the model */ model = gtk_tree_view_get_model (GTK_TREE_VIEW (evlist->treeview)); + /*save the sort information */ + gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), + &(evlist->sort_column), + &(evlist->sort_order)); + + /* update */ gtk_tree_model_foreach (model, event_list_update_sats, evlist); Modified: trunk/src/gtk-event-list.h =================================================================== --- trunk/src/gtk-event-list.h 2011-09-25 13:27:19 UTC (rev 908) +++ trunk/src/gtk-event-list.h 2011-09-28 22:22:25 UTC (rev 909) @@ -69,6 +69,9 @@ guint32 flags; /*!< Flags indicating which columns are visible */ gdouble tstamp; /*!< time stamp of calculations; set by GtkSatModule */ + GKeyFile *cfgdata; + gint sort_column; + GtkSortType sort_order; void (* update) (GtkWidget *widget); /*!< update function */ }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-09-28 22:39:45
|
Revision: 910 http://gpredict.svn.sourceforge.net/gpredict/?rev=910&view=rev Author: aa1vs Date: 2011-09-28 22:39:39 +0000 (Wed, 28 Sep 2011) Log Message: ----------- Save and restore sort information for satellite lists. Modified Paths: -------------- trunk/ChangeLog trunk/src/config-keys.h trunk/src/gtk-sat-list.c trunk/src/gtk-sat-list.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-09-28 22:22:25 UTC (rev 909) +++ trunk/ChangeLog 2011-09-28 22:39:39 UTC (rev 910) @@ -6,7 +6,13 @@ * src/gtk-event-list.h Save and restore sort information for event lists. + * ChangeLog + * src/config-keys.c + * src/gtk-sat-list.c + * src/gtk-sat-list.h + Save and restore sort information for satellite lists. + 2011-09-25 Charles Suprin <hamaa1vs at gmail.com> * ChangeLog Modified: trunk/src/config-keys.h =================================================================== --- trunk/src/config-keys.h 2011-09-28 22:22:25 UTC (rev 909) +++ trunk/src/config-keys.h 2011-09-28 22:39:39 UTC (rev 910) @@ -84,6 +84,8 @@ #define MOD_CFG_LIST_SECTION "LIST" #define MOD_CFG_LIST_COLUMNS "COLUMNS" #define MOD_CFG_LIST_REFRESH "REFRESH" +#define MOD_CFG_LIST_SORT_COLUMN "SORT_COLUMN" +#define MOD_CFG_LIST_SORT_ORDER "SORT_ORDER" /* map specific */ #define MOD_CFG_MAP_SECTION "MAP" Modified: trunk/src/gtk-sat-list.c =================================================================== --- trunk/src/gtk-sat-list.c 2011-09-28 22:22:25 UTC (rev 909) +++ trunk/src/gtk-sat-list.c 2011-09-28 22:39:39 UTC (rev 910) @@ -304,6 +304,14 @@ static void gtk_sat_list_destroy (GtkObject *object) { + GtkSatList *list = GTK_SAT_LIST(object); + + g_key_file_set_integer(list->cfgdata, MOD_CFG_LIST_SECTION, + MOD_CFG_LIST_SORT_COLUMN, list->sort_column); + + g_key_file_set_integer(list->cfgdata, MOD_CFG_LIST_SECTION, + MOD_CFG_LIST_SORT_ORDER, list->sort_order); + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -327,7 +335,37 @@ /* Read configuration data. */ /* ... */ + GTK_SAT_LIST (widget)->cfgdata = cfgdata; + /* read initial sorting criteria */ + GTK_SAT_LIST (widget)->sort_column = SAT_LIST_COL_NAME; + GTK_SAT_LIST (widget)->sort_order = GTK_SORT_ASCENDING; + if (g_key_file_has_key (GTK_SAT_LIST (widget)->cfgdata,MOD_CFG_LIST_SECTION, + MOD_CFG_LIST_SORT_COLUMN, NULL)) { + GTK_SAT_LIST (widget)->sort_column = g_key_file_get_integer (GTK_SAT_LIST (widget)->cfgdata, + MOD_CFG_LIST_SECTION, + MOD_CFG_LIST_SORT_COLUMN, + NULL); + if ((GTK_SAT_LIST (widget)->sort_column >SAT_LIST_COL_NUMBER) + ||(GTK_SAT_LIST (widget)->sort_column<0)) { + GTK_SAT_LIST (widget)->sort_column = SAT_LIST_COL_NAME; + } + } + if (g_key_file_has_key (GTK_SAT_LIST (widget)->cfgdata, + MOD_CFG_EVENT_LIST_SECTION, + MOD_CFG_EVENT_LIST_SORT_ORDER, + NULL)) { + GTK_SAT_LIST (widget)->sort_order = g_key_file_get_integer (GTK_SAT_LIST (widget)->cfgdata, + MOD_CFG_EVENT_LIST_SECTION, + MOD_CFG_EVENT_LIST_SORT_ORDER, + NULL); + if ((GTK_SAT_LIST (widget)->sort_order >1)||(GTK_SAT_LIST (widget)->sort_order<0)) { + GTK_SAT_LIST (widget)->sort_order=GTK_SORT_ASCENDING; + } + } + + + GTK_SAT_LIST (widget)->satellites = sats; GTK_SAT_LIST (widget)->qth = qth; @@ -413,8 +451,8 @@ /* satellite name should be initial sorting criteria */ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), - SAT_LIST_COL_NAME, - GTK_SORT_ASCENDING), + GTK_SAT_LIST(widget)->sort_column, + GTK_SAT_LIST(widget)->sort_order); g_object_unref (model); @@ -555,6 +593,11 @@ /* get and tranverse the model */ model = gtk_tree_view_get_model (GTK_TREE_VIEW (satlist->treeview)); + + /*save the sort information */ + gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model), + &(satlist->sort_column), + &(satlist->sort_order)); /* optimisation: detach model from view while updating */ /* No, we do not do it, because it makes selections and scrolling Modified: trunk/src/gtk-sat-list.h =================================================================== --- trunk/src/gtk-sat-list.h 2011-09-28 22:22:25 UTC (rev 909) +++ trunk/src/gtk-sat-list.h 2011-09-28 22:39:39 UTC (rev 910) @@ -71,7 +71,10 @@ guint counter; /*!< cycle counter */ gdouble tstamp; /*!< time stamp of calculations; set by GtkSatModule */ - + GKeyFile *cfgdata; + gint sort_column; + GtkSortType sort_order; + void (* update) (GtkWidget *widget); /*!< update function */ }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aa...@us...> - 2011-10-05 00:46:08
|
Revision: 918 http://gpredict.svn.sourceforge.net/gpredict/?rev=918&view=rev Author: aa1vs Date: 2011-10-05 00:46:02 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Update ChangeLog and NEWS Modified Paths: -------------- trunk/ChangeLog trunk/NEWS Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-10-05 00:45:25 UTC (rev 917) +++ trunk/ChangeLog 2011-10-05 00:46:02 UTC (rev 918) @@ -1,3 +1,19 @@ +2011-10-05 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-rot-ctrl.c + Eliminate compiler warning. + + * src/gtk-sat-list.c + * src/gtk-single-sat.c + * src/gtk-sat-map.h + * src/predict-tools.h + Use signed 32 bit integers for orbit counts. + +2011-10-03 Charles Suprin <hamaa1vs at gmail.com> + + * src/gtk-polar-view-popup.c + Fix segfault when turning on and off skytrack. Bug 3417553: Gpredict crashes. + 2011-10-02 Charles Suprin <hamaa1vs at gmail.com> * src/sgpsdp/sgp4sdp4.h Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-10-05 00:45:25 UTC (rev 917) +++ trunk/NEWS 2011-10-05 00:46:02 UTC (rev 918) @@ -17,6 +17,7 @@ - Fixed bug 3309111: Wrong icon in time controller. - Fixed bug 3413571: UARS Ground Track not Updated on TLE update. - Fixed bug 3416451: No ground track for new satellites. +- Fixed bug 3417553: Gpredict crashes Changes in version 1.3 (1 Mar 2011) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |