Commit 1d1137bf authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting (WIP)

parent 77dbf06a
......@@ -29,4 +29,5 @@ if nargin == 2
oa.objs{end+1} = varargin{1};
elseif nargin == 3
oa.objs{varargin{2}} = varargin{1};
end
end
\ No newline at end of file
......@@ -22,6 +22,7 @@ switch nargin
case 1
e = oa.objs;
case 2
assert(isnumeric(varargin{1}));
e = oa.objs{varargin{1}};
otherwise
error('objArray getObjs: invalid number of arguments');
......
......@@ -30,20 +30,9 @@ function p = addSection(p, varargin)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(nargin >= 1 && nargin <= 3, ['incorrect number of arguments passed ' ...
'to addSection']);
assert(isa(p, 'page'), 'First argument must be a page object');
if nargin > 1
assert(isa(varargin{1},'section'), ['Optional 2nd arg to addSection must be a ' ...
'Section']);
if nargin > 2
assert(isnumeric(varargin{2}), ['Optional 3rd arg to addSection must be ' ...
'an index']);
end
end
if nargin == 1
p.sections = p.sections.addSection(section());
p.sections = p.sections.addSection();
elseif nargin == 2 || nargin == 3
p.sections = p.sections.addSection(varargin{:});
end
......
function display(o)
%function display(o)
% Display a Page object
%
% INPUTS
% none
%
% OUTPUTS
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
name = 'report.page';
disp(' ');
disp([name '.sections = ']);
disp(' ');
disp(o.sections());
end
\ No newline at end of file
......@@ -35,7 +35,7 @@ switch S.type
B{index} = V;
case '.'
switch S.subs
case fields(A)
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['field ' S.subs 'does not exist in the page class'])
......
function display(o)
%function display(o)
% Display a Pages object
%
% INPUTS
% none
%
% OUTPUTS
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
name = 'report.pages';
disp(' ');
disp([name ' = ']);
disp(' ');
disp(getPages(o));
end
\ No newline at end of file
......@@ -43,7 +43,7 @@ if nargin > 1
end
if nargin == 1
r.pages = r.pages.addPage(page());
r.pages = r.pages.addPage();
elseif nargin == 2 || nargin == 3
r.pages = r.pages.addPage(varargin{:});
end
......
function display(r)
%function display(r)
function display(o)
%function display(o)
% Display a Report object
%
% INPUTS
......@@ -28,20 +28,21 @@ function display(r)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
name = 'report';
disp(' ');
disp([inputname(1) '.title = ']);
disp([name '.title = ']);
disp(' ');
disp([' ''' r.title '''']);
disp([' ''' o.title '''']);
disp(' ')
disp([inputname(1) '.orientation = ']);
disp([name '.orientation = ']);
disp(' ');
disp([' ''' r.orientation '''']);
disp([' ''' o.orientation '''']);
disp(' ')
disp([inputname(1) '.numPages() = ']);
disp([name '.numPages() = ']);
disp(' ');
disp([' ' num2str(numPages(r))]);
disp([' ' num2str(numPages(o))]);
disp(' ');
disp([inputname(1) '.pages = ']);
disp([name '.pages = ']);
disp(' ');
disp(r.pages.getPages());
disp(o.pages.getPages());
end
\ No newline at end of file
......@@ -35,7 +35,7 @@ switch S.type
B.pages(index) = V;
case '.'
switch S.subs
case fields(A)
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['field ' S.subs 'does not exist in the report class']);
......
......@@ -34,9 +34,7 @@ switch S(1).type
error(['Report Class: unknown field or method: ' S(1).subs]);
end
case '()'
index = S(1).subs{:};
assert(isnumeric(index));
A = A(index);
A = A.pages.getPages(S(1).subs{:});
case '{}'
error(['Report Class: ' S(1).type ' indexing not supported.']);
otherwise
......
function display(o)
%function display(o)
% Display a Section object
%
% INPUTS
% none
%
% OUTPUTS
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
name = 'report.page.section';
disp(' ');
disp([name '.x = ']);
end
\ No newline at end of file
......@@ -19,6 +19,11 @@ function ss = addSection(ss, varargin)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(nargin >= 1 && nargin <= 3)
if nargin > 1
assert(isa(varargin{1},'section'), ['Optional 2nd arg to addSection ' ...
'must be a Section']);
end
if nargin == 1
ss.objArray = ss.objArray.addObj(section());
else
......
function display(o)
%function display(o)
% Display a Sections object
%
% INPUTS
% none
%
% OUTPUTS
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
name = 'reports.page';
disp(' ');
disp([name '.sections = ']);
disp(' ');
disp(getSections(o));
end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment