X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fstd%2Fsrc%2FbbstdExecBbiCommand.cxx;h=730ef392bcd6c29fd78ed3e955ee59453d23c944;hb=2129cd54808003c1ff7a3da8d714e02cc3ef1045;hp=b22054016d21ac229053c26679eae8d75f072630;hpb=cfad95b6e08e6e53846ffcda7fbc5932065f2c47;p=bbtk.git diff --git a/packages/std/src/bbstdExecBbiCommand.cxx b/packages/std/src/bbstdExecBbiCommand.cxx index b220540..730ef39 100755 --- a/packages/std/src/bbstdExecBbiCommand.cxx +++ b/packages/std/src/bbstdExecBbiCommand.cxx @@ -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