function outInfo=eblkinfo
%EBLKSINFO Helper function for keeping list data
%          for the MATLAB Tour 

%   Yama Habibzai
%   Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%   $Revision: 1.9 $
%   $Date: 1997/12/02 20:55:41 $ 

% Looks for Blocksets that are installed. If not, it adds its own
% little blurb on it.

% Flag to show if a Toolbox is installed. Initially, assume none are installed

comm = 0;
dsp= 0;
fixpoint= 0;
powersys=0;
ncd= 0;
rtw=0;
ada=0;
statflow=0;
n = 0;

figs = allchild(0);
figNumber = findobj(figs, 'Name', 'MATLAB Tour');
param = get(figNumber, 'userdata');
blocksets = param.blocksets;
toolboxes = param.toolboxes;

% Communications Toolbox is part of Toolboxes, but we want to 
% include it with blocksets also.

for i = 1:size(toolboxes, 2);
  if  strcmp(toolboxes(i).Name, 'Communications')
    n = n+1;
    comm = 1;
    tbxList(n).DemoList = toolboxes(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on The Communication Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Toolbox';
    tbxList(n).FcnList = toolboxes(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''comm''))';
    tbxList(n).Help = toolboxes(i).Help;
    tbxList(n).Name = toolboxes(i).Name;
  end
end

% -----------------
sfExist = exist('sfinfo.m');
if sfExist
  n=n+1;
  stateflow=1;
  stfList = esfinfo;
  tbxList(n).DemoList = stfList.DemoList;
  tbxList(n).FcnList = stfList.FcnList;
  tbxList(n).Name = 'Stateflow';
end % if ....

% *******************
for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'DSP Blockset')
    n = n+1; 
    dsp = 1;
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on The DSP Blockset';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Blockset';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''dspblks''))';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name =blocksets(i).Name;
  end
end
% *******************
for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'Fixed Point')
    n = n+1;
    fixpoint = 1; 
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Fixed Point Blockset';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Blockset';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''fixpoint''))';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name = blocksets(i).Name;
  end
end

% *******************
for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'Power System Blockset')
    n = n+1;
    powersys= 1;
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on Power System Blockset';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'Help on this Blockset';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''powersys''))';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name = blocksets(i).Name;
  end
end
 

%*************
for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'Nonlinear Control Design')
    n = n+1; 
    ncd =1;
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = ' More on the NCD Toolbox';
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = ' Help on this Toolbox';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'helpwin(help(''ncd''))';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name =blocksets(i).Name;
  end
end

% *******************
for i = 1:size(blocksets, 2);
  if  strcmp(blocksets(i).Name, 'RTW')
    n = n+1; 
    rtw =1;
    tbxList(n).DemoList = blocksets(i).DemoList;
    tbxList(n).DemoList{size(tbxList(n).DemoList, 2)+1} = 'More on the Real-Time Worksh op';
    tbxList(n).FcnList = blocksets(i).FcnList;
    tbxList(n).FcnList{size(tbxList(n).FcnList, 2)+1} = 'evalcb(''toolInfo'')';
    tbxList(n).Help = blocksets(i).Help;
    tbxList(n).Name = blocksets(i).Name;
  end
end

%%%%%%%% IF PRODUCT IS NOT INSTALLED %%%%%%%%%%
if comm == 0
  n = n+1;
  tbxList(n).DemoList={'More on The Communications Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'comm_con'};
  tbxList(n).Help= about('communications');
  tbxList(n).Name= 'Communications Toolbox';
end

if stateflow== 0
  n = n+1;
  tbxList(n).DemoList={'More on Stateflow'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'};
  tbxList(n).Help= about('stateflow');
  tbxList(n).Name='Stateflow';
end

if dsp== 0
  n = n+1;
  
  tbxList(n).DemoList={'More on DSP Blockset'
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'dsp_con'};
  tbxList(n).Help=  about('dsp');
  tbxList(n).Name='DSP Blockset';
end

if fixpoint== 0
  n = n+1;
  tbxList(n).DemoList={'More on Fixed Point Blockset',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'fix_con'};
  tbxList(n).Help= about('fixpoint');
  tbxList(n).Name='Fixed Point Blockset';
end

if powersys== 0
  n = n+1;
  tbxList(n).DemoList={'More on Power System Blockset',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'pwr_con'};
  tbxList(n).Help= about('powersys');
  tbxList(n).Name='Power System Blockset';
end

if ncd== 0
  n = n+1;
  tbxList(n).DemoList={'More on the NCD Toolbox',
  'Partial functions help'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')',
  'ncd_con'};
  tbxList(n).Help = about('ncd');
  tbxList(n).Name='Nonlinear Control Design Blockset';
end

if rtw== 0
  n = n+1;
  tbxList(n).DemoList={'More on the Real-Time Workshop'};
  tbxList(n).FcnList={'evalcb(''toolInfo'')'};
  tbxList(n).Help= about('rtw');
  tbxList(n).Name='Real-Time Workshop';
end

outInfo=tbxList;



