Commit 1495ed82 authored by Claire Dross's avatar Claire Dross

Layer2_MMS_SW_SPARK: update after answers on #28

parent 916d6c8f
...@@ -50,7 +50,7 @@ package External with Abstract_State => (State with External => Async_Writers) i ...@@ -50,7 +50,7 @@ package External with Abstract_State => (State with External => Async_Writers) i
Volatile_Function, Volatile_Function,
Global => State; Global => State;
function USB_Key return Navigation_Parameters_Type_Option with function USB_Key return USB_Key_Type_Option with
Volatile_Function, Volatile_Function,
Global => State; Global => State;
......
...@@ -41,7 +41,7 @@ package MMS.F_PT.F_CM.Input is ...@@ -41,7 +41,7 @@ package MMS.F_PT.F_CM.Input is
function Payload_Mass return Payload_Mass_Type function Payload_Mass return Payload_Mass_Type
renames MMS.F_PT.Input.Payload_Mass; renames MMS.F_PT.Input.Payload_Mass;
function USB_Key return Navigation_Parameters_Type_Option function USB_Key return USB_Key_Type_Option
renames MMS.F_PT.Input.USB_Key; renames MMS.F_PT.Input.USB_Key;
function P return Distance_Type function P return Distance_Type
......
...@@ -86,7 +86,7 @@ package MMS.F_PT.F_CM.Output is ...@@ -86,7 +86,7 @@ package MMS.F_PT.F_CM.Output is
function Bay_Switch return Bay_Switch_Type function Bay_Switch return Bay_Switch_Type
renames MMS.F_PT.F_CM.Input.Bay_Switch; renames MMS.F_PT.F_CM.Input.Bay_Switch;
function USB_Key return Navigation_Parameters_Type_Option function USB_Key return USB_Key_Type_Option
renames MMS.F_PT.F_CM.Input.USB_Key; renames MMS.F_PT.F_CM.Input.USB_Key;
---------------------- ----------------------
......
...@@ -8,12 +8,6 @@ package MMS.F_PT.F_FC.Behavior.Guarantees with SPARK_Mode is ...@@ -8,12 +8,6 @@ package MMS.F_PT.F_FC.Behavior.Guarantees with SPARK_Mode is
-- High-Level Properties on F_FC -- -- High-Level Properties on F_FC --
----------------------------------- -----------------------------------
subtype Propulsion_State_Type is Engine_State_Type
range PROPULSION .. WAITING_BRAK;
subtype Braking_State_Type is Engine_State_Type
range BRAKING .. WAITING_PROP;
function Engine_State_In_Braking return Boolean is function Engine_State_In_Braking return Boolean is
(On_State = RUNNING (On_State = RUNNING
and then Engine_State in Braking_State_Type); and then Engine_State in Braking_State_Type);
......
...@@ -37,13 +37,15 @@ package MMS.F_PT.F_MM.Behavior.Guarantees with SPARK_Mode is ...@@ -37,13 +37,15 @@ package MMS.F_PT.F_MM.Behavior.Guarantees with SPARK_Mode is
----------------------------------- -----------------------------------
procedure Run with procedure Run with
Post => Pre => State_Invariant,
Post => State_Invariant
-- 6.6.3.A Viability guarantee: no take-off if energy aboard is -- 6.6.3.A Viability guarantee: no take-off if energy aboard is
-- incompatible with mission completion. -- incompatible with mission completion.
(if In_Take_Off_State and then not In_Take_Off_State'Old then and then
Initial_Energy_Test_Succeeded) (if In_Take_Off_State and then not In_Take_Off_State'Old then
Initial_Energy_Test_Succeeded)
-- 6.6.3.B Any mission cancellation is signaled to CP and GS. -- 6.6.3.B Any mission cancellation is signaled to CP and GS.
...@@ -69,7 +71,7 @@ package MMS.F_PT.F_MM.Behavior.Guarantees with SPARK_Mode is ...@@ -69,7 +71,7 @@ package MMS.F_PT.F_MM.Behavior.Guarantees with SPARK_Mode is
and then Mission_Parameters_Defined and then Mission_Parameters_Defined
then then
USB_Key_Present USB_Key_Present
and then Operating_Mode = Operating_Mode_From_CP and then Operating_Mode_From_Parameters = Operating_Mode_From_USB_Key
and then Navigation_Parameters = Navigation_Parameters_From_USB_Key); and then Navigation_Parameters = Navigation_Parameters_From_USB_Key);
end MMS.F_PT.F_MM.Behavior.Guarantees; end MMS.F_PT.F_MM.Behavior.Guarantees;
...@@ -72,7 +72,8 @@ package MMS.F_PT.F_MM.Data is ...@@ -72,7 +72,8 @@ package MMS.F_PT.F_MM.Data is
-- Issue #28 -- Issue #28
Altitude_ref_TakeOff : Current_Altitude_Type; Altitude_ref_TakeOff : Current_Altitude_Type;
Speed_ref_TakeOff : Current_Speed_Type; Speed_ref_TakeOff : Current_Speed_Type;
Energy_Mode_ref_TakeOff : Speed_Or_Altitude;
end MMS.F_PT.F_MM.Data; end MMS.F_PT.F_MM.Data;
...@@ -38,7 +38,7 @@ package MMS.F_PT.F_MM.Input is ...@@ -38,7 +38,7 @@ package MMS.F_PT.F_MM.Input is
function Payload_Mass return Payload_Mass_Type function Payload_Mass return Payload_Mass_Type
renames MMS.F_PT.F_CM.Output.Payload_Mass; renames MMS.F_PT.F_CM.Output.Payload_Mass;
function USB_Key return Navigation_Parameters_Type_Option function USB_Key return USB_Key_Type_Option
renames MMS.F_PT.F_CM.Output.USB_Key; renames MMS.F_PT.F_CM.Output.USB_Key;
----------------------- -----------------------
......
...@@ -26,7 +26,7 @@ package MMS.F_PT.F_MM.State is ...@@ -26,7 +26,7 @@ package MMS.F_PT.F_MM.State is
Input_Payload_Mass : Payload_Mass_Type with Part_Of => Input_State; Input_Payload_Mass : Payload_Mass_Type with Part_Of => Input_State;
Input_USB_Key : Navigation_Parameters_Type_Option with Input_USB_Key : USB_Key_Type_Option with
Part_Of => Input_State; Part_Of => Input_State;
Input_Mission_Abort : Boolean with Part_Of => Input_State; Input_Mission_Abort : Boolean with Part_Of => Input_State;
...@@ -65,6 +65,9 @@ package MMS.F_PT.F_MM.State is ...@@ -65,6 +65,9 @@ package MMS.F_PT.F_MM.State is
Navigation_Mode : Navigation_Mode_Type with Navigation_Mode : Navigation_Mode_Type with
Part_Of => Navigation_Parameter_State; Part_Of => Navigation_Parameter_State;
Operating_Mode_From_Parameters : Navigation_Option_Type with
Part_Of => Navigation_Parameter_State;
Operating_Mode : Navigation_Option_Type with Operating_Mode : Navigation_Option_Type with
Part_Of => Navigation_Parameter_State; Part_Of => Navigation_Parameter_State;
......
...@@ -37,6 +37,7 @@ SPARK_Mode, ...@@ -37,6 +37,7 @@ SPARK_Mode,
Aborted_For_Energy_Reasons), Aborted_For_Energy_Reasons),
Navigation_Parameter_State => Navigation_Parameter_State =>
(Navigation_Mode, (Navigation_Mode,
Operating_Mode_From_Parameters,
Operating_Mode, Operating_Mode,
Navigation_Parameters), Navigation_Parameters),
Operating_Point_State => Operating_Point_State =>
......
...@@ -39,7 +39,7 @@ package MMS.F_PT.Input is ...@@ -39,7 +39,7 @@ package MMS.F_PT.Input is
function Payload_Mass return Payload_Mass_Type function Payload_Mass return Payload_Mass_Type
renames MMS.Input.Payload_Mass; renames MMS.Input.Payload_Mass;
function USB_Key return Navigation_Parameters_Type_Option function USB_Key return USB_Key_Type_Option
renames MMS.Input.USB_Key; renames MMS.Input.USB_Key;
function P return Distance_Type function P return Distance_Type
......
...@@ -11,6 +11,8 @@ package MMS.F_PT is ...@@ -11,6 +11,8 @@ package MMS.F_PT is
type Estimated_Total_Mass_Type is delta 0.1 range 5.0 .. 10.0; -- in kg ??? type Estimated_Total_Mass_Type is delta 0.1 range 5.0 .. 10.0; -- in kg ???
type Energy_Level_Type is range 0 .. 500; -- in kj type Energy_Level_Type is range 0 .. 500; -- in kj
subtype Speed_Or_Altitude is Navigation_Option_Type range SPEED .. ALTITUDE;
type Operating_Point_Type is record type Operating_Point_Type is record
Altitude : Current_Altitude_Type; -- ??? which altitude type Altitude : Current_Altitude_Type; -- ??? which altitude type
......
...@@ -39,7 +39,7 @@ package MMS.Input is ...@@ -39,7 +39,7 @@ package MMS.Input is
function Payload_Mass return Payload_Mass_Type function Payload_Mass return Payload_Mass_Type
renames External.Payload_Mass; renames External.Payload_Mass;
function USB_Key return Navigation_Parameters_Type_Option function USB_Key return USB_Key_Type_Option
renames External.USB_Key; renames External.USB_Key;
------------------------- -------------------------
......
...@@ -47,6 +47,20 @@ package Types is ...@@ -47,6 +47,20 @@ package Types is
end case; end case;
end record; end record;
type USB_Key_Type is record
Navigation_Parameters : Navigation_Parameters_Type;
Navigation_Option : Navigation_Option_Type;
end record;
type USB_Key_Type_Option (Present : Boolean := False) is record
case Present is
when True =>
Content : USB_Key_Type;
when False =>
null;
end case;
end record;
type Bay_Switch_Type is (OPEN, CLOSED); type Bay_Switch_Type is (OPEN, CLOSED);
type Payload_Mass_Type is new Integer range 0 .. 98; -- in kg type Payload_Mass_Type is new Integer range 0 .. 98; -- in kg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment