Commit 9b895f95 authored by Leigh Stoller's avatar Leigh Stoller

New script to generate SVG images of the topology (and thumbnails).

parent eabb41ae
#
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -30,7 +30,7 @@ include $(OBJDIR)/Makeconf
BIN_SCRIPTS = dbvistopology
LIBEXEC_SCRIPTS = webvistopology webfloormap
LIBEXEC_VIS = prerender render prerender_all floormap
LIBEXEC_VIS = prerender render prerender_all floormap svgrender
#
# Force dependencies on the scripts so that they will be rerun through
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2003, 2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -35,7 +35,7 @@ sub usage()
"Usage: dbvistoplogy [-o <outputfile>] [-t <thumbsize> ] [-z <zoomfactor>] [-d <detaillevel>] <pid> <eid>\n";
exit(-1);
}
my $optlist = "o:z:d:t:";
my $optlist = "o:z:d:t:xs:";
#
# Configure variables
......@@ -145,18 +145,18 @@ if (! ExpState($pid, $eid)) {
die("*** $0:\n".
" No such experiment $pid/$eid\n");
}
#
# Verify that this person is allowed to look at experiment.
#
if (! TBExptAccessCheck($UID, $pid, $eid, TB_EXPT_READINFO)) {
die("*** $0:\n".
" You do not have permission to view experiment $pid/$eid\n");
}
my $args = "";
if (defined($options{"x"})) {
$args .= "-x ";
}
if (defined($options{"s"})) {
my $uid = $options{"s"};
if ($uid =~ /^([-\w]+)$/) {
$uid = $1;
}
$args .= "-s $uid ";
}
if (defined($zoom)) {
$args .= "-z $zoom ";
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -50,7 +50,15 @@ sub usage {
die "Usage:\nrender [-v] [-t <thumbsize>] [-z <zoomfactor>] [-d <detaillevel>] <pid> <eid>\n";
}
my $optlist = "z:d:vt:";
#
# Look for -x option, and chain to SVG rendering.
#
if (grep {$_ eq "-x"} @ARGV) {
exec "$TB/libexec/vis/svgrender", @ARGV;
die("render: Could not exec svgrender: $!");
}
my $optlist = "z:d:vt:x";
if (! getopts($optlist, \%options)) { usage; }
if (@ARGV != 2) { usage; }
......
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