Commit a2bf251f authored by Maxime Perrotin's avatar Maxime Perrotin

Generate gpr files properly

parent fb0d4ab2
......@@ -1951,11 +1951,19 @@ class SDL_View(QtGui.QGraphicsView, object):
prj_name = ''.join(
filename.split(os.path.extsep)[0:-1]).split(os.path.sep)[-1]
# Neet to get the list of .pr (incl e.g. system_structure.pr)
# for the gpr file
pr_names = ['"' + os.path.basename(pr_file) + '"'
for pr_file in sdlSymbols.AST.pr_files]
first_pr = pr_names.pop()
other_pr = ", ".join(pr_names)
template_gpr_sdl = '''with "dataview_ada";
project {pr} is
for Languages use ("SDL");
for Source_Dirs use (".");
for Object_Dir use "code";
for Source_Files use ({first_pr});
package Naming is
for Body_Suffix ("SDL") use ".pr";
......@@ -1964,9 +1972,11 @@ project {pr} is
package Compiler is
for Driver ("SDL") use "opengeode";
for Object_File_Suffix ("SDL") use ".adb";
for Leading_Required_Switches ("SDL") use ("--toAda");
for Leading_Required_Switches ("SDL") use ("--toAda"{other_pr});
end Compiler;
end {pr};'''.format(pr=prj_name)
end {pr};'''.format(pr=prj_name,
first_pr=first_pr,
other_pr=", " + other_pr if other_pr else "")
# ASN1 template to be filled with "Ada" or "c"
template_gpr_asn1 = '''project DataView_{lang} is
......
This diff is collapsed.
SYSTEM testsc;
/* CIF TEXT (205, 237), (290, 186) */
signal hello(ExtendedModeUnionTypeT);
use dataview comment 'dataview.asn';
/* CIF ENDTEXT */
CHANNEL c
FROM ENV TO testsc WITH hello;
ENDCHANNEL;
BLOCK testsc;
SIGNALROUTE r
FROM ENV TO testsc WITH hello;
CONNECT c AND r;
/* CIF PROCESS (140, 56), (275, 137) */
PROCESS testsc;
/* CIF TEXT (259, 125), (367, 218) */
-- Text area for declarations and comments
dcl foo ExtendedModeUnionTypeT := {
queryCount 10,
typeKeyword mode,
mode 255
};
/* CIF ENDTEXT */
/* CIF START (644, 84), (70, 35) */
START;
/* CIF NEXTSTATE (644, 139), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (644, 139), (70, 35) */
STATE wait;
/* CIF INPUT (636, 194), (86, 35) */
INPUT hello(foo);
/* CIF NEXTSTATE (644, 249), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDPROCESS testsc;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
-- Automatically generated by OpenGEODE - do NOT modify!
SUBPROGRAM hello
FEATURES
hello_param: IN PARAMETER DataView::ExtendedModeUnionTypeT {encoding=>Native;};
END hello;
SUBPROGRAM IMPLEMENTATION hello.GUI_RI
PROPERTIES
FV_Name => "testsc";
Source_Language => GUI_RI;
END hello.GUI_RI;
#!/bin/bash -e
rm -rf testsc_simu
mkdir -p testsc_simu
cp /home/taste/opengeode-github/tests/regression/test-eds1/testsc_simu/testsc.pr /home/taste/opengeode-github/tests/regression/test-eds1/testsc_simu/dataview.asn testsc_simu
cd testsc_simu
opengeode testsc.pr --shared
cat /home/taste/opengeode-github/tests/regression/test-eds1/testsc_simu/dataview.asn >> dataview-uniq.asn
mono $(which asn1.exe) -Ada -typePrefix asn1Scc -equal /home/taste/opengeode-github/tests/regression/test-eds1/testsc_simu/dataview.asn
mono $(which asn1.exe) -c -typePrefix asn1Scc -equal /home/taste/opengeode-github/tests/regression/test-eds1/testsc_simu/dataview.asn
gnatmake -fPIC -gnat2012 -c *.adb
gnatbind -n -Llibtestsc testsc
gnatmake -fPIC -c -gnat2012 b~testsc.adb
gcc -shared -fPIC -o libtestsc.so b~testsc.o testsc.o ccsdssoissubnetwork.o ccsdssoissubnetworkinterfaces.o demo.o demointerfaces.o environment.o environmentinterfaces.o adaasn1rtl.o -lgnat
rm -f dataview-uniq.c dataview-uniq.h
asn2aadlPlus dataview-uniq.asn DataView.aadl
aadl2glueC DataView.aadl testsc_interface.aadl
asn2dataModel -toPython dataview-uniq.asn
make -f Makefile.python
echo "errCodes=$(taste-asn1-errCodes ./dataview-uniq.h)" >>datamodel.py
LD_LIBRARY_PATH=. opengeode-simulator
......@@ -3,7 +3,7 @@ project orchestrator is
for Languages use ("SDL");
for Source_Dirs use (".");
for Object_Dir use "code";
for Source_Files use ("orchestrator.pr");
for Source_Files use ("system_structure.pr");
package Naming is
for Body_Suffix ("SDL") use ".pr";
......@@ -12,6 +12,6 @@ project orchestrator is
package Compiler is
for Driver ("SDL") use "opengeode";
for Object_File_Suffix ("SDL") use ".adb";
for Leading_Required_Switches ("SDL") use ("--toAda", "../system_structure.pr");
for Leading_Required_Switches ("SDL") use ("--toAda", "orchestrator.pr");
end Compiler;
end orchestrator;
end orchestrator;
\ No newline at end of file
......@@ -55,15 +55,6 @@ comment 'Hello';
call writeln('Simulation startup');
/* CIF NEXTSTATE (1095, 251), (72, 34) */
NEXTSTATE Wait;
/* CIF state (1680, 345), (74, 35) */
state next;
/* CIF input (1677, 400), (74, 35) */
input pulse(a);
/* CIF PROCEDURECALL (1607, 450), (213, 35) */
call reset_timer(mytimer);
/* CIF NEXTSTATE (1679, 500), (70, 35) */
NEXTSTATE wait;
endstate;
/* CIF state (1674, 125), (100, 35) */
state timeout;
/* CIF input (1651, 180), (147, 35) */
......@@ -73,6 +64,15 @@ comment 'Hello';
/* CIF NEXTSTATE (1687, 280), (74, 35) */
NEXTSTATE next;
endstate;
/* CIF state (1680, 345), (74, 35) */
state next;
/* CIF input (1677, 400), (74, 35) */
input pulse(a);
/* CIF PROCEDURECALL (1607, 450), (213, 35) */
call reset_timer(mytimer);
/* CIF NEXTSTATE (1679, 500), (70, 35) */
NEXTSTATE wait;
endstate;
/* CIF state (1095, 251), (72, 34) */
state Wait;
/* CIF input (807, 305), (101, 35) */
......
SYSTEM og;
/* CIF TEXT (159, 221), (287, 188) */
system og;
/* CIF TEXT (159, 221), (290, 200) */
-- Text area for declarations and comments
use dv comment 'dataview-uniq.asn';
--use dv2 comment 'dataview2.asn';
signal dd(Type2);
signal we(Some_Thing);
procedure hehe;
fpar in/out a_param Type2;
external;
use dv comment 'dataview-uniq.asn';
--use dv2 comment 'dataview2.asn';
signal dd(Type2);
signal we(Some_Thing);
procedure hehe;
fpar in/out a_param Type2;
external;
/* CIF ENDTEXT */
CHANNEL c
FROM ENV TO og WITH dd;
FROM og TO ENV WITH we;
ENDCHANNEL;
BLOCK og;
SIGNALROUTE r
FROM ENV TO og WITH dd;
FROM og TO ENV WITH we;
CONNECT c AND r;
channel c
from env to og with dd;
from og to env with we;
endchannel;
block og;
signalroute r
from env to og with dd;
from og to env with we;
connect c and r;
/* CIF PROCESS (225, 49), (150, 75) */
PROCESS og;
/* CIF TEXT (57, 58), (287, 140) */
process og;
/* CIF TEXT (57, 58), (290, 140) */
-- Text area for declarations and comments
dcl haha SeqOf;
dcl hihi type2;
dcl test Some_Thing := 4;
dcl haha SeqOf;
dcl hihi type2;
dcl test Some_Thing := 4;
/* CIF ENDTEXT */
/* CIF PROCEDURE (404, 228), (73, 35) */
PROCEDURE aProc;
/* CIF procedure (430, 404), (78, 35) */
procedure enum1
/* CIF comment (528, 404), (206, 35) */
comment 'same name as an enum item';
endprocedure;
/* CIF procedure (414, 353), (124, 35) */
procedure default_seqof
/* CIF comment (558, 353), (189, 35) */
comment 'same name as a constant';
endprocedure;
/* CIF procedure (439, 309), (70, 35) */
procedure haha
/* CIF comment (529, 309), (184, 35) */
comment 'same name as a variable';
endprocedure;
/* CIF procedure (404, 228), (73, 35) */
procedure aProc;
/* CIF TEXT (542, 127), (287, 140) */
dcl tmp Some_Thing := 1;
/* CIF ENDTEXT */
/* CIF START (164, 113), (70, 35) */
START;
/* CIF OUTPUT (154, 163), (89, 35) */
OUTPUT we(test);
/* CIF OUTPUT (155, 213), (88, 35) */
OUTPUT we(tmp)
/* CIF COMMENT (263, 213), (269, 35) */
COMMENT 'check that local variables can be sent';
/* CIF RETURN (181, 263), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF PROCEDURE (439, 309), (70, 35) */
PROCEDURE haha
/* CIF COMMENT (529, 309), (184, 35) */
COMMENT 'same name as a variable';
ENDPROCEDURE;
/* CIF PROCEDURE (414, 353), (124, 35) */
PROCEDURE default_seqof
/* CIF COMMENT (558, 353), (189, 35) */
COMMENT 'same name as a constant';
ENDPROCEDURE;
/* CIF PROCEDURE (430, 404), (78, 35) */
PROCEDURE enum1
/* CIF COMMENT (528, 404), (206, 35) */
COMMENT 'same name as an enum item';
ENDPROCEDURE;
/* CIF output (154, 163), (89, 35) */
output we(test);
/* CIF output (155, 213), (88, 35) */
output we(tmp)
/* CIF comment (263, 213), (269, 35) */
comment 'check that local variables can be sent';
/* CIF return (181, 263), (35, 35) */
return ;
endprocedure;
/* CIF START (155, 216), (70, 35) */
START;
/* CIF NEXTSTATE (155, 266), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (296, 231), (70, 35) */
STATE wait;
/* CIF INPUT (289, 286), (84, 35) */
INPUT dd(hihi);
/* CIF state (296, 231), (70, 35) */
state wait;
/* CIF input (289, 286), (84, 35) */
input dd(hihi);
/* CIF PROCEDURECALL (281, 336), (100, 35) */
CALL hehe(hihi);
/* CIF OUTPUT (286, 386), (89, 35) */
OUTPUT we(test);
call hehe(hihi);
/* CIF output (286, 386), (89, 35) */
output we(test);
/* CIF PROCEDURECALL (296, 436), (70, 35) */
CALL haha;
call haha;
/* CIF PROCEDURECALL (269, 486), (124, 35) */
CALL default_seqof;
call default_seqof;
/* CIF PROCEDURECALL (292, 536), (78, 35) */
CALL enum1;
call enum1;
/* CIF NEXTSTATE (296, 586), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
ENDPROCESS og;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
endstate;
endprocess og;
endblock;
endsystem;
\ No newline at end of file
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