Commit 14750ee7 authored by hrchilds's avatar hrchilds

Update from April 1, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@211 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1b209ae1
......@@ -11,24 +11,20 @@ import os, string, sys, thread
# Programmer: Brad Whitlock
# Date: Wed Dec 18 11:33:22 PDT 2002
#
# Modifications:
#
# Hank Childs, Thu Apr 1 09:33:16 PST 2004
# Simplified a bit (previous implementation was not portable).
#
###############################################################################
def CommandInPath(command):
retval = 0
if(sys.platform != "win32"):
# Look for the command using the which command
cmd = "which %s" % command
f = os.popen(cmd)
lines = f.readlines()
f.close()
# Glue the lines together.
str = ""
for line in lines:
str = str + line
# See if the command could not be found
noFail1 = (str.find("no %s in" % command) == -1)
noFail2 = (str.find("Command not found") == -1)
if(noFail1 and noFail2):
cmd = "which %s > /dev/null" % command
rv = os.system(cmd)
if (rv == 0):
retval = 1
return retval
......@@ -149,15 +145,20 @@ def removeFiles(format, nframes):
# Programmer: Brad Whitlock
# Date: Wed Dec 18 11:33:22 PDT 2002
#
# Modifications:
#
# Hank Childs, Thu Apr 1 07:48:41 PST 2004
# Added frames per second.
#
###############################################################################
def createQuickTimeFile(moviename, baseFormat, start, end, xres, yres):
def createQuickTimeFile(moviename, baseFormat, start, end, xres, yres, fps):
names = ""
for i in range(start, end):
filename = baseFormat % i
names = names + " " + filename
# Create the movie file.
command = "dmconvert -f qt -p video,comp=qt_mjpega,inrate=15,rate=15 %s %s" % (names, moviename)
command = "dmconvert -f qt -p video,comp=qt_mjpega,inrate=%d,rate=%d %s %s" % (fps, fps, names, moviename)
#print command
os.system(command)
......@@ -170,6 +171,11 @@ def createQuickTimeFile(moviename, baseFormat, start, end, xres, yres):
# Programmer: Brad Whitlock
# Date: Wed Dec 18 11:33:22 PDT 2002
#
# Modifications:
#
# Hank Childs, Thu Apr 1 07:52:00 PST 2004
# Added frames per second.
#
###############################################################################
def EncodeQuickTimeMovieHelper(threadID, start, end, conversionargs):
......@@ -178,9 +184,10 @@ def EncodeQuickTimeMovieHelper(threadID, start, end, conversionargs):
baseFormat = conversionargs[1]
xres = conversionargs[2]
yres = conversionargs[3]
fps = conversionargs[4]
# Create the name of the part of the movie and the names of the files to use.
subMovieName = "%s.%d" % (moviename, threadID)
createQuickTimeFile(subMovieName, baseFormat, start, end, xres, yres)
createQuickTimeFile(subMovieName, baseFormat, start, end, xres, yres, fps)
###############################################################################
# Function: MovieClassSaveWindow
......@@ -226,6 +233,9 @@ class MakeMovie:
# Brad Whitlock, Fri Oct 3 11:14:50 PDT 2003
# Added support for processing Python files.
#
# Hank Childs, Wed Mar 31 08:44:34 PST 2004
# Added frames per second.
#
###########################################################################
def __init__(self):
......@@ -255,6 +265,7 @@ class MakeMovie:
self.xres = 512
self.yres = 512
self.tmpDir = os.curdir
self.fps = 10
# Set the slash used in filenames based on the platform.
self.slash = "/"
......@@ -277,6 +288,9 @@ class MakeMovie:
# Brad Whitlock, Fri Oct 3 11:16:12 PDT 2003
# Added -scriptfile.
#
# Hank Childs, Wed Mar 31 08:44:34 PST 2004
# Added -fps.
#
###########################################################################
def PrintUsage(self):
......@@ -335,6 +349,9 @@ class MakeMovie:
print " -output moviename The output option lets you set the name of "
print " your movie."
print ""
print " -fps number Sets the frames per second the movie should "
print " play at."
print ""
###########################################################################
# Method: Debug
......@@ -409,6 +426,9 @@ class MakeMovie:
# I made it set the movieBase from the session or script filename
# if -output was not given.
#
# Hank Childs, Wed Mar 31 08:44:34 PST 2004
# Parse -fps.
#
###########################################################################
def ProcessArguments(self):
......@@ -498,6 +518,18 @@ class MakeMovie:
else:
self.PrintUsage()
sys.exit(-1)
elif(sys.argv[i] == "-fps"):
if((i+1) < len(sys.argv)):
try:
self.fps = int(sys.argv[i+1])
if(self.fps < 1):
self.frameStep = 10
except ValueError:
self.fps = 10
print "A bad value was provided for frames per second. Using 10."
i = i + 1
else:
self.PrintUsage()
elif(sys.argv[i] == "-geometry"):
if((i+1) < len(sys.argv)):
geometry = sys.argv[i+1]
......@@ -759,6 +791,9 @@ class MakeMovie:
# Hank Childs, Sat Mar 27 11:51:10 PST 2004
# Don't do such aggressive compression.
#
# Hank Childs, Wed Mar 31 08:50:48 PST 2004
# Backed off compression even more. Allow for fps to be set as well.
#
###########################################################################
def EncodeMPEGMovie(self):
......@@ -772,6 +807,29 @@ class MakeMovie:
if(ext != ".mpeg"):
moviename = self.movieBase + ".mpeg"
# We can only drive the movie at 30 fps. So if the user wants
# a movie at 10 fps, we have to pad frames. Determine what that
# pad rate is.
pad_rate=-1
for i in range(1,31):
if (pad_rate < 0):
if ((30./i) <= self.fps):
pad_rate = i
if ((30./i) != self.fps):
print "Because of limitations in MPEG encoding, the "
print "movie will be encoded at %f frames per second" %(30./i)
# Now create symbolic links to the images at that pad rate.
linkbase = self.frameBase+"link"
linkindex = 0
for i in range(self.numFrames):
imgname=self.frameBase+"%04d.ppm" %(i)
for j in range(pad_rate):
linkname=self.tmpDir+"/"+linkbase+"%04d.ppm"%(linkindex)
linkindex += 1
os.symlink(imgname, linkname)
nframes=pad_rate*self.numFrames
f = open(paramFile, "w")
f.write("PATTERN IBBPBBPBBPBBPBB\n")
f.write("OUTPUT %s\n" % moviename)
......@@ -782,16 +840,16 @@ class MakeMovie:
f.write("RANGE 10\n")
f.write("PSEARCH_ALG TWOLEVEL\n")
f.write("BSEARCH_ALG SIMPLE\n")
f.write("IQSCALE 2\n")
f.write("PQSCALE 2\n")
f.write("BQSCALE 2\n")
f.write("IQSCALE 1\n")
f.write("PQSCALE 1\n")
f.write("BQSCALE 1\n")
f.write("REFERENCE_FRAME DECODED\n")
f.write("FORCE_ENCODE_LAST_FRAME\n")
f.write("YUV_SIZE %dx%d\n" % (self.xres, self.yres))
f.write("INPUT_CONVERT *\n")
f.write("INPUT_DIR %s\n" % self.tmpDir)
f.write("INPUT\n")
f.write("%s*.ppm [0000-%04d]\n" % (self.frameBase, self.numFrames-1))
f.write("%s*.ppm [0000-%04d]\n" % (linkbase, nframes-1))
f.write("END_INPUT\n")
f.close();
......@@ -800,7 +858,15 @@ class MakeMovie:
r = os.system(command)
# Remove the param file.
RemoveFile(paramFile);
#RemoveFile(paramFile);
# Remove the symbolic links.
linkindex = 0
for i in range(self.numFrames):
for j in range(pad_rate):
linkname=self.tmpDir+"/"+linkbase+"%04d.ppm"%(linkindex)
#RemoveFile(linkname)
linkindex += 1
retval = (r == 0)
except IOError:
......@@ -823,6 +889,11 @@ class MakeMovie:
# Programmer: Brad Whitlock
# Date: Mon Jul 28 13:58:06 PST 2003
#
# Modifications:
#
# Hank Childs, Thu Apr 1 07:48:41 PST 2004
# Set frames per second.
#
###########################################################################
def EncodeQuickTimeMovie(self):
......@@ -839,9 +910,10 @@ class MakeMovie:
baseFormat = "%s%s%s%%04d.%s" % (self.tmpDir, self.slash, self.frameBase, ext)
xres = self.xres
yres = self.yres
fps = self.fps
# Create small quicktime movies
conversionargs = (moviename, baseFormat, xres, yres)
conversionargs = (moviename, baseFormat, xres, yres, fps)
framesPerMovie = 50
nframes = self.numFrames
applyFunctionToNFrames(EncodeQuickTimeMovieHelper, framesPerMovie, nframes, conversionargs)
......@@ -850,7 +922,7 @@ class MakeMovie:
if(nSubMovies * framesPerMovie < nframes):
nSubMovies = nSubMovies + 1
subMovieFormat = "%s.%%d" % moviename
createQuickTimeFile(moviename, subMovieFormat, 0, nSubMovies, xres, yres)
createQuickTimeFile(moviename, subMovieFormat, 0, nSubMovies, xres, yres, fps)
# Delete the submovies.
removeFiles(subMovieFormat, nSubMovies)
retval = 1
......@@ -870,6 +942,11 @@ class MakeMovie:
# Programmer: Brad Whitlock
# Date: Mon Jul 28 13:58:06 PST 2003
#
# Modifications:
#
# Hank Childs, Thu Apr 1 07:45:06 PST 2004
# Added frames per second.
#
###########################################################################
def EncodeStreamingMovie(self):
......@@ -887,7 +964,7 @@ class MakeMovie:
moviename = self.movieBase + ".sm"
# Execute the img2sm command
command = "img2sm -rle -first 0 -last %d -form tiff %s %s" % (self.numFrames-1, format, moviename)
command = "img2sm -rle -FPS %d -first 0 -last %d -form tiff %s %s" % (self.fps, self.numFrames-1, format, moviename)
self.Debug(command)
os.system(command)
retval = 1
......
......@@ -313,6 +313,9 @@ $0 = shift @ARGV;
# I added support for a manual plugin installation destination. Simply
# set the VISITPLUGININST environment variable before running xml2makefile.
#
# Jeremy Meredith, Thu Apr 1 16:11:43 PST 2004
# Made the new parallel argument stuff backwards-compatible.
#
###############################################################################
......@@ -346,7 +349,7 @@ while ($tmpdir =~ s|(/\./)|/|) {}
# compress out remaining /dir/.. forms
while ($tmpdir =~ s|(/[^/]+/\.\.)||) {}
# Note: the above ".."-compression is safe because we already determined we
# Note: the above ".."-compression is safe because we already determined we
# had an absolute path, we know the substitution goes left-to-right, and
# we cannot legally .. above the root of the directory tree. If at some
# point these assumptions change, we can use the following line instead,
......@@ -697,13 +700,15 @@ if (($procs_set) and ($procs < 1))
exit 1;
}
@engine_parallel_args = ();
$had_to_strip_parallel_args = 0;
if ((($parallel) or ($launchengine)) and
($exe_name ne "engine") and
(($exe_name ne "vcl") or (!$parlaunch_set)))
{
$had_to_strip_parallel_args = 1;
# If we're trying to run in parallel, or we've been explicitly
# told to launch an engine, add any parallel arguments back on
@engine_parallel_args = ();
push @engine_parallel_args, "-par" if ($parallel && !$procs_set);
push @engine_parallel_args, "-l", $launch if ($launch_set);
push @engine_parallel_args, "-la", "@launchargs" if ($launchargs_set);
......@@ -714,12 +719,6 @@ if ((($parallel) or ($launchengine)) and
push @engine_parallel_args, "-b", $bank if ($bank_set);
push @engine_parallel_args, "-t", $time if ($time_set);
if (scalar(@engine_parallel_args) > 0)
{
$engine_arg_string = ";".join(';', @engine_parallel_args);
push @visitargs, "-engineargs", $engine_arg_string;
}
# ... but don't confuse the script
$parallel=0;
$launchargs_set=0;
......@@ -943,7 +942,7 @@ else
if ($ver_set && ! grep /$ver/, @exeversions)
{
print STDERR "Version $ver of '$exe_name' does not exist.\n";
if ($exe_name eq "engine_par")
if ($exe_name eq "engine_par")
{
print STDERR "Note that the serial engine may still work.\n";
}
......@@ -969,15 +968,51 @@ else
($ver_major = $ver) =~ s/^(\d+)\.\d+$/$1/;
($ver_minor = $ver) =~ s/^\d+\.(\d+)$/$1/;
($ver_tiny = 0);
($ver_beta = 0);
}
elsif (grep /^\d+\.\d+\.\d+$/, $ver)
{
($ver_major = $ver) =~ s/^(\d+)\.\d+\.\d+$/$1/;
($ver_minor = $ver) =~ s/^\d+\.(\d+)\.\d+$/$1/;
($ver_tiny = $ver) =~ s/^\d+\.\d+\.(\d+)$/$1/;
($ver_beta = 0);
}
elsif (grep /^\d+\.\d+b\d+$/, $ver)
{
($ver_major = $ver) =~ s/^(\d+)\.\d+b\d+$/$1/;
($ver_minor = $ver) =~ s/^\d+\.(\d+)b\d+$/$1/;
($ver_tiny = 0);
($ver_beta = $ver) =~ s/^\d+\.\d+b(\d+)$/$1/;
}
elsif (grep /^\d+\.\d+\.\d+b\d+$/, $ver)
{
($ver_major = $ver) =~ s/^(\d+)\.\d+\.\d+b\d+$/$1/;
($ver_minor = $ver) =~ s/^\d+\.(\d+)\.\d+b\d+$/$1/;
($ver_tiny = $ver) =~ s/^\d+\.\d+\.(\d+)b\d+$/$1/;
($ver_beta = $ver) =~ s/^\d+\.\d+\.\d+b(\d+)$/$1/;
}
}
if ($had_to_strip_parallel_args)
{
if ($ver_major == 1 and $ver_minor < 3)
{
if (scalar(@engine_parallel_args) > 0)
{
push @visitargs, @engine_parallel_args;
}
}
else
{
if (scalar(@engine_parallel_args) > 0)
{
$engine_arg_string = ";".join(';', @engine_parallel_args);
push @visitargs, "-engineargs", $engine_arg_string;
}
}
}
# Confirm we have found some version
$msg = "";
if (! -e "$visitbindir/$exe_name")
......@@ -1060,16 +1095,16 @@ if (!defined($ENV{VISITPLUGININST}))
$shouldinstallprivate = $publicversion;
foreach (@plugincategories)
{
$shouldinstallprivate=1 if (! -w "$visitplugins/$_");
$shouldinstallprivate=1 if (! -w "$visitplugins/$_");
}
if ($shouldinstallprivate)
{
$ENV{VISITPLUGININST}="$visitprivateplugins";
$ENV{VISITPLUGININST}="$visitprivateplugins";
}
else
{
$ENV{VISITPLUGININST}="$visitplugins";
$ENV{VISITPLUGININST}="$visitplugins";
}
}
......@@ -1116,7 +1151,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
if ($launch eq "mpirun")
{
@parcmd = ("mpirun");
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-np", $procs if $procs_set;
push @parcmd, "-p", $part if $part_set;
push @parcmd, @visitcmd;
......@@ -1129,7 +1164,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
elsif ($launch eq "dmpirun")
{
@parcmd = ("dmpirun");
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-np", $procs if $procs_set;
push @parcmd, "-p", $part if $part_set;
push @parcmd, @visitcmd;
......@@ -1142,7 +1177,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
elsif ($launch eq "poe")
{
@parcmd = @visitcmd;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-procs", $procs if $procs_set;
push @parcmd, "-nodes", $nodes if $nodes_set;
push @parcmd, "-rmpool", $part if $part_set;
......@@ -1155,7 +1190,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
elsif ($launch eq "prun")
{
@parcmd = ("prun");
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-n", $procs if $procs_set;
push @parcmd, "-N", $nodes if $nodes_set;
push @parcmd, "-p", $part if $part_set;
......@@ -1169,7 +1204,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
elsif (substr($launch,0,4) eq "srun")
{
@parcmd = ("srun");
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-n", $procs if $procs_set;
push @parcmd, "-N", $nodes if $nodes_set;
push @parcmd, "-J", $name if $name_set;
......@@ -1197,7 +1232,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
}
if ($security_key_set) { push @visitcmd, "-key", $security_key; }
@parcmd = ("psub");
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-x";
push @parcmd, "-g", $procs if $procs_set;
push @parcmd, "-ln", $nodes if $nodes_set;
......@@ -1218,7 +1253,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
if ($security_key_set) { push @visitcmd, "-key", $security_key; }
@parcmd = ("bsub");
push @parcmd, "-I";
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-n", $procs if $procs_set;
push @parcmd, "-q", $part if $part_set;
push @parcmd, "-W" , $time if $time_set;
......@@ -1231,7 +1266,7 @@ if ($procs_set or ($parallel and $parlaunch_set))
elsif ($launch eq "yod")
{
@parcmd = ("/cougar/bin/yod");
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, @launchargs if $launchargs_set;
push @parcmd, "-sz", $procs if $procs_set;
push @parcmd, @visitcmd;
......
......@@ -219,6 +219,9 @@
# Brad Whitlock, Thu Jan 22 14:06:37 PST 2004
# I added DatabaseCorrelation, and DatabaseCorrelationList.
#
# Kathleen Bonnell, Wed Mar 31 15:46:46 PST 2004
# Added QueryOverTimeAttributes.
#
##############################################################################
##
......@@ -286,6 +289,7 @@ SRC= AnimationAttributes.C \
PrinterAttributes.C \
QueryAttributes.C \
QueryList.C \
QueryOverTimeAttributes.C \
QuitRPC.C \
RenderingAttributes.C \
ResampleAttributes.C \
......
......@@ -51,13 +51,13 @@ PickAttributes::PickType_FromString(const std::string &s, PickAttributes::PickTy
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
// ****************************************************************************
PickAttributes::PickAttributes() : AttributeSubject("s*bbbbbbbbbsbiiii*iissFFFFFFsii*s*s*s*s*s*ba*s*")
PickAttributes::PickAttributes() : AttributeSubject("s*bbbbbbbbbsbiiii*iissFFFFFFsii*s*s*s*s*s*ba*s*b")
{
variables.push_back("default");
displayIncidentElements = true;
......@@ -98,6 +98,7 @@ PickAttributes::PickAttributes() : AttributeSubject("s*bbbbbbbbbsbiiii*iissFFFFF
rayPoint2[2] = 0;
realElementNumber = -1;
needTransformMessage = false;
doTimeCurve = false;
}
// ****************************************************************************
......@@ -109,13 +110,13 @@ PickAttributes::PickAttributes() : AttributeSubject("s*bbbbbbbbbsbiiii*iissFFFFF
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
// ****************************************************************************
PickAttributes::PickAttributes(const PickAttributes &obj) : AttributeSubject("s*bbbbbbbbbsbiiii*iissFFFFFFsii*s*s*s*s*s*ba*s*")
PickAttributes::PickAttributes(const PickAttributes &obj) : AttributeSubject("s*bbbbbbbbbsbiiii*iissFFFFFFsii*s*s*s*s*s*ba*s*b")
{
AttributeGroupVector::const_iterator pos;
int i;
......@@ -188,6 +189,7 @@ PickAttributes::PickAttributes(const PickAttributes &obj) : AttributeSubject("s*
}
invalidVars = obj.invalidVars;
doTimeCurve = obj.doTimeCurve;
SelectAll();
}
......@@ -201,7 +203,7 @@ PickAttributes::PickAttributes(const PickAttributes &obj) : AttributeSubject("s*
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -225,7 +227,7 @@ PickAttributes::~PickAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -305,6 +307,7 @@ PickAttributes::operator = (const PickAttributes &obj)
}
invalidVars = obj.invalidVars;
doTimeCurve = obj.doTimeCurve;
SelectAll();
}
......@@ -318,7 +321,7 @@ PickAttributes::operator = (const PickAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -405,7 +408,8 @@ PickAttributes::operator == (const PickAttributes &obj) const
(bzoneCoords == obj.bzoneCoords) &&
(needTransformMessage == obj.needTransformMessage) &&
varInfo_equal &&
(invalidVars == obj.invalidVars));
(invalidVars == obj.invalidVars) &&
(doTimeCurve == obj.doTimeCurve));
}
// ****************************************************************************
......@@ -417,7 +421,7 @@ PickAttributes::operator == (const PickAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -438,7 +442,7 @@ PickAttributes::operator != (const PickAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -459,7 +463,7 @@ PickAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -487,7 +491,7 @@ PickAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004
// Creation: Thu Apr 1 18:53:03 PST 2004
//
// Modifications:
//
......@@ -513,7 +517,7 @@ PickAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Mar 16 16:08:47 PST 2004