Commit 57349d3c authored by arnaud's avatar arnaud

Add the getRoot function to retrieve the root form the currently instantiated model

parent 38a0e351
...@@ -134,6 +134,24 @@ package body Ocarina.Python_Cmd is ...@@ -134,6 +134,24 @@ package body Ocarina.Python_Cmd is
Ocarina.Utils.Instantiate (Nth_Arg (Data, 1, "")); Ocarina.Utils.Instantiate (Nth_Arg (Data, 1, ""));
end On_Instantiate; end On_Instantiate;
----------------------
-- On_Get_AADL_Root --
----------------------
procedure On_Get_AADL_Root
(Data : in out Callback_Data'Class; Command : String);
procedure On_Get_AADL_Root
(Data : in out Callback_Data'Class;
Command : String)
is
pragma Unreferenced (Command);
begin
Set_Return_Value (Data, Integer'Image (Integer (
Ocarina.ME_AADL.AADL_Instances.Nodes.Root_System (
Ocarina.Utils.Get_AADL_Root))));
end On_Get_AADL_Root;
---------------- ----------------
-- On_Analyze -- -- On_Analyze --
---------------- ----------------
...@@ -646,6 +664,11 @@ package body Ocarina.Python_Cmd is ...@@ -646,6 +664,11 @@ package body Ocarina.Python_Cmd is
(Repo, "instantiate", 1, 1, (Repo, "instantiate", 1, 1,
Handler => On_Instantiate'Unrestricted_Access); Handler => On_Instantiate'Unrestricted_Access);
-- getRoot() function
Register_Command
(Repo, "getRoot", 0, 0,
Handler => On_Get_AADL_Root'Unrestricted_Access);
-- generate() function -- generate() function
Register_Command Register_Command
(Repo, "generate", 1, 1, (Repo, "generate", 1, 1,
......
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