Add Conversion from DDM to DD
Alire installation and checkup / build (ubuntu-20.04) (push) Failing after 10m30s

This commit is contained in:
Nina Chlóe Kassandra Reiß
2026-06-11 15:26:59 +02:00
parent 970aaad697
commit bb939c2393
2 changed files with 60 additions and 47 deletions
+22 -6
View File
@@ -5,17 +5,33 @@ package body Grl.Coordinates is
begin
case DM_Base.Form is
when Relative => null;
when DD_Fine => null;
when DD => DD_Target := DM_Base;
when Relative =>
null;
when DD_Fine =>
null;
when DD =>
DD_Target := DM_Base;
when DDM =>
if DM_Base.DDM.Cardinal_Lat = North then
DD_Target.DD.Latitude :=
DD_Meter_Scale_Lat (DM_Base.DDM.Degree_Lat)
+
DD_Meter_Scale_Lat (DM_Base.DDM.Degree_Lat) +
DD_Meter_Scale_Lat (DM_Base.DDM.Minutes_Lat / 60.0);
else
DD_Target.DD.Latitude :=
-1.0 * DD_Meter_Scale_Lat (DM_Base.DDM.Degree_Lat) +
DD_Meter_Scale_Lat (DM_Base.DDM.Minutes_Lat / 60.0);
end if;
when DMS => null;
if DM_Base.DDM.Cardinal_Lon = East then
DD_Target.DD.Longitude :=
DD_Meter_Scale_Lon (DM_Base.DDM.Degree_Lon) +
DD_Meter_Scale_Lon (DM_Base.DDM.Minutes_Lon / 60.0);
else
DD_Target.DD.Longitude :=
-1.00 * DD_Meter_Scale_Lon (DM_Base.DDM.Degree_Lon) +
DD_Meter_Scale_Lon (DM_Base.DDM.Minutes_Lon / 60.0);
end if;
when DMS =>
null;
end case;
return DD_Target;
+12 -15
View File
@@ -1,5 +1,5 @@
package Grl.Coordinates
with SPARK_Mode => On
package Grl.Coordinates with
SPARK_Mode => On
is
-- ------------ --
@@ -54,11 +54,10 @@ is
Seconds_Lon : DM_Seconds;
Cardinal_Lat : Cardinal;
Cardinal_Lon : Cardinal;
end record
with Dynamic_Predicate =>
end record with
Dynamic_Predicate =>
Format_DMS.Cardinal_Lat in North | South
and then
Format_DMS.Cardinal_Lon in East | West;
and then Format_DMS.Cardinal_Lon in East | West;
-- DDM
type Format_DDM is record
@@ -68,11 +67,10 @@ is
Minutes_Lon : DDM_Minutes;
Cardinal_Lat : Cardinal;
Cardinal_Lon : Cardinal;
end record
with Dynamic_Predicate =>
end record with
Dynamic_Predicate =>
Format_DDM.Cardinal_Lat in North | South
and then
Format_DDM.Cardinal_Lon in East | West;
and then Format_DDM.Cardinal_Lon in East | West;
-- -------------------------- --
-- Coordinate Type Definition --
@@ -103,10 +101,9 @@ is
-- @return Coordinate
-- @parameter DM_Base : Coordinate
-- @description Take any coordinate and return a DD formatted coordinate.
function To_DD (DM_Base : Coordinate) return Coordinate
with Pre =>
(DM_Base.Form = DD) or else
(DM_Base.Form = DMS) or else
(DM_Base.Form = DDM);
function To_DD (DM_Base : Coordinate) return Coordinate with
Pre =>
(DM_Base.Form = DD) or else (DM_Base.Form = DMS)
or else (DM_Base.Form = DDM);
end Grl.Coordinates;