[project @ 4]
[mussa.git] / mussa.cc
index af25db2ebb5056887c32d7c29c5e9775481d2726..12c649ae2206dc483e5ff1249d2dd574d0602b12 100644 (file)
--- a/mussa.cc
+++ b/mussa.cc
@@ -1,44 +1,25 @@
 #include "mussa_class.hh"
 #include "time.h"
 
+
 int main(int argc, char **argv) 
 {
   Mussa overlord;
+  char run_mode;
   char * para_file, * ana_file;
-  string  an_arg;
   time_t t1, t2, begin, end;
   double setuptime, seqloadtime, seqcomptime, nwaytime, savetime, totaltime;
-  string run_mode;
   int seq_num;
 
 
   begin = time(NULL);
 
-  // need more sophisticated arg reading structure
-  // support -w and -t override options...other stuff??
-  an_arg = * ++argv;
-
-  if (an_arg == "-v")
-  {
-    seq_num = atoi(* ++argv);
-    ana_file = * ++argv;
-    run_mode = "v";
-  }
-  else
-  {
-    para_file = (char*) an_arg.c_str();
-    run_mode = "f";
-  }
+  run_mode = overlord.parse_args(argc, argv);
 
-  if (run_mode == "v")
-  {
-    cout << "load file = " << ana_file << " seq num = " << seq_num << endl;
-    overlord.load_old(ana_file, seq_num);
-  }
-  else if (run_mode == "f")
+  if ((run_mode == 'f') || (run_mode == 'n'))
   {
     t1 = time(NULL);
-    overlord.setup(para_file);
+    overlord.setup();
     t2 = time(NULL);
     setuptime = difftime(t2, t1);
 
@@ -66,7 +47,7 @@ int main(int argc, char **argv)
 
     cout << "fum\n";
     t1 = time(NULL);
-    overlord.save_old();
+    overlord.save();
     t2 = time(NULL);
     savetime = difftime(t2, t1);
 
@@ -82,8 +63,10 @@ int main(int argc, char **argv)
     cout << totaltime << "\n";
   }
 
+  if  (run_mode == 'v')
+    overlord.load();
 
-  if (run_mode == "v")
+  if  ((run_mode == 'f') || (run_mode == 'v'))
     overlord.FuckingPieceOfShit(1000,500);
 }