Skip to content

Commit

Permalink
* Version 7.0.1
Browse files Browse the repository at this point in the history
* Fixes #42: ADSBCOT CoT Events not showing up in iTAK.
  • Loading branch information
ampledata committed Apr 28, 2024
1 parent 9ee7566 commit be390bc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## ADSBCOT 7.0.1

- Fixes #42: ADSBCOT CoT Events are not showing up in iTAK.

## ADSBCOT 7.0.0

- New for 2024!
Expand Down
2 changes: 1 addition & 1 deletion adsbcot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:source: <https://github.com/snstac/adsbcot>
"""

__version__ = "7.0.0"
__version__ = "7.0.1"
__author__ = "Greg Albrecht <gba@snstac.com>"
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com"
__license__ = "Apache License, Version 2.0"
Expand Down
22 changes: 12 additions & 10 deletions adsbcot/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ def adsb_to_cot_xml( # NOQA pylint: disable=too-many-locals,too-many-branches,t
track.set("speed", aircot.functions.get_speed(craft.get("gs")))

detail = ET.Element("detail")

# Remarks should always be the first sub-entity within the Detail entity.
remarks = ET.Element("remarks")
remarks_fields.append(f"{cot_host_id}")
_remarks = " ".join(list(filter(None, remarks_fields)))
remarks.text = _remarks
detail.append(remarks)

detail.append(contact)
detail.append(track)
detail.append(aircotx)
Expand All @@ -235,18 +243,14 @@ def adsb_to_cot_xml( # NOQA pylint: disable=too-many-locals,too-many-branches,t
usericon.set("iconsetpath", icon)
detail.append(usericon)

remarks = ET.Element("remarks")
remarks_fields.append(f"{cot_host_id}")
_remarks = " ".join(list(filter(None, remarks_fields)))
remarks.text = _remarks
detail.append(remarks)

cot_d = {
"lat": str(lat),
"lon": str(lon),
"ce": str(craft.get("nac_p", "9999999.0")),
"le": str(craft.get("nac_v", "9999999.0")),
"hae": aircot.functions.get_hae(craft.get("alt_geom")), # Multiply alt_geom by "Clarke 1880 (international foot)"
"hae": aircot.functions.get_hae(
craft.get("alt_geom")
), # Multiply alt_geom by "Clarke 1880 (international foot)"
"uid": cot_uid,
"cot_type": cot_type,
"stale": cot_stale,
Expand All @@ -271,7 +275,5 @@ def adsb_to_cot(
"""Return CoT XML object as an XML string."""
cot: Optional[ET.Element] = adsb_to_cot_xml(craft, config, known_craft)
return (
b"\n".join([pytak.DEFAULT_XML_DECLARATION, ET.tostring(cot)])
if cot
else None
b"\n".join([pytak.DEFAULT_XML_DECLARATION, ET.tostring(cot)]) if cot else None
)
13 changes: 13 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,16 @@ test =
pylint
flake8
black
[isort]
profile = black

[flake8]
max-line-length = 88
extend-ignore = E203, E704

[pylint]
max-line-length = 88

[pycodestyle]
ignore = E203
max_line_length = 88

0 comments on commit be390bc

Please sign in to comment.