X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkInterpreter.cxx;h=a31fe0f20ceb0b589eae32be38e01864d09a1e5f;hb=84454af9be8cecfbf41ca7c0198c65efe60f9b48;hp=649c2a6e38f91646e7c8385ab0d6908248776e80;hpb=5141e057598cdcde059d180c8cee02e1011f205d;p=bbtk.git diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 649c2a6..a31fe0f 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -1,32 +1,39 @@ -/*========================================================================= +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + +/*========================================================================= Program: bbtk Module: $RCSfile: bbtkInterpreter.cxx,v $ Language: C++ - Date: $Date: 2010/09/17 15:56:51 $ - Version: $Revision: 1.90 $ + Date: $Date: 2012/11/16 08:49:01 $ + Version: $Revision: 1.95 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) -* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux -* -* This software is governed by the CeCILL-B license under French law and -* abiding by the rules of distribution of free software. You can use, -* modify and/ or redistribute the software under the terms of the CeCILL-B -* license as circulated by CEA, CNRS and INRIA at the following URL -* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -* or in the file LICENSE.txt. -* -* As a counterpart to the access to the source code and rights to copy, -* modify and redistribute granted by the license, users are provided only -* with a limited warranty and the software's author, the holder of the -* economic rights, and the successive licensors have only limited -* liability. -* -* The fact that you are presently reading this means that you have had -* knowledge of the CeCILL-B license and that you accept its terms. -* ------------------------------------------------------------------------ */ + /** * \file @@ -374,22 +381,22 @@ namespace bbtk */ - void Interpreter::commandNew(std::string boxType, std::string boxName) //virtual + void Interpreter::commandNew(const std::string &boxType,const std::string &boxName) //virtual { mVirtualExecuter->Create(boxType,boxName); } - void Interpreter::commandDelete(std::string boxName) //virtual + void Interpreter::commandDelete(const std::string &boxName) //virtual { mVirtualExecuter->Destroy(boxName); } - void Interpreter::commandConnection(std::string nodeFrom, std::string outputLabel, std::string nodeTo, std::string inputLabel) //virtual + void Interpreter::commandConnection(const std::string &nodeFrom,const std::string &outputLabel,const std::string &nodeTo,const std::string &inputLabel) //virtual { mVirtualExecuter->Connect(nodeFrom,outputLabel,nodeTo,inputLabel); } - void Interpreter::commandPackage(std::string packageName) //virtual + void Interpreter::commandPackage(const std::string &packageName) //virtual { mVirtualExecuter->BeginPackage(packageName); } @@ -399,7 +406,7 @@ namespace bbtk mVirtualExecuter->EndPackage(); } - void Interpreter::commandDefine(std::string name, std::string pack, std::string scriptfilename) //virtual + void Interpreter::commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename) //virtual { mVirtualExecuter->Define(name,pack,scriptfilename); } @@ -409,18 +416,18 @@ namespace bbtk mVirtualExecuter->EndDefine(); } - void Interpreter::commandKind(std::string kind) //virtual + void Interpreter::commandKind(const std::string &kind) //virtual { mVirtualExecuter->Kind(kind); } - void Interpreter::commandPrint(std::string value) //virtual + void Interpreter::commandPrint(const std::string &value) //virtual { mVirtualExecuter->Print(value); } - void Interpreter::commandExec(std::string word) //virtual + void Interpreter::commandExec(const std::string &word) //virtual { if (word=="freeze") { @@ -445,32 +452,32 @@ namespace bbtk } - void Interpreter::commandInput(std::string name, std::string box, std::string input,std::string help) //virtual + void Interpreter::commandInput(const std::string &name,const std::string &box,const std::string &input,const std::string &help) //virtual { mVirtualExecuter->DefineInput(name,box,input,help); } - void Interpreter::commandOutput(std::string name, std::string box, std::string output,std::string help) //virtual + void Interpreter::commandOutput(const std::string &name,const std::string &box,const std::string &output,const std::string &help) //virtual { mVirtualExecuter->DefineOutput(name,box,output,help); } - void Interpreter::commandSet(std::string box, std::string input, std::string value) //virtual + void Interpreter::commandSet(const std::string &box,const std::string &input,const std::string &value) //virtual { mVirtualExecuter->Set(box,input,value); } - void Interpreter::commandAuthor(std::string author) //virtual + void Interpreter::commandAuthor(const std::string &author) //virtual { mVirtualExecuter->Author(author); } - void Interpreter::commandCategory(std::string categorytype) //virtual + void Interpreter::commandCategory(const std::string &categorytype) //virtual { mVirtualExecuter->Category(categorytype); } - void Interpreter::commandDescription(std::string description) //virtual + void Interpreter::commandDescription(const std::string &description) //virtual { mVirtualExecuter->Description(description); } @@ -481,7 +488,7 @@ namespace bbtk mVirtualExecuter->Clear(); } - void Interpreter::commandInclude(std::string word, bool ok) //virtual + void Interpreter::commandInclude(const std::string &word, bool ok) //virtual { // if 'source' was given (words.size()==3) then tell to set the // source file name of the current complex box with the full file name included @@ -496,12 +503,12 @@ namespace bbtk } - void Interpreter::commandLoad(std::string packageName) //virtual + void Interpreter::commandLoad(const std::string &packageName) //virtual { GetExecuter()->LoadPackage(packageName); } - void Interpreter::commandUnload(std::string packageName) //virtual + void Interpreter::commandUnload(const std::string &packageName) //virtual { GetExecuter()->UnLoadPackage(packageName); } @@ -529,8 +536,7 @@ namespace bbtk mVirtualExecuter->HelpMessages(); } -//ups2 EED Borrame - void Interpreter::commandMessage(std::string kind, std::string levelstr) //virtual + void Interpreter::commandMessage(const std::string &kind,const std::string &levelstr) //virtual { int level=0; sscanf(levelstr.c_str(),"%d",&level); @@ -1281,12 +1287,20 @@ namespace bbtk */ //======================================================================= - void Interpreter::SetCurrentFileName(std::string fullPathScriptName) // virtual + void Interpreter::SetCurrentFileName(const std::string &fullPathScriptName) // virtual { GetExecuter()->SetCurrentFileName(fullPathScriptName); } //======================================================================= + + void Interpreter::SetTypeOfScript_Application() + { + GetExecuter()->SetTypeOfScript_Application(); + } + + + /*EED Borrame //======================================================================= void Interpreter::SwitchToStream( std::stringstream* stream ) @@ -1563,7 +1577,11 @@ void Interpreter::commandHelp(const std::vector& words) CommandDictType::iterator c; c = mCommandDict.find(s); if ( c == mCommandDict.end() ) { - bbtkError(s<<" : Unknown command"); + +//EED 2016-12-22 +// bbtkError(s<<" : Unknown command"); + std::string tmpSS=s+" : Unknown command"; + bbtkError(tmpSS); } // std::cout << " " << s << " : "<< std::endl; // CommandParamDictType::iterator i; @@ -2006,8 +2024,21 @@ void Interpreter::commandNewGUI(const std::string& boxname, ( d->GetCreatorTypeInfo() == typeid(WxBlackBoxDescriptor)) ) continue; #else +// JFGA 12/12/2014 Adding WT options for compile with it. + +/*#if USE_WT + + if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) || + ( d->GetCreatorTypeInfo() == typeid(WtBlackBoxDescriptor)) ) + continue; + + +#else +*/ if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) ) continue; +//#endif + #endif bool widok = true; std::string widget,adaptor;