PAASS
Software suite to Acquire and Analyze Data from Pixie16
utkscan.cpp
Go to the documentation of this file.
1 #include <exception>
2 #include <iostream>
3 
4 // Local files
5 #include "Display.h"
6 #include "UtkScanInterface.hpp"
7 #include "UtkUnpacker.hpp"
8 
9 // Define the name of the program.
10 #ifndef PROGRAM_NAME
11 #define PROGRAM_NAME "utkscan"
12 #endif
13 
14 using std::cout;
15 using std::endl;
16 
17 int main(int argc, char *argv[]){
18  // Define a new unpacker object.
19  cout << "utkscan.cpp : Instancing the UtkScanInterface" << endl;
21 
22  // Set the output message prefix.
23  cout << "utkscan.cpp : Setting the Program Name" << endl;
24  scanner.SetProgramName(std::string(PROGRAM_NAME));
25 
26  // Initialize the scanner.
27  cout << "utkscan.cpp : Performing the setup routine" << endl;
28  scanner.Setup(argc, argv);
29 
30  // Run the main loop.
31  cout << "utkscan.cpp : Performing Execute method" << endl;
32  int retval = 0;
33  try {
34  retval = scanner.Execute();
35  }catch(std::exception &ex) {
36  cout << Display::ErrorStr(ex.what()) << endl;
37  }
38 
39  //Cleanup the scanning
40  cout << "utkscan.cpp : Closing things out" << endl;
41  scanner.Close();
42 
43  //return how things went
44  return(retval);
45 }
#define PROGRAM_NAME
Definition: utkscan.cpp:11
bool Close()
Shutdown cleanly.
bool Setup(int argc, char *argv[])
Setup user options and initialize all required objects.
UtkScanInterface * scanner
Definition: utkscanor.cpp:19
void SetProgramName(const std::string &head_)
Set the header string used to prefix output messages.
Class derived from ScanInterface to handle UI for the scan.
std::string ErrorStr(const std::string &str="[ERROR]")
Definition: Display.cpp:46
int main(int argc, char *argv[])
Definition: utkscan.cpp:17
int Execute()
Run the program.