Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
2f867d3d
Commit
2f867d3d
authored
Oct 29, 2015
by
Maxime Perrotin
Browse files
Render label of start transitions (not all cases)
parent
3ac9f575
Changes
4
Hide whitespace changes
Inline
Side-by-side
opengeode/Connectors.py
View file @
2f867d3d
...
@@ -527,7 +527,7 @@ class Edge(Connection):
...
@@ -527,7 +527,7 @@ class Edge(Connection):
# Add the transition label, if any (none for the START edge)
# Add the transition label, if any (none for the START edge)
font
=
QFont
(
'arial'
,
pointSize
=
8
)
font
=
QFont
(
'arial'
,
pointSize
=
8
)
metrics
=
QFontMetrics
(
font
)
metrics
=
QFontMetrics
(
font
)
label
=
self
.
edge
.
get
(
'label'
,
''
)
label
=
self
.
edge
.
get
(
'label'
,
''
)
or
''
lines
=
label
.
split
(
'
\n
'
)
lines
=
label
.
split
(
'
\n
'
)
width
=
metrics
.
width
(
max
(
lines
))
# longest line
width
=
metrics
.
width
(
max
(
lines
))
# longest line
height
=
metrics
.
height
()
*
len
(
lines
)
height
=
metrics
.
height
()
*
len
(
lines
)
...
...
opengeode/Statechart.py
View file @
2f867d3d
...
@@ -494,7 +494,13 @@ def create_dot_graph(root_ast, basic=False):
...
@@ -494,7 +494,13 @@ def create_dot_graph(root_ast, basic=False):
label
=
label
.
strip
().
replace
(
'
\n
'
,
' '
)
label
=
label
.
strip
().
replace
(
'
\n
'
,
' '
)
except
AttributeError
:
except
AttributeError
:
# START transition may have no inputString
# START transition may have no inputString
label
=
''
for
each
in
root_ast
.
content
.
named_start
:
# each is of type ogAST.Start
if
each
.
transition
==
trans
:
label
=
each
.
inputString
[:
-
6
]
break
else
:
label
=
''
def
find_terminators
(
trans
):
def
find_terminators
(
trans
):
''' Recursively find all NEXTSTATES '''
''' Recursively find all NEXTSTATES '''
...
@@ -514,8 +520,12 @@ def create_dot_graph(root_ast, basic=False):
...
@@ -514,8 +520,12 @@ def create_dot_graph(root_ast, basic=False):
LOG
.
error
(
'Missing label: '
+
join
.
inputString
)
LOG
.
error
(
'Missing label: '
+
join
.
inputString
)
else
:
else
:
# Don't recurse forever in case of livelock
# Don't recurse forever in case of livelock
if
corr_label
.
inputString
!=
trans
.
inputString
:
try
:
next_states
.
extend
(
find_terminators
(
corr_label
))
if
corr_label
.
inputString
!=
trans
.
inputString
:
next_states
.
extend
(
find_terminators
(
corr_label
))
except
AttributeError
:
# START transition -> no inputString
pass
return
set
(
next_states
)
return
set
(
next_states
)
# Determine the list of terminators in this transition
# Determine the list of terminators in this transition
...
...
opengeode/sdlSymbols.py
View file @
2f867d3d
...
@@ -1183,5 +1183,5 @@ class StateStart(Start):
...
@@ -1183,5 +1183,5 @@ class StateStart(Start):
def
update_completion_list
(
self
,
pr_text
):
def
update_completion_list
(
self
,
pr_text
):
''' Update nested state entry points '''
''' Update nested state entry points '''
CONTEXT
.
state_entrypoints
=
set
(
CONTEXT
.
state_entrypoints
CONTEXT
.
state_entrypoints
=
\
+
[
unicode
(
self
)
]
)
set
(
CONTEXT
.
state_entrypoints
)
|
set
(
unicode
(
self
))
tests/regression/test-aggregation2/og.pr
View file @
2f867d3d
...
@@ -29,6 +29,7 @@ exit_aggreg;
...
@@ -29,6 +29,7 @@ exit_aggreg;
SUBSTRUCTURE
SUBSTRUCTURE
STATE a;
STATE a;
SUBSTRUCTURE
SUBSTRUCTURE
in (hehe);
/* CIF PROCEDURE (159, 386), (77, 35) */
/* CIF PROCEDURE (159, 386), (77, 35) */
PROCEDURE entry;
PROCEDURE entry;
/* CIF START (119, 58), (70, 35) */
/* CIF START (119, 58), (70, 35) */
...
@@ -38,6 +39,10 @@ exit_aggreg;
...
@@ -38,6 +39,10 @@ exit_aggreg;
/* CIF RETURN (136, 158), (35, 35) */
/* CIF RETURN (136, 158), (35, 35) */
RETURN ;
RETURN ;
ENDPROCEDURE;
ENDPROCEDURE;
/* CIF START (306, 314), (72, 35) */
START hehe ;
/* CIF NEXTSTATE (308, 364), (70, 35) */
NEXTSTATE a1;
/* CIF START (0, 57), (70, 35) */
/* CIF START (0, 57), (70, 35) */
START;
START;
/* CIF PROCEDURECALL (-64, 107), (198, 35) */
/* CIF PROCEDURECALL (-64, 107), (198, 35) */
...
@@ -125,9 +130,9 @@ dcl x myInteger;
...
@@ -125,9 +130,9 @@ dcl x myInteger;
STATE the_end;
STATE the_end;
/* CIF INPUT (640, 358), (107, 35) */
/* CIF INPUT (640, 358), (107, 35) */
INPUT reset_all(x);
INPUT reset_all(x);
/* CIF PROCEDURECALL (54
4
, 408), (300, 35) */
/* CIF PROCEDURECALL (54
3
, 408), (300, 35) */
CALL writeln('Entering again aggregation');
CALL writeln('Entering again aggregation');
/* CIF NEXTSTATE (65
9
, 458), (70, 35) */
/* CIF NEXTSTATE (65
8
, 458), (70, 35) */
NEXTSTATE wait;
NEXTSTATE wait;
ENDSTATE;
ENDSTATE;
/* CIF STATE (0, 299), (70, 35) */
/* CIF STATE (0, 299), (70, 35) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment