Commit 16ccc22c authored by bonnell's avatar bonnell

Fix logging of time_options for Time Picks

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23053 18c085ea-50e0-402c-830e-de6fd14e8384
parent 4989b501
......@@ -25,6 +25,7 @@ list of changes in release 2.7.</p>
<p><b><font size="4">Bugs fixed in version 2.7.3</font></b></p>
<ul>
<li>The failure of ray-casted volume plot to correctly parse a compound var (eg <i>"foo/bar/density"</i>) when in log-scale mode was corrected (<a href="https://visitbugs.ornl.gov/issues/1778">ticket #1778</a>).</li>
<li>Command recording for Time picks resulted in an empty 'time_options' argument (<a href="https://visitbugs.ornl.gov/issues/1778">ticket #1780</a>).</li>
<li></li>
</ul>
......
......@@ -1290,6 +1290,9 @@ static std::string log_SetRenderingAttributesRPC(ViewerRPC *rpc)
// Kathleen Biagas, Thu Jan 10 09:06:08 PST 2013
// Added some type checking.
//
// Kathleen Biagas, Mon Mar 24 16:24:01 PDT 2014
// Log time_options for time picks.
//
//*****************************************************************************
static std::string log_QueryRPC(ViewerRPC *rpc)
......@@ -1345,11 +1348,28 @@ static std::string log_QueryRPC(ViewerRPC *rpc)
for (size_t i = 0; i < paramNames.size(); ++i)
{
if ((paramNames[i] == "curve_plot_type" ||
paramNames[i] == "preserve_coord") &&
paramNames[i] == "preserve_coord" ||
paramNames[i] == "time_options") &&
!timePick)
continue;
if (paramNames[i] != "query_name" &&
// convert time_options from a dict to its constituent named args
if (paramNames[i] == "time_options")
{
MapNode *t_o = queryParams.GetEntry("time_options");
stringVector t_o_names;
t_o->GetEntryNames(t_o_names);
for (size_t j = 0; j < t_o->GetNumEntries(); ++j)
{
if (numPrinted > 0)
s += ", ";
s += t_o_names[j];
s += "=";
s += t_o->GetEntry(t_o_names[j])->ConvertToString();
numPrinted++;
}
}
else if (paramNames[i] != "query_name" &&
paramNames[i] != "query_type" &&
paramNames[i] != "pick_type" &&
paramNames[i] != "use_global_id" &&
......
......@@ -50,8 +50,8 @@
// ****************************************************************************
// Method: PyMapNode_Wrap
//
// Purpose:
// Converts a MapNode to a python dictonary.
// Purpose:
// Converts a MapNode to a python dictonary.
//
// Programmer: Cyrus Harrison
// Creation: Mon Dec 17 15:20:25 PST 2007
......@@ -72,18 +72,18 @@ PyMapNode_Wrap(const MapNode &node)
Py_INCREF(Py_None);
return Py_None;
}
// must be a variant, use variant helper
if(node.Type() != MapNode::EMPTY_TYPE)
{
return PyVariant_Wrap(node);
}
// we have a dict with map nodes as entries
PyObject *dict = PyDict_New();
stringVector entry_names;
node.GetEntryNames(entry_names);
node.GetEntryNames(entry_names);
for(size_t i=0;i<entry_names.size();i++)
{
const MapNode *child_node = node.GetEntry(entry_names[i]);
......@@ -93,10 +93,10 @@ PyMapNode_Wrap(const MapNode &node)
#if (PY_MAJOR_VERSION < 2) || ((PY_MAJOR_VERSION == 2) && (PY_MINOR_VERSION < 5))
char *str = new char[entry_names[i].length()+1];
strcpy(str, entry_names[i].c_str());
PyDict_SetItemString(dict, str, child);
PyDict_SetItemString(dict, str, child);
delete [] str;
#else
PyDict_SetItemString(dict, entry_names[i].c_str(), child);
PyDict_SetItemString(dict, entry_names[i].c_str(), child);
#endif
}
......@@ -107,16 +107,19 @@ PyMapNode_Wrap(const MapNode &node)
// ****************************************************************************
// Method: PyDict_To_MapNode
//
// Purpose:
// Purpose:
// Converts a python Dictionary to a MapNode.
//
// Programmer: Kathleen Bonnell
// Creation: July 13, 2011
// Programmer: Kathleen Bonnell
// Creation: July 13, 2011
//
// Modifications:
// Kathleen Biagas, Wed Sep 7 11:56:23 PDT 2011
// Allow ints and doubles in same sequence.
//
// Kathleen Biagas, Mon Mar 24 17:00:11 PDT 2014
// Parse Dict.
//
// ****************************************************************************
bool
......@@ -130,7 +133,7 @@ PyDict_To_MapNode(PyObject *obj, MapNode &mn)
PyObject *key = NULL;
PyObject *value = NULL;
while(PyDict_Next(obj, &pos, &key, &value))
while(PyDict_Next(obj, &pos, &key, &value))
{
std::string mkey;
if (PyString_Check(key))
......@@ -155,7 +158,7 @@ PyDict_To_MapNode(PyObject *obj, MapNode &mn)
mval.push_back(PyFloat_AS_DOUBLE(item));
else if (PyInt_Check(item))
mval.push_back((double)PyInt_AS_LONG(item));
else
else
{
debug3 << "PyDict_To_MapNode: tuples/lists must "
<< "contain same type." << endl;
......@@ -174,7 +177,7 @@ PyDict_To_MapNode(PyObject *obj, MapNode &mn)
nd++;
else if (PyInt_Check(item))
ni++;
else
else
no++;
}
if (no != 0)
......@@ -227,28 +230,34 @@ PyDict_To_MapNode(PyObject *obj, MapNode &mn)
}
else
{
debug3 << "PyDict_To_MapNode: type "
<< item->ob_type->tp_name
debug3 << "PyDict_To_MapNode: type "
<< item->ob_type->tp_name
<< " not currently implemented." << endl;
return false;
}
}
else if (PyFloat_Check(value))
{
mn[mkey] = (double) PyFloat_AS_DOUBLE(value);
mn[mkey] = (double) PyFloat_AS_DOUBLE(value);
}
else if (PyInt_Check(value))
{
mn[mkey] = (int) PyInt_AS_LONG(value);
mn[mkey] = (int) PyInt_AS_LONG(value);
}
else if (PyString_Check(value))
{
mn[mkey] = (std::string) PyString_AS_STRING(value);
mn[mkey] = (std::string) PyString_AS_STRING(value);
}
else if (PyDict_Check(value))
{
MapNode tmp;
if (PyDict_To_MapNode(value, tmp))
mn[mkey] = tmp;
}
else
{
debug3 << "PyDict_To_MapNode: type "
<< value->ob_type->tp_name
debug3 << "PyDict_To_MapNode: type "
<< value->ob_type->tp_name
<< " not currently implemented." << endl;
return false;
}
......
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