changeset 32:8ce78cacb5cb

replace warning to error display channel
author Mathieu Lagrange <mathieu.lagrange@cnrs.fr>
date Mon, 22 May 2017 10:26:04 +0200
parents 3c29a652e441
children d0ceb549f734
files nonExposed/addUserOffsets.m nonExposed/check_options.m nonExposed/getEvent.m nonExposed/utils/process_options.m simScene.m
diffstat 5 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/nonExposed/addUserOffsets.m	Mon May 22 10:19:52 2017 +0200
+++ b/nonExposed/addUserOffsets.m	Mon May 22 10:26:04 2017 +0200
@@ -21,7 +21,7 @@
 
 if length(scoreEvent)==1 && strcmp('',scoreEvent{1}{1})  % add the same offset to all the classes
     userOffset=[repmat(scoreEvent{1}{3},length(template),1) repmat(scoreEvent{1}{4},length(template),1) repmat(scoreEvent{1}{5},length(template),1) repmat(scoreEvent{1}{6},length(template),1)];
-    warning('score.event if of length 1: classId will set to the class labels of the scene to replicate')
+    fprintf(2, 'score.event if of length 1: classId will set to the class labels of the scene to replicate')
 else % add class wise offsets
     for jj=1:length(scoreEvent) scoreEventClass{jj}=scoreEvent{jj}{1}; end;
     for ii=1:length(template)
--- a/nonExposed/check_options.m	Mon May 22 10:19:52 2017 +0200
+++ b/nonExposed/check_options.m	Mon May 22 10:26:04 2017 +0200
@@ -41,14 +41,10 @@
     if strcmp(timeMode,'generate') && strcmp(timeMode,'generate')
         error('Score does not have a sceneDuration field')
     else
-        warning('score.sceneduration does not exist; sceneDuration will be set to the duration of the scene to replicate')
+        fprintf(2, 'score.sceneduration does not exist; sceneDuration will be set to the duration of the scene to replicate')
     end
 end
 
-% if ~isfield(score,'backgrounds')
-%     warning('score does not have a backgrounds field; Noise background are going to be generated')
-% end
-
 if strcmp(timeMode,'generate') || strcmp(timeMode,'generate')
     if  ~isfield(score,'events')
         error('score.event does not exist; score.event is needed if one of the modes is set to generate')
@@ -57,7 +53,7 @@
 
 if ~strcmp(timeMode,'generate') || ~strcmp(timeMode,'generate')
     if isfield(score,'events')
-        warning('score.event exist; score.events cells values will be used as offsets')
+        fprintf(2, 'score.event exist; score.events cells values will be used as offsets')
     end
 end
 
--- a/nonExposed/getEvent.m	Mon May 22 10:19:52 2017 +0200
+++ b/nonExposed/getEvent.m	Mon May 22 10:26:04 2017 +0200
@@ -48,12 +48,12 @@
     
     if (settings.start_time > score.sceneDuration)
         settings.start_time = score.sceneDuration;
-        warning(['Sart time of event class ' score.events{ii}{1} ' is superior to the scene Duration; start time has been set to the scene duration.'])
+        fprintf(2, ['Sart time of event class ' score.events{ii}{1} ' is superior to the scene Duration; start time has been set to the scene duration.'])
     end
     
     if (settings.end_time > score.sceneDuration)
         settings.end_time = score.sceneDuration;
-        warning(['End time of event class ' score.events{ii}{1} ' is superior to the scene Duration; end time has been set to the scene duration.'])
+        fprintf(2, ['End time of event class ' score.events{ii}{1} ' is superior to the scene Duration; end time has been set to the scene duration.'])
     end
     
     
--- a/nonExposed/utils/process_options.m	Mon May 22 10:19:52 2017 +0200
+++ b/nonExposed/utils/process_options.m	Mon May 22 10:26:04 2017 +0200
@@ -123,7 +123,7 @@
   end
   if (~found)
     if (warn)
-      warning(sprintf('Option ''%s'' not used.', args{i}));
+      fprintf(2, sprintf('Option ''%s'' not used.', args{i}));
       args{i}
     else
       nunused = nunused + 1;
--- a/simScene.m	Mon May 22 10:19:52 2017 +0200
+++ b/simScene.m	Mon May 22 10:26:04 2017 +0200
@@ -174,7 +174,7 @@
     if isfield(score,'events')
         score.events=addUserOffsets(template.class,score.events,timeMode,ebrMode);
     else
-        warning('score.event is empty: score.event will be created from the scene to replicate');
+        fprintf(2, 'score.event is empty: score.event will be created from the scene to replicate');
         score.events=template.class;
     end
     if ~isfield(score,'sceneDuration')