Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJuergen Haug2018-01-23 04:55:19 -0500
committerJuergen Haug2018-02-05 11:59:40 -0500
commitbf57ff2b489e79cb585eb3a69e3275031358f94c (patch)
tree4982c0b6e9c4073d43ab4d31eb77f1404307f679 /tests
parentf9269fca01565289573b4e4303c6b1c8eaaf7bda (diff)
downloadorg.eclipse.etrice-bf57ff2b489e79cb585eb3a69e3275031358f94c.tar.gz
org.eclipse.etrice-bf57ff2b489e79cb585eb3a69e3275031358f94c.tar.xz
org.eclipse.etrice-bf57ff2b489e79cb585eb3a69e3275031358f94c.zip
[ui] activated detail expressions for PortClass and DataClass
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room183
1 files changed, 104 insertions, 79 deletions
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
index 12fc5f20b..77cde675e 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
@@ -4,6 +4,12 @@ RoomModel DetailExpressionTestModel {
import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
+
+/**
+ * TODO define supported expression properly
+ * TODO sync UI and translation in generator
+ */
+
async ActorClass DetailExpressionTest {
Interface {
SPP sppEvent: PEventdriven
@@ -11,7 +17,7 @@ RoomModel DetailExpressionTestModel {
}
Structure {
ServiceImplementation of sppEvent
- Attribute numberArray [ 5 ]: int32
+ Attribute numberArray [5]: int32
Attribute infoData: DDataNested
Port rPortEvent: PEventdriven
Port rPortData: PDatadriven
@@ -21,57 +27,62 @@ RoomModel DetailExpressionTestModel {
conjugated Port cReplEvent [*]: PEventdriven
}
Behavior {
- Operation actorOp(param: int32): boolean {
- "return true;"
- }
+ ctor '''
+ numberArray[0] = 5;
+ '''
+ dtor '''
+ numberArray[0] = 5;
+ '''
+ Operation actorOp(param: int32): boolean '''
+ return param == 0;
+ '''
StateMachine {
Transition eventTrans: idle -> state1 {
triggers {
- <out1: cPortEvent guard {
- "/* TODO activate action code editor */"
- "rPortData.in1 == numberArray[3] &&"
- "transitionData && infoData.flag"
- }>
- }
- action
- {
- "// TODO syntax highlightiing"
- "rPortEvent.out1(true);"
- "rPortData.in1;"
- "rReplEvent[0].out1(true);"
- "rReplEvent.out1(true); // broadcast"
- "cPortEvent.in1();"
- "cPortData.in1(32);"
- "cReplEvent[1].in1();"
- "cReplEvent.in1(); // broadcast"
- "sppEvent[4].out1(true);"
- "sppEvent.out1(true); // broadcast"
- "rPortEvent.regularOp(32);"
- "cPortEvent.conjugatedOp(32);"
- "actorOp(32);"
- "int number = numberArray[0];"
- "DData nestedData = infoData.nested;"
- "int port = infoData.nested.tcpPort;"
- ""
- "// transition event data"
- "int data = (transitionData)? 1 : 0;"
- ""
- "// -- not supported yet by code translation --"
- "// getReplication():"
- "// int replSize1 = rReplEvent.getReplication();"
- "// int replSize2 = cReplEvent.getReplication();"
- "// int replSize2 = sppEvent.getReplication();"
- ""
- "// DataClass operations:"
- "// infoData.operation(32);"
- "// infoData.nested.set(\"127.0.0.1\", 8080);"
+ <out1: cPortEvent guard '''
+ /* TODO activate action code editor */
+ rPortData.in1 == numberArray[3] &&
+ transitionData && infoData.flag
+ '''
+ >
}
+ action '''
+ // TODO syntax highlighting
+ rPortEvent.out1(true);
+ rPortData.in1;
+ rReplEvent[0].out1(true);
+ rReplEvent.out1(true); // broadcast
+ cPortEvent.in1();
+ cPortData.in1(32);
+ cReplEvent[1].in1();
+ cReplEvent.in1(); // broadcast
+ sppEvent[4].out1(true);
+ sppEvent.out1(true); // broadcast
+ rPortEvent.regularOp(32);
+ cPortEvent.conjOp(32);
+ actorOp(32);
+ int number = numberArray[0];
+ DData nestedData = infoData.nested;
+ int port = infoData.nested.tcpPort;
+
+ // transition event data
+ int data = (transitionData)? 1 : 0;
+
+ // -- not supported yet by code translation --
+ // getReplication():
+ // int replSize1 = rReplEvent.getReplication();
+ // int replSize2 = cReplEvent.getReplication();
+ // int replSize2 = sppEvent.getReplication();
+
+ // DataClass operations:
+ // infoData.dataOp(32);
+ // infoData.nested.dataOp("127.0.0.1", 8080);
+ '''
}
Transition guardedTrans: idle -> state2 {
- guard
- {
- "rPortData.in1 == numberArray[3] && infoData.flag && actorOp(32) && rPortEvent.regularOp(32) && cPortEvent.conjugatedOp(32)"
- }
+ guard '''
+ rPortData.in1 == numberArray[3] && infoData.flag && actorOp(32) && rPortEvent.regularOp(32) && cPortEvent.conjOp(32)
+ '''
}
Transition init: initial -> idle
State idle
@@ -90,17 +101,27 @@ RoomModel DetailExpressionTestModel {
}
regular PortClass
{
- Operation regularOp(param: int32): boolean {
- "return true;"
- }
- Attribute regularAttr: int32
+ Attribute regularAttr : boolean = "true"
+ Operation regularOp(param: int32): boolean '''
+ // return regularOp2(param);
+ return true;
+ '''
+ Operation regularOp2(): boolean '''
+ // return regularAttr;
+ return true;
+ '''
}
conjugated PortClass
{
- Operation conjugatedOp(param: int32): boolean {
- "return true;"
- }
- Attribute conjugatedAttr: int32
+ Attribute conjAttr : boolean = "true"
+ Operation conjOp(param: int32): boolean '''
+ // return conjOp2(param);
+ return true;
+ '''
+ Operation conjOp2(): boolean '''
+ // return conjAttr;
+ return true;
+ '''
}
}
@@ -108,40 +129,44 @@ RoomModel DetailExpressionTestModel {
incoming {
Message in1(data: int32)
}
- /* not supported yet
- regular PortClass
- {
- Operation regularOp(param: int32): boolean {
- ""
- }
- Attribute regularAttr: int32
- }
- conjugated PortClass
- {
- Operation conjugatedOp(param: int32): boolean {
- ""
- }
- Attribute conjugatedAttr: int32
- }
- * /*
- */
+ /* not supported yet
+ * regular PortClass
+ * {
+ * Operation regularOp(param: int32): boolean {
+ * ""
+ * }
+ * Attribute regularAttr: int32
+ * }
+ * conjugated PortClass
+ * {
+ * Operation conjugatedOp(param: int32): boolean {
+ * ""
+ * }
+ * Attribute conjugatedAttr: int32
+ * }
+ * /*
+ */
}
DataClass DDataNested {
- Operation dataOp(number: int32) {
- ""
- }
+ Operation dataOp(number: int32) : boolean '''
+ // return dataOp2() && number;
+ return true;
+ '''
+ Operation dataOp2() : boolean '''
+ // nested.dataOp("", 0);
+ // return flag && nested.tcpPort;
+ return true;
+ '''
Attribute flag: boolean
- Attribute array [ 5 ]: int32
+ Attribute array [5]: int32
Attribute nested: DData
}
DataClass DData {
- Operation dataOp(ip: string, port: int32) {
- ""
- }
+ Operation dataOp(ip: string, port: int32) '''
+ '''
Attribute iPAddr: string
Attribute tcpPort: int32
}
-
} \ No newline at end of file

Back to the top