diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java index 21d76139c5..daf00ee80f 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java @@ -254,7 +254,7 @@ public class DataType { public static final String FALSE = "False"; // - // The Sting for USAGE type + // The String for USAGE type // public final static String USAGE_TYPE_ALWAYS_CONSUMED = "ALWAYS_CONSUMED"; @@ -266,6 +266,19 @@ public class DataType { public final static String USAGE_TYPE_PRIVATE = "PRIVATE"; + // + // The String for PCD type + // + public final static String PCD_ITEM_TYPE_FEATURE_FLAG = "FEATURE_FLAG"; + + public final static String PCD_ITEM_TYPE_FIXED_AT_BUILD = "FIXED_AT_BUILD"; + + public final static String PCD_ITEM_TYPE_PATCHABLE_IN_MODULE = "PATCHABLE_IN_MODULE"; + + public final static String PCD_ITEM_TYPE_DYNAMIC = "DYNAMIC"; + + public final static String PCD_ITEM_TYPE_DYNAMIC_EX = "DYNAMIC_EX"; + // // The String for PPI type // diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java index 4ffca7af59..408e75e812 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java @@ -709,11 +709,11 @@ public class EnumerationData { private void initPcdItemTypes() { vPcdItemTypes.removeAllElements(); - vPcdItemTypes.addElement("FEATURE_FLAG"); - vPcdItemTypes.addElement("FIXED_AT_BUILD"); - vPcdItemTypes.addElement("PATCHABLE_IN_MODULE"); - vPcdItemTypes.addElement("DYNAMIC"); - vPcdItemTypes.addElement("DYNAMIC_EX"); + vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG); + vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FIXED_AT_BUILD); + vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_PATCHABLE_IN_MODULE); + vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC); + vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC_EX); } private void initPcdUsage() { diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java index dedbdddf20..c27b81eea0 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java @@ -458,7 +458,31 @@ public class WorkspaceTools { String help = spd.getPcdDeclarations().getPcdEntryList().get(index).getHelpText(); Vector type = Tools.convertListToVector(spd.getPcdDeclarations().getPcdEntryList() .get(index).getValidUsage()); - + // + // The algorithm for PCD of msa should be: + // 1. If the type of PCD from Spd is FEATURE_FLAG, + // the type of Msa only can be FEATURE_FLAG. + // 2. If the type of PCD from Spd is not FEATURE_FLAG, + // the type of Msa could be selected from the PCD's all types and "DYNAMIC" type. + // + boolean hasFEATURE_FLAG = false; + boolean hasDYNAMIC = false; + for (int indexOfType = 0; indexOfType < type.size(); indexOfType++) { + if (type.elementAt(indexOfType).equals(DataType.PCD_ITEM_TYPE_DYNAMIC)) { + hasDYNAMIC = true; + } + if(type.elementAt(indexOfType).equals(DataType.PCD_ITEM_TYPE_FEATURE_FLAG)) { + hasFEATURE_FLAG = true; + } + } + if (hasFEATURE_FLAG) { + type.removeAllElements(); + type.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG); + } else { + if (!hasDYNAMIC) { + type.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC); + } + } vector.addPcd(new PcdIdentification(name, guidCName, help, type)); } }