]> Creatis software - creaImageIO.git/commitdiff
Added command line interaction with the synchronization option.
authorcaballero <caballero>
Wed, 29 Apr 2009 12:23:57 +0000 (12:23 +0000)
committercaballero <caballero>
Wed, 29 Apr 2009 12:23:57 +0000 (12:23 +0000)
appli/TestWxGimmickReaderDialog/main.cxx
appli/gimmick/main.cxx
src2/creaImageIOGimmick.h

index f2885d18ea152884a0bceeb09c227dd0b44bd4fd..94838a8317fbfb7f844a61d1b1dd02cf9ed3ee7b 100644 (file)
@@ -38,7 +38,7 @@ bool myApp::OnInit( )
                                        -1,
                                        _T("Select image(s)        - Gimmick! (c) CREATIS-LRMN 2008"),
                                        wxDefaultPosition,
-                                       wxSize(600,750),
+                                       wxSize(635,750),
                                        min_dim,
                                        max_dim,
                                        output_dim,
index bee8ff1c269aa6b2137bbd82c9d695eaa1854764..0a44cf0c400bc65b31f08933737154ab5543e202 100644 (file)
@@ -1,5 +1,5 @@
 #include <boost/program_options.hpp>
+
 using namespace boost;
 namespace po = boost::program_options;
 
@@ -28,15 +28,17 @@ int main(int ac, char* av[])
     ("file,f",po::value< vector<string> >(),"Adds the file to the local database")
     ("dir,d",po::value< vector<string> >(),"Adds the directory to the local database")
     ("sync,s","Synchronizes the local database with the files")
-    ("recurse,r","Recurse into sub-directories  (default=off)");
+    ("recurse,r","Recurse into sub-directories  (default=off)")
+       ("repair,R","Repair the database (on synchronization) (default=off)")
+       ("check,c","Check for attribute differences (on synchronization) (default=off)");
+
   
   //Describes third group of options
   po::options_description option("OPTIONS");
   option.add_options()
     ("verbose,v",po::value<int>(&verb),"Verbosity level (default=`1')")
     ("debug,D",po::value<int>(&deb),"Debug messages level (default=`0')");
-  
-  
   //Adds the groups into a big one
   po::options_description cmdline_options;
   cmdline_options.add(generic).add(command).add(option);
@@ -86,10 +88,22 @@ int main(int ac, char* av[])
        }
        if (vm.count("dir")) {
          std::vector<std::string> dirs=vm["dir"].as< vector<string> >();
-         g.AddDir(handler,dirs.front(), vm.count("recurse"));
+         bool recu=false;
+         std::stringstream out;
+         out<<vm.count("recurse");
+         if(out.str().compare("1")==0){recu=true;}
+         g.AddDir(handler,dirs.front(), recu);
        }
        if (vm.count("sync")) {
-         g.Synchronize(true,g.GetTreeHandler(handler));
+         bool rep=false;
+      bool chk=false;
+         std::stringstream out;
+         out<<vm.count("repair");
+         if(out.str().compare("1")==0){rep=true;}
+         std::stringstream out2;
+         out2<<vm.count("check");
+         if(out2.str().compare("1")==0){chk=true;}
+         g.Synchronize(rep,chk);
        }       
        g.Finalize();
       }
@@ -97,6 +111,7 @@ int main(int ac, char* av[])
       {
        e.Print();
       }
+         
   
   return 0;
 }
index 1265ca163f2bb366975e30db22f45a0db4528f42..dfd176e27e83dde6ae7e2f5b56064a2ee8a7862c 100644 (file)
@@ -36,7 +36,7 @@ namespace creaImageIO
 
   //=======================================================================
   /// Central controler of the gimmick application
-  class Gimmick
+  class CREAIMAGEIO_EXPORT Gimmick
   {
   public:
     /// Ctor