From e2470a7e14fbee7fd2973a04e39d58959ce7cb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Thu, 19 Dec 2024 17:00:09 +0100 Subject: [PATCH] [uss_qualifier/mock_uss/riddp/observation] Propagate 'eu_classification' field (#868) --- monitoring/mock_uss/riddp/routes_observation.py | 1 + monitoring/monitorlib/fetch/rid.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/monitoring/mock_uss/riddp/routes_observation.py b/monitoring/mock_uss/riddp/routes_observation.py index da7faffbd6..4b0ef0394b 100644 --- a/monitoring/mock_uss/riddp/routes_observation.py +++ b/monitoring/mock_uss/riddp/routes_observation.py @@ -213,6 +213,7 @@ def riddp_flight_details(flight_id: str) -> Tuple[str, int]: ), uas=observation_api.UAS( id=details.arbitrary_uas_id, + eu_classification=details.eu_classification, ), ) if details.operator_location is not None: diff --git a/monitoring/monitorlib/fetch/rid.py b/monitoring/monitorlib/fetch/rid.py index 3f8219f23f..983f31ed56 100644 --- a/monitoring/monitorlib/fetch/rid.py +++ b/monitoring/monitorlib/fetch/rid.py @@ -503,6 +503,22 @@ def arbitrary_uas_id(self) -> Optional[str]: f"Cannot retrieve plain_uas_id using RID version {self.rid_version}" ) + @property + def eu_classification( + self, + ) -> Optional[v22a.api.UAClassificationEU]: + if self.rid_version == RIDVersion.f3411_19: + return None + elif self.rid_version == RIDVersion.f3411_22a: + if self.v22a_value.has_field_with_value("eu_classification"): + return self.v22a_value.eu_classification + else: + return None + else: + raise NotImplementedError( + f"Cannot retrieve UA classification using RID version {self.rid_version}" + ) + @property def operator_location( self,