1 /*
2   Gpredict: Real-time satellite tracking and orbit prediction program
3 
4   Copyright (C)  2001-2009  Alexandru Csete, OZ9AEC.
5 
6   Comments, questions and bugreports should be submitted via
7   http://sourceforge.net/projects/gpredict/
8   More details can be found at the project home page:
9 
10   http://gpredict.oz9aec.net/
11 
12   This program is free software; you can redistribute it and/or modify
13   it under the terms of the GNU General Public License as published by
14   the Free Software Foundation; either version 2 of the License, or
15   (at your option) any later version.
16 
17   This program is distributed in the hope that it will be useful,
18   but WITHOUT ANY WARRANTY; without even the implied warranty of
19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20   GNU General Public License for more details.
21 
22   You should have received a copy of the GNU General Public License
23   along with this program; if not, visit http://www.fsf.org/
24 */
25 #ifndef TLE_UPDATE_H
26 #define TLE_UPDATE_H 1
27 
28 #include <gtk/gtk.h>
29 #include "sgpsdp/sgp4sdp4.h"
30 
31 
32 /** TLE format type flags. */
33 typedef enum {
34     TLE_TYPE_NASA = 0           /*!< NASA two-line format (3 lines with name). */
35 } tle_type_t;
36 
37 
38 /** TLE auto update frequency. */
39 typedef enum {
40     TLE_AUTO_UPDATE_NEVER = 0,  /*!< No auto-update, just warn after one week. */
41     TLE_AUTO_UPDATE_MONTHLY = 1,
42     TLE_AUTO_UPDATE_WEEKLY = 2,
43     TLE_AUTO_UPDATE_DAILY = 3,
44     TLE_AUTO_UPDATE_NUM
45 } tle_auto_upd_freq_t;
46 
47 
48 /** Action to perform when it's time to update TLE. */
49 typedef enum {
50     TLE_AUTO_UPDATE_NOACT = 0,  /*!< No action (not a valid option). */
51     TLE_AUTO_UPDATE_NOTIFY = 1, /*!< Notify user. */
52     TLE_AUTO_UPDATE_GOAHEAD = 2 /*!< Perform unattended update. */
53 } tle_auto_upd_action_t;
54 
55 
56 /** Data structure to hold a TLE set. */
57 typedef struct {
58     guint           catnum;     /*!< Catalog number. */
59     gdouble         epoch;      /*!< Epoch. */
60     gchar          *satname;    /*!< Satellite name. */
61     gchar          *line1;      /*!< Line 1. */
62     gchar          *line2;      /*!< Line 2. */
63     gchar          *srcfile;    /*!< The file where TLE comes from (needed for cat) */
64     gboolean        isnew;      /*!< Flag indicating whether sat is new. */
65     op_stat_t       status;     /*!< Enum indicating current satellite status. */
66 } new_tle_t;
67 
68 
69 /** Data structure to hold local TLE data. */
70 typedef struct {
71     tle_t           tle;        /*!< TLE data. */
72     gchar          *filename;   /*!< File name where the TLE data is from */
73 } loc_tle_t;
74 
75 
76 void            tle_update_from_files(const gchar * dir,
77                                       const gchar * filter,
78                                       gboolean silent,
79                                       GtkWidget * progress,
80                                       GtkWidget * label1, GtkWidget * label2);
81 
82 void            tle_update_from_network(gboolean silent,
83                                         GtkWidget * progress,
84                                         GtkWidget * label1,
85                                         GtkWidget * label2);
86 
87 const gchar    *tle_update_freq_to_str(tle_auto_upd_freq_t freq);
88 
89 #endif
90