Skip to content

Commit

Permalink
Merge pull request #32 from hpuhr/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
hpuhr authored Jun 28, 2021
2 parents 7a19783 + e1ab325 commit 7446909
Show file tree
Hide file tree
Showing 40 changed files with 11,394 additions and 7,308 deletions.
24 changes: 16 additions & 8 deletions analyze/reconst_util/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ def process_record(self, cat, record):
self._num_records += 1

# process time
tod = find_value("073.Time of Message Reception for Position", record)

tod = find_value("071.Time of Applicability for Position", record)

if tod is None:
tod = find_value("073.Time of Message Reception for Position", record)

if tod is None:
print ('no time found')
return

if self._last_tod is not None and tod < self._last_tod:
print('warn: utn {} ta {} record {} time jump from {} to {} diff {}'.format(
self._utn, hex(self._target_address), self._num_records,
time_str_from_seconds(self._last_tod), time_str_from_seconds(tod),
time_str_from_seconds(self._last_tod-tod)))

self._target_reports[tod] = ADSBTargetReport(record)

Expand All @@ -46,13 +60,7 @@ def process_record(self, cat, record):
self._first_tod = tod
self._last_tod = tod

if tod > self._last_tod:
self._last_tod = tod
elif tod < self._last_tod:
print('warn: utn {} ta {} record {} time jump from {} to {} diff {}'.format(
self._utn, hex(self._target_address), self._num_records,
time_str_from_seconds(self._last_tod), time_str_from_seconds(tod),
time_str_from_seconds(self._last_tod-tod)))
self._last_tod = tod

def getMOPSVersions(self):
mops_versions = []
Expand Down
7 changes: 6 additions & 1 deletion analyze/reconst_util/reference_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ def __init__(self, utn, tod):

def fromADSBTargetReport (self, target_report):
assert isinstance(target_report, ADSBTargetReport)
assert self.tod == target_report.get("tod")

if target_report.get("tod") is not None:
assert self.tod == target_report.get("tod")
else:
assert target_report.get("tod2") is not None
assert self.tod == target_report.get("tod2")

self.callsign = target_report.get("callsign")
self.mode3a_code = target_report.get("mode3a_code")
Expand Down
3 changes: 2 additions & 1 deletion analyze/reconst_util/target_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class ADSBTargetReport(TargetReport):
"test_target": lambda record: get_as_verif_flag("040.TST", record, False),
"toap": lambda record: None,
"toav": lambda record: None,
"tod": lambda record: find_value("073.Time of Message Reception for Position", record),
"tod": lambda record: find_value("071.Time of Applicability for Position", record),
"tod2": lambda record: find_value("073.Time of Message Reception for Position", record),
"tod_accuracy": lambda record: None,
"tod_calculated": lambda record: None,
"torp": lambda record: find_value("073.Time of Message Reception for Position", record),
Expand Down
8 changes: 4 additions & 4 deletions definitions/categories/001/cat001_1.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
"type":"fixed_bytes",
"length":2,
"data_type":"uint",
"lsb":0.00549316406
"lsb":0.0054931640625
}
]
},
Expand Down Expand Up @@ -490,7 +490,7 @@
"type":"fixed_bytes",
"length":1,
"data_type":"int",
"lsb":0.00006103515
"lsb":6.103515625e-5
}
]
},
Expand Down Expand Up @@ -703,15 +703,15 @@
"type":"fixed_bytes",
"length":2,
"data_type":"int",
"lsb":0.00006103515
"lsb":6.103515625e-5
},
{
"name":"CALCULATED HEADING",
"comment":"",
"type":"fixed_bytes",
"length":2,
"data_type":"uint",
"lsb":0.00549316406
"lsb":0.0054931640625
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions definitions/categories/002/cat002_1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"type":"fixed_bytes",
"length":1,
"data_type":"int",
"lsb":0.00549316406
"lsb":0.0054931640625
}
]
},
Expand Down Expand Up @@ -313,15 +313,15 @@
"type":"fixed_bytes",
"length":2,
"data_type":"uint",
"lsb":0.00549316406
"lsb":0.0054931640625
},
{
"name":"THETA-END",
"comment":"",
"type":"fixed_bytes",
"length":2,
"data_type":"uint",
"lsb":0.00549316406
"lsb":0.0054931640625
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions definitions/categories/004/cat004_1.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -961,15 +961,15 @@
"type":"fixed_bytes",
"length":4,
"data_type":"int",
"lsb":0.00000536442
"lsb":5.36441802978515625e-6
},
{
"name":"Longitude #1",
"comment":"In WGS.84 in two’s complement. Range -180 <= longitude < 180 deg.",
"type":"fixed_bytes",
"length":4,
"data_type":"int",
"lsb":0.00000536442
"lsb":5.36441802978515625e-6
},
{
"name":"Altitude #1",
Expand Down Expand Up @@ -1288,15 +1288,15 @@
"type":"fixed_bytes",
"length":4,
"data_type":"int",
"lsb":0.00000536442
"lsb":5.36441802978515625E-6
},
{
"name":"Longitude #2",
"comment":"In WGS.84 in two’s complement. Range -180 <= longitude < 180 deg.",
"type":"fixed_bytes",
"length":4,
"data_type":"int",
"lsb":0.00000536442
"lsb":5.36441802978515625E-6
},
{
"name":"Altitude #2",
Expand Down
Loading

0 comments on commit 7446909

Please sign in to comment.