Modify the way of pcd warning message reporting to be a total in the end.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1948 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-11-14 07:14:04 +00:00
parent c2bf31448e
commit ed7aa83f2e
2 changed files with 26 additions and 9 deletions

View File

@ -383,7 +383,7 @@ public class FpdFileContents {
cursor.dispose(); cursor.dispose();
} }
public boolean adjustPcd (int seqModuleSa) throws Exception { public boolean adjustPcd (int seqModuleSa, Vector<String> vExceptions) throws Exception {
boolean dataModified = false; boolean dataModified = false;
ModuleSADocument.ModuleSA moduleSa = getModuleSA(seqModuleSa); ModuleSADocument.ModuleSA moduleSa = getModuleSA(seqModuleSa);
int pcdCount = getPcdDataCount(seqModuleSa); int pcdCount = getPcdDataCount(seqModuleSa);
@ -403,6 +403,7 @@ public class FpdFileContents {
getLibraryInstances(moduleKey, saaLib); getLibraryInstances(moduleKey, saaLib);
ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey); ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
if (mi == null) { if (mi == null) {
vExceptions.add("Module " + mg + " does NOT exist in workspace.");
throw new Exception ("Module does NOT exist in workspace."); throw new Exception ("Module does NOT exist in workspace.");
} }
Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>(); Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>();
@ -413,7 +414,9 @@ public class FpdFileContents {
for (int j = 0; j < saaLib.length; ++j) { for (int j = 0; j < saaLib.length; ++j) {
String libKey = saaLib[j][1] + " " + saaLib[j][2] + " " + saaLib[j][3] + " " + saaLib[j][4]; String libKey = saaLib[j][1] + " " + saaLib[j][2] + " " + saaLib[j][3] + " " + saaLib[j][4];
ModuleIdentification libMi = WorkspaceProfile.getModuleId(libKey); ModuleIdentification libMi = WorkspaceProfile.getModuleId(libKey);
vMi.add(libMi); if (libMi != null) {
vMi.add(libMi);
}
} }
nextPcd:for (int i = 0; i < saaModuleSaPcd.length; ++i) { nextPcd:for (int i = 0; i < saaModuleSaPcd.length; ++i) {
@ -458,8 +461,13 @@ public class FpdFileContents {
// //
// ToDo Error // ToDo Error
// //
throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + " in Module " String errorMessage = "No Declaration for PCD Entry " + msaPcd.getCName() + " in Module "
+ mi.getName()); + mi.getName();
if (i != 0) {
errorMessage += " Library Instance " + vMi.get(i).getName();
}
vExceptions.add(errorMessage);
throw new PcdDeclNotFound(errorMessage);
} }
// //
// AddItem to ModuleSA PcdBuildDefinitions // AddItem to ModuleSA PcdBuildDefinitions

View File

@ -672,7 +672,8 @@ public class FpdFrameworkModules extends IInternalFrame {
private void showSettingsDlg (int row) { private void showSettingsDlg (int row) {
try { try {
if (ffc.adjustPcd(row)) { Vector<String> vExceptions = new Vector<String>();
if (ffc.adjustPcd(row, vExceptions)) {
JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files."); JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");
docConsole.setSaved(false); docConsole.setSaved(false);
} }
@ -852,9 +853,17 @@ public class FpdFrameworkModules extends IInternalFrame {
public FpdFrameworkModules(OpeningPlatformType opt) { public FpdFrameworkModules(OpeningPlatformType opt) {
this(opt.getXmlFpd()); this(opt.getXmlFpd());
docConsole = opt; docConsole = opt;
if (pcdSync()) { Vector<String> vExceptions = new Vector<String>();
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.");
} }
if (vExceptions.size() > 0) {
String errorMsg = "";
for (int i = 0; i < vExceptions.size(); ++i) {
errorMsg += " " + vExceptions.get(i);
}
JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:" + errorMsg);
}
} }
private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) { private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
@ -916,16 +925,16 @@ public class FpdFrameworkModules extends IInternalFrame {
} }
private boolean pcdSync() { private boolean pcdSync(Vector<String> v) {
boolean synced = false; boolean synced = false;
for (int i = 0; i < jTableFpdModules.getRowCount(); ++i) { for (int i = 0; i < jTableFpdModules.getRowCount(); ++i) {
try { try {
if (ffc.adjustPcd(i)) { if (ffc.adjustPcd(i, v)) {
synced = true; synced = true;
} }
} }
catch (Exception exp) { catch (Exception exp) {
JOptionPane.showMessageDialog(frame, exp.getMessage()); // JOptionPane.showMessageDialog(frame, exp.getMessage());
continue; continue;
} }
} }