You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: object-ledger/object_ledger_pub_sub.py
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -232,6 +232,12 @@ def _state_callback(
232
232
state["object_type"] ="ship"
233
233
state["track"] =state["course"]
234
234
235
+
elif"Radiosonde"indata:
236
+
logging.debug(f"Processing AIS state message data: {data}")
237
+
state=json.loads(data["Radiosonde"])
238
+
state["object_id"] =state["sonde_serial"]
239
+
state["object_type"] ="balloon"
240
+
235
241
else:
236
242
logging.debug(f"Skipping state message data: {data}")
237
243
return
@@ -255,11 +261,13 @@ def _state_callback(
255
261
)
256
262
257
263
else:
258
-
logging.debug(
259
-
f"Updating entry state data for object id: {entry.index}"
260
-
)
261
-
self.ledger.update(entry)
262
-
264
+
if (entry['timestamp'] -self.ledger.loc[entry.index, 'timestamp']).iloc[0] >0:
265
+
self.ledger.update(entry)
266
+
logging.debug(f"Updating entry state data for object id: {entry.index[0]} | {(entry['timestamp'] -self.ledger.loc[entry.index, 'timestamp']).iloc[0]} newer than ledger")
0 commit comments