osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
39 stars 8 forks source link

Subprogram Problem #226

Closed lcroy closed 11 years ago

lcroy commented 11 years ago

Dear all,

I just download the "AADL Examples in the SAE AADL Standard.zip" from the http://www.aadl.info/aadl/currentsite/examplemodel.html. I want to run the "subprogramexample", so I import it into the OSATE 2.0.2. The following is the source:

package subprogramtest public --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ --@@ Section 5.2 Subprogram component --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

data matrix end matrix;

subprogram Matrix_delta features A: in parameter matrix; B: in parameter matrix; result: out parameter matrix; end Matrix_delta;

subprogram Interpret_result features A: in parameter matrix; result: out parameter weather_forecast; end Interpret_result;

data weather_DB features getCurrent: subprogram getCurrent; getFuture: subprogram getFuture; end weather_DB;

subprogram getCurrent features result: out parameter Matrix; end getCurrent ;

subprogram getFuture -- a subprogram whose source text contains a raise_event service call -- the subprogram also has access to shared data features date: in parameter date; result: out parameter Matrix; bad_date: out event port; wdb: requires data access weather_DB; end getFuture ;

thread Predict_Weather features target_date: in event data port date; prediction: out event data port weather_forecast; past_date: out event port; weather_database: requires data access weather_DB; end Predict_Weather;

thread implementation Predict_Weather.others calls { -- subprogram call on a data component subprogram feature -- out parameter is not resolved, but will be identified by user of value current: subprogram weather_DB.getCurrent;

-- subprogram call on a data component subprogram feature with port value
-- as additional parameter. Event is mapped to thread event    
future: subprogram weather_DB.getFuture;

-- in parameter actuals are out parameter values of previous calls
-- they are identified by the call name and the out parameter name
diff: subprogram Matrix_delta;

-- call with out parameter value resolved to be passed on through a port
interpret: subprogram Interpret_result;

}; connections parameter target_date -> future.date; event port future.bad_date -> past_date; parameter current.result -> diff.A; parameter future.result -> diff.B; parameter diff.result -> interpret.A; parameter interpret.result -> prediction; data access weather_database -> future.wdb; end Predict_Weather.others;

-- not in draft

data date end date;

data weather_forecast end weather_forecast;

end subprogramtest;

Some errors and warning show up. There are 33 errors show up! image

Especiall it keep saying that "Duplicate Element 'xxxxx' in PublicPackageSection 'subprogramtest'". Is there anyone can help me? Thanks!!

Best Chen Li

juli1 commented 11 years ago

Hello,

This example uses AADLv1 while OSATE 2.0.2 supports AADLv1. You might be interested by using older version of OSATE to use this model.

Please let me know if you want to keep this issue open.

lcroy commented 11 years ago

Thank you very much! I have downloaded OSATE1.5.10 and I will try it later. Thanks. I am glad to let this issue open: )

juli1 commented 11 years ago

No news since. Closed.

lcroy commented 11 years ago

ok!