Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
45cfae33
Commit
45cfae33
authored
9 months ago
by
Sophie Coudert
Browse files
Options
Downloads
Patches
Plain Diff
transition handler : begin draft...
parent
903a3783
No related branches found
No related tags found
4 merge requests
!504
merge first stable version of Avatar-SysML V2
,
!503
merge the first stable version of the Avatar-SysML parser/generator
,
!501
Avatar sys ml 04 2024
,
!498
Avatar sys ml 04 2024 (first merge request, only for verification)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/avatartranslator/tosysmlv2/AvatarFromSysML.java
+48
-4
48 additions, 4 deletions
...main/java/avatartranslator/tosysmlv2/AvatarFromSysML.java
with
48 additions
and
4 deletions
src/main/java/avatartranslator/tosysmlv2/AvatarFromSysML.java
+
48
−
4
View file @
45cfae33
...
@@ -278,13 +278,57 @@ public class AvatarFromSysML {
...
@@ -278,13 +278,57 @@ public class AvatarFromSysML {
List
<
StxTransition
>
transitions
=
states
[
i
].
getTransitions
();
List
<
StxTransition
>
transitions
=
states
[
i
].
getTransitions
();
int
tsize
=
transitions
.
size
();
int
tsize
=
transitions
.
size
();
for
(
int
j
=
0
;
j
<
tsize
;
j
++)
{
for
(
int
j
=
0
;
j
<
tsize
;
j
++)
{
StxTransition
transition
=
transitions
.
get
(
j
);
AvatarTransition
theTransition
=
new
AvatarTransition
(
theBlock
,
""
,
null
);
AvatarTransition
theTransition
=
new
AvatarTransition
(
theBlock
,
""
,
null
);
transitionList
.
add
(
theTransition
);
transitionList
.
add
(
theTransition
);
theSourceState
.
addNext
(
theTransition
);
theSourceState
.
addNext
(
theTransition
);
theTransition
.
setGuard
(
transitions
.
get
(
j
).
getGuard
());
theTransition
.
setGuard
(
transition
.
getGuard
());
theTransition
.
setDelays
(
transitions
.
get
(
j
).
getMinDelay
(),
transitions
.
get
(
j
).
getMaxDelay
());
theTransition
.
setDelays
(
transition
.
getMinDelay
(),
transition
.
getMaxDelay
());
setDistributionLaw
(
theTransition
,
transitions
.
get
(
j
).
getDelayDistributionLaw
(),
transitions
.
get
(
j
).
getDelayExtra
());
setDistributionLaw
(
theTransition
,
transition
.
getDelayDistributionLaw
(),
transition
.
getDelayExtra
());
}
// add actions
List
<
StxAction
>
actions
=
transition
.
getActions
();
// should exist only in some cases...
int
asize
=
actions
.
size
();
for
(
int
k
=
0
;
k
<
asize
;
k
++)
{
StxAction
action
=
actions
.
get
(
k
);
if
(
action
.
getType
()
==
AvatarFromSysMLSyntax
.
STXASSIGNACTION
){
String
leftHandStr
=
extendIdent
(
action
.
getTarget
(),
blk
);
String
rightHandStr
;
StxTerm
value
=
action
.
getValue
();
if
(
value
instanceof
StxId
){
rightHandStr
=
extendIdent
(((
StxId
)
value
).
getString
(),
blk
);
}
else
if
(
value
instanceof
StxExpr
){
rightHandStr
=
((
StxExpr
)
value
).
getString
();
}
else
{
rightHandStr
=
extendCall
((
StxCall
)
value
,
blk
);
}
theTransition
.
addAction
(
AvatarTerm
.
createActionFromString
(
theBlock
,
leftHandStr
+
"="
+
rightHandStr
));
}
else
{
// STXMETHODACTION
if
(
action
.
getValue
()
instanceof
StxCall
)
{
// else ERROR
String
termStr
=
extendCall
((
StxCall
)
action
.
getValue
(),
blk
);
theTransition
.
addAction
(
AvatarTerm
.
createActionFromString
(
theBlock
,
termStr
));
}
}
}
if
(
transition
.
getType
()
==
AvatarFromSysMLSyntax
.
STXTRIVIALTRANSITION
)
{
// search next state
AvatarStateMachineElement
tgtState
=
getState
(
transition
.
getTarget
(),
theBlock
);
theTransition
.
addNext
(
tgtState
);
}
else
if
(
transition
.
getType
()
==
AvatarFromSysMLSyntax
.
STXSENDTRANSITION
)
{
if
(
transition
.
getTarget
().
getType
()
==
AvatarFromSysMLSyntax
.
STXPRESENDSTATE
){
AvatarStateMachineElement
tgtState
=
getState
(
transition
.
getTarget
(),
theBlock
);
if
(
tgtState
instanceof
AvatarActionOnSignal
)
{
// ELSE ERROR
theTransition
.
addNext
(
getState
(
transition
.
getTarget
().
getTransition
(
0
).
getTarget
(),
theBlock
));
}
else
{}
}
else
if
(
transition
.
getTarget
().
getType
()
==
AvatarFromSysMLSyntax
.
STXPRERECEIVESTATE
){}
else
{}
}
else
if
(
transition
.
getType
()
==
AvatarFromSysMLSyntax
.
STXRECEIVETRANSITION
)
{}
else
if
(
transition
.
getType
()
==
AvatarFromSysMLSyntax
.
STXSETTIMERTRANSITION
)
{}
else
if
(
transition
.
getType
()
==
AvatarFromSysMLSyntax
.
STXRESETTIMERTRANSITION
)
{}
else
if
(
transition
.
getType
()
==
AvatarFromSysMLSyntax
.
STXEXPIRETIMERTRANSITION
)
{}
else
{}
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment