From be180be5236b189f4609d838e7756a9b3be2e4fa Mon Sep 17 00:00:00 2001
From: Andrea Enrici <andrea.enrici@nokia.com>
Date: Mon, 27 Apr 2015 15:38:36 +0000
Subject: [PATCH] corrected drone model bug

---
 src/ui/tmldd/TMLArchiArtifact.java | 31 +++++++++++++++++-------------
 src/ui/tmldd/TMLArchiCPUNode.java  |  7 ++++++-
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/src/ui/tmldd/TMLArchiArtifact.java b/src/ui/tmldd/TMLArchiArtifact.java
index 11976ffbe1..d15ed3c3f1 100755
--- a/src/ui/tmldd/TMLArchiArtifact.java
+++ b/src/ui/tmldd/TMLArchiArtifact.java
@@ -271,7 +271,12 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa
 								}
 								operation = elt.getAttribute("operation");
 								if( (elt.getAttribute("fatherComponentMECType") != null) &&  (elt.getAttribute("fatherComponentMECType").length() > 0) )	{
-									fatherArchUnitMECType = ArchUnitMEC.Types.get( Integer.valueOf( elt.getAttribute("fatherComponentMECType") ) );
+									if( elt.getAttribute("fatherComponentMECType").length() > 1 )	{
+										fatherArchUnitMECType = ArchUnitMEC.Types.get(0);
+									}
+									else	{
+										fatherArchUnitMECType = ArchUnitMEC.Types.get( Integer.valueOf( elt.getAttribute("fatherComponentMECType") ) );
+									}
 								}
                             }
                             if (svalue != null) {
@@ -315,41 +320,41 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa
 		return "Priority = " + priority;
 	}
 
-	public OperationMEC getOperationMECOfTask()	{
+	public int getOperationType()	{
 
 		if( fatherArchUnitMECType instanceof FepMEC )	{
 			if( operation.equals( "CWM" ) )	{
-				return new CwmMEC( "", "", "" );
+				return FepOperationMEC.CwmMEC;
 			}
 			else if( operation.equals( "CWL" ) )	{
-				return new CwlMEC( "", "", "" );
+				return FepOperationMEC.CwlMEC;
 			}
 			else if( operation.equals( "CWA" ) )	{
-				return new CwaMEC( "", "", "", "" );
+				return FepOperationMEC.CwaMEC;
 			}
 			else if( operation.equals( "CWP" ) )	{
-				return new CwpMEC( "", "", "" );
+				return FepOperationMEC.CwpMEC;
 			}
 			else if( operation.equals( "FFT" ) )	{
-				return new FftMEC( "", "", "" );
+				return FepOperationMEC.FftMEC;
 			}
 			else if( operation.equals( "SUM" ) )	{
-				return new SumMEC( "", "", "" );
+				return FepOperationMEC.SumMEC;
 			}
 		}
 		else if( fatherArchUnitMECType instanceof MapperMEC )	{
-			return new MappOperationMEC( "", "", "" );
+			return OperationMEC.MappOperationMEC;
 		}
 		else if( fatherArchUnitMECType instanceof InterleaverMEC	)	{
-				return new IntlOperationMEC( "", "", "" );
+				return OperationMEC.IntlOperationMEC;
 		}
 		else if( fatherArchUnitMECType instanceof AdaifMEC )	{
-			return new AdaifOperationMEC( "", "", "" );
+			return OperationMEC.AdaifOperationMEC;
 		}
 		else if( fatherArchUnitMECType instanceof CpuMEC )	{
-			return new CpuOperationMEC( "", "", "" );
+			return OperationMEC.CpuOperationMEC;
 		}
-		return null;
+		return -1;
 	}
 
 	public ArchUnitMEC getArchUnitMEC()	{
diff --git a/src/ui/tmldd/TMLArchiCPUNode.java b/src/ui/tmldd/TMLArchiCPUNode.java
index 525e25b0d3..cce9c6b0f4 100755
--- a/src/ui/tmldd/TMLArchiCPUNode.java
+++ b/src/ui/tmldd/TMLArchiCPUNode.java
@@ -542,7 +542,12 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent,
                                     clockRatio = Integer.decode(elt.getAttribute("clockRatio")).intValue();
                                 }
                                 if ((elt.getAttribute("MECType") != null) &&  (elt.getAttribute("MECType").length() > 0)){
-                                	MECType = ArchUnitMEC.Types.get( Integer.valueOf( elt.getAttribute("MECType") ) );
+																	if( elt.getAttribute("MECType").length() > 1 )	{	//old format
+                                		MECType = ArchUnitMEC.Types.get(0);
+																	}
+																	else	{
+                                		MECType = ArchUnitMEC.Types.get( Integer.valueOf( elt.getAttribute("MECType") ) );
+																	}
 																}
                                 if ((elt.getAttribute("sliceTime") != null) &&  (elt.getAttribute("sliceTime").length() > 0)){
                                     sliceTime = Integer.decode(elt.getAttribute("sliceTime")).intValue();
-- 
GitLab