Commit 0911e240 authored by hrchilds's avatar hrchilds
Browse files

If we are reading a virtual database and the format has variant DB metadata

and if we don't have permissions to access one of the time slices, then
VisIt's GUI was dying because of an uncaught exception.  (Fixed.)


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12545 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7faa52a1
......@@ -575,34 +575,36 @@ GUIBase::RestoreCursor()
// Added extra parameter telling ClearFile whether or not we want it
// to forget about which plugin opened a file. Here, we don't.
//
// Hank Childs, Sun Sep 19 18:48:17 PDT 2010
// Catch exception for not being able to read database meta-data.
//
// ****************************************************************************
bool
GUIBase::SetOpenDataFile(const QualifiedFilename &qf, int timeState,
SimpleObserver *sob, bool reOpen)
{
const char *mName = "GUIBase::SetOpenDataFile";
bool retval = true;
//
// Clears any information about the specified file and causes it to be
// read again from the mdserver.
//
if(reOpen)
const char *mName = "GUIBase::SetOpenDataFile";
TRY
{
fileServer->ClearFile(qf, false);
fileServer->CloseFile();
if(sob)
sob->SetUpdate(false);
fileServer->Notify();
}
//
// Clears any information about the specified file and causes it to be
// read again from the mdserver.
//
if(reOpen)
{
fileServer->ClearFile(qf, false);
fileServer->CloseFile();
if(sob)
sob->SetUpdate(false);
fileServer->Notify();
}
//
// If the file is not already open, read it in and tell the observers.
//
if(fileServer->GetOpenFile() != qf)
{
TRY
//
// If the file is not already open, read it in and tell the observers.
//
if(fileServer->GetOpenFile() != qf)
{
// Display a message while we open the file.
QString msg;
......@@ -631,25 +633,25 @@ GUIBase::SetOpenDataFile(const QualifiedFilename &qf, int timeState,
fileServer->Notify();
ClearStatus();
}
CATCH2(GetMetaDataException, gmde)
{
// Clear the status bar.
ClearStatus();
// Tell the user about the error.
QString msg = QObject::tr("VisIt could not open the file %1.\n\n"
"The metadata server returned the "
"following message:\n\n%2", mName).
arg(QString(qf.FullName().c_str())).
arg(QString(gmde.Message().c_str()));
debug1 << msg.toStdString().c_str() << endl;
debug1 << "Not issuing an error message because the viewer will "
<< "cover that." << endl;
//Error(msg);
retval = false;
}
ENDTRY
}
CATCH2(GetMetaDataException, gmde)
{
// Clear the status bar.
ClearStatus();
// Tell the user about the error.
QString msg = QObject::tr("VisIt could not open the file %1.\n\n"
"The metadata server returned the "
"following message:\n\n%2", mName).
arg(QString(qf.FullName().c_str())).
arg(QString(gmde.Message().c_str()));
debug1 << msg.toStdString().c_str() << endl;
debug1 << "Not issuing an error message because the viewer will "
<< "cover that." << endl;
//Error(msg);
retval = false;
}
ENDTRY
return retval;
}
......
......@@ -58,6 +58,8 @@
#include <QToolBar>
#include <QToolButton>
#include <GetMetaDataException.h>
#include <ViewerProxy.h>
#include <PlotList.h>
#include <FileServerList.h>
......@@ -1615,53 +1617,65 @@ QvisPlotManagerWidget::EnablePluginMenus()
// Rob Sisneros, Sun Aug 29 20:13:10 CDT 2010
// Add support for operators that create expressions.
//
// Hank Childs, Sun Sep 19 18:48:17 PDT 2010
// Catch exception when database meta-data can't be read.
//
// ****************************************************************************
bool
QvisPlotManagerWidget::PopulateVariableLists(VariableMenuPopulator &populator,
const QualifiedFilename &filename)
{
// Get a pointer to the specified file's metadata object.
const avtDatabaseMetaData *md =
fileServer->GetMetaData(filename,
GetStateForSource(filename),
FileServerList::ANY_STATE,
!FileServerList::GET_NEW_MD);
OperatorPluginManager *oPM = GetViewerProxy()->GetOperatorPluginManager();
if (fileServer->GetTreatAllDBsAsTimeVarying() ||
(md && md->GetMustRepopulateOnStateChange()))
TRY
{
// we need metadata and sil for current state
md = fileServer->GetMetaData(filename,
GetStateForSource(filename),
!FileServerList::ANY_STATE,
FileServerList::GET_NEW_MD);
const avtSIL *sil =
fileServer->GetSIL(filename,
GetStateForSource(filename),
!FileServerList::ANY_STATE,
FileServerList::GET_NEW_MD);
return populator.PopulateVariableLists(filename.FullName(),
md, sil, exprList, oPM,
fileServer->GetTreatAllDBsAsTimeVarying());
// Get a pointer to the specified file's metadata object.
const avtDatabaseMetaData *md =
fileServer->GetMetaData(filename,
GetStateForSource(filename),
FileServerList::ANY_STATE,
!FileServerList::GET_NEW_MD);
OperatorPluginManager *oPM = GetViewerProxy()->GetOperatorPluginManager();
if (fileServer->GetTreatAllDBsAsTimeVarying() ||
(md && md->GetMustRepopulateOnStateChange()))
{
// we need metadata and sil for current state
md = fileServer->GetMetaData(filename,
GetStateForSource(filename),
!FileServerList::ANY_STATE,
FileServerList::GET_NEW_MD);
const avtSIL *sil =
fileServer->GetSIL(filename,
GetStateForSource(filename),
!FileServerList::ANY_STATE,
FileServerList::GET_NEW_MD);
return populator.PopulateVariableLists(filename.FullName(),
md, sil, exprList, oPM,
fileServer->GetTreatAllDBsAsTimeVarying());
}
else
{
// any metadata and sil will do
const avtSIL *sil =
fileServer->GetSIL(filename,
GetStateForSource(filename),
FileServerList::ANY_STATE,
!FileServerList::GET_NEW_MD);
return populator.PopulateVariableLists(filename.FullName(),
md, sil, exprList, oPM,
fileServer->GetTreatAllDBsAsTimeVarying());
}
}
else
CATCH2(GetMetaDataException, gmde)
{
// any metadata and sil will do
const avtSIL *sil =
fileServer->GetSIL(filename,
GetStateForSource(filename),
FileServerList::ANY_STATE,
!FileServerList::GET_NEW_MD);
return populator.PopulateVariableLists(filename.FullName(),
md, sil, exprList, oPM,
fileServer->GetTreatAllDBsAsTimeVarying());
debug1 << "Unable to get metadata when populating variable list" << endl;
return false;
}
ENDTRY
}
// ****************************************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment