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
Show whitespace changes
Inline
Side-by-side
opengeode/Connectors.py
View file @
2f867d3d
...
...
@@ -527,7 +527,7 @@ class Edge(Connection):
# Add the transition label, if any (none for the START edge)
font
=
QFont
(
'arial'
,
pointSize
=
8
)
metrics
=
QFontMetrics
(
font
)
label
=
self
.
edge
.
get
(
'label'
,
''
)
label
=
self
.
edge
.
get
(
'label'
,
''
)
or
''
lines
=
label
.
split
(
'
\n
'
)
width
=
metrics
.
width
(
max
(
lines
))
# longest line
height
=
metrics
.
height
()
*
len
(
lines
)
...
...
opengeode/Statechart.py
View file @
2f867d3d
...
...
@@ -494,6 +494,12 @@ def create_dot_graph(root_ast, basic=False):
label
=
label
.
strip
().
replace
(
'
\n
'
,
' '
)
except
AttributeError
:
# START transition may have no inputString
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
):
...
...
@@ -514,8 +520,12 @@ def create_dot_graph(root_ast, basic=False):
LOG
.
error
(
'Missing label: '
+
join
.
inputString
)
else
:
# Don't recurse forever in case of livelock
try
:
if
corr_label
.
inputString
!=
trans
.
inputString
:
next_states
.
extend
(
find_terminators
(
corr_label
))
except
AttributeError
:
# START transition -> no inputString
pass
return
set
(
next_states
)
# Determine the list of terminators in this transition
...
...
opengeode/sdlSymbols.py
View file @
2f867d3d
...
...
@@ -1183,5 +1183,5 @@ class StateStart(Start):
def
update_completion_list
(
self
,
pr_text
):
''' Update nested state entry points '''
CONTEXT
.
state_entrypoints
=
set
(
CONTEXT
.
state_entrypoints
+
[
unicode
(
self
)
]
)
CONTEXT
.
state_entrypoints
=
\
set
(
CONTEXT
.
state_entrypoints
)
|
set
(
unicode
(
self
))
tests/regression/test-aggregation2/og.pr
View file @
2f867d3d
...
...
@@ -29,6 +29,7 @@ exit_aggreg;
SUBSTRUCTURE
STATE a;
SUBSTRUCTURE
in (hehe);
/* CIF PROCEDURE (159, 386), (77, 35) */
PROCEDURE entry;
/* CIF START (119, 58), (70, 35) */
...
...
@@ -38,6 +39,10 @@ exit_aggreg;
/* CIF RETURN (136, 158), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF START (306, 314), (72, 35) */
START hehe ;
/* CIF NEXTSTATE (308, 364), (70, 35) */
NEXTSTATE a1;
/* CIF START (0, 57), (70, 35) */
START;
/* CIF PROCEDURECALL (-64, 107), (198, 35) */
...
...
@@ -125,9 +130,9 @@ dcl x myInteger;
STATE the_end;
/* CIF INPUT (640, 358), (107, 35) */
INPUT reset_all(x);
/* CIF PROCEDURECALL (54
4
, 408), (300, 35) */
/* CIF PROCEDURECALL (54
3
, 408), (300, 35) */
CALL writeln('Entering again aggregation');
/* CIF NEXTSTATE (65
9
, 458), (70, 35) */
/* CIF NEXTSTATE (65
8
, 458), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* 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