]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdExecBbiCommand.cxx
#3508 ConcatString_tool Reactivity 2
[bbtk.git] / packages / std / src / bbstdExecBbiCommand.cxx
index b22054016d21ac229053c26679eae8d75f072630..730ef392bcd6c29fd78ed3e955ee59453d23c944 100755 (executable)
@@ -57,59 +57,61 @@ namespace bbstd
   {
   }
   
-  void ExecBbiCommand::DoProcess()
+void ExecBbiCommand::DoProcess()
+{
+    printf("EED ExecBbiCommand::DoProcess Start \n");
+    // Look for the interpreter
+    bbtk::Interpreter::Pointer I;
+    bool delete_inter = false;
+    if (bbGetParent() != 0)
     {
-
-      // Look for the interpreter
-      bbtk::Interpreter::Pointer I;
-         bool delete_inter = false;
-         if (bbGetParent() != 0)
-         {
-         bbtk::Factory::Pointer f
-               = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()
-                 ->bbGetDescriptor().get())->GetFactory();
-         if ((f != 0)&&
-             (f->GetExecuter()))
-           {
-             I = f->GetExecuter()->GetInterpreter();
-           }
-         }
-      if (I==0)
-         {
-         //      bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
-         I = bbtk::Interpreter::New();
-         delete_inter = true;
-         }
-
-      unsigned int i;
-
-      bool ok=true;
-      int pos1=0,pos2;
-      pos2 = bbGetInputIn().find(";",pos1);
-      std::string ccommand;
-      while (ok==true)
+        printf("EED ExecBbiCommand::DoProcess 1 \n");
+        bbtk::Factory::Pointer f = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()->bbGetDescriptor().get())->GetFactory();
+        if ( (f != 0) && (f->GetExecuter()) )
            {
-         if (pos2==-1) 
-          {
-           ok=false;
-           ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
-          } else {
-           ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
-         }
-         for ( i=0 ; i < ccommand.length() ; i++)
-         {
-           if (ccommand[i]==39)
-           {
-                 ccommand[i]=34;
+            printf("EED ExecBbiCommand::DoProcess 2 \n");
+            I = f->GetExecuter()->GetInterpreter();
+           } // if f
+    } // if Parent
+    if (I==NULL)
+    {
+        printf("EED ExecBbiCommand::DoProcess 3 \n");
+        //       bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
+        I = bbtk::Interpreter::New();
+        delete_inter = true;
+    } // if I
+    unsigned int i;
+    bool ok=true;
+    int pos1=0,pos2;
+    pos2 = bbGetInputIn().find(";",pos1);
+    std::string ccommand;
+    printf("EED ExecBbiCommand::DoProcess 4 \n");
+    while (ok==true)
+    {
+        if (pos2==-1)
+        {
+            ok=false;
+            ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
+        } else {
+            ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
         }
-     }
-
-         I->InterpretLine( ccommand );
-         pos1=pos2+1;
-         pos2 = bbGetInputIn().find(";",pos2+1);
-
-       }
-      
+        for ( i=0 ; i < ccommand.length() ; i++)
+        {
+            if (ccommand[i]==39)
+            {
+                ccommand[i]=34;
+            } // if 39
+        } // for i
+        printf("EED ExecBbiCommand::DoProcess 5 \n");
+        printf("EED ExecBbiCommand::DoProcess command=%s \n", ccommand.c_str() );
+        I->InterpretLine( ccommand );
+        pos1=pos2+1;
+        pos2 = bbGetInputIn().find(";",pos2+1);
+       } // while
+
+    printf("EED ExecBbiCommand::DoProcess 6 \n");
+
+    
 //      if (delete_inter) delete I;
 
    /*  Grrr  not works in windows
@@ -132,7 +134,12 @@ namespace bbstd
        pch = strtok (NULL, ";");
        }
   */
-  }
+    
+    printf("EED ExecBbiCommand::DoProcess End\n");
+
+    
+}
+
 } // EO namespace bbstd