diff --git a/src/tmltranslator/TMLMapping.java b/src/tmltranslator/TMLMapping.java index 127ae3fc83e09bddef876871cddf8241ce081ea6..ca41c09728790a9f572f8cd7131c004d7ef9b965 100755 --- a/src/tmltranslator/TMLMapping.java +++ b/src/tmltranslator/TMLMapping.java @@ -61,7 +61,7 @@ public List<String> securityPatterns = new ArrayList<String>(); private ArrayList<HwExecutionNode> onnodes; private ArrayList<TMLTask> mappedtasks; private ArrayList<HwCommunicationNode> oncommnodes; - private ArrayList<TMLElement> mappedcommelts; + public ArrayList<TMLElement> mappedcommelts; private ArrayList<TMLCP> mappedCPs; private ArrayList<TMLElement> commEltsMappedOnCPs; diff --git a/src/tmltranslator/TMLModeling.java b/src/tmltranslator/TMLModeling.java index 0bc9fc62b410efd4ffec73b6190497ee01615bc1..3ab1d08bda660cfa1579c7a52e12322c0dde1646 100755 --- a/src/tmltranslator/TMLModeling.java +++ b/src/tmltranslator/TMLModeling.java @@ -1628,7 +1628,7 @@ public class TMLModeling { if ((elt0 instanceof TMLExecC) && (elt0.getNbNext() == 1)) { elt1 = elt0.getNextElement(0); - if (elt1 instanceof TMLExecC) { + if (elt1 instanceof TMLExecC && ((TMLExecC)elt1).securityPattern==null) { // Concate both elements concateActivityElementWithActions(activity, (TMLActivityElementWithAction)elt0, (TMLActivityElementWithAction)elt1); diff --git a/src/tmltranslator/toavatar/TML2Avatar.java b/src/tmltranslator/toavatar/TML2Avatar.java index ccf91a5ef8f4dc891a963100bdc974cf64cc2583..f263988fa9c01999f83397a2a8e33600bd946b01 100644 --- a/src/tmltranslator/toavatar/TML2Avatar.java +++ b/src/tmltranslator/toavatar/TML2Avatar.java @@ -95,6 +95,7 @@ public class TML2Avatar { List<String> allStates; public TML2Avatar(TMLMapping tmlmap) { this.tmlmap = tmlmap; + System.out.println(tmlmap.mappedcommelts); this.tmlmodel = tmlmap.getTMLModeling(); allStates = new ArrayList<String>(); attrsToCheck=new ArrayList<String>(); @@ -192,7 +193,6 @@ public class TML2Avatar { List<HwBus> buses = new ArrayList<HwBus>(); HwNode node2 = tmlmap.getHwNodeOf(t); if (node1==node2){ - // System.out.println("Channel "+channel.getName() + " between Task "+ a.getTaskName() + " and Task " + t.getTaskName() + " is confidential"); channelMap.put(channel, channelPrivate); } if (node1!=node2){ @@ -662,8 +662,7 @@ public class TML2Avatar { sencrypt.addParameter(block.getAvatarAttributeWithName("key")); block.addMethod(sencrypt); tran.addAction(ae.securityPattern.name+"_encrypted = sencrypt("+ae.securityPattern.name+", key)"); - System.out.println("ADDING ACTION ENCRYPT"); - System.out.println("Found security pattern "+ae.securityPattern.name); + ae.securityPattern.originTask=block.getName(); ae.securityPattern.state1=as; AvatarAttributeState authOrigin = new AvatarAttributeState(ae.securityPattern.name+"1",ae.getReferenceObject(),block.getAvatarAttributeWithName(ae.securityPattern.name), as); @@ -686,11 +685,7 @@ public class TML2Avatar { tran.addAction(ae.securityPattern.name+" = sdecrypt("+ae.securityPattern.name+"_encrypted, key)"); - - System.out.println("ADDING ACTION DECRYPT"); ae.securityPattern.state2=as; - System.out.println("Found security pattern decrypt "+ae.securityPattern.name); - elementList.add(as); elementList.add(tran); as.addNext(tran); @@ -742,7 +737,6 @@ public class TML2Avatar { if (ae.securityPattern!=null){ secChannelMap.put(ae.securityPattern.name,ch.getName()); - System.out.println(block.getName() + " readchannel has security pattern" + ae.securityPattern.name); as.addValue(ae.securityPattern.name+"_encrypted"); AvatarAttribute data= new AvatarAttribute(ae.securityPattern.name+"_encrypted", AvatarType.INTEGER, block, null); block.addAttribute(data); @@ -809,14 +803,13 @@ public class TML2Avatar { AvatarActionOnSignal as = new AvatarActionOnSignal(ae.getName(), sig, ae.getReferenceObject()); if (ae.securityPattern!=null){ - System.out.println(block.getName() + " writechannel has security pattern " + ae.securityPattern.name); as.addValue(ae.securityPattern.name+"_encrypted"); AvatarAttribute data= new AvatarAttribute(ae.securityPattern.name+"_encrypted", AvatarType.INTEGER, block, null); block.addAttribute(data); secChannelMap.put(ae.securityPattern.name,ch.getName()); } else { - System.out.println(block.getName() + " writechannel has no security pattern "); + //No security pattern as.addValue(ch.getName()+"__chData"); } diff --git a/src/ui/GTMLModeling.java b/src/ui/GTMLModeling.java index f0628ec6702dee62e0c480593075579246c78843..f97abeb651d6e22f53456da3cda931940ea4431f 100755 --- a/src/ui/GTMLModeling.java +++ b/src/ui/GTMLModeling.java @@ -1945,8 +1945,6 @@ public class GTMLModeling { tmlwritechannel.addChannel(channel); } //add sec pattern - System.out.println("All security patterns "+securityPatterns); - System.out.println(((TMLADWriteChannel)tgc).securityContext); if (securityPatterns.get(((TMLADWriteChannel)tgc).securityContext)!=null){ System.out.println("Security context "+((TMLADWriteChannel)tgc).securityContext+"!"); tmlwritechannel.securityPattern= securityPatterns.get(((TMLADWriteChannel)tgc).securityContext); diff --git a/src/ui/tmlad/TMLADReadChannel.java b/src/ui/tmlad/TMLADReadChannel.java index b7ce127d184c953247907ae2fb3c4017ce1fc136..24b4b6fb201db40f0e7423faf206c5711d71e0fd 100755 --- a/src/ui/tmlad/TMLADReadChannel.java +++ b/src/ui/tmlad/TMLADReadChannel.java @@ -150,7 +150,7 @@ public class TMLADReadChannel extends TGCWithoutInternalComponent implements Che g.drawString(value, x + linebreak + textX0, y + textY1); if (!securityContext.equals("")){ - g.drawString("sec:"+securityContext, x+width/2, y+height+textY1); + g.drawString("sec:"+securityContext, x+3*width/4, y+height+textY1); } drawReachabilityInformation(g); diff --git a/src/ui/tmlad/TMLADWriteChannel.java b/src/ui/tmlad/TMLADWriteChannel.java index 7d4bb51fb8170d7635efa89214637fea506c9a0a..12a637aa861a17c31b0fec1b7014eb155a0656ac 100755 --- a/src/ui/tmlad/TMLADWriteChannel.java +++ b/src/ui/tmlad/TMLADWriteChannel.java @@ -148,7 +148,7 @@ public class TMLADWriteChannel extends TGCWithoutInternalComponent implements Ch g.drawString("chl", x+(width-w) / 2, y); g.drawString(value, x + (width - w) / 2 , y + textY); if (!securityContext.equals("")){ - g.drawString("sec:"+securityContext, x+width/2, y+height+textY); + g.drawString("sec:"+securityContext, x+3*width/4, y+height+textY); } drawReachabilityInformation(g); diff --git a/src/ui/tmlcompd/TMLCPrimitivePort.java b/src/ui/tmlcompd/TMLCPrimitivePort.java index a3b78f1f8994d10399805b5abf1620a3819ad47f..9fb3fb5b7cfec7fde52cbd60b190ab7dd3022ec8 100755 --- a/src/ui/tmlcompd/TMLCPrimitivePort.java +++ b/src/ui/tmlcompd/TMLCPrimitivePort.java @@ -322,7 +322,7 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent public void drawAuthVerification(Graphics g){ - g.drawString(secName, x-20, y+8); + g.drawString(secName, x-20, y+10); Color c = g.getColor(); Color c1; Color c2; @@ -347,12 +347,12 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent c2= c1; } - g.drawOval(x-18, y+8, 10, 15); + g.drawOval(x-18, y+12, 10, 15); g.setColor(c1); int[] xps = new int[]{x-20, x-20, x-4}; - int[] yps = new int[]{y+14, y+28, y+28}; + int[] yps = new int[]{y+18, y+32, y+32}; int[] xpw = new int[]{x-4, x-4, x-20}; - int[] ypw = new int[]{y+28, y+14, y+14}; + int[] ypw = new int[]{y+32, y+18, y+18}; g.fillPolygon(xps, yps,3); g.setColor(c2); @@ -360,8 +360,8 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent g.setColor(c); g.drawPolygon(xps, yps,3); g.drawPolygon(xpw, ypw, 3); - g.drawString("S", x-18, y+26); - g.drawString("W", x-11, y+22); + g.drawString("S", x-18, y+30); + g.drawString("W", x-11, y+26); } public void drawConfVerification(Graphics g){ Color c = g.getColor();