Changeset 372 for cpp/frams/_demos
- Timestamp:
- 04/22/15 04:14:59 (10 years ago)
- Location:
- cpp/frams/_demos
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/f0_variants_test.cpp
r348 r372 10 10 #include <frams/genetics/defgenoconv.h> 11 11 #include <frams/model/model.h> 12 #include <frams/ errmgr/stdouterr.h>12 #include <frams/mhandlers/stdouthandler.h> 13 13 14 14 void save_as_f0(SString &gen,Model &m,bool omit_default_values) … … 74 74 int main(int argc,char*argv[]) 75 75 { 76 StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output) 76 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 77 77 78 78 //without converters the application would only handle "format 0" genotypes -
cpp/frams/_demos/full_props.cpp
r348 r372 9 9 10 10 #include <frams/model/model.h> 11 #include <frams/ errmgr/stdouterr.h>11 #include <frams/mhandlers/stdouthandler.h> 12 12 #include <frams/genetics/preconfigured.h> 13 13 … … 50 50 { 51 51 StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err 52 StdoutErrorHandler err(ErrorHandlerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout52 MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout 53 53 54 54 PreconfiguredGenetics genetics; … … 79 79 if (!m.isValid()) 80 80 { 81 FMprintf("","full_props",FMLV_ERROR,"Cannot build Model from the supplied genotype\n");81 Hprintf("","full_props",HMLV_ERROR,"Cannot build Model from the supplied genotype\n"); 82 82 return 2; 83 83 } -
cpp/frams/_demos/geno_test.cpp
r365 r372 6 6 #include <frams/util/sstringutils.h> 7 7 #include <frams/genetics/preconfigured.h> 8 #include <frams/ errmgr/stdouterr.h>8 #include <frams/mhandlers/stdouthandler.h> 9 9 10 10 /** … … 18 18 { 19 19 PreconfiguredGenetics genetics; 20 StdoutErrorHandler stdouterr; //comment this object out to mute error/warning messages20 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); //comment this object out to mute error/warning messages 21 21 22 22 if (argc <= 1) -
cpp/frams/_demos/genoconv_test.cpp
r348 r372 9 9 10 10 #include "printconvmap.h" 11 #include <frams/ errmgr/stdouterr.h>11 #include <frams/mhandlers/stdouthandler.h> 12 12 13 13 /** … … 117 117 int main(int argc,char *argv[]) 118 118 { 119 StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output) 119 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 120 120 121 121 DefaultGenoConvManager gcm; -
cpp/frams/_demos/genomanipulation.cpp
r348 r372 10 10 #include <frams/model/model.h> 11 11 #include <frams/genetics/preconfigured.h> 12 #include <frams/ errmgr/stdouterr.h>12 #include <frams/mhandlers/stdouthandler.h> 13 13 14 14 /** … … 266 266 int main(int argc,char*argv[]) 267 267 { 268 StdoutErrorHandler err; //redirect model-related errors to stdout268 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); //redirect model-related errors to stdout 269 269 270 270 srand(time(0)); -
cpp/frams/_demos/genooper_test.cpp
r348 r372 3 3 // See LICENSE.txt for details. 4 4 5 #include <frams/ errmgr/stdouterr.h>5 #include <frams/mhandlers/stdouthandler.h> 6 6 #include <frams/genetics/preconfigured.h> 7 7 … … 21 21 int main(int argc, char *argv[]) 22 22 { 23 StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output)23 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 24 24 PreconfiguredGenetics genetics; 25 25 -
cpp/frams/_demos/loader_test_param.cpp
r348 r372 5 5 #include <frams/param/multiparamload.h> 6 6 #include <frams/virtfile/stdiofile.h> 7 #include <frams/ errmgr/stdouterr.h>7 #include <frams/mhandlers/stdouthandler.h> 8 8 9 9 /** … … 66 66 StdioFILEDontClose virt_stderr(stderr); 67 67 StdioFILEDontClose virt_stdout(stdout); 68 StdoutErrorHandler error_handler(0, &virt_stderr);68 MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable, &virt_stderr); 69 69 StdioFileSystem_autoselect stdiofilesys; 70 70 MultiParamLoader loader(argv[1]); -
cpp/frams/_demos/multiline_f0_test.cpp
r348 r372 10 10 #include <frams/genetics/preconfigured.h> 11 11 #include <frams/model/model.h> 12 #include <frams/ errmgr/stdouterr.h>12 #include <frams/mhandlers/stdouthandler.h> 13 13 #include <frams/virtfile/stringfile.h> 14 14 15 15 int main(int argc,char*argv[]) 16 16 { 17 StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output) 17 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 18 18 PreconfiguredGenetics genetics; 19 19 -
cpp/frams/_demos/neuro_layout_test.cpp
r348 r372 7 7 #include <frams/genetics/preconfigured.h> 8 8 #include <frams/model/model.h> 9 #include <frams/ errmgr/stdouterr.h>9 #include <frams/mhandlers/stdouthandler.h> 10 10 #include <frams/canvas/nn_layout_model.h> 11 11 … … 83 83 int main(int argc,char*argv[]) 84 84 { 85 StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output) 85 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 86 86 PreconfiguredGenetics genetics; 87 87 -
cpp/frams/_demos/neuro_test.cpp
r348 r372 9 9 #include <frams/neuro/neuroimpl.h> 10 10 #include <frams/neuro/neurofactory.h> 11 #include <frams/ errmgr/stdouterr.h>11 #include <frams/mhandlers/stdouthandler.h> 12 12 13 13 /** … … 60 60 int main(int argc,char*argv[]) 61 61 { 62 StdoutErrorHandler err;//the default ErrorHandler constructor automatically registers this object to receive framsg messages (and in this case, redirect them to standard output) 62 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 63 63 PreconfiguredGenetics genetics; 64 64 -
cpp/frams/_demos/shapeconvert.cpp
r348 r372 9 9 10 10 #include <frams/model/model.h> 11 #include <frams/ errmgr/stdouterr.h>11 #include <frams/mhandlers/stdouthandler.h> 12 12 #include <frams/genetics/preconfigured.h> 13 13 … … 34 34 { 35 35 StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err 36 StdoutErrorHandler err(ErrorHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout36 MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout 37 37 38 38 PreconfiguredGenetics genetics; … … 50 50 if ((shape != Part::SHAPE_ELLIPSOID) && (shape != Part::SHAPE_CUBOID) && (shape != Part::SHAPE_CYLINDER)) 51 51 { 52 FMprintf("", "shapeconvert", FMLV_ERROR, "Invalid shape");52 Hprintf("", "shapeconvert", HMLV_ERROR, "Invalid shape"); 53 53 return 4; 54 54 } … … 71 71 if (!m.isValid()) 72 72 { 73 FMprintf("", "shapeconvert", FMLV_ERROR, "Cannot build Model from the supplied genotype");73 Hprintf("", "shapeconvert", HMLV_ERROR, "Cannot build Model from the supplied genotype"); 74 74 return 2; 75 75 } … … 77 77 if (m.getShape() != Model::SHAPE_OLD) 78 78 { 79 FMprintf("", "shapeconvert", FMLV_ERROR, "Only old style shapes can be converted");79 Hprintf("", "shapeconvert", HMLV_ERROR, "Only old style shapes can be converted"); 80 80 return 3; 81 81 } -
cpp/frams/_demos/simil_test.cpp
r361 r372 5 5 6 6 #include <vector> 7 #include "frams/ errmgr/stdouterr.h"7 #include "frams/mhandlers/stdouthandler.h" 8 8 #include "frams/_demos/genotypeloader.h" 9 9 #include "frams/genetics/preconfigured.h" … … 39 39 int main(int argc, char *argv[]) 40 40 { 41 StdoutErrorHandler stdouterr; //comment this object out to mute error/warning messages41 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); 42 42 typedef double *pDouble; 43 43 int iCurrParam = 0; // index of the currently processed parameter
Note: See TracChangeset
for help on using the changeset viewer.