Commit f38a6510 authored by David E. DeMarle's avatar David E. DeMarle

export spatio temporal scripts

two new pieces of global state:
 time compartment size, the number of ranks to use per timestep
 input filepattern for readers that begin the pipeline

input filepattern used to be per source, and was specified via
the channel matching section of the dialog. Per discussion with Andy
multiple readers are not really well supported anyway so simplify
to a global filepattern.

fixed some bugs in the original plugin that this deprecates, involving
a lookup into map of views that failed with no name, and code rot
where the base paraview python API changed and made it incompatible
parent 74821f4c
......@@ -141,6 +141,7 @@ protected:
vtkSMProxy* GetFormatProxy(const std::string& filename);
friend class pqCatalystExportReaction; // access to GetView,FormatProxy
friend class pqTemporalExportReaction; // access to GetView,FormatProxy
private:
vtkSMSaveScreenshotProxy(const vtkSMSaveScreenshotProxy&) = delete;
void operator=(const vtkSMSaveScreenshotProxy&) = delete;
......
......@@ -3758,6 +3758,29 @@
</Documentation>
</IntVectorProperty>
<StringVectorProperty name="TimeInputFilePattern"
label="Input File Pattern"
number_of_elements="1"
default_values="infile_*.vti"
panel_visibility="advanced">
<Documentation>
A regular expression to that tells spatio-temporal scripts where to search for input files.
</Documentation>
</StringVectorProperty>
<IntVectorProperty name="TimeCompartmentSize"
default_values="1"
number_of_elements="1"
panel_visibility="advanced">
<IntRangeDomain name="range" min="1" max="1000" />
<Documentation>
The number of processes working together on a specific time step in a spatio-temporal style batch script.
</Documentation>
</IntVectorProperty>
<PropertyGroup label="Spatio-Temporal Controls">
<Property name="TimeInputFilePattern" />
<Property name="TimeCompartmentSize" />
</PropertyGroup>
</Proxy>
</ProxyGroup>
......
......@@ -72,7 +72,7 @@ class ViewAccessor(smtrace.RealProxyAccessor):
assert len(params) == 4
trace.append([
"STP.RegisterView(%s," % self,
" filename='%s', magnification=%s, width=%s, height=%s, tp_views)" %\
" filename='%s', magnification=%s, width=%s, height=%s, tp_views=tp_views)" %\
(params[0], params[1], params[2], params[3])])
trace.append_separator()
return trace.raw_data()
......@@ -141,7 +141,8 @@ def tp_hook(varname, proxy):
return ReaderAccessor(varname, proxy, reader_input_map[pname])
if pname and proxy.GetHints() and proxy.GetHints().FindNestedElementByName("WriterProxy"):
return WriterAccessor(varname, proxy)
if smtrace.Trace.get_registered_name(proxy, "views"):
pname = smtrace.Trace.get_registered_name(proxy, "views")
if pname:
# since view is being accessed, ensure that we were indeed saving
# rendering components.
assert export_rendering
......
......@@ -318,6 +318,8 @@ set (Module_SRCS
pqStatusBar.h
pqStreamingTestingEventPlayer.cxx
pqStreamingTestingEventPlayer.h
pqTemporalExportReaction.cxx
pqTemporalExportReaction.h
pqTestingReaction.cxx
pqTestingReaction.h
pqTextLocationWidget.cxx
......@@ -499,6 +501,7 @@ set (Module_MOC_HDRS
pqStandardViewFrameActionsImplementation.h
pqStatusBar.h
pqStreamingTestingEventPlayer.h
pqTemporalExportReaction.h
pqTestingReaction.h
pqTextLocationWidget.h
pqTimeInspectorWidget.h
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>351</width>
<height>465</height>
<height>559</height>
</rect>
</property>
<property name="windowTitle">
......@@ -358,29 +358,28 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="container" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>250</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
......
......@@ -97,6 +97,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqSetName.h"
#include "pqShowHideAllReaction.h"
#include "pqSourcesMenuReaction.h"
#include "pqTemporalExportReaction.h"
#include "pqTestingReaction.h"
#include "pqTimerLogReaction.h"
#include "pqUndoRedoReaction.h"
......@@ -695,6 +696,10 @@ void pqParaViewMenuBuilders::buildCatalystMenu(QMenu& menu, QWidget* exportConfi
QAction* gcatalyst = menu.addAction("Export Catalyst Script")
<< pqSetName("actionExportCatalyst");
new pqCatalystExportReaction(gcatalyst);
QAction* gtemporal = menu.addAction("Export Temporal Script")
<< pqSetName("actionExportTemporal");
new pqTemporalExportReaction(gtemporal);
#else
(void)exportConfiguration; // avoid unreferenced parameter comp warning
#endif
......
This diff is collapsed.
/*=========================================================================
Program: ParaView
Module: pqTemporalExportReaction.h
Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#ifndef pqTemporalExportReaction_h
#define pqTemporalExportReaction_h
#include "pqApplicationComponentsModule.h"
#include "pqReaction.h"
/**
* @ingroup Reactions
* Reaction to export a Temporal script that will produce configured catalyst data products.
*/
class PQAPPLICATIONCOMPONENTS_EXPORT pqTemporalExportReaction : public pqReaction
{
Q_OBJECT
typedef pqReaction Superclass;
public:
pqTemporalExportReaction(QAction* parent);
~pqTemporalExportReaction();
protected slots:
/**
* Called when the action is triggered.
*/
virtual void onTriggered();
private:
Q_DISABLE_COPY(pqTemporalExportReaction)
};
#endif
......@@ -328,8 +328,9 @@ class NewStyleWriters(object):
"""Helper to dump configured writer proxies, which are not in the pipeline,
into the script."""
def __init__(self):
def __init__(self, make_temporal_script=False):
self.__cnt = 1
self.__make_temporal_script = make_temporal_script
def __make_name(self, name):
"""
......@@ -391,8 +392,12 @@ class NewStyleWriters(object):
varname = self.__make_name(prototype.GetXMLLabel())
f = "%s = servermanager.writers.%s(Input=%s)" % (varname, writername, inputname)
res.append(f)
f = "coprocessor.RegisterWriter(%s, filename='%s', freq=%s, paddingamount=%s)" % (
varname, filename, write_frequency, padding_amount)
if self.__make_temporal_script:
f = "STP.RegisterWriter(%s, '%s', tp_writers)" % (
varname, filename)
else:
f = "coprocessor.RegisterWriter(%s, filename='%s', freq=%s, paddingamount=%s)" % (
varname, filename, write_frequency, padding_amount)
res.append(f)
res.append("")
if len(res) == 2:
......
......@@ -84,7 +84,7 @@ def CreateReader(ctor, fileInfo, **kwargs):
import glob
files = glob.glob(fileInfo)
files.sort() # assume there is a logical ordering of the filenames that corresponds to time ordering
reader = ctor(FileName=files)
reader = paraview.simple.OpenDataFile(files)
CheckReader(reader)
if kwargs:
pvsimple.SetProperties(reader, **kwargs)
......@@ -103,7 +103,7 @@ def CreateView(proxy_ctor, filename, magnification, width, height, tp_views):
view = proxy_ctor()
return RegisterView(view, filename, magnification, width, height, tp_views)
def RegisterView(view, filename, magnification, width, height, tp_views):
def RegisterView(view, filename='filename_%t.vti', magnification=1.0, width=1024, height=1024, tp_views=[]):
view.add_attribute("tpFileName", filename)
view.add_attribute("tpMagnification", magnification)
tp_views.append(view)
......
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