Provide default value for PCD in platform if user does not specify anything for it.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 15 Nov 2006 08:57:57 +0000 (08:57 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 15 Nov 2006 08:57:57 +0000 (08:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1956 6f19259b-4bc3-4df7-8a09-765794883524

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

index 1c41daf1fec410d55b147f203cf98466e4409911..f7de3a738820af06fd3026bb542b78a68cd20359 100644 (file)
@@ -1345,7 +1345,7 @@ public class FpdFileContents {
         fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType));\r
         fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType));\r
         \r
-        if (defaultVal != null){\r
+        if (defaultVal != null && defaultVal.length() > 0){\r
             fpdPcd.setValue(defaultVal);\r
         }\r
         else {\r
@@ -1356,7 +1356,7 @@ public class FpdFileContents {
                 fpdPcd.setValue("FALSE");\r
             }\r
             if (dataType.equals("VOID*")) {\r
-                fpdPcd.setValue("");\r
+                fpdPcd.setValue("L\"\"");\r
             }\r
         }\r
         //\r
index e415d22e43df513251654c0ea8328f927439a27a..1f1bf214f3059e83cc1706f2e1ca41ee7b96b8af 100644 (file)
@@ -856,6 +856,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         Vector<String> vExceptions = new Vector<String>();\r
         if (pcdSync(vExceptions)) {\r
             JOptionPane.showMessageDialog(frame, "PCD in this platform are synchronized with those in MSA files.");    \r
+            docConsole.setSaved(false);\r
         }\r
         if (vExceptions.size() > 0) {\r
             String errorMsg = "";\r
index f58c09570d4a724b9d4f08ad61eb64f9c879934f..2f3dec94c89a5e12093c59a1ab5e3a41ac75d3ef 100644 (file)
@@ -1786,8 +1786,21 @@ private JButton getJButtonUpdatePcd() {
                 String cName = model.getValueAt(row, 0)+"";\r
                 String tsGuid = model.getValueAt(row, 1)+"";\r
                 String oldItemType = model.getValueAt(row, 2)+"";\r
+                String dataType = model.getValueAt(row, 5)+"";\r
                 String newItemType = jComboBoxItemType.getSelectedItem()+"";\r
                 String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+""; \r
+                if (newValue.length() == 0){\r
+                \r
+                    if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) {\r
+                        newValue = "0";\r
+                    }\r
+                    if (dataType.equals("BOOLEAN")){\r
+                        newValue = "FALSE";\r
+                    }\r
+                    if (dataType.equals("VOID*")) {\r
+                        newValue = "L\"\"";\r
+                    }\r
+                }\r
                 \r
                 String[] pcdInfo = {"", "", ""};\r
                 Vector<String> validPcdTypes = new Vector<String>();\r