From 68616be0d8bdea803a480b389f3374b57a7a18e9 Mon Sep 17 00:00:00 2001 From: Sophie Coudert <sophie.coudert@telecom-paris.fr> Date: Tue, 11 Mar 2025 13:12:41 +0100 Subject: [PATCH] adding one test --- .../test/java/cli/CLIAvatar2SysMLV2Test.java | 2 +- .../cli/models/AvSysML_graphics1.sysml | 1639 +++++++++++ .../cli/models/avSysML_CoffeeMachine.sysml | 2407 +++++++++++++++++ 3 files changed, 4047 insertions(+), 1 deletion(-) create mode 100644 ttool/src/test/resources/cli/models/AvSysML_graphics1.sysml create mode 100644 ttool/src/test/resources/cli/models/avSysML_CoffeeMachine.sysml diff --git a/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java b/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java index 93a829083..220666fc1 100644 --- a/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java +++ b/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java @@ -137,7 +137,7 @@ public class CLIAvatar2SysMLV2Test extends AbstractTest implements InterpreterOu true, // M false // N }; - private final String[] toTestOrder = {"avSysML_timer", "avSysML_original", "AvSysML_graphics1"}; // + private final String[] toTestOrder = {"avSysML_timer", "avSysML_original", "AvSysML_graphics1", "avSysML_CoffeeMachine"}; // private StringBuilder outputResult; diff --git a/ttool/src/test/resources/cli/models/AvSysML_graphics1.sysml b/ttool/src/test/resources/cli/models/AvSysML_graphics1.sysml new file mode 100644 index 000000000..125473579 --- /dev/null +++ b/ttool/src/test/resources/cli/models/AvSysML_graphics1.sysml @@ -0,0 +1,1639 @@ +package AvatarInstance { + private import AvatarGeneral::*; + private import AvatarBlockTypes::*; + private import AvatarCommunication::*; + private import AvatarTransitionServer::*; + + // COMMUNICATIONS $$$$$$$$$$$$$$$$$$$$$$$$ + + // Relation '@NBF0:B0-B2'============= + part '@NBF0:B0-B2': '#NBfifo_Rel' = '#NBfifo_Rel'('@block1' = '@blk:B0', '@block2' = '@blk:B2', '@private'=true, '@max_size'=2) { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 316, + '@ordinate' = 301, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 184, + '@ordinate' = 200, + '@height' = 153, + '@width' = 153 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 513, + '@ordinate' = 239, + '@height' = 147, + '@width' = 147 + ) + ); + } + } + + // Channel '@nbf:B0.in0<B2.out2'------------- + part '@nbf:B0.in0<B2.out2' : '#NBfifo' = '#NBfifo'('@relation' = '@NBF0:B0-B2'); + binding : '#InSignalBinding' bind '@blk:B0'.'@sig:in0' = '@nbf:B0.in0<B2.out2'; + binding : '#OutSignalBinding' bind '@blk:B2'.'@sig:out2' = '@nbf:B0.in0<B2.out2'; + + // Message of signal '@blk:B0'.'@sig:in0'............ + part def '@MSG:B0.in0' :> '#InMessage' { + part '@channel' redefines '@channel' = '@nbf:B0.in0<B2.out2'; + attribute 'a' : Integer; + attribute 't' : Boolean; + } + + // Message of signal '@blk:B2'.'@sig:out2'............ + part def '@MSG:B2.out2' :> '#OutMessage', '@MSG:B0.in0' { + attribute 'x' redefines 'a'; + attribute 'b' redefines 't'; + } + + // Relation '@SYN0:B0-B1'============= + part '@SYN0:B0-B1': '#Sync_Rel' = '#Sync_Rel'('@block1' = '@blk:B0', '@block2' = '@blk:B1', '@private'=true) { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 316, + '@ordinate' = 251, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 184, + '@ordinate' = 200, + '@height' = 153, + '@width' = 153 + ), + '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 388, + '@ordinate' = 151, + '@height' = 310, + '@width' = 281 + ) + ); + } + } + + // Channel '@syn:B0.out0>B1.in1'------------- + part '@syn:B0.out0>B1.in1' : '#Sync' = '#Sync'('@relation' = '@SYN0:B0-B1'); + binding : '#OutSignalBinding' bind '@blk:B0'.'@sig:out0' = '@syn:B0.out0>B1.in1'; + binding : '#InSignalBinding' bind '@blk:B1'.'@sig:in1' = '@syn:B0.out0>B1.in1'; + + // Message of signal '@blk:B1'.'@sig:in1'............ + part def '@MSG:B1.in1' :> '#InMessage' { + part '@channel' redefines '@channel' = '@syn:B0.out0>B1.in1'; + attribute 'x' : Integer; + attribute 'b' : Boolean; + } + + // Message of signal '@blk:B0'.'@sig:out0'............ + part def '@MSG:B0.out0' :> '#OutMessage', '@MSG:B1.in1' { + attribute 'a' redefines 'x'; + attribute 't' redefines 'b'; + } + + // BLOCKS $$$$$$$$$$$$$$$$$$$$$$$$ + + // Block '@blk:B0'============= + part '@blk:B0' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$x' : Integer := 0; + attribute '$b' : Boolean := false; + + // Methods --------------------- + action '$m0v': '#AvatarVoidMethod' { + attribute 'x' : Integer; + attribute 'b' : Boolean; + } + calc '$m0i': '#AvatarCalcMethod' { + attribute 'x' : Integer; + attribute 'b' : Boolean; + return : Integer; + } + + // Signals --------------------- + part '@sig:in0' : '#Fifo'; + part '@sig:out0' : '#Channel'; + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + state '@st:count.in0.0' : '#AvatarCountState' { + action '@state_action' redefines '@state_action' { + first start; + then assign '$x' := '@sig:in0'.'@amount'(); + then done; + } + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 292, + '@ordinate' = 351, + '@height' = 31, + '@width' = 122 + ); + } + } + + transition : '#AvatarTransition' first '@st:count.in0.0' + then '@st:stop' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 359, + '@ordinate' = 453, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 292, + '@ordinate' = 351, + '@height' = 31, + '@width' = 122 + ), + '#AvatarGraphicElement'( + '@ident' = 15, + '@absciss' = 338, + '@ordinate' = 423, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 292, + '@ordinate' = 351, + '@height' = 31, + '@width' = 122 + ), + '#AvatarGraphicElement'( + '@ident' = 15, + '@absciss' = 338, + '@ordinate' = 423, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 19, + '@absciss' = 349, + '@ordinate' = 506, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + + exit action '@st:stop' :'#AvatarStopState'; + + state '@st:send.out0.0' : '#AvatarSendState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 175, + '@ordinate' = 352, + '@height' = 31, + '@width' = 96 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.out0.0' + then '@st:stop' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 168, + '@ordinate' = 404, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 175, + '@ordinate' = 352, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 208, + '@ordinate' = 423, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 175, + '@ordinate' = 352, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 208, + '@ordinate' = 423, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 18, + '@absciss' = 168, + '@ordinate' = 462, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + + state '@st:receive.in0.0' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 446, + '@ordinate' = 351, + '@height' = 31, + '@width' = 93 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.in0.0' + then '@st:stop' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 796, + '@ordinate' = 606, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 446, + '@ordinate' = 351, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 477, + '@ordinate' = 426, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 446, + '@ordinate' = 351, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 477, + '@ordinate' = 426, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 22, + '@absciss' = 803, + '@ordinate' = 625, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + + state '@st:standard.st1' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = {( + if '#else'(('$x' < 0)&('$x' > 4)) ? + '#immediate_request' + else '#NOKrequest'(1), + if '$x' < 0 ? + '#TrivialRequest'('@index' = 2) + else '#NOKrequest'(2), + if '$x' > 4 ? + '#TrivialRequest'('@index' = 3) + else '#NOKrequest'(3) + )}; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.st1' if '@index' == 1 + do action : '#TransitionAction' { + first start; + then action = '$m0v'('$x', '$b'); + then done; + } then '@st:prereceive.in0.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 431, + '@ordinate' = 331, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 446, + '@ordinate' = 351, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 446, + '@ordinate' = 351, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicPoint'( + '@absciss' = 7, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 467, + '@ordinate' = 271, + '@height' = 48, + '@width' = 82 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.st1' if '@index' == 2 + then '@st:count.in0.0' { + attribute '@distributionLaw' : String = "Exponential"; + attribute 'mean' : String = "12"; + attribute '@weight' : Real = 8.0; + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 371, + '@ordinate' = 331, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 292, + '@ordinate' = 351, + '@height' = 31, + '@width' = 122 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 292, + '@ordinate' = 351, + '@height' = 31, + '@width' = 122 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 356, + '@ordinate' = 299, + '@height' = 48, + '@width' = 78 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.st1' if '@index' == 3 + do action : '#TransitionAction' { + first start; + then assign '$x':= '$m0i'('$x', '$b'); + then done; + } then '@st:presend.out0.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 274, + '@ordinate' = 331, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 175, + '@ordinate' = 352, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 175, + '@ordinate' = 352, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicPoint'( + '@absciss' = 37, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 162, + '@ordinate' = 281, + '@height' = 48, + '@width' = 107 + ) + ); + } + } + + state '@st:prereceive.in0.0' : '#AvatarPreReceiveState' { + calc '@request' redefines '@request' = { + '#ReceiveRequest'( + '@channel' = '@sig:in0' + ) + }; + } + + transition : '#AvatarTransition' first '@st:prereceive.in0.0' + do action : '#ReceiveAction' { + item '@msg' : '@MSG:B0.in0' = '@payload' as '@MSG:B0.in0'; + first start; + then assign '$x' := '@msg'.'a'; + then assign '$b' := '@msg'.'t'; + then done; + } then '@st:receive.in0.0'; + + state '@st:presend.out0.0' : '#AvatarPreSendState' { + calc '@request' redefines '@request' = { + '#SendRequest'( + '@channel' = '@sig:out0', + '@payload' = '@MSG:B0.out0'( + '$x', + '$b' ) + ) + }; + } + + transition : '#AvatarTransition' first '@st:presend.out0.0' then '@st:send.out0.0'; + + state '@st:random.0' : '#AvatarRandomState' { + action '@state_action' redefines '@state_action' { + first start; + then assign '$x' := '#bound_random'(0, 10); + then done; + } + attribute '@distributionLaw' : String = "Log normal"; + attribute 'standard deviation' : String = "10"; + attribute 'mean' : String = "3"; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 250, + '@ordinate' = 147, + '@height' = 31, + '@width' = 207 + ); + } + } + + transition : '#AvatarTransition' first '@st:random.0' + then '@st:standard.st1' { + attribute '@distributionLaw' : String = "Log normal"; + attribute 'standard deviation' : String = "10"; + attribute 'mean' : String = "2"; + attribute '@weight' : Real = 2.0; + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 352, + '@ordinate' = 190, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 250, + '@ordinate' = 147, + '@height' = 31, + '@width' = 207 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 250, + '@ordinate' = 147, + '@height' = 31, + '@width' = 207 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 275, + '@ordinate' = 215, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 363, + '@ordinate' = 182, + '@height' = 25, + '@width' = 83 + ) + ); + } + } + + entry action '@st:start' :'#AvatarStartState' { + calc '@request' redefines '@request' = { + '#TrivialRequest'('@delay' = '#bound_random'(1, 5)) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 16, + '@absciss' = 342, + '@ordinate' = 47, + '@height' = 23, + '@width' = 23 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + do action : '#TransitionAction' { + first start; + then assign '$x':= 1; + then assign '$b':= true; + then done; + } then '@st:random.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 352, + '@ordinate' = 70, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 16, + '@absciss' = 342, + '@ordinate' = 47, + '@height' = 23, + '@width' = 23 + ), + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 250, + '@ordinate' = 147, + '@height' = 31, + '@width' = 207 + ), + '#AvatarGraphicElement'( + '@ident' = 16, + '@absciss' = 342, + '@ordinate' = 47, + '@height' = 23, + '@width' = 23 + ), + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 250, + '@ordinate' = 147, + '@height' = 31, + '@width' = 207 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 24, + '@absciss' = 367, + '@ordinate' = 61, + '@height' = 71, + '@width' = 98 + ) + ); + } + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 184, + '@ordinate' = 200, + '@height' = 153, + '@width' = 153 + ); + + attribute 'color' : String = "-4072719"; + } + } + + // Block '@blk:B1'============= + part '@blk:B1' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$x' : Integer default := 0; + attribute '$b' : Boolean default := false; + + // Signals --------------------- + part '@sig:in1' : '#Channel'; + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + exit action '@st:stop' :'#AvatarStopState'; + + state '@st:receive.in1.0' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 291, + '@ordinate' = 409, + '@height' = 31, + '@width' = 93 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.in1.0' + then '@st:stop' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 338, + '@ordinate' = 472, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 291, + '@ordinate' = 409, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 322, + '@ordinate' = 488, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 291, + '@ordinate' = 409, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 322, + '@ordinate' = 488, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 343, + '@ordinate' = 493, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + + state '@st:standard.st2' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = {( + '#ReceiveRequest'( + '@channel' = '@sig:in1' + ), + '#TrivialRequest'('@index' = 2, '@delay' = 5) + )}; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.st2' if '@index' == 1 + do action : '#ReceiveAction' { + item '@msg' : '@MSG:B1.in1' = '@payload' as '@MSG:B1.in1'; + first start; + then assign '$x' := '@msg'.'x'; + then assign '$b' := '@msg'.'b'; + then done; + } then '@st:receive.in1.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 357, + '@ordinate' = 362, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 291, + '@ordinate' = 409, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 291, + '@ordinate' = 409, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 342, + '@ordinate' = 363, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.st2' if '@index' == 2 + then '@st:standard.st1' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 487, + '@ordinate' = 468, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicPoint'( + '@absciss' = 26, + '@ordinate' = 4 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 454, + '@ordinate' = 331, + '@height' = 12, + '@width' = 12 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 454, + '@ordinate' = 196, + '@height' = 12, + '@width' = 12 + ), + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 459, + '@ordinate' = 246, + '@height' = 25, + '@width' = 78 + ) + ); + } + } + + state '@st:standard.st1' : '#AvatarStandardState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.st1' + do action : '#TransitionAction' { + first start; + then assign '$b':= not '$b'; + then done; + } then '@st:standard.st2' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 395, + '@ordinate' = 235, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 257, + '@ordinate' = 292, + '@height' = 64, + '@width' = 160 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 33 + ), + '#AvatarGraphicElement'( + '@ident' = 15, + '@absciss' = 345, + '@ordinate' = 246, + '@height' = 25, + '@width' = 84 + ) + ); + } + } + + entry action '@st:start' :'#AvatarStartState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 326, + '@ordinate' = 99, + '@height' = 23, + '@width' = 23 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + then '@st:standard.st1' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 338, + '@ordinate' = 71, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 326, + '@ordinate' = 99, + '@height' = 23, + '@width' = 23 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 326, + '@ordinate' = 99, + '@height' = 23, + '@width' = 23 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 259, + '@ordinate' = 157, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 16, + '@absciss' = 346, + '@ordinate' = 85, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + } + + // Sub-Blocks øøøøøøøøøøøøøøøøøøøøøøø + + // Block '@blk:B2'============= + part '@blk:B2' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$x' : Integer default := 0; + attribute '$b' : Boolean default := false; + + // Signals --------------------- + part '@sig:out2' : '#Channel'; + part '@sig:inJunk' : '#InJunkSignal' { + attribute 'x' : Integer; + attribute 'b' : Boolean; + } + part '@sig:outJunk' : '#OutJunkSignal' { + attribute 'b' : Boolean; + } + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + state '@st:send.out2.0' : '#AvatarSendState' { + calc '@request' redefines '@request' = { + '#TrivialRequest'('@delay' = 5) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 505, + '@ordinate' = 331, + '@height' = 31, + '@width' = 96 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.out2.0' + then '@st:standard.st1' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 703, + '@ordinate' = 484, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 505, + '@ordinate' = 331, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 505, + '@ordinate' = 331, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 4 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 553, + '@ordinate' = 385, + '@height' = 12, + '@width' = 12 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 670, + '@ordinate' = 385, + '@height' = 12, + '@width' = 12 + ), + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 670, + '@ordinate' = 212, + '@height' = 12, + '@width' = 12 + ), + '#AvatarGraphicElement'( + '@ident' = 15, + '@absciss' = 676, + '@ordinate' = 281, + '@height' = 25, + '@width' = 97 + ) + ); + } + } + + exit action '@st:stop' :'#AvatarStopState'; + + state '@st:receive.in1.0' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 384, + '@ordinate' = 296, + '@height' = 31, + '@width' = 93 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.in1.0' + then '@st:stop' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 340, + '@ordinate' = 320, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 384, + '@ordinate' = 296, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 415, + '@ordinate' = 396, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 384, + '@ordinate' = 296, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 415, + '@ordinate' = 396, + '@height' = 31, + '@width' = 31 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 345, + '@ordinate' = 340, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + + state '@st:standard.st1' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = {( + '#immediate_request', + '#SendRequest'( + '@index' = 2, + '@channel' = '@sig:out2', + '@delay' = '#bound_random'(1, 4), + '@payload' = '@MSG:B2.out2'( + '$x', + '$b' ) + ) + )}; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.st1' if '@index' == 1 + do action : '#TransitionAction' { + first start; + then assign '$x':= '$x' + 1; + then done; + } then '@st:prereceive.in1.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 573, + '@ordinate' = 378, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 384, + '@ordinate' = 296, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 384, + '@ordinate' = 296, + '@height' = 31, + '@width' = 93 + ), + '#AvatarGraphicPoint'( + '@absciss' = 5, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 395, + '@ordinate' = 235, + '@height' = 25, + '@width' = 78 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.st1' if '@index' == 2 + then '@st:send.out2.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 610, + '@ordinate' = 251, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 505, + '@ordinate' = 331, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 505, + '@ordinate' = 331, + '@height' = 31, + '@width' = 96 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 16, + '@absciss' = 559, + '@ordinate' = 256, + '@height' = 48, + '@width' = 108 + ) + ); + } + } + + state '@st:prereceive.in1.0' : '#AvatarPreReceiveState' { + calc '@request' redefines '@request' = { + '#ReceiveRequest'( + '@channel' = '@sig:in1' + ) + }; + } + + transition : '#AvatarTransition' first '@st:prereceive.in1.0' + do action : '#ReceiveAction' { + item '@msg' : '@MSG:B1.in1' = '@payload' as '@MSG:B1.in1'; + first start; + then assign '$x' := '@msg'.'x'; + then assign '$b' := '@msg'.'b'; + then done; + } then '@st:receive.in1.0'; + + entry action '@st:start' :'#AvatarStartState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 542, + '@ordinate' = 92, + '@height' = 23, + '@width' = 23 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + then '@st:standard.st1' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 554, + '@ordinate' = 87, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 542, + '@ordinate' = 92, + '@height' = 23, + '@width' = 23 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 542, + '@ordinate' = 92, + '@height' = 23, + '@width' = 23 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 475, + '@ordinate' = 173, + '@height' = 78, + '@width' = 156 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 562, + '@ordinate' = 101, + '@height' = 25, + '@width' = 50 + ) + ); + } + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 513, + '@ordinate' = 239, + '@height' = 147, + '@width' = 147 + ); + + attribute 'color' : String = "-4072719"; + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 388, + '@ordinate' = 151, + '@height' = 310, + '@width' = 281 + ); + + attribute 'color' : String = "-4072719"; + } + } + // Block Shortcut Links $$$$$$$$$$$$ + part '@blk:B2' : '#AvatarBlock' :> '@blk:B1'.'@blk:B2' = '@blk:B1'.'@blk:B2'; +} diff --git a/ttool/src/test/resources/cli/models/avSysML_CoffeeMachine.sysml b/ttool/src/test/resources/cli/models/avSysML_CoffeeMachine.sysml new file mode 100644 index 000000000..ff5c440d9 --- /dev/null +++ b/ttool/src/test/resources/cli/models/avSysML_CoffeeMachine.sysml @@ -0,0 +1,2407 @@ +package AvatarInstance { + private import AvatarGeneral::*; + private import AvatarBlockTypes::*; + private import AvatarCommunication::*; + private import AvatarTransitionServer::*; + + // COMMUNICATIONS $$$$$$$$$$$$$$$$$$$$$$$$ + + // Relation '@SYN0:CoffeeButton-CoffeeMachine'============= + part '@SYN0:CoffeeButton-CoffeeMachine': '#Sync_Rel' = '#Sync_Rel'('@block1' = '@blk:CoffeeButton', '@block2' = '@blk:CoffeeMachine', '@private'=true) { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 321, + '@ordinate' = 567, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 464, + '@ordinate' = 228, + '@height' = 102, + '@width' = 190 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 445, + '@ordinate' = 19, + '@height' = 358, + '@width' = 461 + ) + ); + } + } + + // Channel '@syn:CoffeeButton.push>CoffeeMachine.pushCoffeeButton'------------- + part '@syn:CoffeeButton.push>CoffeeMachine.pushCoffeeButton' : '#Sync' = '#Sync'('@relation' = '@SYN0:CoffeeButton-CoffeeMachine'); + binding : '#OutSignalBinding' bind '@blk:CoffeeButton'.'@sig:push' = '@syn:CoffeeButton.push>CoffeeMachine.pushCoffeeButton'; + binding : '#InSignalBinding' bind '@blk:CoffeeMachine'.'@sig:pushCoffeeButton' = '@syn:CoffeeButton.push>CoffeeMachine.pushCoffeeButton'; + + // Message of signal '@blk:CoffeeMachine'.'@sig:pushCoffeeButton'............ + part def '@MSG:CoffeeMachine.pushCoffeeButton' :> '#InMessage' { + part '@channel' redefines '@channel' = '@syn:CoffeeButton.push>CoffeeMachine.pushCoffeeButton'; + } + + // Message of signal '@blk:CoffeeButton'.'@sig:push'............ + part def '@MSG:CoffeeButton.push' :> '#OutMessage', '@MSG:CoffeeMachine.pushCoffeeButton' { + } + + // Relation '@SYN1:Wallet-CoffeeMachine'============= + part '@SYN1:Wallet-CoffeeMachine': '#Sync_Rel' = '#Sync_Rel'('@block1' = '@blk:Wallet', '@block2' = '@blk:CoffeeMachine', '@private'=true) { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 275, + '@ordinate' = 114, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 106, + '@ordinate' = 55, + '@height' = 218, + '@width' = 200 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 445, + '@ordinate' = 19, + '@height' = 358, + '@width' = 461 + ) + ); + } + } + + // Channel '@syn:Wallet.getCoin<CoffeeMachine.ejectCoin'------------- + part '@syn:Wallet.getCoin<CoffeeMachine.ejectCoin' : '#Sync' = '#Sync'('@relation' = '@SYN1:Wallet-CoffeeMachine'); + binding : '#InSignalBinding' bind '@blk:Wallet'.'@sig:getCoin' = '@syn:Wallet.getCoin<CoffeeMachine.ejectCoin'; + binding : '#OutSignalBinding' bind '@blk:CoffeeMachine'.'@sig:ejectCoin' = '@syn:Wallet.getCoin<CoffeeMachine.ejectCoin'; + + // Message of signal '@blk:Wallet'.'@sig:getCoin'............ + part def '@MSG:Wallet.getCoin' :> '#InMessage' { + part '@channel' redefines '@channel' = '@syn:Wallet.getCoin<CoffeeMachine.ejectCoin'; + attribute 'nbOfCoins' : Integer; + } + + // Message of signal '@blk:CoffeeMachine'.'@sig:ejectCoin'............ + part def '@MSG:CoffeeMachine.ejectCoin' :> '#OutMessage', '@MSG:Wallet.getCoin' { + attribute 'nbOfCoins' redefines 'nbOfCoins'; + } + + // Channel '@syn:Wallet.putCoin>CoffeeMachine.getCoin'------------- + part '@syn:Wallet.putCoin>CoffeeMachine.getCoin' : '#Sync' = '#Sync'('@relation' = '@SYN1:Wallet-CoffeeMachine'); + binding : '#OutSignalBinding' bind '@blk:Wallet'.'@sig:putCoin' = '@syn:Wallet.putCoin>CoffeeMachine.getCoin'; + binding : '#InSignalBinding' bind '@blk:CoffeeMachine'.'@sig:getCoin' = '@syn:Wallet.putCoin>CoffeeMachine.getCoin'; + + // Message of signal '@blk:CoffeeMachine'.'@sig:getCoin'............ + part def '@MSG:CoffeeMachine.getCoin' :> '#InMessage' { + part '@channel' redefines '@channel' = '@syn:Wallet.putCoin>CoffeeMachine.getCoin'; + attribute 'nbOfCoins' : Integer; + } + + // Message of signal '@blk:Wallet'.'@sig:putCoin'............ + part def '@MSG:Wallet.putCoin' :> '#OutMessage', '@MSG:CoffeeMachine.getCoin' { + attribute 'nbOfCoins' redefines 'nbOfCoins'; + } + + // Relation '@SYN2:TeaButton-CoffeeMachine'============= + part '@SYN2:TeaButton-CoffeeMachine': '#Sync_Rel' = '#Sync_Rel'('@block1' = '@blk:TeaButton', '@block2' = '@blk:CoffeeMachine', '@private'=true) { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 623, + '@ordinate' = 565, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 695, + '@ordinate' = 224, + '@height' = 102, + '@width' = 189 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 445, + '@ordinate' = 19, + '@height' = 358, + '@width' = 461 + ) + ); + } + } + + // Channel '@syn:TeaButton.push>CoffeeMachine.pushTeaButton'------------- + part '@syn:TeaButton.push>CoffeeMachine.pushTeaButton' : '#Sync' = '#Sync'('@relation' = '@SYN2:TeaButton-CoffeeMachine'); + binding : '#OutSignalBinding' bind '@blk:TeaButton'.'@sig:push' = '@syn:TeaButton.push>CoffeeMachine.pushTeaButton'; + binding : '#InSignalBinding' bind '@blk:CoffeeMachine'.'@sig:pushTeaButton' = '@syn:TeaButton.push>CoffeeMachine.pushTeaButton'; + + // Message of signal '@blk:CoffeeMachine'.'@sig:pushTeaButton'............ + part def '@MSG:CoffeeMachine.pushTeaButton' :> '#InMessage' { + part '@channel' redefines '@channel' = '@syn:TeaButton.push>CoffeeMachine.pushTeaButton'; + } + + // Message of signal '@blk:TeaButton'.'@sig:push'............ + part def '@MSG:TeaButton.push' :> '#OutMessage', '@MSG:CoffeeMachine.pushTeaButton' { + } + + // BLOCKS $$$$$$$$$$$$$$$$$$$$$$$$ + + // Block '@blk:Wallet'============= + part '@blk:Wallet' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$nbOfCoins' : Integer := 2; + attribute '$x' : Integer := 1; + attribute '$minUserDelay' : Integer := 50; + attribute '$maxUserDelay' : Integer := 70; + + // Methods --------------------- + action '$contentOfWallet': '#AvatarVoidMethod' { + attribute 'nbOfCoins' : Integer; + } + + // Signals --------------------- + part '@sig:getCoin' : '#Channel'; + part '@sig:putCoin' : '#Channel'; + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + state '@st:send.putCoin.0' : '#AvatarSendState' { + calc '@request' redefines '@request' = { + '#TrivialRequest'('@delay' = '#bound_random'('$minUserDelay', '$maxUserDelay')) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 217, + '@ordinate' = 206, + '@height' = 20, + '@width' = 69 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.putCoin.0' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= '$nbOfCoins' - '$x'; + then action = '$contentOfWallet'('$nbOfCoins'); + then done; + } then '@st:standard.main' { + attribute '@weight' : Real = 0.99; + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 223, + '@ordinate' = 260, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 217, + '@ordinate' = 206, + '@height' = 20, + '@width' = 69 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 217, + '@ordinate' = 206, + '@height' = 20, + '@width' = 69 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 227, + '@ordinate' = 300, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 175, + '@ordinate' = 246, + '@height' = 60, + '@width' = 225 + ) + ); + } + } + + state '@st:receive.getCoin.0' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 447, + '@ordinate' = 194, + '@height' = 20, + '@width' = 76 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.getCoin.0' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= '$nbOfCoins' + '$x'; + then action = '$contentOfWallet'('$nbOfCoins'); + then done; + } then '@st:standard.main' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 516, + '@ordinate' = 264, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 447, + '@ordinate' = 194, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 447, + '@ordinate' = 194, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 493, + '@ordinate' = 251, + '@height' = 30, + '@width' = 173 + ) + ); + } + } + + state '@st:standard.main' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = {( + '#ReceiveRequest'( + '@channel' = '@sig:getCoin' + ), + if '$nbOfCoins' > 0 ? + '#SendRequest'( + '@index' = 2, + '@channel' = '@sig:putCoin', + '@payload' = '@MSG:Wallet.putCoin'( + '$x' ) + ) + else '#NOKrequest'(2) + )}; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 227, + '@ordinate' = 300, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 345, + '@ordinate' = 135, + '@height' = 30, + '@width' = 50 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.main' if '@index' == 1 + do action : '#ReceiveAction' { + item '@msg' : '@MSG:Wallet.getCoin' = '@payload' as '@MSG:Wallet.getCoin'; + first start; + then assign '$x' := '@msg'.'nbOfCoins'; + then done; + } then '@st:receive.getCoin.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 382, + '@ordinate' = 165, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 447, + '@ordinate' = 194, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 345, + '@ordinate' = 135, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 447, + '@ordinate' = 194, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicPoint'( + '@absciss' = 15, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 419, + '@ordinate' = 170, + '@height' = 15, + '@width' = 20 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.main' if '@index' == 2 + then '@st:send.putCoin.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 357, + '@ordinate' = 165, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 217, + '@ordinate' = 206, + '@height' = 20, + '@width' = 69 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 345, + '@ordinate' = 135, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 217, + '@ordinate' = 206, + '@height' = 20, + '@width' = 69 + ), + '#AvatarGraphicPoint'( + '@absciss' = 14, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 220, + '@ordinate' = 174, + '@height' = 15, + '@width' = 99 + ) + ); + } + } + + entry action '@st:start' :'#AvatarStartState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 363, + '@ordinate' = 44, + '@height' = 15, + '@width' = 15 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + do action : '#TransitionAction' { + first start; + then action = '$contentOfWallet'('$nbOfCoins'); + then done; + } then '@st:standard.main' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 369, + '@ordinate' = 115, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 363, + '@ordinate' = 44, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 460, + '@ordinate' = 275, + '@height' = 40, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 363, + '@ordinate' = 44, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 345, + '@ordinate' = 135, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 15, + '@absciss' = 376, + '@ordinate' = 105, + '@height' = 15, + '@width' = 173 + ) + ); + } + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 106, + '@ordinate' = 55, + '@height' = 218, + '@width' = 200 + ); + + attribute 'color' : String = "-4072719"; + } + } + + // Block '@blk:CoffeeMachine'============= + part '@blk:CoffeeMachine' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$teaMinDelay' : Integer := 3; + attribute '$teaMaxDelay' : Integer := 8; + attribute '$coffeeMinDelay' : Integer := 5; + attribute '$coffeeMaxDelay' : Integer := 10; + attribute '$coinDelay' : Integer := 50; + attribute '$x' : Integer := 0; + attribute '$nbOfCoins' : Integer := 0; + + // Methods --------------------- + action '$beverageReady': '#AvatarVoidMethod'; + + // Signals --------------------- + part '@sig:pushCoffeeButton' : '#Channel'; + part '@sig:pushTeaButton' : '#Channel'; + part '@sig:getCoin' : '#Channel'; + part '@sig:ejectCoin' : '#Channel'; + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + state '@st:receive.getCoin.0' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 268, + '@ordinate' = 141, + '@height' = 20, + '@width' = 76 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.getCoin.0' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= '$nbOfCoins' + '$x'; + then done; + } then '@st:standard.WaitingForSecondCoin' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 309, + '@ordinate' = 160, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 268, + '@ordinate' = 141, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ), + '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 268, + '@ordinate' = 141, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 39, + '@absciss' = 328, + '@ordinate' = 178, + '@height' = 15, + '@width' = 168 + ) + ); + } + } + + state '@st:send.ejectCoin.0' : '#AvatarSendState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 18, + '@absciss' = 634, + '@ordinate' = 321, + '@height' = 20, + '@width' = 130 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.ejectCoin.0' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= 0; + then done; + } then '@st:standard.WaitingForFirstCoin' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 667, + '@ordinate' = 346, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 18, + '@absciss' = 634, + '@ordinate' = 321, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 18, + '@absciss' = 634, + '@ordinate' = 321, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicElement'( + '@ident' = 25, + '@absciss' = 631, + '@ordinate' = 381, + '@height' = 40, + '@width' = 137 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 35, + '@absciss' = 707, + '@ordinate' = 368, + '@height' = 15, + '@width' = 89 + ) + ); + } + } + + state '@st:receive.getCoin.1' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 19, + '@absciss' = 239, + '@ordinate' = 280, + '@height' = 20, + '@width' = 76 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.getCoin.1' + then '@st:standard.Beverage' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 243, + '@ordinate' = 319, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 19, + '@absciss' = 239, + '@ordinate' = 280, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 26, + '@absciss' = 23, + '@ordinate' = 372, + '@height' = 354, + '@width' = 577 + ), + '#AvatarGraphicElement'( + '@ident' = 19, + '@absciss' = 239, + '@ordinate' = 280, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 26, + '@absciss' = 23, + '@ordinate' = 372, + '@height' = 354, + '@width' = 577 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 37, + '@absciss' = 243, + '@ordinate' = 359, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:standard.ejectState' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = { + '#SendRequest'( + '@channel' = '@sig:ejectCoin', + '@payload' = '@MSG:CoffeeMachine.ejectCoin'( + '$nbOfCoins' ) + ) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 649, + '@ordinate' = 239, + '@height' = 50, + '@width' = 100 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 649, + '@ordinate' = 239, + '@height' = 50, + '@width' = 100 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.ejectState' + then '@st:send.ejectCoin.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 691, + '@ordinate' = 288, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 649, + '@ordinate' = 239, + '@height' = 50, + '@width' = 100 + ), + '#AvatarGraphicElement'( + '@ident' = 18, + '@absciss' = 634, + '@ordinate' = 321, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 649, + '@ordinate' = 239, + '@height' = 50, + '@width' = 100 + ), + '#AvatarGraphicElement'( + '@ident' = 18, + '@absciss' = 634, + '@ordinate' = 321, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 27, + '@absciss' = 691, + '@ordinate' = 328, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:standard.WaitingForSecondCoin' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = {( + '#TrivialRequest'('@delay' = '$coinDelay'), + '#ReceiveRequest'( + '@index' = 2, + '@channel' = '@sig:getCoin' + ) + )}; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.WaitingForSecondCoin' if '@index' == 1 + then '@st:standard.ejectState' { + attribute '@weight' : Real = 0.1; + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 348, + '@ordinate' = 228, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ), + '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 649, + '@ordinate' = 239, + '@height' = 50, + '@width' = 100 + ), + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ), + '#AvatarGraphicElement'( + '@ident' = 20, + '@absciss' = 649, + '@ordinate' = 239, + '@height' = 50, + '@width' = 100 + ), + '#AvatarGraphicPoint'( + '@absciss' = 4, + '@ordinate' = 3 + ), + '#AvatarGraphicElement'( + '@ident' = 36, + '@absciss' = 411, + '@ordinate' = 206, + '@height' = 30, + '@width' = 100 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.WaitingForSecondCoin' if '@index' == 2 + do action : '#ReceiveAction' { + item '@msg' : '@MSG:CoffeeMachine.getCoin' = '@payload' as '@MSG:CoffeeMachine.getCoin'; + first start; + then assign '$x' := '@msg'.'nbOfCoins'; + then done; + } then '@st:receive.getCoin.1' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 270, + '@ordinate' = 224, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ), + '#AvatarGraphicElement'( + '@ident' = 19, + '@absciss' = 239, + '@ordinate' = 280, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 21, + '@absciss' = 231, + '@ordinate' = 188, + '@height' = 40, + '@width' = 157 + ), + '#AvatarGraphicElement'( + '@ident' = 19, + '@absciss' = 239, + '@ordinate' = 280, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicPoint'( + '@absciss' = 14, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 38, + '@absciss' = 270, + '@ordinate' = 264, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + entry action '@st:start' :'#AvatarStartState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 22, + '@absciss' = 296, + '@ordinate' = 20, + '@height' = 15, + '@width' = 15 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + then '@st:standard.WaitingForFirstCoin' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 15, + '@absciss' = 303, + '@ordinate' = 40, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 22, + '@absciss' = 296, + '@ordinate' = 20, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 22, + '@absciss' = 296, + '@ordinate' = 20, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 41, + '@absciss' = 303, + '@ordinate' = 80, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:standard.WaitingForFirstCoin' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = { + '#ReceiveRequest'( + '@channel' = '@sig:getCoin' + ) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 24, + '@absciss' = 221, + '@ordinate' = 748, + '@height' = 40, + '@width' = 137 + ), + '#AvatarGraphicElement'( + '@ident' = 25, + '@absciss' = 631, + '@ordinate' = 381, + '@height' = 40, + '@width' = 137 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.WaitingForFirstCoin' + do action : '#ReceiveAction' { + item '@msg' : '@MSG:CoffeeMachine.getCoin' = '@payload' as '@MSG:CoffeeMachine.getCoin'; + first start; + then assign '$x' := '@msg'.'nbOfCoins'; + then done; + } then '@st:receive.getCoin.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 14, + '@absciss' = 303, + '@ordinate' = 103, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 268, + '@ordinate' = 141, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 17, + '@absciss' = 268, + '@ordinate' = 141, + '@height' = 20, + '@width' = 76 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 40, + '@absciss' = 303, + '@ordinate' = 143, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:standard.Beverage' : '#AvatarStandardState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 26, + '@absciss' = 23, + '@ordinate' = 372, + '@height' = 354, + '@width' = 577 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 26, + '@absciss' = 23, + '@ordinate' = 372, + '@height' = 354, + '@width' = 577 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.Beverage' + then '@st:standard.WaitingForSelection' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 280, + '@ordinate' = 420, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 44, + '@absciss' = 254, + '@ordinate' = 401, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 44, + '@absciss' = 254, + '@ordinate' = 401, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 34, + '@absciss' = 280, + '@ordinate' = 460, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:receive.pushTeaButton.2' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 42, + '@absciss' = 242, + '@ordinate' = 529, + '@height' = 20, + '@width' = 112 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.pushTeaButton.2' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= 0; + then action = '$beverageReady'(); + then done; + } then '@st:standard.WaitingForFirstCoin' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 355, + '@ordinate' = 545, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 42, + '@absciss' = 242, + '@ordinate' = 529, + '@height' = 20, + '@width' = 112 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 42, + '@absciss' = 242, + '@ordinate' = 529, + '@height' = 20, + '@width' = 112 + ), + '#AvatarGraphicElement'( + '@ident' = 24, + '@absciss' = 221, + '@ordinate' = 748, + '@height' = 40, + '@width' = 137 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 30, + '@absciss' = 284, + '@ordinate' = 594, + '@height' = 45, + '@width' = 252 + ) + ); + } + } + + state '@st:standard.WaitingForSelection' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = {( + '#SendRequest'( + '@channel' = '@sig:ejectCoin', + '@delay' = '$coinDelay', + '@payload' = '@MSG:CoffeeMachine.ejectCoin'( + '$nbOfCoins' ) + ), + '#ReceiveRequest'( + '@index' = 2, + '@channel' = '@sig:pushTeaButton' + ), + '#ReceiveRequest'( + '@index' = 3, + '@channel' = '@sig:pushCoffeeButton' + ) + )}; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.WaitingForSelection' if '@index' == 1 + then '@st:send.ejectCoin.1' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 555, + '@ordinate' = 559, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 46, + '@absciss' = 377, + '@ordinate' = 502, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 46, + '@absciss' = 377, + '@ordinate' = 502, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicPoint'( + '@absciss' = 4, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 29, + '@absciss' = 395, + '@ordinate' = 448, + '@height' = 15, + '@width' = 100 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.WaitingForSelection' if '@index' == 2 + then '@st:receive.pushTeaButton.2' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 295, + '@ordinate' = 465, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 42, + '@absciss' = 242, + '@ordinate' = 529, + '@height' = 20, + '@width' = 112 + ), + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 42, + '@absciss' = 242, + '@ordinate' = 529, + '@height' = 20, + '@width' = 112 + ), + '#AvatarGraphicPoint'( + '@absciss' = 15, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 31, + '@absciss' = 295, + '@ordinate' = 505, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + transition : '#AvatarTransition' first '@st:standard.WaitingForSelection' if '@index' == 3 + then '@st:receive.pushCoffeeButton.3' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 229, + '@ordinate' = 465, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 45, + '@absciss' = 63, + '@ordinate' = 529, + '@height' = 20, + '@width' = 127 + ), + '#AvatarGraphicElement'( + '@ident' = 43, + '@absciss' = 194, + '@ordinate' = 437, + '@height' = 40, + '@width' = 132 + ), + '#AvatarGraphicElement'( + '@ident' = 45, + '@absciss' = 63, + '@ordinate' = 529, + '@height' = 20, + '@width' = 127 + ), + '#AvatarGraphicPoint'( + '@absciss' = 14, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 33, + '@absciss' = 229, + '@ordinate' = 505, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:receive.pushCoffeeButton.3' : '#AvatarReceiveState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 45, + '@absciss' = 63, + '@ordinate' = 529, + '@height' = 20, + '@width' = 127 + ); + } + + } + + transition : '#AvatarTransition' first '@st:receive.pushCoffeeButton.3' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= 0; + then action = '$beverageReady'(); + then done; + } then '@st:standard.WaitingForFirstCoin' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 148, + '@ordinate' = 549, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 45, + '@absciss' = 63, + '@ordinate' = 529, + '@height' = 20, + '@width' = 127 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 45, + '@absciss' = 63, + '@ordinate' = 529, + '@height' = 20, + '@width' = 127 + ), + '#AvatarGraphicElement'( + '@ident' = 24, + '@absciss' = 221, + '@ordinate' = 748, + '@height' = 40, + '@width' = 137 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 8 + ), + '#AvatarGraphicElement'( + '@ident' = 32, + '@absciss' = 32, + '@ordinate' = 587, + '@height' = 45, + '@width' = 288 + ) + ); + } + } + + state '@st:send.ejectCoin.1' : '#AvatarSendState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 46, + '@absciss' = 377, + '@ordinate' = 502, + '@height' = 20, + '@width' = 130 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.ejectCoin.1' + do action : '#TransitionAction' { + first start; + then assign '$nbOfCoins':= 0; + then done; + } then '@st:standard.WaitingForFirstCoin' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 481, + '@ordinate' = 501, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 46, + '@absciss' = 377, + '@ordinate' = 502, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicElement'( + '@ident' = 23, + '@absciss' = 192, + '@ordinate' = 62, + '@height' = 40, + '@width' = 220 + ), + '#AvatarGraphicElement'( + '@ident' = 46, + '@absciss' = 377, + '@ordinate' = 502, + '@height' = 20, + '@width' = 130 + ), + '#AvatarGraphicElement'( + '@ident' = 24, + '@absciss' = 221, + '@ordinate' = 748, + '@height' = 40, + '@width' = 137 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 9 + ), + '#AvatarGraphicElement'( + '@ident' = 28, + '@absciss' = 420, + '@ordinate' = 552, + '@height' = 15, + '@width' = 89 + ) + ); + } + } + } + + // Sub-Blocks øøøøøøøøøøøøøøøøøøøøøøø + + // Block '@blk:CoffeeButton'============= + part '@blk:CoffeeButton' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$mechanicalDelay' : Integer := 10; + + // Signals --------------------- + part '@sig:push' : '#Channel'; + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + state '@st:standard.main' : '#AvatarStandardState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 374, + '@ordinate' = 352, + '@height' = 30, + '@width' = 50 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 374, + '@ordinate' = 352, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 297, + '@ordinate' = 88, + '@height' = 30, + '@width' = 50 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.main' + then '@st:standard.state0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 377, + '@ordinate' = 144, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 374, + '@ordinate' = 352, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 264, + '@ordinate' = 174, + '@height' = 130, + '@width' = 184 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 297, + '@ordinate' = 88, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 264, + '@ordinate' = 174, + '@height' = 130, + '@width' = 184 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 10, + '@absciss' = 377, + '@ordinate' = 184, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + entry action '@st:start' :'#AvatarStartState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 315, + '@ordinate' = 49, + '@height' = 15, + '@width' = 15 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + then '@st:standard.main' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 322, + '@ordinate' = 69, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 315, + '@ordinate' = 49, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 374, + '@ordinate' = 352, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 315, + '@ordinate' = 49, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 297, + '@ordinate' = 88, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 322, + '@ordinate' = 109, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:standard.state0' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = { + '#SendRequest'( + '@channel' = '@sig:push', + '@payload' = '@MSG:CoffeeButton.push'() + ) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 264, + '@ordinate' = 174, + '@height' = 130, + '@width' = 184 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 264, + '@ordinate' = 174, + '@height' = 130, + '@width' = 184 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.state0' + then '@st:send.push.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 177, + '@ordinate' = 199, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 333, + '@ordinate' = 213, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 330, + '@ordinate' = 257, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicElement'( + '@ident' = 13, + '@absciss' = 333, + '@ordinate' = 213, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 330, + '@ordinate' = 257, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 177, + '@ordinate' = 239, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + state '@st:send.push.0' : '#AvatarSendState' { + calc '@request' redefines '@request' = { + '#TrivialRequest'('@delay' = '$mechanicalDelay') + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 330, + '@ordinate' = 257, + '@height' = 20, + '@width' = 46 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.push.0' + then '@st:standard.main' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 377, + '@ordinate' = 187, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 330, + '@ordinate' = 257, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 374, + '@ordinate' = 352, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 12, + '@absciss' = 330, + '@ordinate' = 257, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 374, + '@ordinate' = 352, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 11, + '@absciss' = 417, + '@ordinate' = 335, + '@height' = 15, + '@width' = 145 + ) + ); + } + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 464, + '@ordinate' = 228, + '@height' = 102, + '@width' = 190 + ); + + attribute 'color' : String = "-4072719"; + } + } + + // Block '@blk:TeaButton'============= + part '@blk:TeaButton' : '#AvatarBlock' { + + // Attributes --------------------- + attribute '$mechanicalDelay' : Integer := 10; + + // Signals --------------------- + part '@sig:push' : '#Channel'; + + // state-machine ------------------- + exhibit state '@statemachine' : '#AvatarStateMachine' { + + state '@st:send.push.0' : '#AvatarSendState' { + calc '@request' redefines '@request' = { + '#TrivialRequest'('@delay' = '$mechanicalDelay') + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 340, + '@ordinate' = 179, + '@height' = 20, + '@width' = 46 + ); + } + + } + + transition : '#AvatarTransition' first '@st:send.push.0' + then '@st:standard.main' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 0, + '@absciss' = 363, + '@ordinate' = 193, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 340, + '@ordinate' = 179, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 337, + '@ordinate' = 257, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 340, + '@ordinate' = 179, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 337, + '@ordinate' = 257, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 1, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 7, + '@absciss' = 380, + '@ordinate' = 228, + '@height' = 15, + '@width' = 145 + ) + ); + } + } + + state '@st:standard.main' : '#AvatarStandardState' { + calc '@pool' redefines '@pool' = { + '#SendRequest'( + '@channel' = '@sig:push', + '@payload' = '@MSG:TeaButton.push'() + ) + }; + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 337, + '@ordinate' = 257, + '@height' = 30, + '@width' = 50 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 337, + '@ordinate' = 257, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 338, + '@ordinate' = 120, + '@height' = 30, + '@width' = 50 + ) + ); + } + + } + + transition : '#AvatarTransition' first '@st:standard.main' + then '@st:send.push.0' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 1, + '@absciss' = 363, + '@ordinate' = 150, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 337, + '@ordinate' = 257, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 340, + '@ordinate' = 179, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 338, + '@ordinate' = 120, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 3, + '@absciss' = 340, + '@ordinate' = 179, + '@height' = 20, + '@width' = 46 + ), + '#AvatarGraphicPoint'( + '@absciss' = 6, + '@ordinate' = 0 + ), + '#AvatarGraphicElement'( + '@ident' = 8, + '@absciss' = 363, + '@ordinate' = 190, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + + entry action '@st:start' :'#AvatarStartState' { + + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 355, + '@ordinate' = 81, + '@height' = 15, + '@width' = 15 + ); + } + + } + + transition : '#AvatarTransition' first '@st:start' + then '@st:standard.main' { + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 2, + '@absciss' = 362, + '@ordinate' = 101, + '@height' = 0, + '@width' = 0 + ); + + item '@otherRefs' : '#AvatarGraphicObject'[*] = ( + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 355, + '@ordinate' = 81, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 337, + '@ordinate' = 257, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 355, + '@ordinate' = 81, + '@height' = 15, + '@width' = 15 + ), + '#AvatarGraphicElement'( + '@ident' = 5, + '@absciss' = 338, + '@ordinate' = 120, + '@height' = 30, + '@width' = 50 + ), + '#AvatarGraphicPoint'( + '@absciss' = 0, + '@ordinate' = 1 + ), + '#AvatarGraphicElement'( + '@ident' = 9, + '@absciss' = 362, + '@ordinate' = 141, + '@height' = 15, + '@width' = 10 + ) + ); + } + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 6, + '@absciss' = 695, + '@ordinate' = 224, + '@height' = 102, + '@width' = 189 + ); + + attribute 'color' : String = "-4072719"; + } + } + item '@graphics' : '#AvatarGraphicData' { + + item '@refObject' : '#AvatarGraphicObject' = '#AvatarGraphicElement'( + '@ident' = 4, + '@absciss' = 445, + '@ordinate' = 19, + '@height' = 358, + '@width' = 461 + ); + + attribute 'color' : String = "-4072719"; + } + } + // Block Shortcut Links $$$$$$$$$$$$ + part '@blk:CoffeeButton' : '#AvatarBlock' :> '@blk:CoffeeMachine'.'@blk:CoffeeButton' = '@blk:CoffeeMachine'.'@blk:CoffeeButton'; + part '@blk:TeaButton' : '#AvatarBlock' :> '@blk:CoffeeMachine'.'@blk:TeaButton' = '@blk:CoffeeMachine'.'@blk:TeaButton'; +} -- GitLab