set default value of PCD from msa file or spd file.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Aug 2006 03:45:57 +0000 (03:45 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Aug 2006 03:45:57 +0000 (03:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1180 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java

index e0a0137..d942add 100644 (file)
@@ -906,6 +906,21 @@ public class FpdFileContents {
         fpdPcd.setTokenSpaceGuidCName(tsGuid);\r
         fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType));\r
         fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType));\r
+        \r
+        if (defaultVal != null){\r
+            fpdPcd.setValue(defaultVal);\r
+        }\r
+        else {\r
+            if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) {\r
+                fpdPcd.setValue("0");\r
+            }\r
+            if (dataType.equals("BOOLEAN")){\r
+                fpdPcd.setValue("false");\r
+            }\r
+            if (dataType.equals("VOID*")) {\r
+                fpdPcd.setValue("");\r
+            }\r
+        }\r
         if (dataType.equals("UINT8")){\r
             fpdPcd.setMaxDatumSize(1);\r
         }\r
@@ -926,6 +941,7 @@ public class FpdFileContents {
             fpdPcd.setMaxDatumSize(maxSize);\r
         }\r
         \r
+        \r
         if (itemType.equals("DYNAMIC") || itemType.equals("DYNAMIC_EX")) {\r
             ArrayList<String> al = LookupDynamicPcdBuildDefinition(cName + " " + tsGuid);\r
             //\r
@@ -937,6 +953,7 @@ public class FpdFileContents {
             }\r
         }\r
         else {\r
+            /*\r
             if (defaultVal != null){\r
                 fpdPcd.setValue(defaultVal);\r
             }\r
@@ -951,7 +968,7 @@ public class FpdFileContents {
                     fpdPcd.setValue("");\r
                 }\r
             }\r
-            /*\r
+            \r
             if (dataType.equals("UINT8")){\r
                 fpdPcd.setMaxDatumSize(1);\r
             }\r