summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2013-08-15 09:49:00 (EDT)
committerJuergen Haug2013-08-16 10:21:51 (EDT)
commit50dac8a8ce370b8abf78b168578e72920580ac67 (patch)
treeb306c0ee1f70d298a09553d81229a3892a5a900b
parent108b1ce567fa1b56b1d7176bc6915aa0e1a1403c (diff)
downloadorg.eclipse.etrice-50dac8a8ce370b8abf78b168578e72920580ac67.zip
org.eclipse.etrice-50dac8a8ce370b8abf78b168578e72920580ac67.tar.gz
org.eclipse.etrice-50dac8a8ce370b8abf78b168578e72920580ac67.tar.bz2
[core,ui] added validation for interface items and their messagesrefs/changes/08/15508/2
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java9
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/dialogs/TransitionPropertyDialog.java10
2 files changed, 18 insertions, 1 deletions
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java
index da35f0a..cfc19ab 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/validation/RoomJavaValidator.java
@@ -45,6 +45,7 @@ import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.LayerConnection;
import org.eclipse.etrice.core.room.LogicalSystem;
import org.eclipse.etrice.core.room.Message;
+import org.eclipse.etrice.core.room.MessageFromIf;
import org.eclipse.etrice.core.room.NonInitialTransition;
import org.eclipse.etrice.core.room.Port;
import org.eclipse.etrice.core.room.PortClass;
@@ -544,6 +545,14 @@ public class RoomJavaValidator extends AbstractRoomJavaValidator {
if (msg.getData()==null)
error("Messages of data driven protocols must carry data", RoomPackage.Literals.MESSAGE__DATA);
}
+
+ @Check
+ public void checkMessageFromIf(MessageFromIf mfi){
+ if(mfi.getFrom() != null){
+ if(RoomHelpers.getProtocol(mfi.getFrom()).getCommType() != CommunicationType.EVENT_DRIVEN)
+ error("port must have event driven protocol", mfi, RoomPackage.eINSTANCE.getMessageFromIf_From());
+ }
+ }
@Check
public void checkOperation(StandardOperation op) {
diff --git a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/dialogs/TransitionPropertyDialog.java b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/dialogs/TransitionPropertyDialog.java
index f649829..17c570b 100644
--- a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/dialogs/TransitionPropertyDialog.java
+++ b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/dialogs/TransitionPropertyDialog.java
@@ -12,6 +12,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.naming.RoomNameProvider;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.CPBranchTransition;
+import org.eclipse.etrice.core.room.CommunicationType;
import org.eclipse.etrice.core.room.DetailCode;
import org.eclipse.etrice.core.room.Guard;
import org.eclipse.etrice.core.room.GuardedTransition;
@@ -19,6 +20,7 @@ import org.eclipse.etrice.core.room.InitialTransition;
import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.MessageFromIf;
+import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RefinedTransition;
import org.eclipse.etrice.core.room.RoomFactory;
import org.eclipse.etrice.core.room.RoomPackage;
@@ -192,7 +194,13 @@ public class TransitionPropertyDialog extends AbstractMemberAwarePropertyDialog
s2m = new StringToDetailCode();
s2m_not_null = new StringToDetailCode(false);
- interfaceItems = RoomHelpers.getAllInterfaceItems(ac);
+ interfaceItems = new ArrayList<InterfaceItem>();
+ for(InterfaceItem item : RoomHelpers.getAllInterfaceItems(ac)){
+ ProtocolClass pc = RoomHelpers.getProtocol(item);
+ if(pc != null && pc.getCommType() == CommunicationType.EVENT_DRIVEN)
+ interfaceItems.add(item);
+ }
+
inherited = RoomHelpers.getActorClass(trans)!=ac;
refined = null;