FACT++  1.0
int main ( int  argc,
const char *  argv[] 
)

Definition at line 560 of file agilentctrl.cc.

References Configuration::DoParse(), ConnectionAgilent::fMode, Configuration::Get(), Configuration::Has(), PrintHelp(), PrintUsage(), Configuration::SetPrintUsage(), Main::SetupConfiguration(), and SetupConfiguration().

561 {
562  Configuration conf(argv[0]);
563  conf.SetPrintUsage(PrintUsage);
565  SetupConfiguration(conf);
566 
567  if (!conf.DoParse(argc, argv, PrintHelp))
568  return 127;
569 
570  ConnectionAgilent::fMode = conf.Get<string>("mode");
571 
572  //try
573  {
574  // No console access at all
575  if (!conf.Has("console"))
576  {
577  if (conf.Get<bool>("no-dim"))
578  return RunShell<LocalStream, StateMachine, ConnectionAgilent>(conf);
579  else
580  return RunShell<LocalStream, StateMachineDim, ConnectionDimAgilent>(conf);
581  }
582  // Cosole access w/ and w/o Dim
583  if (conf.Get<bool>("no-dim"))
584  {
585  if (conf.Get<int>("console")==0)
586  return RunShell<LocalShell, StateMachine, ConnectionAgilent>(conf);
587  else
588  return RunShell<LocalConsole, StateMachine, ConnectionAgilent>(conf);
589  }
590  else
591  {
592  if (conf.Get<int>("console")==0)
593  return RunShell<LocalShell, StateMachineDim, ConnectionDimAgilent>(conf);
594  else
595  return RunShell<LocalConsole, StateMachineDim, ConnectionDimAgilent>(conf);
596  }
597  }
598  /*catch (std::exception& e)
599  {
600  cerr << "Exception: " << e.what() << endl;
601  return -1;
602  }*/
603 
604  return 0;
605 }
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void PrintHelp()
Definition: agilentctrl.cc:555
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9
void SetupConfiguration(Configuration &conf)
Definition: agilentctrl.cc:512
void PrintUsage()
Definition: agilentctrl.cc:540
static string fMode
Definition: agilentctrl.cc:27

+ Here is the call graph for this function: