diff --git a/src/ui/GTMLModeling.java b/src/ui/GTMLModeling.java index 4b8bf371e209ac1fe91134c6fceb67b678832e4a..206f4e493e636e47ff2c9c4db169a0d09aa878f0 100755 --- a/src/ui/GTMLModeling.java +++ b/src/ui/GTMLModeling.java @@ -1474,9 +1474,9 @@ public class GTMLModeling { listE.addCor(tmlexecii, tgc); } else if (tgc instanceof TMLADEncrypt) { - tmlexecc = new TMLExecI("encrypt", tgc); + tmlexecc = new TMLExecC("encrypt", tgc); tmlexecc.setAction(((TMLADEncrypt) tgc).calculationTime); - activity.addElement(tmlexeci); + activity.addElement(tmlexecc); SecurityPattern securityPattern = new SecurityPattern(((TMLADEncrypt)tgc).securityContext, ((TMLADEncrypt)tgc).keySize, ((TMLADEncrypt)tgc).MACSize); tmlexecc.securityPattern = securityPattern; securityPatterns.put(((TMLADEncrypt)tgc).securityContext, securityPattern); @@ -1484,9 +1484,9 @@ public class GTMLModeling { listE.addCor(tmlexecc, tgc); } else if (tgc instanceof TMLADDecrypt) { - tmlexecc = new TMLExecI("decrypt", tgc); + tmlexecc = new TMLExecC("decrypt", tgc); tmlexecc.setAction(((TMLADDecrypt) tgc).calculationTime); - activity.addElement(tmlexeci); + activity.addElement(tmlexecc); tmlexecc.securityPattern = securityPatterns.get(((TMLADDecrypt)tgc).securityContext); ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlexecc, tgc); @@ -1611,6 +1611,12 @@ public class GTMLModeling { //security pattern if (securityPatterns.get(((TMLADReadChannel)tgc).securityContext)!=null){ tmlreadchannel.securityPattern= securityPatterns.get(((TMLADReadChannel)tgc).securityContext); + //NbOfSamples will increase due to extra overhead from MAC + int cur = Integer.valueOf(modifyString(((TMLADReadChannel)tgc).getSamplesValue())); + int add = Integer.valueOf(tmlreadchannel.securityPattern.MACSize); + Double d= Math.ceil(add/4.0); + cur = cur+ d.intValue(); + tmlreadchannel.setNbOfSamples(Integer.toString(cur)); } activity.addElement(tmlreadchannel); ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); @@ -1915,6 +1921,11 @@ public class GTMLModeling { //add sec pattern if (securityPatterns.get(((TMLADWriteChannel)tgc).securityContext)!=null){ tmlwritechannel.securityPattern= securityPatterns.get(((TMLADWriteChannel)tgc).securityContext); + int cur = Integer.valueOf(modifyString(((TMLADWriteChannel)tgc).getSamplesValue())); + int add = Integer.valueOf(tmlwritechannel.securityPattern.MACSize); + Double d= Math.ceil(add/4.0); + cur = cur+ d.intValue(); + tmlwritechannel.setNbOfSamples(Integer.toString(cur)); } activity.addElement(tmlwritechannel); ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); diff --git a/src/ui/tmldd/TMLArchiBUSNode.java b/src/ui/tmldd/TMLArchiBUSNode.java index f88680e977d4ecdfcbbb6d5fe62ecf08eb46249c..e677330e96c6d5339cc5428b1b6c8d62a3431f04 100755 --- a/src/ui/tmldd/TMLArchiBUSNode.java +++ b/src/ui/tmldd/TMLArchiBUSNode.java @@ -152,18 +152,20 @@ public class TMLArchiBUSNode extends TMLArchiCommunicationNode implements Swallo //Draw bus privacy if (privacy== HwBus.BUS_PUBLIC){ - g.drawArc(x+6, y+18, 12, 18, 50, 170); - g.setColor(Color.red); - g.fillRect(x+4, y+26, 18, 14); - g.setColor(c); - g.drawRect(x+4, y+26, 18, 14); + } else { - g.drawOval(x+6, y+19, 12, 18); - g.setColor(Color.green); - g.fillRect(x+4, y+25, 18, 14); + int[] xps = new int[]{x+4, x+7, x+13, x+19, x+22, x+22, x+13, x+4}; + int[] yps = new int[]{y+20, y+20, y+15, y+20, y+20, y+35, y+40, y+35}; + g.setColor(Color.green); + g.fillPolygon(xps, yps,8); + + // g.drawOval(x+6, y+19, 12, 18); + + // g.fillRect(x+4, y+25, 18, 14); g.setColor(c); - g.drawRect(x+4, y+25, 18, 14); + g.drawPolygon(xps, yps,8); + // g.drawRect(x+4, y+25, 18, 14); } }