function schema
%SCHEMA   Define the hdledas class.

%   Author(s): J. Sun, et-al
%   Copyright 2008-2023 The MathWorks, Inc.

% store persistent variables
mlock;

pk = findpackage('hdlcoderui');
parentcls = findclass(pk, 'abstracthdlcomps');
c  = schema.class(pk, 'abstracthdledas',parentcls);

% property for the listbox
p = schema.prop(c, 'ScriptSelection', 'mxArray');
p.FactoryValue = 0;

if isempty(findtype('SynToolType'))
    schema.EnumType( ...
        'SynToolType', {'None', 'Vivado', 'ISE', 'Libero', 'Precision', 'Quartus', 'Synplify', 'Custom'});
end

p = schema.prop(c,'SynToolOption','SynToolType'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%none
p = schema.prop(c,'SynScriptPostFix','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%ISE
p = schema.prop(c,'SynScriptPostFix_I','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_I','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_I','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_I','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 


%Vivado
p = schema.prop(c,'SynScriptPostFix_V','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_V','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_V','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_V','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 



%Libero
p = schema.prop(c,'SynScriptPostFix_L','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_L','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_L','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_L','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%Precision
p = schema.prop(c,'SynScriptPostFix_P','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_P','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_P','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_P','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%Quartus
p = schema.prop(c,'SynScriptPostFix_Q','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_Q','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_Q','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_Q','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%Synplify
p = schema.prop(c,'SynScriptPostFix_S','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_S','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_S','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_S','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%Custom
p = schema.prop(c,'SynScriptPostFix_C','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptInit_C','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptCmd_C','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

p = schema.prop(c,'SynScriptTerm_C','string'); 
p.AccessFlags.PublicSet = 'on';
p.AccessFlags.PublicGet = 'on';
set(p, 'Visible','off'); 

%%%%%%%%%% Lint Tool stuff %%%%%%%%%%%%%%%%%%%
function add_schema_property( propname, type )
    p = schema.prop(c,propname,type);
    p.AccessFlags.PublicSet = 'on';
    p.AccessFlags.PublicGet = 'on';
    set(p, 'Visible','off'); 
end

LintType = {'Cmd','Init','Term'};
% Caveat: LintTools field names should have distinct first-letters, so we are
% limited to only 26 choices here. They should match allowed property names on
% CLI. This is due to the implementation using the first letter of the LintTools
% field to define the postfix of the name of the tool-specific field,
% e.g. HDLLintCmd_A.
LintTools = {'None','AscentLint','HDLDesigner','Leda','SpyGlass', 'Custom'};

if isempty(findtype('LintToolType'))
    schema.EnumType( ...
        'LintToolType', LintTools);
end

add_schema_property('LintToolOption','LintToolType'); 

add_schema_property('HDLLintInit','string'); 

add_schema_property('HDLLintCmd','string');

add_schema_property('HDLLintTerm','string'); 

for itx = 1:length(LintType)
    type = LintType{itx};
    for itr = 1:length(LintTools)    
        toolname = LintTools{itr}; 
        postfix = upper(toolname(1));
        add_schema_property(['HDLLint',type,'_',postfix],'string');
    end
end

%
% Methods
% %
m = schema.method(c, 'getTabDialogSchema');
s = m.Signature;
s.varargin = 'off';
s.InputTypes = {'handle', 'string', 'mxArray'};
s.OutputTypes = {'mxArray'};

% static method callback to update HDL Lint Tool setting
m = schema.method(c, 'updateLintToolNameCallback','static'); %#ok
end

% LocalWords:  abstracthdledas
