@@ -73,6 +73,7 @@ const gchar *SAT_LIST_COL_TITLE[SAT_LIST_COL_NUMBER] = {
7373 N_ ("Orbit" ),
7474 N_ ("Vis" ),
7575 N_ ("Decayed" ),
76+ N_ ("Status" ),
7677 N_ ("BOLD" ) /* should never be seen */
7778};
7879
@@ -105,6 +106,7 @@ const gchar *SAT_LIST_COL_HINT[SAT_LIST_COL_NUMBER] = {
105106 N_ ("Orbit Number" ),
106107 N_ ("Visibility" ),
107108 N_ ("Decayed" ),
109+ N_ ("Operational Status" ),
108110 N_ ("---" )
109111};
110112
@@ -134,6 +136,7 @@ const gfloat SAT_LIST_COL_XALIGN[SAT_LIST_COL_NUMBER] = {
134136 0.0 , // phase
135137 1.0 , // orbit
136138 0.5 , // visibility
139+ 0.0 , // Operational Status
137140};
138141
139142static void gtk_sat_list_class_init (GtkSatListClass * class );
@@ -184,11 +187,20 @@ static void two_dec_cell_data_function(GtkTreeViewColumn * col,
184187 GtkTreeIter * iter ,
185188 gpointer column );
186189
190+
191+ static void operational_status_cell_data_function (GtkTreeViewColumn * col ,
192+ GtkCellRenderer * renderer ,
193+ GtkTreeModel * model ,
194+ GtkTreeIter * iter ,
195+ gpointer column );
196+
197+
187198static void event_cell_data_function (GtkTreeViewColumn * col ,
188199 GtkCellRenderer * renderer ,
189200 GtkTreeModel * model ,
190201 GtkTreeIter * iter , gpointer column );
191202
203+
192204static gint event_cell_compare_function (GtkTreeModel * model ,
193205 GtkTreeIter * a , GtkTreeIter * b ,
194206 gpointer user_data );
@@ -440,6 +452,7 @@ static GtkTreeModel *create_and_fill_model(GHashTable * sats)
440452 G_TYPE_LONG , // orbit
441453 G_TYPE_STRING , // visibility
442454 G_TYPE_BOOLEAN , // decay
455+ G_TYPE_INT , // Operational Status
443456 G_TYPE_INT // weight/bold
444457 );
445458
@@ -485,8 +498,9 @@ static void sat_list_add_satellites(gpointer key, gpointer value,
485498 SAT_LIST_COL_DELAY , 0.0 ,
486499 SAT_LIST_COL_MA , sat -> ma ,
487500 SAT_LIST_COL_PHASE , sat -> phase ,
488- SAT_LIST_COL_ORBIT , sat -> orbit , SAT_LIST_COL_DECAY ,
489- !decayed (sat ), -1 );
501+ SAT_LIST_COL_ORBIT , sat -> orbit ,
502+ SAT_LIST_COL_STAT_OPERATIONAL , (char * ) sat -> tle .status ,
503+ SAT_LIST_COL_DECAY , !decayed (sat ), -1 );
490504}
491505
492506/** Update satellites */
@@ -856,12 +870,69 @@ static void check_and_set_cell_renderer(GtkTreeViewColumn * column,
856870 event_cell_data_function ,
857871 GUINT_TO_POINTER (i ), NULL );
858872 break ;
873+
874+ case SAT_LIST_COL_STAT_OPERATIONAL :
875+ gtk_tree_view_column_set_cell_data_func (column ,
876+ renderer ,
877+ operational_status_cell_data_function ,
878+ GUINT_TO_POINTER (i ), NULL );
879+ break ;
880+
859881
860882 default :
861883 break ;
862884 }
863885}
864886
887+ /* Render column containing the operational status */
888+ static void operational_status_cell_data_function (GtkTreeViewColumn * col ,
889+ GtkCellRenderer * renderer ,
890+ GtkTreeModel * model ,
891+ GtkTreeIter * iter ,
892+ gpointer column )
893+ {
894+ gint number ;
895+ guint coli = GPOINTER_TO_UINT (column );
896+
897+ (void )col ; /* avoid unusued parameter compiler warning */
898+
899+ gtk_tree_model_get (model , iter , coli , & number , -1 );
900+
901+ switch (number )
902+ {
903+
904+ case OP_STAT_OPERATIONAL :
905+ g_object_set (renderer , "text" , "Operational" , NULL );
906+ break ;
907+
908+ case OP_STAT_NONOP :
909+ g_object_set (renderer , "text" , "Non-operational" , NULL );
910+ break ;
911+
912+ case OP_STAT_PARTIAL :
913+ g_object_set (renderer , "text" , "Partially operational" , NULL );
914+ break ;
915+
916+ case OP_STAT_STDBY :
917+ g_object_set (renderer , "text" , "Backup/Standby" , NULL );
918+ break ;
919+
920+ case OP_STAT_SPARE :
921+ g_object_set (renderer , "text" , "Spare" , NULL );
922+ break ;
923+
924+ case OP_STAT_EXTENDED :
925+ g_object_set (renderer , "text" , "Extended Mission" , NULL );
926+ break ;
927+
928+ default :
929+ g_object_set (renderer , "text" , "Unknown" , NULL );
930+ break ;
931+
932+ }
933+
934+ }
935+
865936/* Render column containg lat/lon
866937 by using this instead of the default data function, we can
867938 control the number of decimals and display the coordinates in a
0 commit comments