From ef7bb4f04fa473ef7faa347e535afe10eca63257 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Wed, 10 Apr 2013 14:50:22 +0200
Subject: [PATCH] reporting: add more info to stdout during processing/writing

---
 matlab/reporting/@graph/createGraph.m   | 1 -
 matlab/reporting/@pages/addPage.m       | 1 +
 matlab/reporting/@pages/write.m         | 1 +
 matlab/reporting/@report/write.m        | 3 ++-
 matlab/reporting/@section/addGraph.m    | 1 +
 matlab/reporting/@section/addTable.m    | 1 +
 matlab/reporting/@section/addVspace.m   | 1 +
 matlab/reporting/@section/write.m       | 1 +
 matlab/reporting/@sections/addSection.m | 7 ++++---
 matlab/reporting/@sections/write.m      | 1 +
 matlab/reporting/@table/write.m         | 1 -
 11 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m
index 4a14767b8b..e40eaddead 100644
--- a/matlab/reporting/@graph/createGraph.m
+++ b/matlab/reporting/@graph/createGraph.m
@@ -38,7 +38,6 @@ if ~o.seriesElements.numElements()
     return;
 end
 
-disp('creating plot..........');
 h = figure('visible','off');
 hold on;
 box on;
diff --git a/matlab/reporting/@pages/addPage.m b/matlab/reporting/@pages/addPage.m
index e5fe7e556f..00d154a1f1 100644
--- a/matlab/reporting/@pages/addPage.m
+++ b/matlab/reporting/@pages/addPage.m
@@ -29,5 +29,6 @@ function o = addPage(o, varargin)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
+disp(['Processing Page: ' num2str(numPages(o)+1)]);
 o.objArray = o.objArray.addObj(page(varargin{:}));
 end
\ No newline at end of file
diff --git a/matlab/reporting/@pages/write.m b/matlab/reporting/@pages/write.m
index 903e8b6b6e..203060495e 100644
--- a/matlab/reporting/@pages/write.m
+++ b/matlab/reporting/@pages/write.m
@@ -33,6 +33,7 @@ assert(fid ~= -1);
 fprintf(fid, '\n%% Pages Object\n');
 nps = numPages(o);
 for i=1:nps
+    disp(['Writing Page: ' num2str(i)]);
     o.objArray(i).write(fid);
 end
 fprintf(fid, '%% End Pages Object\n\n');
diff --git a/matlab/reporting/@report/write.m b/matlab/reporting/@report/write.m
index d3b282ce6f..031310d475 100644
--- a/matlab/reporting/@report/write.m
+++ b/matlab/reporting/@report/write.m
@@ -72,4 +72,5 @@ status = fclose(fid);
 if status == -1
     error('@report.wrie: closing %s\n', o.filename);
 end
-end
\ No newline at end of file
+disp('Finished Writing Report!');
+end
diff --git a/matlab/reporting/@section/addGraph.m b/matlab/reporting/@section/addGraph.m
index 28e6e80b9b..b8e3c03f2a 100644
--- a/matlab/reporting/@section/addGraph.m
+++ b/matlab/reporting/@section/addGraph.m
@@ -30,5 +30,6 @@ function o = addGraph(o, varargin)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
+disp(['Processing Section Element: ' num2str(numElements(o)+1)]);
 o.elements = o.elements.addGraph(varargin{:});
 end
diff --git a/matlab/reporting/@section/addTable.m b/matlab/reporting/@section/addTable.m
index 7e9390c96c..1668793ccc 100644
--- a/matlab/reporting/@section/addTable.m
+++ b/matlab/reporting/@section/addTable.m
@@ -30,5 +30,6 @@ function o = addTable(o, varargin)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
+disp(['Processing Section Element: ' num2str(numElements(o)+1)]);
 o.elements = o.elements.addTable(varargin{:});
 end
diff --git a/matlab/reporting/@section/addVspace.m b/matlab/reporting/@section/addVspace.m
index b572b19422..43ca6ac671 100644
--- a/matlab/reporting/@section/addVspace.m
+++ b/matlab/reporting/@section/addVspace.m
@@ -29,5 +29,6 @@ function o = addVspace(o, varargin)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
+disp(['Processing Section Element: ' num2str(numElements(o)+1)]);
 o.elements = o.elements.addVspace(varargin{:});
 end
diff --git a/matlab/reporting/@section/write.m b/matlab/reporting/@section/write.m
index 8a4d36d8e1..6a1f68dfca 100644
--- a/matlab/reporting/@section/write.m
+++ b/matlab/reporting/@section/write.m
@@ -51,6 +51,7 @@ ne = numElements(o);
 nvspace = numVspace(o);
 nlcounter = 0;
 for i=1:ne
+    disp(['Writing Section Element: ' num2str(i)]);
     if isa(o.elements(i), 'vspace')
         assert(rem(nlcounter, o.cols) == 0, ['@section.write: must place ' ...
                             'vspace command after a linebreak in the table ' ...
diff --git a/matlab/reporting/@sections/addSection.m b/matlab/reporting/@sections/addSection.m
index 08bf94813f..d2190ae848 100644
--- a/matlab/reporting/@sections/addSection.m
+++ b/matlab/reporting/@sections/addSection.m
@@ -1,5 +1,5 @@
-function ss = addSection(ss, varargin)
-% function ss = addSection(ss, varargin)
+function o = addSection(o, varargin)
+% function o = addSection(o, varargin)
 
 % Copyright (C) 2013 Dynare Team
 %
@@ -18,5 +18,6 @@ function ss = addSection(ss, varargin)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-ss.objArray = ss.objArray.addObj(section(varargin{:}));
+disp(['Processing Section: ' num2str(numSections(o)+1)]);
+o.objArray = o.objArray.addObj(section(varargin{:}));
 end
\ No newline at end of file
diff --git a/matlab/reporting/@sections/write.m b/matlab/reporting/@sections/write.m
index 372ef6299d..d354d331f9 100644
--- a/matlab/reporting/@sections/write.m
+++ b/matlab/reporting/@sections/write.m
@@ -33,6 +33,7 @@ assert(fid ~= -1);
 fprintf(fid, '\n%% Sections Object\n');
 nps = numSections(o);
 for i=1:nps
+    disp(['Writing Section: ' num2str(i)]);
     o.objArray(i).write(fid);
 end
 fprintf(fid, '%% End Sections Object\n\n');
diff --git a/matlab/reporting/@table/write.m b/matlab/reporting/@table/write.m
index ba5357c387..af10ff79b4 100644
--- a/matlab/reporting/@table/write.m
+++ b/matlab/reporting/@table/write.m
@@ -49,7 +49,6 @@ else
 end
 ndates = dates.ndat;
 
-disp('creating table.........');
 fprintf(fid, '%% Table Object\n');
 fprintf(fid, '\\setlength{\\tabcolsep}{4pt}\n');
 fprintf(fid, '\\begin{tabular}{@{}l');
-- 
GitLab