[Gpredict-svn] SF.net SVN: gpredict:[894] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <aa...@us...> - 2011-09-04 23:14:13
|
Revision: 894
http://gpredict.svn.sourceforge.net/gpredict/?rev=894&view=rev
Author: aa1vs
Date: 2011-09-04 23:14:07 +0000 (Sun, 04 Sep 2011)
Log Message:
-----------
Cleanup comments and code with satellite status updates.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/tle-update.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-09-01 11:39:20 UTC (rev 893)
+++ trunk/ChangeLog 2011-09-04 23:14:07 UTC (rev 894)
@@ -1,3 +1,10 @@
+2011-09-04 Charles Suprin <hamaa1vs at gmail.com>
+
+ * ChangeLog
+ * src/tle-update.c
+ Cleanup comments and code with satellite status updates.
+
+
2011-09-01 Charles Suprin <hamaa1vs at gmail.com>
* ChangeLog
Modified: trunk/src/tle-update.c
===================================================================
--- trunk/src/tle-update.c 2011-09-01 11:39:20 UTC (rev 893)
+++ trunk/src/tle-update.c 2011-09-04 23:14:07 UTC (rev 894)
@@ -889,9 +889,11 @@
/* add data to hash table */
key = g_try_new0 (guint, 1);
*key = catnr;
-
+
+ ntle = g_hash_table_lookup (data, key);
+
/* check if satellite already in hash table */
- if (g_hash_table_lookup (data, key) == NULL) {
+ if ( ntle == NULL) {
/* create new_tle structure */
ntle = g_try_new (new_tle_t, 1);
@@ -908,23 +910,26 @@
retcode++;
}
else {
- /* if the satellite in the hash is older than
- the one just loaded, copy the values over. */
- ntle = g_hash_table_lookup (data, key);
+ /* satellite is already in hash */
+ /* apply various merge routines */
if (ntle->epoch == tle.epoch) {
- if (ntle->status!=tle.status) {
- if (tle.status != OP_STAT_UNKNOWN) {
- if (ntle->status!= OP_STAT_UNKNOWN) {
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("%s:%s: Two different statuses for the same satellite at the same time."),
- __FILE__, __FUNCTION__);
-
- }
- ntle->status = tle.status;
+ /* if satellite epoch has the same time, merge status as appropriate */
+ if ( (ntle->status != tle.status) && ( ntle->status != OP_STAT_UNKNOWN )) {
+ /* update status */
+ ntle->status = tle.status;
+ if ( tle.status != OP_STAT_UNKNOWN ) {
+ /* log if there is something funny about the data coming in */
+ sat_log_log (SAT_LOG_LEVEL_WARN,
+ _("%s:%s: Two different statuses for %s:%d at the same time."),
+ __FILE__, __FUNCTION__, ntle->satname,ntle->catnum);
+
}
}
}
- else if (ntle->epoch <tle.epoch) {
+ else if ( ntle->epoch < tle.epoch ) {
+ /* if the satellite in the hash is older than
+ the one just loaded, copy the values over. */
+
ntle->catnum = catnr;
ntle->epoch = tle.epoch;
ntle->status = tle.status;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|