set MaxDatumSize for PcdData.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1178 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-08-02 09:34:27 +00:00
parent 1faac7b69f
commit 802e005517
2 changed files with 28 additions and 2 deletions

View File

@ -906,6 +906,25 @@ public class FpdFileContents {
fpdPcd.setTokenSpaceGuidCName(tsGuid);
fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType));
fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType));
if (dataType.equals("UINT8")){
fpdPcd.setMaxDatumSize(1);
}
if (dataType.equals("UINT16")) {
fpdPcd.setMaxDatumSize(2);
}
if (dataType.equals("UINT32")) {
fpdPcd.setMaxDatumSize(4);
}
if (dataType.equals("UINT64")){
fpdPcd.setMaxDatumSize(8);
}
if (dataType.equals("BOOLEAN")){
fpdPcd.setMaxDatumSize(1);
}
if (dataType.equals("VOID*")) {
int maxSize = setMaxSizeForPointer(fpdPcd.getValue());
fpdPcd.setMaxDatumSize(maxSize);
}
if (itemType.equals("DYNAMIC") || itemType.equals("DYNAMIC_EX")) {
ArrayList<String> al = LookupDynamicPcdBuildDefinition(cName + " " + tsGuid);
@ -932,6 +951,7 @@ public class FpdFileContents {
fpdPcd.setValue("");
}
}
/*
if (dataType.equals("UINT8")){
fpdPcd.setMaxDatumSize(1);
}
@ -951,6 +971,7 @@ public class FpdFileContents {
int maxSize = setMaxSizeForPointer(fpdPcd.getValue());
fpdPcd.setMaxDatumSize(maxSize);
}
*/
}
}

View File

@ -93,6 +93,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
private DefaultTableModel optionsTableModel = null;
private FpdFileContents ffc = null;
private String moduleKey = null;
private int moduleSaNum = -1;
private HashMap<String, ArrayList<String>> classInstanceMap = null;
private ArrayList<String> classProduced = null;
private HashMap<String, ArrayList<String>> classConsumed = null;
@ -135,6 +136,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
public void setKey(String k, int i, OpeningPlatformType dc){
this.moduleKey = k;
moduleSaNum = i;
this.docConsole = dc;
classProduced = null;
classConsumed = null;
@ -196,14 +198,17 @@ public class FpdModuleSA extends JDialog implements ActionListener {
//
// display module SA options
//
jTextFieldFvBinding.setText("");
String fvBinding = ffc.getFvBinding(key);
if (fvBinding != null) {
jTextFieldFvBinding.setText(fvBinding);
}
jTextFieldFileGuid.setText("");
String fileGuid = ffc.getFfsFileNameGuid(key);
if (fileGuid != null) {
jTextFieldFileGuid.setText(fileGuid);
}
jTextFieldFfsKey.setText("");
String ffsKey = ffc.getFfsFormatKey(key);
if (ffsKey != null) {
jTextFieldFfsKey.setText(ffsKey);
@ -471,7 +476,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
jPanelPcd.add(getJPanelPcdSouth(), java.awt.BorderLayout.SOUTH);
jPanelPcd.addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent e) {
// initPcdBuildDefinition(moduleKey);
initPcdBuildDefinition(moduleSaNum);
}
});
@ -1183,7 +1188,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
private JTextField getJTextFieldFfsKey() {
if (jTextFieldFfsKey == null) {
jTextFieldFfsKey = new JTextField();
jTextFieldFfsKey.setPreferredSize(new java.awt.Dimension(150,20));
jTextFieldFfsKey.setPreferredSize(new java.awt.Dimension(250,20));
jTextFieldFfsKey.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
String originalFfsKey = ffc.getFfsFormatKey(moduleKey);