Commit 7f0942a7 authored by yoogx's avatar yoogx

Merge branch 'python'

parents 9473e85d a54e50f5
......@@ -12,6 +12,7 @@ run-time.
support. Refer to the :ref:`installation`;
* At run-time, the following environment variables must be set up::
* export PATH=`ocarina-config --prefix`/bin:$PATH
% export OCARINA_PATH=`ocarina-config --prefix`
% export LD_LIBRARY_PATH=$OCARINA_PATH/lib:$LD_LIBRARY_PATH
% export PYTHONPATH=$OCARINA_PATH/include/ocarina/runtime/python:$OCARINA_PATH/lib:$PYTHONPATH
......
......@@ -35,8 +35,8 @@ def status ():
def reset ():
'''Reset Ocarina internal state
**Note:** this function must be called before processing a new set of models.
'''
**Note:** this function must be called before processing a new set of
models.'''
libocarina_python.reset();
......@@ -44,7 +44,7 @@ def reset ():
def load (filename):
'''Load a file
:param filename: name of the file to be loaded, following Ocarina search path
:param filename: name of the file to be loaded, using Ocarina search path
:type filename: string
E.g. to load "foo.aadl":
......@@ -57,7 +57,7 @@ def load (filename):
################################################################################
def analyze ():
'''Analyze models'''
libocarina_python.analyze ();
return libocarina_python.analyze ();
################################################################################
def instantiate (root_system):
......@@ -311,5 +311,3 @@ def getNodeId (name):
>>> getNodeId (MyHome);
'''
return libocarina_python.getNodeId (name);
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2014 ESA & ISAE. --
-- Copyright (C) 2014-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -145,9 +145,10 @@ package body Ocarina.Python_Cmd is
(Data : in out Callback_Data'Class;
Command : String)
is
pragma Unreferenced (Command, Data);
pragma Unreferenced (Command);
Result : constant Boolean := Ocarina.Utils.Analyze;
begin
Ocarina.Utils.Analyze;
Set_Return_Value (Data, Result);
end On_Analyze;
-----------------
......
......@@ -208,7 +208,7 @@ package body Ocarina.Utils is
-- Analyze --
-------------
procedure Analyze is
function Analyze return Boolean is
Success : Boolean;
begin
Success := Analyze (Language, AADL_Root);
......@@ -217,6 +217,7 @@ package body Ocarina.Utils is
else
Write_Line ("Model analyzed sucessfully");
end if;
return Success;
end Analyze;
-----------------
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2013 ESA & ISAE. --
-- Copyright (C) 2013-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -49,7 +49,7 @@ package Ocarina.Utils is
-- Display status information on Ocarina
procedure Load_AADL_File (Filename : String);
procedure Analyze;
function Analyze return Boolean;
procedure Instantiate (Root_System : String);
procedure Generate (Backend_Name : String);
procedure Reset;
......
......@@ -10,7 +10,8 @@ def main ():
load("rma.aadl"); # load a file
load("deployment.aadl"); # load a file
analyze(); # analyze models
result = analyze(); # analyze models
print "Analysis result %r" % (result);
instantiate("rma.erc32"); # instantiate
generate (Backends.polyorb_hi_ada);
......
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