fprintf(ff,"\n" );
fprintf(ff,"from bbtk.bbtkBlackBox import *\n" );
fprintf(ff,"\n" );
- fprintf(ff,"class %s:\n",fileBase.c_str() );
+ fprintf(ff,"class %s(ComplexBlackBox):\n",fileBase.c_str() );
fprintf(ff,"\n" );
- fprintf(ff," def __init__(self):\n" );
- fprintf(ff," self.mCBpy = ComplexBlackBox('%s')\n",file.c_str() );
+ fprintf(ff," def __init__(self, nameBox):\n" );
+ fprintf(ff," super().__init__(nameBox)\n" );
fprintf(ff,"\n" );
fprintf(ff," def Run(self):\n" );
int i,size=pythonBBTK.size();
for (i=0; i<size;i++)
{
- fprintf(ff," self.mCBpy.%s\n", pythonBBTK[i].c_str() );
+ fprintf(ff," self.%s\n", pythonBBTK[i].c_str() );
}// for i
- fprintf(ff," self.mCBpy.Execute()\n" );
+ fprintf(ff," self.Execute()\n" );
fclose(ff);
} catch (bbtk::Exception e) {
e.Print();
ComplexBlackBox::Pointer ComplexBlackBox::New(const std::string& name,
ComplexBlackBoxDescriptor::Pointer desc)
{
- bbtkDebugMessage("object",1,"##> ComplexBlackBox::New('"<<name<<"','"<<
- desc->GetTypeName()<<"')" <<bbtkendl);
- ComplexBlackBox::Pointer p =
- MakeBlackBoxPointer(new ComplexBlackBox(name,desc));
- bbtkDebugMessage("object",2,"<## ComplexBlackBox::New('"<<name<<"','"<<
- desc->GetTypeName()<<"')" <<bbtkendl);
+ bbtkDebugMessage("object",1,"##> ComplexBlackBox::New('"<<name<<"','"<< desc->GetTypeName()<<"')" <<bbtkendl);
+ ComplexBlackBox::Pointer p = MakeBlackBoxPointer(new ComplexBlackBox(name,desc));
+ bbtkDebugMessage("object",2,"<## ComplexBlackBox::New('"<<name<<"','"<< desc->GetTypeName()<<"')" <<bbtkendl);
return p;
}
//==========================================================================
//=========================================================================
void InterpreterPython::commandInput(const std::string &name,const std::string &box,const std::string &input,const std::string &help)
{
+ std::string code("DECLARE_INPUT('"+name+"','"+box+"."+input+"')");
+ this->pythonBBTK.push_back(code);
}
//=========================================================================