1 /* 2 Gpredict: Real-time satellite tracking and orbit prediction program 3 4 Copyright (C) 2001-2017 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 SAT_CFG_H 26 #define SAT_CFG_H 1 27 28 #include <glib.h> 29 30 #define TIME_FORMAT_MAX_LENGTH 50 31 32 /** Symbolic references for boolean config values. */ 33 typedef enum { 34 SAT_CFG_BOOL_USE_LOCAL_TIME = 0, /*!< Display local time instead of UTC. */ 35 SAT_CFG_BOOL_USE_NSEW, /*!< Use N, S, E and W instead of sign */ 36 SAT_CFG_BOOL_USE_IMPERIAL, /*!< Use Imperial units instead of Metric */ 37 SAT_CFG_BOOL_MAIN_WIN_POS, /*!< Restore position of main window */ 38 SAT_CFG_BOOL_MOD_WIN_POS, /*!< Restore size and position of module windows */ 39 SAT_CFG_BOOL_MOD_STATE, /*!< Restore module state */ 40 SAT_CFG_BOOL_RULES_HINT_OBSOLETE, /*!< Enable rules hint in GtkSatList. */ 41 SAT_CFG_BOOL_MAP_SHOW_QTH_INFO, /*!< Show QTH info on map */ 42 SAT_CFG_BOOL_MAP_SHOW_NEXT_EV, /*!< Show next event on map */ 43 SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK, /*!< Track mouse cursor on map. */ 44 SAT_CFG_BOOL_MAP_SHOW_GRID, /*!< Show grid on map. */ 45 SAT_CFG_BOOL_MAP_KEEP_RATIO, /*!< Keep original aspect ratio */ 46 SAT_CFG_BOOL_POL_SHOW_QTH_INFO, /*!< Show QTH info on polar plot */ 47 SAT_CFG_BOOL_POL_SHOW_NEXT_EV, /*!< Show next event on polar plot */ 48 SAT_CFG_BOOL_POL_SHOW_CURS_TRACK, /*!< Track mouse cursor on polar plot. */ 49 SAT_CFG_BOOL_POL_SHOW_EXTRA_AZ_TICKS, /*!< Extra Az ticks at every 30 deg. */ 50 SAT_CFG_BOOL_POL_SHOW_TRACK_AUTO, /*!< Automatically show the sky track. */ 51 SAT_CFG_BOOL_TLE_SERVER_AUTH, /*!< TLE server requires authentication. */ 52 SAT_CFG_BOOL_TLE_PROXY_AUTH, /*!< Proxy requires authentication. */ 53 SAT_CFG_BOOL_TLE_ADD_NEW, /*!< Add new satellites to database. */ 54 SAT_CFG_BOOL_KEEP_LOG_FILES, /*!< Whether to keep old log files */ 55 SAT_CFG_BOOL_PRED_USE_REAL_T0, /*!< Whether to use current time as T0 fro predictions */ 56 SAT_CFG_BOOL_NUM /*!< Number of boolean parameters */ 57 } sat_cfg_bool_e; 58 59 /** Symbolic references for integer config values. */ 60 typedef enum { 61 SAT_CFG_INT_VERSION_MAJOR = 0, /*!< Configuration version number (major) */ 62 SAT_CFG_INT_VERSION_MINOR, /*!< Configuration version number (minor) */ 63 SAT_CFG_INT_MODULE_TIMEOUT, /*!< Module refresh rate */ 64 SAT_CFG_INT_MODULE_LAYOUT, /*!< Module layout */ 65 SAT_CFG_INT_MODULE_VIEW_1, /*!< Type of view 1 */ 66 SAT_CFG_INT_MODULE_VIEW_2, /*!< Type of view 2 */ 67 SAT_CFG_INT_MODULE_VIEW_3, /*!< Type of view 3 */ 68 SAT_CFG_INT_MODULE_CURRENT_PAGE, /*!< Number of integer parameters. */ 69 SAT_CFG_INT_WARP_FACTOR, /*!< Time compression factor. */ 70 SAT_CFG_INT_LIST_REFRESH, /*!< List refresh rate (cycle). */ 71 SAT_CFG_INT_LIST_COLUMNS, /*!< List column visibility. */ 72 SAT_CFG_INT_MAP_CENTER, /*!< Longitude around which the map is centered. */ 73 SAT_CFG_INT_MAP_REFRESH, /*!< Map refresh rate (cycle). */ 74 SAT_CFG_INT_MAP_INFO_COL, /*!< Info text colour on maps. */ 75 SAT_CFG_INT_MAP_INFO_BGD_COL, /*!< Info text bgd colour on maps. */ 76 SAT_CFG_INT_MAP_QTH_COL, /*!< QTH mark colour on map. */ 77 SAT_CFG_INT_MAP_SAT_COL, /*!< Satellite colour on maps */ 78 SAT_CFG_INT_MAP_SAT_SEL_COL, /*!< Selected satellite colour */ 79 SAT_CFG_INT_MAP_SAT_COV_COL, /*!< Map coverage area colour */ 80 SAT_CFG_INT_MAP_GRID_COL, /*!< Grid colour. */ 81 SAT_CFG_INT_MAP_TERMINATOR_COL, /*!< Solar terminator colour. */ 82 SAT_CFG_INT_MAP_GLOBAL_SHADOW_COL, /*!< Earth shadow colour. */ 83 SAT_CFG_INT_MAP_TICK_COL, /*!< Tick labels colour. */ 84 SAT_CFG_INT_MAP_TRACK_COL, /*!< Ground Track colour. */ 85 SAT_CFG_INT_MAP_TRACK_NUM, /*!< Number of orbits to show ground track for */ 86 SAT_CFG_INT_MAP_SHADOW_ALPHA, /*!< Tranparency of shadow under satellite marker. */ 87 SAT_CFG_INT_POLAR_REFRESH, /*!< Polar refresh rate (cycle). */ 88 SAT_CFG_INT_POLAR_ORIENTATION, /*!< Orientation of the polar charts. */ 89 SAT_CFG_INT_POLAR_BGD_COL, /*!< Polar view, background colour. */ 90 SAT_CFG_INT_POLAR_AXIS_COL, /*!< Polar view, axis colour. */ 91 SAT_CFG_INT_POLAR_TICK_COL, /*!< Tick label colour, e.g. N/W/S/E */ 92 SAT_CFG_INT_POLAR_SAT_COL, /*!< Satellite colour. */ 93 SAT_CFG_INT_POLAR_SAT_SEL_COL, /*!< Selected satellite colour. */ 94 SAT_CFG_INT_POLAR_TRACK_COL, /*!< Track colour. */ 95 SAT_CFG_INT_POLAR_INFO_COL, /*!< Info colour. */ 96 SAT_CFG_INT_SINGLE_SAT_REFRESH, /*!< Single-sat refresh rate (cycle). */ 97 SAT_CFG_INT_SINGLE_SAT_FIELDS, /*!< Single-sat fields. */ 98 SAT_CFG_INT_SINGLE_SAT_SELECT, /*!< Single-sat selected satellite. */ 99 SAT_CFG_INT_EVENT_LIST_REFRESH, /*!< Event list refresh rate (cycle). */ 100 SAT_CFG_INT_PRED_MIN_EL, /*!< Minimum elevation for passes. */ 101 SAT_CFG_INT_PRED_NUM_PASS, /*!< Number of passes to predict. */ 102 SAT_CFG_INT_PRED_LOOK_AHEAD, /*!< Look-ahead time limit in days. */ 103 SAT_CFG_INT_PRED_RESOLUTION, /*!< Time resolution in seconds */ 104 SAT_CFG_INT_PRED_NUM_ENTRIES, /*!< Number of entries in single pass. */ 105 SAT_CFG_INT_PRED_SINGLE_COL, /*!< Visible columns in single-pass dialog */ 106 SAT_CFG_INT_PRED_MULTI_COL, /*!< Visible columns in multi-pass dialog */ 107 SAT_CFG_INT_PRED_SAVE_FORMAT, /*!< Last used save format for predictions */ 108 SAT_CFG_INT_PRED_SAVE_CONTENTS, /*!< Last selection for save file contents */ 109 SAT_CFG_INT_PRED_TWILIGHT_THLD, /*!< Twilight zone threshold */ 110 SAT_CFG_INT_SKYATGL_TIME, /*!< Time span for sky at a glance predictions */ 111 SAT_CFG_INT_SKYATGL_COL_01, /*!< Colour 1 in sky at a glance predictions */ 112 SAT_CFG_INT_SKYATGL_COL_02, /*!< Colour 2 in sky at a glance predictions */ 113 SAT_CFG_INT_SKYATGL_COL_03, /*!< Colour 3 in sky at a glance predictions */ 114 SAT_CFG_INT_SKYATGL_COL_04, /*!< Colour 4 in sky at a glance predictions */ 115 SAT_CFG_INT_SKYATGL_COL_05, /*!< Colour 5 in sky at a glance predictions */ 116 SAT_CFG_INT_SKYATGL_COL_06, /*!< Colour 6 in sky at a glance predictions */ 117 SAT_CFG_INT_SKYATGL_COL_07, /*!< Colour 7 in sky at a glance predictions */ 118 SAT_CFG_INT_SKYATGL_COL_08, /*!< Colour 8 in sky at a glance predictions */ 119 SAT_CFG_INT_SKYATGL_COL_09, /*!< Colour 9 in sky at a glance predictions */ 120 SAT_CFG_INT_SKYATGL_COL_10, /*!< Colour 10 in sky at a glance predictions */ 121 SAT_CFG_INT_WINDOW_POS_X, /*!< Main window X during last session */ 122 SAT_CFG_INT_WINDOW_POS_Y, /*!< Main window Y during last session */ 123 SAT_CFG_INT_WINDOW_WIDTH, /*!< Main window width during last session */ 124 SAT_CFG_INT_WINDOW_HEIGHT, /*!< Main window height during last session */ 125 SAT_CFG_INT_WEB_BROWSER_TYPE, /*!< Web browser type, see browser_type_t */ 126 SAT_CFG_INT_TLE_AUTO_UPD_FREQ, /*!< TLE auto-update frequency. */ 127 SAT_CFG_INT_TLE_AUTO_UPD_ACTION, /*!< TLE auto-update action. */ 128 SAT_CFG_INT_TLE_LAST_UPDATE, /*!< Date and time of last update, Unix seconds. */ 129 SAT_CFG_INT_LOG_CLEAN_AGE, /*!< Age of log file to delete (seconds) */ 130 SAT_CFG_INT_LOG_LEVEL, /*!< Logging level */ 131 SAT_CFG_INT_NUM /*!< Number of integer parameters. */ 132 } sat_cfg_int_e; 133 134 /** Symbolic references for string config values. */ 135 typedef enum { 136 SAT_CFG_STR_TIME_FORMAT = 0, /*!< Time format. */ 137 SAT_CFG_STR_DEF_QTH, /*!< Default QTH file. */ 138 SAT_CFG_STR_OPEN_MODULES, /*!< Open modules. */ 139 SAT_CFG_STR_WEB_BROWSER, /*!< Web browser string. */ 140 SAT_CFG_STR_MODULE_GRID, /*!< The grid layout of the module */ 141 SAT_CFG_STR_MAP_FILE, /*!< Map file (abs or rel). */ 142 SAT_CFG_STR_MAP_FONT, /*!< Map font. */ 143 SAT_CFG_STR_POL_FONT, /*!< Polar view font. */ 144 SAT_CFG_STR_TRSP_SERVER, /*!< Server for transponder updates (since 1.4) */ 145 SAT_CFG_STR_TRSP_FREQ_FILE, /*!< The file with frequency data on the server (since 1.4) */ 146 SAT_CFG_STR_TRSP_MODE_FILE, /*!< The file with mode descriptions on the server (since 1.4) */ 147 SAT_CFG_STR_TRSP_PROXY, /*!< Proxy server. */ 148 SAT_CFG_STR_TLE_SERVER, /*!< Server for TLE updates (replaced in 1.4 by TLE_URLS) */ 149 SAT_CFG_STR_TLE_FILES, /*!< ; separated list of files on server (replaced in 1.4 by TLE_URLS) */ 150 SAT_CFG_STR_TLE_PROXY, /*!< Proxy server. */ 151 SAT_CFG_STR_TLE_URLS, /*!< ; separated list of TLE file URLs (since 1.4) */ 152 SAT_CFG_STR_TLE_FILE_DIR, /*!< Local directory from which tle were last updated. */ 153 SAT_CFG_STR_PRED_SAVE_DIR, /*!< Last used save directory for pass predictions */ 154 SAT_CFG_STR_NUM /*!< Number of string parameters */ 155 } sat_cfg_str_e; 156 157 guint sat_cfg_load(void); 158 guint sat_cfg_save(void); 159 void sat_cfg_close(void); 160 gboolean sat_cfg_get_bool(sat_cfg_bool_e param); 161 gboolean sat_cfg_get_bool_def(sat_cfg_bool_e param); 162 void sat_cfg_set_bool(sat_cfg_bool_e param, gboolean value); 163 void sat_cfg_reset_bool(sat_cfg_bool_e param); 164 gchar *sat_cfg_get_str(sat_cfg_str_e param); 165 gchar *sat_cfg_get_str_def(sat_cfg_str_e param); 166 void sat_cfg_set_str(sat_cfg_str_e param, const gchar * value); 167 void sat_cfg_reset_str(sat_cfg_str_e param); 168 gint sat_cfg_get_int(sat_cfg_int_e param); 169 gint sat_cfg_get_int_def(sat_cfg_int_e param); 170 void sat_cfg_set_int(sat_cfg_int_e param, gint value); 171 void sat_cfg_reset_int(sat_cfg_int_e param); 172 173 #endif 174