function [ok,info,varargout] = plotAllCharts(varargin)
%PLOTALLCHARTS  plot all the charts with MKL, TKL and BKL coastlines 
%
%   The charts for all the sections and their jarkus transects are plotted 
%   as jpg files. The charts are for the years where possibly MKL, BKL and
%   TKL coastline information was found
%
%   Syntax:
%   [ok,info,varargout] = plotAllCharts(varargin)
%
%   Input: 
%    varargin = key/value-pair. When given it is treated as the storage directory
%               keyword = 'storage'; the directory to store the charts
%    load CoastLineInfo
%      a save must have been done of various data in "CoastLineInfo"
%      charts  : the coast line values for the transects and the years
%      years   : the years with possible data for the coast lines
%      secTrans: the id for the section and the transect = section*10^6 +
%                transect
%      LonLat  : the Lon/lat coordinates for the given transects in secTrans
%      sections: the section numbers and the related section names
%
%   Output:
%      ok   = 0 no correct computation, the function stopped
%             1 no problems
%      info = info message
%
%   Example
%   plotAllCharts
%
%   See also 

%% Copyright notice
%   --------------------------------------------------------------------
%   Copyright (C) 2010 <COMPANY>
%       Lou Verhage
%
%       <lou.verhage@deltares.nl>	
%
%       <ADDRESS>
%
%   This library is free software: you can redistribute it and/or
%   modify it under the terms of the GNU Lesser General Public
%   License as published by the Free Software Foundation, either
%   version 2.1 of the License, or (at your option) any later version.
%
%   This library 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
%   Lesser General Public License for more details.
%
%   You should have received a copy of the GNU Lesser General Public
%   License along with this library. If not, see <http://www.gnu.org/licenses/>.
%   --------------------------------------------------------------------

% This tool is part of <a href="http://OpenEarth.nl">OpenEarthTools</a>.
% OpenEarthTools is an online collaboration to share and manage data and 
% programming tools in an open source, version controlled environment.
% Sign up to recieve regular updates of this function, and to contribute 
% your own tools.

%% Version <http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html>
% Created: 22 Mar 2010
% Created with Matlab version: 7.8.0.347 (R2009a)

% $Id: plotAllCharts.m 4926 2011-04-18 13:00:40Z verhage $
% $Date: 2011-04-18 15:00:40 +0200 (Mon, 18 Apr 2011) $
% $Author: verhage $
% $Revision: 4926 $
% $HeadURL: https://svn.oss.deltares.nl/repos/openearthrawdata/trunk/rijkswaterstaat/kustlijnkaartenboek/scripts/plotAllCharts.m $
% $Keywords: $

%% initialize, get the results from jarkus_GEChart.m
load CoastLineInfo;
OPT.storage = '';
OPT = setProperty(OPT,varargin{:});
%% plot the charts for the sections
nrSections = sections.number;
clear LonLat charts secTrans sections years
ok   = true;
info = '';
if nargout > 2
    varargout{1} = [];
end
for sec = 1 : length(nrSections)
    waitText = ['section nr=' num2str(sec) '/' num2str(length(nrSections))];
%     [ok,info,tr] = plotSectionCharts(nrSections{sec},mfilename,waitText);
    [ok,info,tr] = plotSectionCharts(nrSections{sec},char(fieldnames(OPT)),getfield(OPT,char(fieldnames(OPT))),'mfile',mfilename,'waittext',waitText);
    if ~ok
        if nargout > 2
            varargout{1} = tr;
        end
        return
    end
end

