From c6e0ea85e435bfee76499f7217a536050f026e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Tue, 17 Dec 2024 16:06:27 +0100 Subject: [PATCH] [uss_qualifier/mock_uss/riddp/observation] Propagate 'eu_classification' field --- 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,