Text archives Help
- From: "James Bigler" <bigler@cs.utah.edu>
- To: manta@sci.utah.edu
- Subject: [Manta] r2074 - trunk/StandAlone
- Date: Fri, 15 Feb 2008 08:07:05 -0700 (MST)
Author: bigler
Date: Fri Feb 15 08:07:04 2008
New Revision: 2074
Modified:
trunk/StandAlone/manta.cc
Log:
StandAlone/manta.cc
Made unknown argments barf. This has been annoying for way too long. If in
the event we want to start using the stack stuff again (unknown arguments
were
ignored, so they could be passed to the stack configuration file), we should
come up with a better way to pass those in, like ask the stack file if it
knows about these arguments.
Throw IllegalArgument exceptions when more than one channel is created.
Throw IllegalArgument exception when we specify a resolution after a channel
is created.
Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc (original)
+++ trunk/StandAlone/manta.cc Fri Feb 15 08:07:04 2008
@@ -286,6 +286,11 @@
ImageDisplay *display = factory->createImageDisplay( "null" );
rtrt->createChannel(display, currentCamera, stereo, xres,
yres);
channelCreated=true;
+ } else {
+ cerr << "ERROR: Already created channel.\n"
+ << "Currently only one channel is supported in
bin/manta.\n"
+ << "You can create channels with -imagedisplay or a
-nodisplaybench command.\n";
+ throw IllegalArgument( string(argv[0]), i, args );
}
UserInterface* ui = factory->createUserInterface("null");
if (!ui) throw UnknownComponent( "Null user interface not
found", "");
@@ -304,6 +309,11 @@
throw IllegalArgument( s, i, args );
}
} else if(arg == "-res"){
+ if (channelCreated) {
+ cerr << "ERROR: Already created channel.\n"
+ << "Please specify resolution before creating channel
(-imagedisplay or a -nodisplaybench command).\n";
+ throw IllegalArgument( string(argv[0]), i, args );
+ }
if(!getResolutionArg(i, args, xres, yres)){
cerr << "Error parsing resolution: " << args[i+1] << '\n';
usage(factory);
@@ -322,6 +332,11 @@
ImageDisplay *display = factory->createImageDisplay( s );
rtrt->createChannel(display, currentCamera, stereo, xres,
yres);
+ } else {
+ cerr << "Already created channel.\n"
+ << "Currently only one channel is supported in
bin/manta.\n"
+ << "You can create channels with -imagedisplay or a
-nodisplaybench command.\n";
+ throw IllegalArgument( s, i, args );
}
} catch (UnknownComponent e) {
@@ -424,6 +439,13 @@
cerr << "Error reading max depth\n";
usage(factory);
}
+ }
+ else {
+ // We should barf about unknown commands. For the stack stuff,
args
+ // should probably be parsed out some other way instead of on the
+ // general command line.
+ cerr << "ERROR: Unknown argument\n";
+ throw IllegalArgument( string(argv[0]), i, args );
}
}
}
- [Manta] r2074 - trunk/StandAlone, James Bigler, 02/15/2008
Archive powered by MHonArc 2.6.16.