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

Definition at line 528 of file magiclidar.cc.

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

529 {
530  Configuration conf(argv[0]);
531  conf.SetPrintUsage(PrintUsage);
533  SetupConfiguration(conf);
534 
535  if (!conf.DoParse(argc, argv, PrintHelp))
536  return 127;
537 
538  //try
539  {
540  // No console access at all
541  if (!conf.Has("console"))
542  {
543  if (conf.Get<bool>("no-dim"))
544  return RunShell<LocalStream, StateMachine, ConnectionLidar>(conf);
545  else
546  return RunShell<LocalStream, StateMachineDim, ConnectionDimLidar>(conf);
547  }
548  // Cosole access w/ and w/o Dim
549  if (conf.Get<bool>("no-dim"))
550  {
551  if (conf.Get<int>("console")==0)
552  return RunShell<LocalShell, StateMachine, ConnectionLidar>(conf);
553  else
554  return RunShell<LocalConsole, StateMachine, ConnectionLidar>(conf);
555  }
556  else
557  {
558  if (conf.Get<int>("console")==0)
559  return RunShell<LocalShell, StateMachineDim, ConnectionDimLidar>(conf);
560  else
561  return RunShell<LocalConsole, StateMachineDim, ConnectionDimLidar>(conf);
562  }
563  }
564  /*catch (std::exception& e)
565  {
566  cerr << "Exception: " << e.what() << endl;
567  return -1;
568  }*/
569 
570  return 0;
571 }
void SetupConfiguration(Configuration &conf)
Definition: Main.h:25
void PrintUsage()
Definition: magiclidar.cc:491
void PrintHelp()
Definition: magiclidar.cc:506
void SetupConfiguration(Configuration &conf)
Definition: magiclidar.cc:467
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9

+ Here is the call graph for this function: