diff --git a/src/main/java/tmltranslator/TMLChannel.java b/src/main/java/tmltranslator/TMLChannel.java index 25f6c86a405a8c4071a75f58f8c2562b310a8c68..e6b36d8dab22c936c875e177b5934cf5f3a2a378 100755 --- a/src/main/java/tmltranslator/TMLChannel.java +++ b/src/main/java/tmltranslator/TMLChannel.java @@ -464,7 +464,6 @@ public class TMLChannel extends TMLCommunicationElement { return s; } - // We assume the channel is a basic channel public String toXML() { TraceManager.addDev("Channel:" + this.toString()); String s = "<TMLCHANNEL "; @@ -474,6 +473,7 @@ public class TMLChannel extends TMLCommunicationElement { s += "originport=\"" + originPort.getName() + "\" "; s += "destinationtask=\"" + destinationTask.getName() + "\" "; s += "destinationport=\"" + destinationPort.getName() + "\" "; + s += "dataFlowType=\"" + originPort.getDataFlowType() + "\" "; } if( isAForkChannel() ) { s += "origintask=\"" + originTasks.get(0).getName() + "\" "; @@ -486,6 +486,7 @@ public class TMLChannel extends TMLCommunicationElement { } s += "destinationtask=\"" + destTask + "\" "; s += "destinationport=\"" + destPort + "\" "; + s += "dataFlowType=\"" + originPort.getDataFlowType() + "\" "; } if (isAJoinChannel()) { s += "destinationtask=\"" + destinationTasks.get(0).getName() + "\" "; @@ -500,10 +501,11 @@ public class TMLChannel extends TMLCommunicationElement { } s += "origintask=\"" + oriTask + "\" "; s += "originport=\"" + oriPort + "\" "; + s += "dataFlowType=\"" + originPorts.get(0).getDataFlowType() + "\" "; } s += "isLossy=\"" + isLossy + "\" "; - s += "lossPercentage=\"" + lossPercentage + "\" "; + s += "lossPercentage=\"" + lossPercentage + "\" "; s += "maxNbOfLoss=\"" + maxNbOfLoss + "\" "; switch(type) { case BRBW: @@ -518,7 +520,6 @@ public class TMLChannel extends TMLCommunicationElement { } s += "size=\"" + size + "\" "; s += "max=\"" + max + "\" "; - s += " />\n"; return s; } diff --git a/src/main/java/tmltranslator/TMLPort.java b/src/main/java/tmltranslator/TMLPort.java index e2151a062d7d31207468884efd540770fb19de9b..e41780cc20fcd1c08054be357c43c1a1fc920809 100755 --- a/src/main/java/tmltranslator/TMLPort.java +++ b/src/main/java/tmltranslator/TMLPort.java @@ -1,6 +1,8 @@ /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * + * Andrea ENRICI, Nokia Bell Labs France + * * ludovic.apvrille AT enst.fr + * andrea.enrici AT nokia-bell-labs.com * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to @@ -37,47 +39,73 @@ */ - - -package tmltranslator; - /** * Class TMLPort * Creation: 16/02/2015 * @version 1.0 16/02/2015 - * @author Ludovic APVRILLE + * @author Ludovic APVRILLE, Andrea ENRICI */ + + +package tmltranslator; + + +import ui.tmlcompd.TMLCPrimitivePort; + + public class TMLPort extends TMLElement { private boolean prex; private boolean postex; - private String associatedEvent; + private String associatedEvent; + private String dataFlowType; + + public TMLPort( String _name, Object _referenceObject ) { + + super( _name, _referenceObject ); + dataFlowType = ( (TMLCPrimitivePort)referenceObject ).getDataFlowType(); - public TMLPort(String _name, Object _referenceObject) { - super(_name, _referenceObject); } public void setPrex( boolean _prex ) { + prex = _prex; + } public boolean isPrex() { + return prex; + } public void setPostex( boolean _postex ) { + postex = _postex; + } public boolean isPostex() { + return postex; + } - public void setAssociatedEvent( String _eventName ) { - associatedEvent = _eventName; - } + public void setAssociatedEvent( String _eventName ) { - public String getAssociatedEvent() { - return associatedEvent; - } + associatedEvent = _eventName; + + } + + public String getAssociatedEvent() { + + return associatedEvent; + + } + + public String getDataFlowType() { + + return dataFlowType; + + } }