Commit 62d14d9a authored by bonnell's avatar bonnell

1. Added error checking for Lineout parameters passed via Query (eg from CLI...

1. Added error checking for Lineout parameters passed via Query (eg from CLI or Query Window, not Lineout tool). Resolves #1292
2. Removed extraneous Logging of Picks/Queries/Lineout. Resolves #1298

As a consequence of looking into the two above:
3. Added logging for GetQueryParameters.
4. Added logic to handle GetQueryParameters for Lineout.
5. Updated cli Lineout method to handle named parameters the same way that Query("Lineout") does.
6. Reduced number of times SetQueryFloatFormat is called when using the gui to do a Query.  Noticed it cropping up during Command Recording every time a query was performed, regardless of whether or not the format had changed in between.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@19967 18c085ea-50e0-402c-830e-de6fd14e8384
parent 38e8f2e3
......@@ -109,12 +109,17 @@ using std::string;
// Kathleen Bonnell, Tue Jun 24 11:18:13 PDT 2008
// Added queryVarTypes, the default types of vars for queries.
//
// Kathleen Biagas, Wed Jan 9 13:45:16 PST 2013
// Store currentFloatFormat so that the floatFormat will only be sent to
// viewer when it has changed. (Reduces log messages).
//
// ****************************************************************************
QvisQueryWindow::QvisQueryWindow(const QString &caption,
const QString &shortName, QvisNotepadArea *n) :
QvisPostableWindowSimpleObserver(caption, shortName, n, NoExtraButtons,
false)
false),
currentFloatFormat()
{
queries = 0;
queryAtts = 0;
......@@ -1313,6 +1318,9 @@ QvisQueryWindow::ConnectPlotList(PlotList *pl)
// Moved majority of query execution logic to ExecuteStandardQuery().
// Added path for executing python queries via ExecutePythonQuery().
//
// Kathleen Biagas, Wed Jan 9 13:45:16 PST 2013
// Only send float format if it has changed. (Reduces log messages).
//
// ****************************************************************************
void
......@@ -1328,7 +1336,11 @@ QvisQueryWindow::Apply(bool ignore)
return;
}
GetViewerMethods()->SetQueryFloatFormat(format);
if (format != currentFloatFormat)
{
GetViewerMethods()->SetQueryFloatFormat(format);
currentFloatFormat = format;
}
if(AutoUpdate() || ignore)
{
......
......@@ -139,6 +139,10 @@ class QvisXRayImageQueryWidget;
// QvisXRayImageQueryWidget, QvisLineoutWidget, QvisTimeQueryOptionsWidget,
// which provide controls for specific queries.
//
// Kathleen Biagas, Wed Jan 9 13:45:16 PST 2013
// Store currentFloatFormat so that the floatFormat will only be sent to
// viewer when it has changed. (Reduces log messages).
//
// ****************************************************************************
class GUI_API QvisQueryWindow : public QvisPostableWindowSimpleObserver
......@@ -220,6 +224,7 @@ private:
int saveCount;
int queryVarTypes;
std::string currentFloatFormat;
QWidget *pyQueryWidget;
QLabel *pyFilterEditLabel;
......
......@@ -47,6 +47,8 @@ list of changes in release 2.6.</p>
<li>An error was corrected in the WriteScript python function where GetCurveView was incorrectly used instead of GetViewCurve. Thanks Jean Favre for the fix.</li>
<li>Pathlines again work when running in serial.</li>
<li>The FTLE operator no longer issues many print statements, which slowed down client-server performance.</li>
<li>A viewer crash when doing lineouts from the cli with incorrect parameters was fixed. An error message will now be generated instaead.</li>
<li>Extraneous Pick/Query log messages printed to visitlog.py and during Command recording were cleaned up.</li>
</ul>
<p><b><font size="4">Enhancements in version 2.6.1</font></b></p>
......
......@@ -1399,6 +1399,9 @@ ViewerQueryManager::DatabaseQuery(const MapNode &queryParams)
// Changed arg to MapNode, changes within to reflect this change.
// Removed modifications notes older than 2009.
//
// Kathleen Biagas, Tue Jan 8 10:40:08 PST 2013
// Added error checking of queryParams.
//
// ****************************************************************************
void
......@@ -1407,8 +1410,62 @@ ViewerQueryManager::StartLineQuery(const MapNode &queryParams)
string qName = queryParams.GetEntry("query_name")->AsString();
if (qName == "Lineout")
{
doubleVector pt1 = queryParams.GetEntry("start_point")->AsDoubleVector();
doubleVector pt2 = queryParams.GetEntry("end_point")->AsDoubleVector();
doubleVector pt1, pt2;
if (queryParams.HasEntry("start_point"))
{
if (queryParams.GetEntry("start_point")->TypeName() == "doubleVector")
{
pt1 = queryParams.GetEntry("start_point")->AsDoubleVector();
}
else if (queryParams.GetEntry("start_point")->TypeName() == "intVector")
{
intVector ipt1 = queryParams.GetEntry("start_point")->AsIntVector();
for (size_t i = 0; i < ipt1.size(); ++i)
pt1.push_back(double(ipt1[i]));
}
else
{
Error(tr("Lineout error processing start_point argument."));
return;
}
}
else
{
Error(tr("Lineout requires start_point argument."));
return;
}
if (queryParams.HasEntry("end_point"))
{
if (queryParams.GetEntry("end_point")->TypeName() == "doubleVector")
{
pt2 = queryParams.GetEntry("end_point")->AsDoubleVector();
}
else if (queryParams.GetEntry("end_point")->TypeName() == "intVector")
{
intVector ipt2 = queryParams.GetEntry("start_point")->AsIntVector();
for (size_t i = 0; i < ipt2.size(); ++i)
pt2.push_back(double(ipt2[i]));
}
else
{
Error(tr("Lineout error processing end_point argument."));
return;
}
}
else
{
Error(tr("Lineout requires end_point argument."));
return;
}
// from this point on, code assumes 3 coordinates, so ensure there are
for (size_t i = pt1.size(); i < 3; ++i)
{
pt1.push_back(0.);
}
for (size_t i = pt2.size(); i < 3; ++i)
{
pt2.push_back(0.);
}
viewerSubject->BlockSocketSignals(true);
//
// Can we get a lineout window?
......@@ -1456,9 +1513,11 @@ ViewerQueryManager::StartLineQuery(const MapNode &queryParams)
line.SetPoint1(&pt1[0]);
line.SetPoint2(&pt2[0]);
if (queryParams.HasEntry("num_samples"))
if (queryParams.HasEntry("use_sampling") &&
queryParams.GetEntry("use_sampling")->AsInt() == 1)
{
line.SetNumSamples(queryParams.GetEntry("num_samples")->AsInt());
if (queryParams.HasEntry("num_samples"))
line.SetNumSamples(queryParams.GetEntry("num_samples")->AsInt());
lineoutCache.forceSampling = true;
}
else
......@@ -5659,6 +5718,8 @@ ViewerQueryManager::Query(const MapNode &queryParams)
// Creation: July 15, 2011
//
// Modifications:
// Kathleen Biagas, Wed Jan 9 12:56:32 PST 2013
// Handle Lineout.
//
// ****************************************************************************
void
......@@ -5675,6 +5736,27 @@ ViewerQueryManager::GetQueryParameters(const string &qName)
queryClientAtts->SetXmlResult(sparams);
queryClientAtts->Notify();
}
else if (qName == "Lineout")
{
MapNode params;
doubleVector p1, p2;
stringVector v;
p1.push_back(0.);
p1.push_back(0.);
p1.push_back(0.);
p2.push_back(1.);
p2.push_back(0.);
p2.push_back(0.);
v.push_back("default");
params["start_point"] = p1;
params["end_point"] = p2;
params["vars"] = v;
params["use_sampling"] = 0;
params["num_samples"] = 50;
string sparams = params.ToXML();
queryClientAtts->SetXmlResult(sparams);
queryClientAtts->Notify();
}
else
{
// need an engine key, but don't necessarily need a plot, so
......
......@@ -1417,6 +1417,11 @@ static std::string log_QueryRPC(ViewerRPC *rpc)
return visitmodule() + s;
}
static std::string log_GetQueryParametersRPC(ViewerRPC *rpc)
{
return visitmodule() + std::string("GetQueryParameters(\"") + rpc->GetQueryName() + "\")\n";
}
static std::string log_CloneWindowRPC(ViewerRPC *rpc)
{
......@@ -1959,6 +1964,9 @@ static std::string log_SetPlotOrderToFirstRPC(ViewerRPC *rpc)
// Do not return early when the log file is not open because that breaks
// command recording.
//
// Kathleen Biagas, Wed Jan 9 11:32:39 PST 2013
// Added GetQueryParameters.
//
// ****************************************************************************
void
......@@ -2506,6 +2514,9 @@ LogRPCs(Subject *subj, void *)
case ViewerRPC::RenamePickLabelRPC:
str = log_RenamePickLabelRPC(rpc);
break;
case ViewerRPC::GetQueryParametersRPC:
str = log_GetQueryParametersRPC(rpc);
break;
// RPCs that we don't want to log:
case ViewerRPC::CloseRPC:
......
This diff is collapsed.
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