Commit 36397eb3 authored by Jerome Hugues's avatar Jerome Hugues

* Clean-up

parent 73f0aedf
......@@ -9,7 +9,7 @@ def printError(source, messages):
for message in messages:
print message
def main(argv):ne
def main(argv):
'''Test function'''
import ocarina;
import lmp;
......
#! /usr/bin/python
import OcarinaPython as ocarina;
def visitor (component,level) :
subcomponents=ocarina.AIN.Subcomponents(component);
if subcomponents is not None :
prefix=''
while ( len(prefix)<level ) :
prefix=prefix+'.'
for child in subcomponents :
print prefix,ocarina.getInstanceName(child)[0]
visitor(str(ocarina.AIN.Corresponding_Instance(child)),level+1)
import ocarina
import lmp
def main ():
'''Test function'''
err=ocarina.load("rma.aadl"); # load a file
print 'load("rma.aadl")'
if err[1].strip()!='':
print 'info message: \n', err[1]
print err
if err[1] != None:
print 'info message: ', err[1]
if err[2]!=[]:
print 'warning message: \n', err[2]
print 'warning message: ', err[2]
if err[3]!=[]:
print 'error message: \n', err[3]
print 'error message: ', err[3]
sys.exit(2)
err=ocarina.load("deployment.aadl"); # load a file
print 'load("deployment.aadl")'
if err[1].strip()!='':
print 'info message: \n', err[1]
if err[1] != None:
print 'info message: ', err[1]
if err[2]!=[]:
print 'warning message: \n', err[2]
print 'warning message: ', err[2]
if err[3]!=[]:
print 'error message: \n', err[3]
print 'error message: ', err[3]
sys.exit(2)
err=ocarina.analyze(); # analyze models
print 'ocarina.analyze()'
if err[1].strip()!='':
print 'info message: \n', err[1]
if err[1] != None:
print 'info message: ', err[1]
if err[2]!=[]:
print 'warning message: \n', err[2]
print 'warning message: ', err[2]
if err[3]!=[]:
print 'error message: \n', err[3]
print 'error message: ', err[3]
sys.exit(2)
err=ocarina.instantiate("rma.erc32"); # instantiate system
print 'ocarina.instantiate("rma.erc32")'
if err[1].strip()!='':
print 'info message: \n', err[1]
err=ocarina.instantiate("rma.impl"); # instantiate system
print 'ocarina.instantiate("rma.impl")'
if err[1] != None:
print 'info message: ', err[1]
if err[2]!=[]:
print 'warning message: \n', err[2]
print 'warning message: ', err[2]
if err[3]!=[]:
print 'error message: \n', err[3]
print 'error message: ', err[3]
sys.exit(2)
print '----------------------------------------------------'
print 'Number of Component Instances:'
print '----------------------------------------------------'
root=ocarina.getInstances('all')[0][0]
# root=ocarina.getRoot()
print ocarina.getInstanceName(root)[0]
visitor(root,1)
if __name__ == "__main__":
main ()
......
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