fp@1126: /***************************************************************************** fp@1126: * fp@1126: * $Id$ fp@1126: * fp@1126: ****************************************************************************/ fp@1126: fp@1126: #include fp@1126: #include fp@1126: using namespace std; fp@1126: fp@1126: #include "globals.h" fp@1126: fp@1126: /*****************************************************************************/ fp@1126: fp@1126: const char *help_debug = fp@1126: "[OPTIONS]\n" fp@1126: "\n" fp@1126: "\n" fp@1126: "Command-specific options:\n"; fp@1126: fp@1126: /****************************************************************************/ fp@1126: fp@1126: void command_debug(void) fp@1126: { fp@1126: stringstream str; fp@1126: int debugLevel; fp@1126: fp@1126: if (commandArgs.size() != 1) { fp@1126: stringstream err; fp@1126: err << "'debug' takes exactly one argument!"; fp@1126: throw MasterDeviceException(err.str()); fp@1126: } fp@1126: fp@1126: str << commandArgs[0]; fp@1126: str >> resetiosflags(ios::basefield) // guess base from prefix fp@1126: >> debugLevel; fp@1126: fp@1126: if (str.fail()) { fp@1126: stringstream err; fp@1126: err << "Invalid debug level '" << commandArgs[0] << "'!"; fp@1126: throw MasterDeviceException(err.str()); fp@1126: } fp@1126: fp@1126: masterDev.open(MasterDevice::ReadWrite); fp@1126: masterDev.setDebug(debugLevel); fp@1126: } fp@1126: fp@1126: /*****************************************************************************/