From: guigues Date: Thu, 2 Oct 2008 07:43:20 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.8.0~92 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7df8c08153bd03b58bf320982ec5715122f12eea;p=bbtk.git *** empty log message *** --- diff --git a/kernel/src/bbtkExecuter.h b/kernel/src/bbtkExecuter.h index fc177e2..34ad0a7 100644 --- a/kernel/src/bbtkExecuter.h +++ b/kernel/src/bbtkExecuter.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkExecuter.h,v $ $ Language: C++ - Date: $Date: 2008/04/22 09:40:10 $ - Version: $Revision: 1.14 $ + Date: $Date: 2008/10/02 07:43:20 $ + Version: $Revision: 1.15 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -67,6 +67,9 @@ namespace bbtk /// Sets the mode of dialog of the executer for Root inputs void SetDialogMode(DialogModeType t) { mDialogMode = t; } + void SetNoErrorMode(bool b) { mNoErrorMode = b; } + + bool GetNoErrorMode() const { return mNoErrorMode; } //================================================================= @@ -242,8 +245,13 @@ namespace bbtk /// no exec mode flag bool mNoExecMode; + /// Dialog mode DialogModeType mDialogMode; + + /// no error mode flag + bool mNoErrorMode; + }; } #endif diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 12dd24f..febf071 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.cxx,v $ $ Language: C++ - Date: $Date: 2008/09/10 12:01:46 $ - Version: $Revision: 1.70 $ + Date: $Date: 2008/10/02 07:43:20 $ + Version: $Revision: 1.71 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -149,8 +149,8 @@ namespace bbtk info.argmin = 1; info.argmax = 2; info.code = cExec; - info.syntax = "exec "; - info.help = "Executes the black box of name (and connected boxes if needed). If the special keyword 'freeze' is given then freezes any further execution command. 'unfreeze' reverts to normal execution mode."; + info.syntax = "exec "; + info.help = "Executes the black box of name (and connected boxes if needed). If the special keyword 'freeze' is given then freezes any further execution command. 'unfreeze' reverts to normal execution mode. 'freeze_no_error' is like freeze but also skips any error."; mCommandDict[info.keyword] = info; info.keyword = "package"; @@ -402,6 +402,7 @@ namespace bbtk } else { + std::cout << "!!!HERRR bbtk"<SetNoExecMode(true); - else if (words[1]=="unfreeze") - mVirtualExecuter->SetNoExecMode(false); - else - mVirtualExecuter->Execute(words[1]); + { + mVirtualExecuter->SetNoExecMode(true); + mThrow = false; + } + else if (words[1]=="freeze_no_error ") + { + mVirtualExecuter->SetNoExecMode(true); + mVirtualExecuter->SetNoErrorMode(true); + mThrow = false; + } + else if (words[1]=="unfreeze") + { + mVirtualExecuter->SetNoExecMode(false); + mVirtualExecuter->SetNoErrorMode(false); + } + else + { + mVirtualExecuter->Execute(words[1]); + } break; case cInput : diff --git a/kernel/src/bbtkInterpreter.h b/kernel/src/bbtkInterpreter.h index ee5c86c..6c294d9 100644 --- a/kernel/src/bbtkInterpreter.h +++ b/kernel/src/bbtkInterpreter.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkInterpreter.h,v $ $ Language: C++ - Date: $Date: 2008/07/23 11:46:11 $ - Version: $Revision: 1.32 $ + Date: $Date: 2008/10/02 07:43:20 $ + Version: $Revision: 1.33 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -122,14 +122,16 @@ namespace bbtk /// Puts the executer in "no exec" mode, /// which creates but does not execute pipelines. - void SetNoExecMode(bool b) { mVirtualExecuter->SetNoExecMode(b); } + void SetNoExecMode(bool m) { mVirtualExecuter->SetNoExecMode(m); } + /// Puts the executer in "no error" mode, + /// Errors do not stop execution (but warnings are produced) + void SetNoErrorMode(bool m) { mVirtualExecuter->SetNoErrorMode(m);} /// //typedef Executer::DialogModeType DialogModeType; typedef VirtualExec::DialogModeType DialogModeType; - void SetDialogMode(DialogModeType t) - { mVirtualExecuter->SetDialogMode(t); } + void SetDialogMode(DialogModeType t) { mVirtualExecuter->SetDialogMode(t);} /// Sets the bool that indicates wether we are in command line context void SetCommandLine(bool v = true) { mCommandLine = v; } diff --git a/kernel/src/bbtkTranscriptor.cxx b/kernel/src/bbtkTranscriptor.cxx index 258ad83..57f6913 100644 --- a/kernel/src/bbtkTranscriptor.cxx +++ b/kernel/src/bbtkTranscriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkTranscriptor.cxx,v $ $ Language: C++ - Date: $Date: 2008/04/21 07:01:52 $ - Version: $Revision: 1.12 $ + Date: $Date: 2008/10/02 07:43:21 $ + Version: $Revision: 1.13 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -46,7 +46,6 @@ namespace bbtk */ Transcriptor::Transcriptor(const std::string& filename) : - mNoExecMode(false), mDialogMode(NoDialog) { //VirtualExec(); diff --git a/kernel/src/bbtkTranscriptor.h b/kernel/src/bbtkTranscriptor.h index 35d02e0..60b051b 100644 --- a/kernel/src/bbtkTranscriptor.h +++ b/kernel/src/bbtkTranscriptor.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkTranscriptor.h,v $ $ Language: C++ - Date: $Date: 2008/04/18 12:59:16 $ - Version: $Revision: 1.10 $ + Date: $Date: 2008/10/02 07:43:21 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -58,7 +58,16 @@ namespace bbtk m_Fp << " e->SetNoExecMode(false);" << std::endl; } - bool GetNoExecMode() const { return mNoExecMode; } + void SetNoErrorMode(bool b) + { + if (b) + m_Fp << " e->SetNoErrorMode(true);" << std::endl; + else + m_Fp << " e->SetNoErrorMode(false);" << std::endl; + } + + bool GetNoExecMode() const { return false; } + bool GetNoErrorMode() const { return false; } /// Sets the mode of dialog of the executer for Root inputs void SetDialogMode(DialogModeType t) { mDialogMode = t; } @@ -181,9 +190,6 @@ namespace bbtk /// The input values of the Root ComplexBlackBox std::map mInputs; - /// no exec mode flag - bool mNoExecMode; - /// Dialog mode DialogModeType mDialogMode; diff --git a/kernel/src/bbtkVirtualExec.h b/kernel/src/bbtkVirtualExec.h index 2b57eb0..1ba529d 100644 --- a/kernel/src/bbtkVirtualExec.h +++ b/kernel/src/bbtkVirtualExec.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkVirtualExec.h,v $ $ Language: C++ - Date: $Date: 2008/05/06 13:45:12 $ - Version: $Revision: 1.15 $ + Date: $Date: 2008/10/02 07:43:21 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -74,6 +74,10 @@ namespace bbtk /// Sets the mode of dialog of the executer for Root inputs virtual void SetDialogMode(DialogModeType t) = 0; + /// Puts the executer in "no error" mode, + /// Errors do not stop execution (but warnings are produced) + virtual void SetNoErrorMode(bool b) = 0; + virtual bool GetNoErrorMode() const = 0; //================================================================= /// Loads a package virtual void LoadPackage(const std::string &name ) = 0; diff --git a/packages/std/bbs/appli/exampleAdd.bbs b/packages/std/bbs/appli/exampleAdd.bbs index d98b0aa..c9e7669 100644 --- a/packages/std/bbs/appli/exampleAdd.bbs +++ b/packages/std/bbs/appli/exampleAdd.bbs @@ -17,3 +17,4 @@ print "The result is : $a.Out$" print "That's all " print "folks" +