[Gpredict-svn] SF.net SVN: gpredict:[647] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2010-08-21 06:55:06
|
Revision: 647
http://gpredict.svn.sourceforge.net/gpredict/?rev=647&view=rev
Author: csete
Date: 2010-08-21 06:55:00 +0000 (Sat, 21 Aug 2010)
Log Message:
-----------
Applied patch 3050047: Improve sat search and prediction of upcoming passes (Thanks to Patrick Strasser OE6PSE).
Modified Paths:
--------------
trunk/ChangeLog
trunk/NEWS
trunk/src/gtk-sat-selector.c
trunk/src/predict-tools.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-12 21:19:22 UTC (rev 646)
+++ trunk/ChangeLog 2010-08-21 06:55:00 UTC (rev 647)
@@ -1,5 +1,16 @@
-2010-07-12 alexandru Csete >oz9aec at gmail.com>
+2010-08-21 Alexandru Csete <oz9aec at gmail.com>
+ * src/gtk-sat-selector.c:
+ Applied patch 3050047 from Patrick Strasser OE6PSE to improve searching
+ in the satellite selector.
+
+ * src/predict-tools.c:
+ Applied patch 3050047 from Patrick Strasser OE6PSE to include current
+ pass in the list of future passes.
+
+
+2010-07-12 Alexandru Csete <oz9aec at gmail.com>
+
* src/mod-mgr.c:
Allow docked modules to be reordered by dragging the tabs.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-07-12 21:19:22 UTC (rev 646)
+++ trunk/NEWS 2010-08-21 06:55:00 UTC (rev 647)
@@ -39,6 +39,7 @@
- Applied patch 3005548: Cut and Paste Error In print_pass.h (Thanks to Charles Suprin AA1VS).
- Applied patch 3009725: Delete Explicit Call to gtk_set_locale (Thanks to Charles Suprin AA1VS).
- Applied patch 3009727: Free satellite hash references (Thanks to Charles Suprin AA1VS).
+- Applied patch 3050047: Improve sat search and prediction of upcoming passes (Thanks to Patrick Strasser OE6PSE)
- Slightly improved UI for the single-satellite view.
- Command line options for cleaning user's TLE and transponder data, see --help for list.
- Satellite Map: Added shadow to satellite marker and label to enhance visual appearance
Modified: trunk/src/gtk-sat-selector.c
===================================================================
--- trunk/src/gtk-sat-selector.c 2010-07-12 21:19:22 UTC (rev 646)
+++ trunk/src/gtk-sat-selector.c 2010-08-21 06:55:00 UTC (rev 647)
@@ -28,6 +28,7 @@
/** \brief Satellite selector.
*
*/
+#include "string.h"
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#ifdef HAVE_CONFIG_H
@@ -39,13 +40,13 @@
#include "compat.h"
#include "sat-cfg.h"
#include "gtk-sat-selector.h"
+#include "gtk-sat-tree.h"
-
static void gtk_sat_selector_class_init (GtkSatSelectorClass *class);
static void gtk_sat_selector_init (GtkSatSelector *selector);
static void gtk_sat_selector_destroy (GtkObject *object);
@@ -83,7 +84,37 @@
/** \brief GtkSatSelector specific signals. */
static guint gtksatsel_signals[LAST_SIGNAL] = { 0 };
+gboolean gtk_sat_selector_search_equal_func (GtkTreeModel *model,
+ gint column,
+ const gchar *key,
+ GtkTreeIter *iter,
+ gpointer search_data)
+{
+ gchar *name = NULL;
+ gchar *match;
+ gchar *NULLSTR = "NULL";
+ gtk_tree_model_get(model, iter, GTK_SAT_TREE_COL_NAME, &name, -1);
+ /* sat_log_log(SAT_LOG_LEVEL_MSG, "%s: key %s, name %s", */
+ /* __FUNCTION__, */
+ /* key, */
+ /* (name==NULL) ? NULLSTR : name); */
+ if (name == NULL){
+ sat_log_log(SAT_LOG_LEVEL_MSG, "%s:%s: name is NULL", __FILE__, __FUNCTION__);
+ return TRUE;
+ }
+ match = strstr(name, key);
+
+ if (match == NULL) {
+ //sat_log_log(SAT_LOG_LEVEL_BUG, "%s: no match", __FUNCTION__);
+ return TRUE;
+ }
+ else {
+ //sat_log_log(SAT_LOG_LEVEL_BUG, "%s: MATCH at %s", __FUNCTION__, match);
+ return FALSE;
+ }
+}
+
GType gtk_sat_selector_get_type ()
{
static GType gtk_sat_selector_type = 0;
@@ -293,6 +324,10 @@
/* this enables automatic search */
gtk_tree_view_set_search_entry (GTK_TREE_VIEW (GTK_SAT_SELECTOR (widget)->tree),
GTK_ENTRY (GTK_SAT_SELECTOR (widget)->search));
+ gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW (GTK_SAT_SELECTOR (widget)->tree),
+ gtk_sat_selector_search_equal_func,
+ NULL,
+ NULL);
gtk_table_attach (GTK_TABLE (table), GTK_SAT_SELECTOR (widget)->search, 1, 4, 0, 1,
GTK_SHRINK, GTK_SHRINK, 0, 0);
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2010-07-12 21:19:22 UTC (rev 646)
+++ trunk/src/predict-tools.c 2010-08-21 06:55:00 UTC (rev 647)
@@ -445,7 +445,20 @@
*/
while (!done) {
+ /* Find los of next pass or of current pass */
+ los = find_los (sat, qth, t0, maxdt); // See if a pass is ongoing
aos = find_aos (sat, qth, t0, maxdt);
+ /* sat_log_log(SAT_LOG_LEVEL_MSG, "%s:%s:%d: found aos %f and los %f for t0=%f", */
+ /* __FILE__, */
+ /* __FUNCTION__, */
+ /* __LINE__, */
+ /* aos, */
+ /* los, */
+ /* t0); */
+ if (aos > los) {
+ // los is from an currently happening pass, find previous aos
+ aos = find_prev_aos(sat, qth, t0);
+ }
/* aos = 0.0 means no aos */
if (aos == 0.0) {
@@ -459,7 +472,7 @@
done = TRUE;
}
else {
- los = find_los (sat, qth, aos + 0.001, maxdt); // +1.5 min later
+ //los = find_los (sat, qth, aos + 0.001, maxdt); // +1.5 min later
dt = los - aos;
/* get time step, which will give us the max number of entries */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|