function [mapName, relativePathToMapFile, found] = getBlockHelpMapNameAndPath(block_type)
% getBlockHelpMapNameAndPath

%  Returns the mapName and the relative path to the map file for this block_type

% Internal note: 
%   First column is the "System object name", corresponding to the block, 
%   Second column is the anchor ID, the doc uses for the block.
%   For core blocks, the first column is the 'BlockType'.

% Copyright 2014-2021 The MathWorks, Inc.

blks = {... % System blocks
    'visionhdl.BilateralFilter'        'visionhdlbilateral'              ; ...
    'visionhdl.BirdsEyeView'           'visionhdlbirdseye'             ; ...
    'visionhdl.ChromaResampler'        'visionhdlchromaresampler'     ; ...
    'visionhdl.Closing'                'visionhdlclosing'             ; ...
    'visionhdl.ColorSpaceConverter'    'visionhdlcolorspaceconverter'    ; ...
    'visionhdl.DemosaicInterpolator'   'visionhdldemosaic'               ; ...
    'visionhdl.Dilation'               'visionhdldilation'               ; ...
    'visionhdl.EdgeDetector'           'visionhdledgedetector'           ; ...
    'visionhdl.CornerDetector'         'visionhdlcornerdetector'        ; ...
    'visionhdl.Erosion'                'visionhdlerosion'                ; ...
    'visionhdl.GammaCorrector'         'visionhdlgammacorrection'        ; ...
    'visionhdl.GrayscaleDilation'      'visionhdlgraydilation'           ; ...
    'visionhdl.GrayscaleErosion'       'visionhdlgrayerosion'        ; ... 
    'visionhdl.GrayscaleClosing'       'visionhdlgrayclosing'        ; ...
    'visionhdl.GrayscaleOpening'       'visionhdlgrayopening'        ; ...    
    'visionhdl.Histogram'              'visionhdlhistogram'              ; ...
    'visionhdl.ImageFilter'            'visionhdlimagefilter'            ; ...
    'visionhdl.ImageStatistics'        'visionhdlstatistics'             ; ...
    'visionhdl.LineBuffer'             'visionhdllinemem'                ; ...
    'visionhdl.LookupTable'            'visionhdllut'                    ; ...
    'visionhdl.MedianFilter'           'visionhdlmedianfilter'           ; ...
    'visionhdl.Opening'                'visionhdlopening'                ; ...
    'visionhdl.ROISelector'            'visionhdlroi'                    ; ...
    'visionhdl.MeasureTiming'          'visionhdltiming'                 ; ...
    'visionhdl.PixelStreamAligner'     'visionhdlsync'                   ; ...
    'visionhdl.HVCounter'              'visionhdlhvcounter'              ; ...
    'Pixel Control Bus Creator'        'visionhdlbuscreator'             ; ...
    'Pixels To Frame'                  'visionhdlpixelstoframe'          ; ...
    'Frame To Pixels'                  'visionhdlframetopixels'          ; ...
    'FIL Pixels To Frame'              'visionhdlfilpixelstoframe'       ; ...
    'FIL Frame To Pixels'              'visionhdlfilframetopixels'       ; ...
    'Pixel Stream FIFO'                'visionhdlfifo' ; ...
  };

relativePathToMapFile = '/visionhdl/visionhdl.map';
found = false;
% See whether or not the block is a core or built-in
i = strcmp(block_type, blks(:,1));

if ~any(i)
  mapName = 'User Defined';
else
  found = true;
  mapName = blks(i,2);
end

