Provide default value for PCD in platform if user does not specify anything for it.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1956 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-11-15 08:57:57 +00:00
parent e799f87fe6
commit adf6ff605f
3 changed files with 16 additions and 2 deletions

View File

@ -1345,7 +1345,7 @@ public class FpdFileContents {
fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType)); fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType));
fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType)); fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType));
if (defaultVal != null){ if (defaultVal != null && defaultVal.length() > 0){
fpdPcd.setValue(defaultVal); fpdPcd.setValue(defaultVal);
} }
else { else {
@ -1356,7 +1356,7 @@ public class FpdFileContents {
fpdPcd.setValue("FALSE"); fpdPcd.setValue("FALSE");
} }
if (dataType.equals("VOID*")) { if (dataType.equals("VOID*")) {
fpdPcd.setValue(""); fpdPcd.setValue("L\"\"");
} }
} }
// //

View File

@ -856,6 +856,7 @@ public class FpdFrameworkModules extends IInternalFrame {
Vector<String> vExceptions = new Vector<String>(); Vector<String> vExceptions = new Vector<String>();
if (pcdSync(vExceptions)) { if (pcdSync(vExceptions)) {
JOptionPane.showMessageDialog(frame, "PCD in this platform are synchronized with those in MSA files."); JOptionPane.showMessageDialog(frame, "PCD in this platform are synchronized with those in MSA files.");
docConsole.setSaved(false);
} }
if (vExceptions.size() > 0) { if (vExceptions.size() > 0) {
String errorMsg = ""; String errorMsg = "";

View File

@ -1786,8 +1786,21 @@ private JButton getJButtonUpdatePcd() {
String cName = model.getValueAt(row, 0)+""; String cName = model.getValueAt(row, 0)+"";
String tsGuid = model.getValueAt(row, 1)+""; String tsGuid = model.getValueAt(row, 1)+"";
String oldItemType = model.getValueAt(row, 2)+""; String oldItemType = model.getValueAt(row, 2)+"";
String dataType = model.getValueAt(row, 5)+"";
String newItemType = jComboBoxItemType.getSelectedItem()+""; String newItemType = jComboBoxItemType.getSelectedItem()+"";
String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+""; String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+"";
if (newValue.length() == 0){
if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) {
newValue = "0";
}
if (dataType.equals("BOOLEAN")){
newValue = "FALSE";
}
if (dataType.equals("VOID*")) {
newValue = "L\"\"";
}
}
String[] pcdInfo = {"", "", ""}; String[] pcdInfo = {"", "", ""};
Vector<String> validPcdTypes = new Vector<String>(); Vector<String> validPcdTypes = new Vector<String>();