function [mapName, relativePathToMapFile, found] = getBlockHelpMapNameAndPath(block_type)
% Returns the mapName and the relative path to the maps file for this block_type
% This is a private function, not to be used directly.

% Copyright 2014-2023 The MathWorks, Inc.

blh = gcbh;  % Get block handle

blks = {...
    'WindHWM07'                 'horizontalwindmodel07'                     ;...
    'QuatInterp'                'quaternioninterpolation'                   ;...
    'WindHWM14'                 'horizontalwindmodel14'                     ;...
    'Angle2Rod'                 'angletorodrigues'                          ;...
    'Dcm2Rod'                   'dcmtorodrigues'                            ;...
    'Quat2Rod'                  'quaterniontorodrigues'                     ;...
    'Rod2Angle'                 'rodriguestoangle'                          ;...
    'Rod2Dcm'                   'rodriguestodcm'                            ;...
    'Rod2Quat'                  'rodriguestoquaternion'                     ;...
    'DeltaUT1'                  'deltaut1utc'                               ;...
    'GravityWGS84'              'wgs84_gravity_model'                       ;...
    'EOParameters'              'eoparameters'                              ;...
    'Geoc2Geod'                 'geocentric_to_geodetic_latitude'           ;...
    'Geod2Geoc'                 'geodetic_to_geocentric_latitude'           ;...
    'IGRF'                      'international_geomagnetic_reference_field' ;...
    'ECEF2LLA'                  'ecef_position_to_lla'                      ;...
    'LLA2ECEF'                  'lla_to_ecef_position'                      ;...
    'RefPointMass'              'fixed_wing_point_mass'                     ;...
    'SHGravity'                 'spherical_harmonic_gravity_model'          ;...
    'OrbitPropagator'           'orbit_propagator'                          ;...
    'SpacecraftDynamics'        'spacecraft_dynamics'                       ;...
    'EOM3DOF'                   'threedof_body_axes'                        ;...
    'PlanetaryEphem'            'planetaryephemerides'                      ;...
    'FluxSolarAndGeomagnetic',  'FluxSolarAndGeomagneticData'               ;...
    'AttitudeDynamics',         'attitude_dynamics'                         ;...
    'EclipseShadowModel',       'eclipse_shadow_model'                      ;...
       };

relativePathToMapFile = '/aeroblks/aeroblks.map';
found = false;
% See whether or not the block is a Aerospace Blockset core or built-in

idx = strcmp(block_type, blks(:,1));

if ~any(idx)
    mapName = 'User Defined';
else
    found = true;
    mapName = blks(idx,2);
    % Map each variant of EOM3DOF to a different help page
    if strcmp(block_type, 'EOM3DOF')
        if strcmp(get_param(blh, 'BlockType'), 'EOM3DOF')  % Make sure we have the right block
            mtype = get_param(blh, 'mtype');
            axes = get_param(blh, 'axes');
            switch axes
              case 'Body'
                switch mtype
                  case 'Fixed'
                    mapName = {'threedof_body_axes'};
                  case 'Simple Variable'
                    mapName = {'simple_variable_mass_3dof_body_axes'};
                  case 'Custom Variable'
                    mapName = {'custom_variable_mass_threedof_body_axes'};
                end
              case 'Wind'
                switch mtype
                  case 'Fixed'
                    mapName = {'threedof_wind_axes'};
                  case 'Simple Variable'
                    mapName = {'simple_variable_mass_3dof_wind_axes'};
                  case 'Custom Variable'
                    mapName = {'custom_variable_mass_threedof_wind_axes'};
                end
            end
        end
    end
end
