function plc_ide_list = plc_custom_ide
% plc_custom_ide support for selectron target

%   Copyright 2018-2023 The MathWorks, Inc.
    plc_ide_list(1) = get_ide_info_selectron;
end

function ide_info = get_ide_info_selectron
    ide_info.name = 'selectron';
    ide_info.description = 'Selectron CAP1131';
    ide_info.path = ''; % IDE path
    ide_info.format = 'generic'; % generic|xml
    ide_info.fileExtension = 'asc';
    ide_info.cfg = get_ide_cfg_selectron;
    ide_info.precg_callback = 'plc_precg_callback_selectron';
    ide_info.postcg_callback = 'plc_postcg_callback_selectron';
    ide_info.xmltree_callback = 'empty';
    ide_info.pluginVersion = 1.0;
    ide_info.compatibleBuildVersion = 1.6;
end

function cfg = get_ide_cfg_selectron
    cfg.fConvertDoubleToSingle = false;
    cfg.fConvertDoubleToSingleEmitter = true;
    cfg.fDefineFBExternalVariable = true;
    cfg.fDefineFBExternalConstVariable = true;
    cfg.fArrayInitialValueBrackets = true;
    cfg.fSimplifyFunctionCallExpr = true;%g2080460
    cfg.fSupportGlobalConst = true;
    cfg.fConvertNamedConstantToInteger = true;
    cfg.fConvertAggregateInitValueToAssignment  = true; %g2080462
    cfg.fConvertEnumToInteger = true; %g2080464
    cfg.fEmitVarDeclarationBeforeDescription = true; %g2113292
    cfg.fErrorOnTrailingUS = true;
	cfg.fHoistArrayIndexExprs = false; % Originally set to true by amathewi via g2115535
	                                   % However, it was determined that this option was 
									   % not required in the first place (see g2499781). 
									   % Hence, set to false by akhadse
									   % TODO: Remove this line when change approved by QEs
    cfg.fReplaceShiftFunctions = true;
    cfg.fTargetKeywordHook = 'plc_selectron_keyword_list';
end

% LocalWords:  selectron asc precg postcg amathewi akhadse
