Note that the first two pull requests should be handled first. Just creating this in order to elucidate that this technically is ready to go.
Defined some rules for each type of file. They adhere to the XDG basedir standard. flyby.qth is defined as a config file in the standard, while flyby.db is a data file. It is less clear what the TLE-file is, but in lack of a more proper category, they are defined as data files here. If we'd rather they be in /var/something in the debian package or whatever, we can symlink from /usr/.*/?share/flyby/tles to /var/whatever and still adhere to the XDG standard.
The defined rules are written in the documentation in the header files:
flyby.qth: See qth_from_search_paths() in qth_config.h. If QTH file is read from system dirs, the system default is provided as a default but NewUser() is run so that the user can review the coordinates, and a new flyby.qth is saved to XDG_CONFIG_HOME/flyby/flyby.qth. QthEdit() defaults to XDG_CONFIG_HOME/flyby/flyby.qth. Everything is overridden if QTH is supplied on the command line.
flyby.db: See transponder_db_from_search_paths() in transponder_db.h.
TLE-files: See tle_db_from_search_paths() in tle_db.h. TLE-files defined on the command line overrides everything.
TLE-file update behavior: See tle_db_update() in tle_db.h.
Found TLE-files and transponder databases are all merged together in a single database according to the rules defined in the documentation. System TLE database overriding is assumed to be achieved by solving issue #20. System transponder database overriding is easily achieved by having no transponder fields for a specific satellite number in the user transponder database, so not really that much of an issue.
There is support for having several TLE files in a search directory.
I've based a solution on inserting ready-made TLE files into the defined XDG directories, by extending the existing behavior. Any more advanced database behavior we will have to deal with in the future. :-)
The number of satellites in the database is limited to the number defined as MAX_NUM_SATS in flyby_defines.h, but could be extended to an ulimited amount by changing the behavior of tle_db_add_entry() in tle_db.c. However, there is also a limit to what is sensible to display in the UI. Satellites in user home dir are given priority within the satellite space.
Note that the first two pull requests should be handled first. Just creating this in order to elucidate that this technically is ready to go.
Defined some rules for each type of file. They adhere to the XDG basedir standard. flyby.qth is defined as a config file in the standard, while flyby.db is a data file. It is less clear what the TLE-file is, but in lack of a more proper category, they are defined as data files here. If we'd rather they be in /var/something in the debian package or whatever, we can symlink from /usr/.*/?share/flyby/tles to /var/whatever and still adhere to the XDG standard.
The defined rules are written in the documentation in the header files:
flyby.qth: See
qth_from_search_paths()
inqth_config.h
. If QTH file is read from system dirs, the system default is provided as a default but NewUser() is run so that the user can review the coordinates, and a new flyby.qth is saved to XDG_CONFIG_HOME/flyby/flyby.qth. QthEdit() defaults to XDG_CONFIG_HOME/flyby/flyby.qth. Everything is overridden if QTH is supplied on the command line.flyby.db: See
transponder_db_from_search_paths()
intransponder_db.h
.TLE-files: See
tle_db_from_search_paths()
intle_db.h
. TLE-files defined on the command line overrides everything.TLE-file update behavior: See
tle_db_update()
intle_db.h
.Found TLE-files and transponder databases are all merged together in a single database according to the rules defined in the documentation. System TLE database overriding is assumed to be achieved by solving issue #20. System transponder database overriding is easily achieved by having no transponder fields for a specific satellite number in the user transponder database, so not really that much of an issue.
There is support for having several TLE files in a search directory.
I've based a solution on inserting ready-made TLE files into the defined XDG directories, by extending the existing behavior. Any more advanced database behavior we will have to deal with in the future. :-)
The number of satellites in the database is limited to the number defined as MAX_NUM_SATS in flyby_defines.h, but could be extended to an ulimited amount by changing the behavior of tle_db_add_entry() in tle_db.c. However, there is also a limit to what is sensible to display in the UI. Satellites in user home dir are given priority within the satellite space.