Commit 1b209ae1 authored by hrchilds's avatar hrchilds
Browse files

Update from March 31, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@210 18c085ea-50e0-402c-830e-de6fd14e8384
parent 2b55c980
#include <AnimationActions.h>
#include <ViewerFileServer.h>
#include <ViewerPlotList.h>
#include <ViewerWindow.h>
#include <ViewerWindowManager.h>
#include <DatabaseCorrelationList.h>
#include <DebugStream.h>
#include <qiconset.h>
#include <qpixmap.h>
......@@ -209,8 +213,41 @@ SetActiveTimeSliderAction::SetActiveTimeSliderAction(ViewerWindow *win) :
DisableVisual();
}
// ****************************************************************************
// Method: SetActiveTimeSliderAction::Execute
//
// Purpose:
// This method executes the SetActiveTimeSlider action.
//
// Programmer: Brad Whitlock
// Creation: Wed Mar 31 09:50:32 PDT 2004
//
// Modifications:
// Brad Whitlock, Wed Mar 31 09:50:37 PDT 2004
// Added code to expand the time slider name in case it contains relative
// paths, etc.
//
// ****************************************************************************
void
SetActiveTimeSliderAction::Execute()
{
windowMgr->SetActiveTimeSlider(args.GetDatabase(), windowId);
//
// If we don't find a correlation for the desired time slider, expand the
// time slider name and try and use the expanded time slider name.
//
ViewerFileServer *fs = ViewerFileServer::Instance();
DatabaseCorrelationList *cL = fs->GetDatabaseCorrelationList();
std::string tsName(args.GetDatabase());
if(cL->FindCorrelation(tsName) == 0)
{
std::string host, db;
fs->ExpandDatabaseName(tsName, host, db);
debug3 << "The new time slider had to be expanded before we could "
"use it. It was called: "
<< args.GetDatabase().c_str() << ". Now it is called: "
<< tsName.c_str() << endl;
}
windowMgr->SetActiveTimeSlider(tsName, windowId);
}
......@@ -22,7 +22,12 @@
// Programmer: Jeremy Meredith
// Creation: March 26, 2004
//
// Modifications:
// Brad Whitlock, Wed Mar 31 10:16:38 PDT 2004
// Added != operator so it builds on the SGI.
//
// ****************************************************************************
class VIEWER_API EngineKey
{
private:
......@@ -87,6 +92,12 @@ class VIEWER_API EngineKey
simName == ek.simName);
}
bool operator!=(const EngineKey &ek) const
{
return (realHostName != ek.realHostName ||
simName != ek.simName);
}
bool operator<(const EngineKey &ek) const
{
if (realHostName < ek.realHostName)
......
......@@ -59,7 +59,6 @@ using std::pair;
// it could otherwise get into an infinite loop.
//
#define ENGINE_PROXY_RPC_BEGIN(rpcname) \
cerr << "About to execute rpc="<<rpcname<<endl; \
bool retval = false; \
bool retry = false; \
int numAttempts = 0; \
......
......@@ -846,6 +846,10 @@ ViewerFileServer::ExpandDatabaseName(std::string &hostDBName,
// Brad Whitlock, Mon Jan 13 16:36:11 PST 2003
// I added code to handle a LostConnectionException.
//
// Brad Whitlock, Wed Mar 31 09:55:20 PDT 2004
// Added a call to ExpansionRequired so we can prevent calls to the
// mdserver if they are not really needed.
//
// ****************************************************************************
std::string
......@@ -854,55 +858,103 @@ ViewerFileServer::ExpandedFileName(const std::string &host,
{
std::string retval(filename);
// Try and start a server.
NoFaultStartServer(host);
if(servers.find(host) != servers.end())
//
// If filename expansion is required, expand the filename.
//
if(ExpansionRequired(filename))
{
int numAttempts = 0;
bool tryAgain = false;
// Try and start a server.
NoFaultStartServer(host);
do
if(servers.find(host) != servers.end())
{
TRY
{
retval = servers[host]->proxy->ExpandPath(filename);
tryAgain = false;
}
CATCH(LostConnectionException)
{
// Tell the GUI that the mdserver is dead.
if(numAttempts == 0)
{
char message[200];
SNPRINTF(message, 200, "The metadata server running on host "
"%s has exited abnormally. VisIt is trying to "
"restart it.", host.c_str());
Warning(message);
}
++numAttempts;
tryAgain = (numAttempts < 2);
int numAttempts = 0;
bool tryAgain = false;
do
{
TRY
{
stringVector startArgs(servers[host]->arguments);
CloseServer(host, false);
StartServer(host, startArgs);
retval = servers[host]->proxy->ExpandPath(filename);
tryAgain = false;
}
CATCHALL(...)
CATCH(LostConnectionException)
{
tryAgain = false;
// Tell the GUI that the mdserver is dead.
if(numAttempts == 0)
{
char message[200];
SNPRINTF(message, 200, "The metadata server running on host "
"%s has exited abnormally. VisIt is trying to "
"restart it.", host.c_str());
Warning(message);
}
++numAttempts;
tryAgain = (numAttempts < 2);
TRY
{
stringVector startArgs(servers[host]->arguments);
CloseServer(host, false);
StartServer(host, startArgs);
}
CATCHALL(...)
{
tryAgain = false;
}
ENDTRY
}
ENDTRY
}
ENDTRY
} while(tryAgain);
} while(tryAgain);
}
}
return retval;
}
// ****************************************************************************
// Method: ViewerFileServer::ExpansionRequired
//
// Purpose:
// Returns whether a filename needs to be expanded my the mdserver.
//
// Arguments:
// filename : The filename that we're checking for proper expansion.
//
// Returns: True if the filename needs to be expanded; false otherwise.
//
// Programmer: Brad Whitlock
// Creation: Wed Mar 31 10:00:43 PDT 2004
//
// Modifications:
//
// ****************************************************************************
bool
ViewerFileServer::ExpansionRequired(const std::string &filename) const
{
if(filename.size() > 0)
{
#if defined(_WIN32)
// Look for some drive punctuation
if(filename.find(":\\") != std::string::npos)
return true;
#else
// Make sure that we have an absolute path.
if(filename[0] != '/')
return true;
#endif
if(filename.find("~") != std::string::npos)
return true;
if(filename.find("..") != std::string::npos)
return true;
}
return false;
}
// ****************************************************************************
// Method: ViewerFileServer::StartServer
//
......
......@@ -90,6 +90,9 @@ class DataNode;
// time state is required. I added CreateNode, SetFromNode,
// DetermineVarType, GetMetaDataForState, GetSILForState.
//
// Brad Whitlock, Wed Mar 31 09:52:59 PDT 2004
// I added the ExpansionRequired method.
//
// ****************************************************************************
class ViewerFileServer : public ViewerServerManager
......@@ -204,6 +207,7 @@ protected:
const avtSIL *GetSILHelper(const std::string &host,
const std::string &db,
int timeState);
bool ExpansionRequired(const std::string &) const;
private:
static ViewerFileServer *instance;
......
......@@ -766,7 +766,12 @@ ViewerServerManager::OpenWithLauncher(
// Programmer: Jeremy Meredith
// Creation: March 30, 2004
//
// Modifications:
// Brad Whitlock, Wed Mar 31 10:20:33 PDT 2004
// Fixed code so it builds on the SGI.
//
// ****************************************************************************
void
ViewerServerManager::SimConnectThroughLauncher(const std::string &remoteHost,
const stringVector &args,
......@@ -782,7 +787,7 @@ ViewerServerManager::SimConnectThroughLauncher(const std::string &remoteHost,
{
// We use the data argument to pass in a pointer to the connection
// progress window.
typedef struct {string h; int p;} SimData;
typedef struct {std::string h; int p;} SimData;
SimData *simData = (SimData*)data;
// Search the args list and see if we've supplied the path to
......
......@@ -1280,7 +1280,10 @@ visit_AnimationSetFrame(PyObject *self, PyObject *args)
// Creation: Tue Mar 2 09:13:29 PDT 2004
//
// Modifications:
//
// Brad Whitlock, Wed Mar 31 11:21:10 PDT 2004
// I removed the invalid time slider check so it can be handled more
// appropriately in the viewer.
//
// ****************************************************************************
STATIC PyObject *
......@@ -1295,19 +1298,6 @@ visit_SetActiveTimeSlider(PyObject *self, PyObject *args)
if(!PyArg_ParseTuple(args, "s", &tsName))
return NULL;
//
// Make sure that the time slider has a correlation. If not, it is not
// a valid time slider.
//
DatabaseCorrelationList *correlations = viewer->GetDatabaseCorrelationList();
DatabaseCorrelation *c = correlations->FindCorrelation(tsName);
if(c == 0)
{
fprintf(stderr, "You cannot set the active time slider to \"%s\" "
"because there is no such time slider.\n", tsName);
return NULL;
}
MUTEX_LOCK();
viewer->SetActiveTimeSlider(tsName);
if(logging)
......
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