Commit 1eac7cf6 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix minor glitches

parent 2eef9a74
......@@ -379,6 +379,7 @@ package {process_name} is'''.format(process_name=process_name,
taste_template.extend(dll_api)
# Generate the code for each input signal (provided interface) and timers
print process.input_signals
for signal in process.input_signals + [
{'name': timer.lower()} for timer in process.timers]:
signame = signal.get('name', u'START')
......
......@@ -83,7 +83,16 @@ def variables_autocompletion(symbol, type_filter=None):
else:
constants = {name: (cty.type, None)
for name, cty in AST.asn1_constants.viewitems()}
type_filter_names = [ogParser.type_name(ty) for ty in type_filter]
try:
type_filter_names = [ogParser.type_name(ty)
for ty in type_filter]
except AttributeError as err:
# This would need to be investigated: it can happen when
# using a parameter in an input just after the parameter was
# added to the signal in the block view, and before any
# variable has been declared....
LOG.debug(str(err))
return res
for name, (asn1type, _) in chain(CONTEXT.variables.viewitems(),
CONTEXT.global_variables.viewitems(),
constants.viewitems(),
......
......@@ -32,8 +32,8 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o -lgnat
#python -c "from ctypes import *; test=CDLL('./libog.so'); test.liborchestratorinit()"
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o -lgnat
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit()"
coverage:
......
......@@ -2,7 +2,7 @@ SYSTEM og;
/* CIF TEXT (159, 221), (356, 248) */
use dv comment 'dataview-uniq.asn';
signal reset_all;
signal reset_all(MyInteger);
signal for_a;
signal for_b;
signal response;
......@@ -24,6 +24,33 @@ for_b;
PROCESS og;
STATE AGGREGATION wait;
SUBSTRUCTURE
STATE b;
SUBSTRUCTURE
/* CIF START (146, 55), (70, 35) */
START;
/* CIF PROCEDURECALL (77, 105), (208, 35) */
CALL writeln('[b] startup');
/* CIF NEXTSTATE (146, 155), (70, 35) */
NEXTSTATE b1;
/* CIF STATE (392, 144), (70, 35) */
STATE b2;
/* CIF INPUT (388, 199), (79, 35) */
INPUT for_a;
/* CIF PROCEDURECALL (308, 249), (239, 35) */
CALL writeln('[b] Going to b1');
/* CIF NEXTSTATE (392, 299), (70, 35) */
NEXTSTATE b1;
ENDSTATE;
/* CIF STATE (146, 155), (70, 35) */
STATE b1;
/* CIF INPUT (138, 210), (80, 35) */
INPUT for_b;
/* CIF PROCEDURECALL (58, 260), (239, 35) */
CALL writeln('[b] Going to b2');
/* CIF NEXTSTATE (143, 310), (70, 35) */
NEXTSTATE b2;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE a;
SUBSTRUCTURE
/* CIF START (134, 57), (70, 35) */
......@@ -32,15 +59,6 @@ for_b;
CALL writeln('[a] startup');
/* CIF NEXTSTATE (134, 157), (70, 35) */
NEXTSTATE a1;
/* CIF STATE (134, 157), (70, 35) */
STATE a1;
/* CIF INPUT (129, 212), (79, 35) */
INPUT for_a;
/* CIF PROCEDURECALL (54, 262), (229, 35) */
CALL writeln('[a] Going to a2');
/* CIF NEXTSTATE (134, 312), (70, 35) */
NEXTSTATE a2;
ENDSTATE;
/* CIF STATE (293, 53), (70, 35) */
STATE a2;
/* CIF INPUT (289, 108), (79, 35) */
......@@ -50,57 +68,44 @@ for_b;
/* CIF NEXTSTATE (293, 208), (70, 35) */
NEXTSTATE a1;
ENDSTATE;
ENDSUBSTRUCTURE;
STATE b;
SUBSTRUCTURE
/* CIF START (146, 55), (70, 35) */
START;
/* CIF PROCEDURECALL (77, 105), (208, 35) */
CALL writeln('[b] startup');
/* CIF NEXTSTATE (146, 155), (70, 35) */
NEXTSTATE b1;
/* CIF STATE (146, 155), (70, 35) */
STATE b1;
/* CIF INPUT (138, 210), (80, 35) */
INPUT for_b;
/* CIF PROCEDURECALL (59, 260), (239, 35) */
CALL writeln('[b] Going to b2');
/* CIF NEXTSTATE (143, 310), (70, 35) */
NEXTSTATE b2;
ENDSTATE;
/* CIF STATE (392, 144), (70, 35) */
STATE b2;
/* CIF INPUT (388, 199), (79, 35) */
/* CIF STATE (134, 157), (70, 35) */
STATE a1;
/* CIF INPUT (129, 212), (79, 35) */
INPUT for_a;
/* CIF PROCEDURECALL (308, 249), (239, 35) */
CALL writeln('[b] Going to b1');
/* CIF NEXTSTATE (392, 299), (70, 35) */
NEXTSTATE b1;
/* CIF PROCEDURECALL (54, 262), (229, 35) */
CALL writeln('[a] Going to a2');
/* CIF NEXTSTATE (133, 312), (70, 35) */
NEXTSTATE a2;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF STATE (170, 160), (70, 35) */
STATE b;
ENDSTATE;
/* CIF STATE (170, 50), (70, 35) */
STATE a;
ENDSTATE;
/* CIF STATE (170, 160), (70, 35) */
STATE b;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF TEXT (522, 328), (287, 140) */
-- Text area for declarations and comments
dcl x myInteger;
/* CIF ENDTEXT */
/* CIF START (226, 249), (70, 35) */
START;
/* CIF NEXTSTATE (226, 299), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (487, 484), (70, 35) */
STATE wait;
ENDSTATE;
/* CIF STATE (226, 299), (70, 35) */
STATE wait;
/* CIF INPUT (208, 354), (106, 35) */
INPUT reset_all;
/* CIF INPUT (207, 354), (107, 35) */
INPUT reset_all(x);
/* CIF PROCEDURECALL (174, 404), (174, 35) */
CALL writeln('reset');
/* CIF NEXTSTATE (226, 454), (70, 35) */
NEXTSTATE -;
ENDSTATE;
/* CIF STATE (487, 484), (70, 35) */
STATE wait;
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