5252#define TERMINATOR_UPDATE_INTERVAL (15.0/86400.0)
5353
5454static void gtk_sat_map_class_init (GtkSatMapClass * class ,
55- gpointer class_data );
55+ gpointer class_data );
5656static void gtk_sat_map_init (GtkSatMap * polview ,
57- gpointer g_class );
57+ gpointer g_class );
5858static void gtk_sat_map_destroy (GtkWidget * widget );
5959static void size_allocate_cb (GtkWidget * widget ,
6060 GtkAllocation * allocation , gpointer data );
@@ -142,7 +142,7 @@ GType gtk_sat_map_get_type()
142142}
143143
144144static void gtk_sat_map_class_init (GtkSatMapClass * class ,
145- gpointer class_data )
145+ gpointer class_data )
146146{
147147 GtkWidgetClass * widget_class ;
148148
@@ -154,7 +154,7 @@ static void gtk_sat_map_class_init(GtkSatMapClass * class,
154154}
155155
156156static void gtk_sat_map_init (GtkSatMap * satmap ,
157- gpointer g_class )
157+ gpointer g_class )
158158{
159159 (void )g_class ;
160160
@@ -174,6 +174,9 @@ static void gtk_sat_map_init(GtkSatMap * satmap,
174174 satmap -> height = 0 ;
175175 satmap -> refresh = 0 ;
176176 satmap -> counter = 0 ;
177+ satmap -> satname = FALSE;
178+ satmap -> satfp = FALSE;
179+ satmap -> satmarker = FALSE;
177180 satmap -> show_terminator = FALSE;
178181 satmap -> qthinfo = FALSE;
179182 satmap -> eventinfo = FALSE;
@@ -301,6 +304,19 @@ GtkWidget *gtk_sat_map_new(GKeyFile * cfgdata, GHashTable * sats,
301304 SAT_CFG_INT_MAP_REFRESH );
302305 satmap -> counter = 1 ;
303306
307+ satmap -> satname = mod_cfg_get_bool (cfgdata ,
308+ MOD_CFG_MAP_SECTION ,
309+ MOD_CFG_MAP_SHOW_SAT_NAME ,
310+ SAT_CFG_BOOL_MAP_SHOW_SAT_NAME );
311+ satmap -> satfp = mod_cfg_get_bool (cfgdata ,
312+ MOD_CFG_MAP_SECTION ,
313+ MOD_CFG_MAP_SHOW_SAT_FP ,
314+ SAT_CFG_BOOL_MAP_SHOW_SAT_FP );
315+ satmap -> satmarker = mod_cfg_get_bool (cfgdata ,
316+ MOD_CFG_MAP_SECTION ,
317+ MOD_CFG_MAP_SHOW_SAT_MARKER ,
318+ SAT_CFG_BOOL_MAP_SHOW_SAT_MARKER );
319+
304320 satmap -> qthinfo = mod_cfg_get_bool (cfgdata ,
305321 MOD_CFG_MAP_SECTION ,
306322 MOD_CFG_MAP_SHOW_QTH_INFO ,
@@ -984,6 +1000,9 @@ static gboolean on_button_release(GooCanvasItem * item,
9841000
9851001 /* clear other selections */
9861002 g_hash_table_foreach (satmap -> obj , clear_selection , catpoint );
1003+
1004+ /* update all satellites to update marker visibilities */
1005+ g_hash_table_foreach (satmap -> sats , update_sat , satmap );
9871006 }
9881007 break ;
9891008 default :
@@ -1009,12 +1028,9 @@ static void clear_selection(gpointer key, gpointer val, gpointer data)
10091028 /** FIXME: this is only global default; need the satmap here! */
10101029 col = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_COL );
10111030
1012- g_object_set (obj -> marker ,
1013- "fill-color-rgba" , col , "stroke-color-rgba" , col , NULL );
1014- g_object_set (obj -> label ,
1015- "fill-color-rgba" , col , "stroke-color-rgba" , col , NULL );
1031+ g_object_set (obj -> marker , "fill-color-rgba" , col , "stroke-color-rgba" , col , NULL );
1032+ g_object_set (obj -> label , "fill-color-rgba" , col , "stroke-color-rgba" , col , NULL );
10161033 g_object_set (obj -> range1 , "stroke-color-rgba" , col , NULL );
1017-
10181034 if (obj -> oldrcnum == 2 )
10191035 g_object_set (obj -> range2 , "stroke-color-rgba" , col , NULL );
10201036 }
@@ -1057,6 +1073,9 @@ void gtk_sat_map_select_sat(GtkWidget * satmap, gint catnum)
10571073
10581074 /* clear other selections */
10591075 g_hash_table_foreach (smap -> obj , clear_selection , catpoint );
1076+
1077+ /* update all satellites to update marker visibilities */
1078+ g_hash_table_foreach (smap -> sats , update_sat , smap );
10601079 }
10611080
10621081 g_free (catpoint );
@@ -1978,6 +1997,24 @@ static void plot_sat(gpointer key, gpointer value, gpointer data)
19781997
19791998 /* add sat to hash table */
19801999 g_hash_table_insert (satmap -> obj , catnum , obj );
2000+
2001+ /* hide objects if so configured */
2002+ if (!satmap -> satname )
2003+ {
2004+ g_object_set (obj -> label , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2005+ g_object_set (obj -> shadowl , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2006+ }
2007+ if (!satmap -> satfp )
2008+ {
2009+ g_object_set (obj -> range1 , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2010+ if (obj -> newrcnum == 2 )
2011+ g_object_set (obj -> range2 , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2012+ }
2013+ if (!satmap -> satmarker )
2014+ {
2015+ g_object_set (obj -> marker , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2016+ g_object_set (obj -> shadowm , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2017+ }
19812018}
19822019
19832020/**
@@ -2215,17 +2252,10 @@ static void update_sat(gpointer key, gpointer value, gpointer data)
22152252 SAT_CFG_INT_MAP_SAT_COL );
22162253 }
22172254 /* coverage color */
2218- if (obj -> showcov )
2219- {
2220- covcol = mod_cfg_get_int (satmap -> cfgdata ,
2221- MOD_CFG_MAP_SECTION ,
2222- MOD_CFG_MAP_SAT_COV_COL ,
2223- SAT_CFG_INT_MAP_SAT_COV_COL );
2224- }
2225- else
2226- {
2227- covcol = 0x00000000 ;
2228- }
2255+ covcol = mod_cfg_get_int (satmap -> cfgdata ,
2256+ MOD_CFG_MAP_SECTION ,
2257+ MOD_CFG_MAP_SAT_COV_COL ,
2258+ SAT_CFG_INT_MAP_SAT_COV_COL );
22292259 obj -> range2 = goo_canvas_polyline_model_new (root , FALSE, 0 ,
22302260 "points" , points2 ,
22312261 "line-width" , 1.0 ,
@@ -2239,6 +2269,10 @@ static void update_sat(gpointer key, gpointer value, gpointer data)
22392269 NULL );
22402270 g_object_set_data (G_OBJECT (obj -> range2 ), "catnum" ,
22412271 GINT_TO_POINTER (* catnum ));
2272+
2273+ if (!satmap -> satfp && !obj -> selected )
2274+ g_object_set (obj -> range2 , "visibility" , GOO_CANVAS_ITEM_INVISIBLE , NULL );
2275+
22422276 }
22432277 else
22442278 {
@@ -2282,6 +2316,20 @@ static void update_sat(gpointer key, gpointer value, gpointer data)
22822316 }
22832317 }
22842318
2319+ /* update marker visibilities */
2320+ gboolean vis = satmap -> satname || obj -> selected ;
2321+ g_object_set (obj -> label , "visibility" , vis ? GOO_CANVAS_ITEM_VISIBLE : GOO_CANVAS_ITEM_INVISIBLE , NULL );
2322+ g_object_set (obj -> shadowl , "visibility" , vis ? GOO_CANVAS_ITEM_VISIBLE : GOO_CANVAS_ITEM_INVISIBLE , NULL );
2323+
2324+ vis = satmap -> satfp || obj -> selected ;
2325+ g_object_set (obj -> range1 , "visibility" , vis ? GOO_CANVAS_ITEM_VISIBLE : GOO_CANVAS_ITEM_INVISIBLE , NULL );
2326+ if (obj -> newrcnum == 2 )
2327+ g_object_set (obj -> range2 , "visibility" , vis ? GOO_CANVAS_ITEM_VISIBLE : GOO_CANVAS_ITEM_INVISIBLE , NULL );
2328+
2329+ vis = satmap -> satmarker || obj -> selected ;
2330+ g_object_set (obj -> marker , "visibility" , vis ? GOO_CANVAS_ITEM_VISIBLE : GOO_CANVAS_ITEM_INVISIBLE , NULL );
2331+ g_object_set (obj -> shadowm , "visibility" , vis ? GOO_CANVAS_ITEM_VISIBLE : GOO_CANVAS_ITEM_INVISIBLE , NULL );
2332+
22852333 g_free (catnum );
22862334}
22872335
0 commit comments