/[PAMELA software]/yoda/techmodel/techmodelreader.cpp
ViewVC logotype

Diff of /yoda/techmodel/techmodelreader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6.1 by kusanagi, Wed Mar 8 13:51:45 2006 UTC revision 6.7 by mocchiut, Mon Oct 16 16:02:21 2006 UTC
# Line 3  Line 3 
3  #include <log4cxx/propertyconfigurator.h>  #include <log4cxx/propertyconfigurator.h>
4  #include "EventReader.h"  #include "EventReader.h"
5  #include <time.h>  #include <time.h>
6    #include "../event/yodaversion.h"
7  extern "C" {  extern "C" {
8      #include <dirent.h>      #include <dirent.h>
9  }  }
10    
   
   
11  using namespace pamela;  using namespace pamela;
12  using namespace log4cxx;  using namespace log4cxx;
13  using namespace std;  using namespace std;
# Line 24  int main(int argc, char* argv[]) { Line 22  int main(int argc, char* argv[]) {
22      bool multiFile = 0;      bool multiFile = 0;
23      short compression = 3;      short compression = 3;
24      char nomeFileLog[L_tmpnam];      char nomeFileLog[L_tmpnam];
25      tmpnam(nomeFileLog);      mkstemp(nomeFileLog);
26      DIR *dirp;      DIR *dirp;
27      char *outDir = "";      char *outDir = "";
28            
# Line 52  int main(int argc, char* argv[]) { Line 50  int main(int argc, char* argv[]) {
50    if (argc < 2){    if (argc < 2){
51      //logger->info(_T("You have forgotten the file name."));      //logger->info(_T("You have forgotten the file name."));
52      cout << "You have forgotten the file name. \n";      cout << "You have forgotten the file name. \n";
53      cout << "Try '--help' for more information. \n";      cout << "Try '-help' for more information. \n";
54      exit(1);      exit(1);
55    }      }  
56        
57    if (!strcmp(argv[1], "--help")){    if (!strcmp(argv[1], "-help")){
58          cout << "Usage: yoda FILE [OPTION] \n";          cout << "Usage: yoda FILE [OPTION] \n";
59          cout << "\t --help              print this help and exit \n";          cout << "\t -help               print this help and exit \n";
60            cout << "\t -version            print version number \n";
61          cout << "\t -p                  maximum number of packets to process [default all] \n";          cout << "\t -p                  maximum number of packets to process [default all] \n";
62          cout << "\t -multi              generate multiple root files \n";          cout << "\t -multi              generate multiple root files \n";
63          cout << "\t -c                  set the compression level for the generated root file(s). Values: [0,9] [default = 3]\n";          cout << "\t -c                  set the compression level for the generated root file(s). Values: [0,9] [default = 3]\n";
# Line 66  int main(int argc, char* argv[]) { Line 65  int main(int argc, char* argv[]) {
65          exit(1);          exit(1);
66    }    }
67    
68      if (!strcmp(argv[1], "-version")){
69        printf(" Version %i \n",GetYODAver());
70        //        cout << "$Name:  $ $Revision: 6.5 $" << "\n";
71            exit(1);
72      }
73    
74    ifstream from (argv[1]);    ifstream from (argv[1]);
75    if (!from) {    if (!from) {
76      //logger->info(_T("The file does not exist."));      //logger->info(_T("The file does not exist."));
# Line 77  int main(int argc, char* argv[]) { Line 82  int main(int argc, char* argv[]) {
82      if (!strcmp(argv[i], "-p")){      if (!strcmp(argv[i], "-p")){
83          if (++i >= argc){          if (++i >= argc){
84              cerr << "-p needs arguments. \n";              cerr << "-p needs arguments. \n";
85              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
86              exit(1);              exit(1);
87          }          }
88          if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) {          if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) {
# Line 85  int main(int argc, char* argv[]) { Line 90  int main(int argc, char* argv[]) {
90          } else {          } else {
91              //logger->info(_T("The file does not exist."));              //logger->info(_T("The file does not exist."));
92              cerr << "-p needs a integer value. \n";              cerr << "-p needs a integer value. \n";
93              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
94              exit(1);              exit(1);
95          }          }
96          continue;          continue;
# Line 96  int main(int argc, char* argv[]) { Line 101  int main(int argc, char* argv[]) {
101      if (!strcmp(argv[i], "-c")){      if (!strcmp(argv[i], "-c")){
102          if (++i >= argc){          if (++i >= argc){
103              cerr << "-c needs arguments. \n";              cerr << "-c needs arguments. \n";
104              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
105              exit(1);              exit(1);
106          }          }
107          if ((isdigit(*argv[i])) && ( (atoi(argv[i]) >= 0) && (atoi(argv[i]) <= 9))) {          if ((isdigit(*argv[i])) && ( (atoi(argv[i]) >= 0) && (atoi(argv[i]) <= 9))) {
# Line 104  int main(int argc, char* argv[]) { Line 109  int main(int argc, char* argv[]) {
109          } else {          } else {
110              //logger->info(_T("The file does not exist."));              //logger->info(_T("The file does not exist."));
111              cerr << "-c needs a integer value beetween 0 and 9. \n";              cerr << "-c needs a integer value beetween 0 and 9. \n";
112              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
113              exit(1);              exit(1);
114          }          }
115          continue;          continue;
# Line 113  int main(int argc, char* argv[]) { Line 118  int main(int argc, char* argv[]) {
118      if (!strcmp(argv[i], "-o")){      if (!strcmp(argv[i], "-o")){
119          if (++i >= argc){          if (++i >= argc){
120              cerr << "-o needs arguments. \n";              cerr << "-o needs arguments. \n";
121              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
122              exit(1);              exit(1);
123          }          }
124          DIR* tempdir;          DIR* tempdir;
# Line 123  int main(int argc, char* argv[]) { Line 128  int main(int argc, char* argv[]) {
128          } else {          } else {
129              //logger->info(_T("The file does not exist."));              //logger->info(_T("The file does not exist."));
130              cerr << "-o needs an existing/accessable directory. \n";              cerr << "-o needs an existing/accessable directory. \n";
131              cout << "Try '--help' for more information. \n";              cout << "Try '-help' for more information. \n";
132              exit(1);              exit(1);
133          }          }
134          continue;          continue;
# Line 177  int main(int argc, char* argv[]) { Line 182  int main(int argc, char* argv[]) {
182    Run.WriteFiles();    Run.WriteFiles();
183    
184    logger->info("<-------------------------------END UNPACKING------------------------------->\n");    logger->info("<-------------------------------END UNPACKING------------------------------->\n");
185      printf("Finished, exiting...\n");
186    
187    //Momentarly suspended the save      //Momentarly suspended the save  
188    //system(command.c_str());    //system(command.c_str());
189  }  }
190    

Legend:
Removed from v.6.1  
changed lines
  Added in v.6.7

  ViewVC Help
Powered by ViewVC 1.1.23