function architPanel = getTabDialogSchema(this, hParent, schemaName) %#ok
%GETTABDIALOGSCHEMA   Get the tabDialogSchema.

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

componentname = 'Dialog_Main_';
tagpf = [hParent.getproductname, componentname];

currRow = 1;
src = hParent.CLIProperties;

txtArchitecture.Name    = DAStudio.message('HDLShared:fdhdldialog:architecture');
txtArchitecture.Type    = 'text';
txtArchitecture.RowSpan = [currRow, currRow];
txtArchitecture.ColSpan = [1 1];

cbArchitecture.Type           = 'combobox';
cbArchitecture.Source         = this;
cbArchitecture.Tag            = [tagpf, 'Architecture'];
this.ArchitectureEntries = squeezeEntries(this.ArchitectureEntries);
cbArchitecture.Entries = getTranslatedStringcell('HDLShared:fdhdldialog',this.ArchitectureEntries);
defaultindx = find(strcmpi(this.ArchitectureEntries,this.Architecture));
if ~isempty(defaultindx)
    cbArchitecture.Value = defaultindx - 1;
end
txtArchitecture.Buddy      = cbArchitecture.Tag;
cbArchitecture.RowSpan        = [currRow, currRow];
cbArchitecture.ColSpan        = [2 2];
cbArchitecture.Mode = true;
cbArchitecture.DialogRefresh = true;
cbArchitecture.Enabled = getEnableState(this, 'Architecture');
cbArchitecture.ObjectMethod = 'selectComboboxEntry';
cbArchitecture.MethodArgs  = {'%dialog', '%value', 'Architecture', this.ArchitectureEntries};
cbArchitecture.ArgDataTypes = {'handle', 'mxArray', 'string', 'mxArray'};
    
items = {txtArchitecture, cbArchitecture};

if strcmpi(this.Architecture, 'Fully parallel')
    this.setSerialArchSettings;    
    gcurrRow = currRow+1;
    
    spacer.Type    = 'panel';
    spacer.ColSpan = [3 3];
    spacer.RowSpan = [currRow, currRow];
    items = [items {spacer}];
    
    if isParallelInfoAvailable(hParent)
        
        info1.Type = 'text';
        info1.RowSpan  = [gcurrRow-1 gcurrRow];
        info1.ColSpan        = [4 4];
        info1.AutoFormatting = true;
        info1.Name = sprintf([getString(message('HDLShared:fdhdldialog:Foldingfactor')) ': \n' getString(message('HDLShared:fdhdldialog:Multiplier')) ': ']);
        
        info2.Type = 'text';
        info2.RowSpan  = [gcurrRow-1 gcurrRow];
        info2.ColSpan        = [5 5];
        info2.AutoFormatting = true;
        info2.Name = sprintf('%s \n%s', this.FPFoldingFactor, this.FPMultipliers);
        
        items = [items, {info1, info2}];
        currRow = gcurrRow+1;
    end
    
elseif strcmpi(this.Architecture, 'Fully serial')
    this.setSerialArchSettings;
    gcurrRow = currRow+1;
    
    spacer.Type    = 'panel';
    spacer.ColSpan = [3 3];
    spacer.RowSpan = [currRow, currRow];
    items = [items {spacer}];
    
    info1.Type = 'text';
    info1.RowSpan  = [gcurrRow-1 gcurrRow];
    info1.ColSpan        = [4 4];
    info1.AutoFormatting = true;
    if isSerialPartInfoAvailable(hParent)    
        info1.Name = sprintf([getString(message('HDLShared:fdhdldialog:Foldingfactor')) ': \n' getString(message('HDLShared:fdhdldialog:Multiplier')) ': \n' getString(message('HDLShared:fdhdldialog:Serialpartition')) ': ']);
    else
        info1.Name = sprintf([getString(message('HDLShared:fdhdldialog:Foldingfactor')) ': \n' getString(message('HDLShared:fdhdldialog:Multiplier')) ': ']);
    end
    info1.Tag = [tagpf, 'SerialPartitionInfoText'];
    
    info2.Type = 'text';
    info2.RowSpan  = [gcurrRow-1 gcurrRow];
    info2.ColSpan        = [5 5];
    info2.AutoFormatting = true;
    if isSerialPartInfoAvailable(hParent)
        info2.Name = sprintf('%s \n%s \n%s', this.FSFoldingFactor, this.FSMultipliers, this.FSSerialPartition);
    else
        info2.Name = sprintf('%s \n%s', this.FSFoldingFactor, this.FSMultipliers);
    end
    info2.Tag = [tagpf, 'SerialPartitionInfoValue'];
    gcurrRow = gcurrRow+1;
    infolink.Type = 'hyperlink';
    infolink.Name = DAStudio.message('HDLShared:fdhdldialog:viewDetails');
    infolink.RowSpan = [gcurrRow, gcurrRow];
    infolink.ColSpan = [4 5];    
    infolink.MatlabMethod = 'dialogCallback'; 
    infolink.MatlabArgs = {this, this, hParent, 'SerialPartitionInfoLink'};    
    infolink.ArgDataTypes = {'handle', 'handle', 'string'};
    infolink.WidgetId = 'SerialPartitionInfoLink';
    infolink.Tag = [tagpf, 'SerialPartitionInfoLink'];
    
    items = [items, {info1, info2, infolink}];
    currRow = gcurrRow+1;

elseif strcmpi(this.Architecture, 'Partly serial')
    currRow = currRow+1;
    [widgets, currRow] = getPartlySerialPartition(this, hParent, currRow, tagpf);
    items = [items, widgets];
 
elseif strcmpi(this.Architecture, 'Distributed arithmetic (DA)') && getEnableState(this, 'LUTPartition')
    [widgets, currRow] = getDAwidgets(this, hParent, currRow, tagpf);
    items = [items, widgets];        
    
elseif strcmpi(this.Architecture, 'Cascade serial')
    currRow = currRow+1;
    txtSerialPart.Name    = DAStudio.message('HDLShared:fdhdldialog:serialPartition');
    txtSerialPart.Type    = 'text';
    txtSerialPart.RowSpan = [currRow, currRow];
    txtSerialPart.ColSpan = [1 1];

    editSerialPart.Type           = 'edit';
    editSerialPart.Source       = this;
    editSerialPart.ObjectProperty = 'CascadeSerialPartition';
    editSerialPart.Tag          = [tagpf, 'SerialPartition'];
    txtSerialPart.Buddy      = editSerialPart.Tag;
    editSerialPart.RowSpan        = [currRow, currRow];
    editSerialPart.ColSpan        = [2 2];
    editSerialPart.Mode = true;
    editSerialPart.DialogRefresh = true;
    
    items = [items, {txtSerialPart, editSerialPart}];
end

currRow = currRow+1;
group1.Type = 'group';
group1.Flat = 1;
group1.RowSpan = [currRow, currRow];
group1.ColSpan = [1 6];

items = [items, {group1}];

currRow = currRow+1;
txtCoefSource.Name    = DAStudio.message('HDLShared:fdhdldialog:coefSource');
txtCoefSource.Type    = 'text';
txtCoefSource.RowSpan = [currRow, currRow];
txtCoefSource.ColSpan = [1 1];

cbCoefSource.Type           = 'combobox';
cbCoefSource.Source         = this;
a                           = findtype('CoefficientSourceUIType');
cbEntries                   = a.Strings;
cbCoefSource.Entries        = getTranslatedStringcell('HDLShared:fdhdldialog',cbEntries);
defaultindx = find(strcmpi(cbEntries,this.CoefficientSource));
if ~isempty(defaultindx)
    cbCoefSource.Value = defaultindx - 1;
end
cbCoefSource.ObjectMethod = 'selectComboboxEntry';
cbCoefSource.MethodArgs  = {'%dialog', '%value', 'CoefficientSource', cbEntries};
cbCoefSource.ArgDataTypes = {'handle', 'mxArray', 'string', 'mxArray'};
cbCoefSource.Tag            = [tagpf, 'CoefficientSource'];
txtCoefSource.Buddy         = cbCoefSource.Tag;
cbCoefSource.RowSpan        = [currRow, currRow];
cbCoefSource.ColSpan        = [2 2];
cbCoefSource.Mode = true;
cbCoefSource.DialogRefresh = true;
cbCoefSource.Visible = getEnableState(this, 'CoefficientSource');
txtCoefSource.Visible = cbCoefSource.Visible;
items = [items, {txtCoefSource, cbCoefSource}];

if getEnableState(this, 'CoefficientMemory') == true
    txtCoefficientMemory.Name    = DAStudio.message('HDLShared:fdhdldialog:CoefficientMemory');
    txtCoefficientMemory.Type    = 'text';
    txtCoefficientMemory.RowSpan = [currRow, currRow];
    txtCoefficientMemory.ColSpan = [3 3];
    
    editCoefficientMemory.Type           = 'combobox';
    editCoefficientMemory.Source       = this;
    a                           = findtype('RAMUIType');
    cbEntries                   = a.Strings;
    editCoefficientMemory.Entries       = getTranslatedStringcell('HDLShared:fdhdldialog',cbEntries);
    defaultindx = find(strcmpi(cbEntries,this.CoefficientMemory));
    if ~isempty(defaultindx)
        editCoefficientMemory.Value = defaultindx - 1;
    end
    editCoefficientMemory.Tag            = [tagpf, 'CoefficientMemory'];
    txtCoefficientMemory.Buddy      = editCoefficientMemory.Tag;
    editCoefficientMemory.RowSpan        = [currRow, currRow];
    editCoefficientMemory.ColSpan        = [4 4];
    editCoefficientMemory.Mode = true;
    editCoefficientMemory.ObjectMethod = 'selectComboboxEntry';
    editCoefficientMemory.MethodArgs  = {'%dialog', '%value', 'CoefficientMemory', cbEntries};
    editCoefficientMemory.ArgDataTypes = {'handle', 'mxArray', 'string', 'mxArray'};
    items = [items, {txtCoefficientMemory, editCoefficientMemory}];
end

currRow = currRow+1;
if hParent.hdlfilter.isVarRateSupported
    %CIC filter
    chkAddRatePort.Type = 'checkbox';
    chkAddRatePort.Name = DAStudio.message('HDLShared:fdhdldialog:AddRatePort');
    chkAddRatePort.Tag = [tagpf,'AddRatePort'];
    chkAddRatePort.Source = this;
    chkAddRatePort.RowSpan = [currRow, currRow];
    chkAddRatePort.ColSpan = [4 5];
    chkAddRatePort.Mode = true;
    chkAddRatePort.DialogRefresh = true;
    chkAddRatePort.ObjectMethod = 'setCheckBox';
    chkAddRatePort.Value        = strcmpi(src.AddRatePort, 'on');
    chkAddRatePort.MethodArgs   = {'%value', 'AddRatePort', src};
    chkAddRatePort.ArgDataTypes = {'mxArray', 'string', 'mxArray'};
    items = [items, {chkAddRatePort}];
end

% currRow = currRow+1;
txtCoefMult.Name    = DAStudio.message('HDLShared:fdhdldialog:coefMultipliers');
txtCoefMult.Type    = 'text';
txtCoefMult.RowSpan = [currRow, currRow];
txtCoefMult.ColSpan = [1 1];

cbCoefMult.Type           = 'combobox';
cbCoefMult.Source         = this;
a                         = hdlcoderprops.hdlcoderpropsDataType.HDLMultipliersType;
cbEntries                 = a.Strings;
cbCoefMult.Entries        = getTranslatedStringcell('HDLShared:fdhdldialog',cbEntries);
defaultindx = find(strcmpi(cbEntries,src.CoeffMultipliers));
if ~isempty(defaultindx)
    cbCoefMult.Value = defaultindx - 1;
end
cbCoefMult.Tag            = [tagpf 'CoefMultipliers'];
txtCoefMult.Buddy      = cbCoefMult.Tag;
cbCoefMult.RowSpan        = [currRow, currRow];
cbCoefMult.ColSpan        = [2 2];
cbCoefMult.Mode = true;
cbCoefMult.DialogRefresh = true;
cbCoefMult.Enabled = getEnableState(this, 'CoefMultipliers') && strcmpi(this.CoefficientSource, 'Internal');
cbCoefMult.ObjectMethod = 'selectComboboxEntryCLI';
cbCoefMult.MethodArgs  = {'%value', 'CoeffMultipliers', cbEntries, src};
cbCoefMult.ArgDataTypes = {'mxArray', 'string', 'mxArray', 'mxArray'};
if cbCoefMult.Enabled == false
    src.CoeffMultipliers = 'Multiplier';
end
items = [items {txtCoefMult, cbCoefMult}];

currRow = currRow+1;
txtMultInputPipeline.Name    = DAStudio.message('HDLShared:fdhdldialog:multiplierInputPipeline');
txtMultInputPipeline.Type    = 'text';
txtMultInputPipeline.RowSpan = [currRow, currRow];
txtMultInputPipeline.ColSpan = [1 1];

editMultInputPipeline.Type           = 'edit';
editMultInputPipeline.Source         = src;
editMultInputPipeline.ObjectProperty = 'MultiplierInputPipeline';
editMultInputPipeline.Tag            = [tagpf 'MultiplierInputPipeline'];
txtMultInputPipeline.Buddy      = editMultInputPipeline.Tag;
editMultInputPipeline.RowSpan        = [currRow, currRow];
editMultInputPipeline.ColSpan        = [2 2];
editMultInputPipeline.Mode = true;
pipeline = hParent.hdlfilter.isPipelineSupported;
editMultInputPipeline.Enabled = pipeline.multinput && strcmpi(src.CoeffMultipliers, 'Multiplier') && strcmpi(this.CoefficientSource, 'Internal');
items = [items {txtMultInputPipeline, editMultInputPipeline}];

currRow = currRow+1;
txtMultOutputPipeline.Name    = DAStudio.message('HDLShared:fdhdldialog:multiplierOutputPipeline');
txtMultOutputPipeline.Type    = 'text';
txtMultOutputPipeline.RowSpan = [currRow, currRow];
txtMultOutputPipeline.ColSpan = [1 1];

editMultOutputPipeline.Type           = 'edit';
editMultOutputPipeline.Source         = src;
editMultOutputPipeline.ObjectProperty = 'MultiplierOutputPipeline';
editMultOutputPipeline.Tag            = [tagpf 'MultiplierOutputPipeline'];
txtMultOutputPipeline.Buddy      = editMultOutputPipeline.Tag;
editMultOutputPipeline.RowSpan        = [currRow, currRow];
editMultOutputPipeline.ColSpan        = [2 2];
editMultOutputPipeline.Mode = true;
editMultOutputPipeline.Enabled = editMultInputPipeline.Enabled;
if editMultOutputPipeline.Enabled == false
    src.MultiplierOutputPipeline = 0;
    src.MultiplierInputPipeline = 0;
end
items = [items {txtMultOutputPipeline, editMultOutputPipeline}];

currRow = currRow+1;
group2.Type = 'group';
group2.Flat = 1;
group2.RowSpan = [currRow, currRow];
group2.ColSpan = [1 6];

items = [items, {group2}];

currRow = currRow+1;
chkPipeline.Type = 'checkbox';
chkPipeline.Name = DAStudio.message('HDLShared:fdhdldialog:addPipelineRegisters');
chkPipeline.Tag = [tagpf,'AddPipelineRegisters'];
chkPipeline.Source = this;
chkPipeline.ObjectProperty = 'AddPipelineRegisters';
chkPipeline.RowSpan = [currRow, currRow];
chkPipeline.ColSpan = [1 2];
chkPipeline.Mode = true;
chkPipeline.DialogRefresh = true;
chkPipeline.Enabled = getEnableState(this, 'AddPipelineRegisters');

currRow = currRow+1;

txtAdderStyle.Name    = DAStudio.message('HDLShared:fdhdldialog:firAdderStyle');
txtAdderStyle.Type    = 'text';
txtAdderStyle.RowSpan = [currRow, currRow];
txtAdderStyle.ColSpan = [1 1];
    
cbAdderStyle.Type           = 'combobox';
cbAdderStyle.Source         = this;
cbAdderStyle.ObjectProperty = 'FIRAdderStyle'; 
a                           = findtype('HDLFinalAddersUIType');
cbEntries                   = a.Strings;
cbAdderStyle.Entries        = getTranslatedStringcell('HDLShared:fdhdldialog',cbEntries);
defaultindx = find(strcmpi(cbEntries,this.FIRAdderStyle));
if ~isempty(defaultindx)
    cbAdderStyle.Value = defaultindx - 1;
end
cbAdderStyle.Tag            = [tagpf, 'FIRAdderStyle'];
txtAdderStyle.Buddy      = cbAdderStyle.Tag;
cbAdderStyle.RowSpan        = [currRow, currRow];
cbAdderStyle.ColSpan        = [2 2];
cbAdderStyle.Enabled = getEnableState(this, 'FIRAdder');
cbAdderStyle.Mode = true;
cbAdderStyle.DialogRefresh = true;

cbAdderStyle.ObjectMethod = 'selectComboboxEntry';
cbAdderStyle.MethodArgs  = {'%dialog', '%value', 'FIRAdderStyle', cbEntries};
cbAdderStyle.ArgDataTypes = {'handle', 'mxArray', 'string', 'mxArray'};
if cbAdderStyle.Enabled == false
    src.FIRAdderStyle = 'Linear';
end

currRow = currRow+1;
chkOptimize.Type = 'checkbox';
chkOptimize.Name = DAStudio.message('HDLShared:fdhdldialog:optimizeHDL');
chkOptimize.Tag = [tagpf,'OptimizeForHDL'];
chkOptimize.Source = this;
chkOptimize.RowSpan = [currRow, currRow];
chkOptimize.ColSpan = [1 2];
chkOptimize.Mode = true;
chkOptimize.DialogRefresh = true;
chkOptimize.ObjectMethod = 'setCheckBox';
chkOptimize.Value        = strcmpi(src.OptimizeForHDL, 'on');
chkOptimize.MethodArgs   = {'%value', 'OptimizeForHDL', src};
chkOptimize.ArgDataTypes = {'mxArray', 'string', 'mxArray'};
items = [items, {chkPipeline, txtAdderStyle, cbAdderStyle, chkOptimize}];


currRow = currRow+1;
spacer.Type    = 'panel';
spacer.RowSpan = [currRow, currRow];
items = [items {spacer}];

if hParent.modifyForUSRP2filter    
    for i=1:length(items)
        items{i}.Enabled = false;
    end
end
% gparch.Type = 'group';
gparch.Name = DAStudio.message('HDLShared:fdhdldialog:filterArchitecture');
gparch.Items = items;

gparch.LayoutGrid = [currRow 6];
gparch.ColStretch = [0 0 0 0 0 1];
gparch.RowStretch = [zeros(1, currRow-1) 1];

gparch.Tag = [tagpf, 'ArchitectureGroup'];

architPanel = gparch;

%--------------------------------------------------------------------------
function [items, currRow] = getPartlySerialPartition(this, hParent, gcurrRow, tagpf)
    this.setSerialArchSettings;
    lblpartitionMode.Type = 'text';
    lblpartitionMode.Name = DAStudio.message('HDLShared:fdhdldialog:SpecifiedBy');
    lblpartitionMode.RowSpan = [gcurrRow gcurrRow];
    lblpartitionMode.ColSpan        = [1 1];    
    
    partitionMode.Type           = 'combobox';
    partitionMode.Source = this;
    partitionMode.ObjectProperty = 'PartitionModeEntry';
    partitionMode.Tag      = [tagpf, 'PartitionModeEntry'];
    lblpartitionMode.Buddy = partitionMode.Tag;
    partitionMode.RowSpan        = [gcurrRow gcurrRow];
    partitionMode.ColSpan        = [2 2];
    partitionMode.Mode = true;
    partitionMode.DialogRefresh = true;
    partitionMode.ObjectMethod = 'dialogCallback';
    partitionMode.MethodArgs = {'%dialog', hParent, 'PartitionModeEntry'};
    partitionMode.ArgDataTypes = {'handle', 'handle', 'string'};
    if isa(hParent.hdlfilter, 'hdlfilter.df1sos') || isa(hParent.hdlfilter, 'hdlfilter.df2sos')
        partitionMode.Entries = {getString(message('HDLShared:fdhdldialog:Foldingfactor')), getString(message('HDLShared:fdhdldialog:Multipliers'))};
    else
        partitionMode.Entries = {getString(message('HDLShared:fdhdldialog:Foldingfactor')), getString(message('HDLShared:fdhdldialog:Multipliers')), getString(message('HDLShared:fdhdldialog:Serialpartition'))};
    end
    
    foldingfactor.Type           = 'combobox';
    foldingfactor.Entries = this.FoldingFactorEntry;
    foldingfactor.Source = this;
    foldingfactor.ObjectProperty = 'FoldingFactor';
    foldingfactor.Tag      = [tagpf, 'FoldingFactorEntry'];
    foldingfactor.RowSpan        = [gcurrRow gcurrRow];
    foldingfactor.ColSpan        = [3 3];
    foldingfactor.Mode = true;
    foldingfactor.DialogRefresh = true;
    foldingfactor.ObjectMethod = 'dialogCallback';
    foldingfactor.MethodArgs = {'%dialog', hParent, 'FoldingFactor'};
    foldingfactor.ArgDataTypes = {'handle', 'handle', 'string'};   
    foldingfactor.Visible = strcmpi(this.PartitionModeEntry, 'Folding factor');
    
    multipliers.Type           = 'combobox';
    multipliers.Entries = this.MultipliersEntry;
    multipliers.RowSpan        = [gcurrRow gcurrRow];
    multipliers.ColSpan        = [3 3];
    multipliers.Source = this;
    multipliers.ObjectProperty = 'Multipliers';
    multipliers.Tag      = [tagpf, 'MultipliersEntry'];
    multipliers.ObjectMethod = 'dialogCallback';
    multipliers.MethodArgs = {'%dialog', hParent, 'Multipliers'};
    multipliers.ArgDataTypes = {'handle', 'handle', 'string'};
    multipliers.Mode = true;
    multipliers.DialogRefresh = true;       
    multipliers.Visible = strcmpi(this.PartitionModeEntry, 'Multipliers');
    
    serialpart.Type           = 'combobox';
    serialpart.Entries = this.SerialPartitionEntry;
    serialpart.RowSpan        = [gcurrRow gcurrRow];
    serialpart.ColSpan        = [3 3];
    serialpart.Source = this;
    serialpart.ObjectProperty = 'SerialPartition';
    serialpart.Tag      = [tagpf, 'SerialPartitionEntry'];
    serialpart.Editable = true;
    serialpart.Mode = true;
    serialpart.DialogRefresh = true;
    serialpart.ObjectMethod = 'dialogCallback';
    serialpart.MethodArgs = {'%dialog', hParent, 'SerialPartition'};
    serialpart.ArgDataTypes = {'handle', 'handle', 'string'};
    serialpart.Visible = strcmpi(this.PartitionModeEntry, 'Serial partition');
        
    items = {lblpartitionMode, partitionMode, foldingfactor, multipliers, serialpart};
    
    spacer.Type    = 'panel';
    spacer.ColSpan = [4 4];
    items = [items {spacer}];
    
    info1.Type = 'text';
    info1.RowSpan  = [gcurrRow-1 gcurrRow];
    info1.ColSpan        = [5 5];
    info1.AutoFormatting = true;
    if isSerialPartInfoAvailable(hParent)
        info1.Name = sprintf([getString(message('HDLShared:fdhdldialog:Foldingfactor')) ': \n' getString(message('HDLShared:fdhdldialog:Multiplier')) ': \n' getString(message('HDLShared:fdhdldialog:Serialpartition')) ': ']);
    else
        info1.Name = sprintf([getString(message('HDLShared:fdhdldialog:Foldingfactor')) ': \n' getString(message('HDLShared:fdhdldialog:Multiplier')) ': ']);
    end
    info1.Tag = [tagpf, 'SerialPartitionInfoText'];
    
    info2.Type = 'text';
    info2.RowSpan  = [gcurrRow-1 gcurrRow];
    info2.ColSpan        = [6 6];
    info2.AutoFormatting = true;
    if isSerialPartInfoAvailable(hParent)
        info2.Name = sprintf('%s \n%s \n%s', this.FoldingFactor, this.Multipliers, this.SerialPartition);
    else
        info2.Name = sprintf('%s \n%s', this.FoldingFactor, this.Multipliers);
    end    
    info2.Tag = [tagpf, 'SerialPartitionInfoValue'];
    
    gcurrRow = gcurrRow+1;
    infolink.Type = 'hyperlink';
    infolink.Name = DAStudio.message('HDLShared:fdhdldialog:viewDetails');
    infolink.RowSpan = [gcurrRow, gcurrRow];
    infolink.ColSpan = [5 6];    
    infolink.MatlabMethod = 'dialogCallback'; 
    infolink.MatlabArgs = {this, this, hParent, 'SerialPartitionInfoLink'};    
    infolink.ArgDataTypes = {'handle', 'handle', 'string'};
    infolink.WidgetId = 'SerialPartitionInfoLink';
    infolink.Tag = [tagpf, 'SerialPartitionInfoLink'];
    
    items = [items, {info1, info2, infolink}];
            
    currRow = gcurrRow+1;
    
%--------------------------------------------------------------------------
function [items, currRow] = getDAwidgets(this, hParent, currRow, tagpf)
    currRow = currRow+1;
    txtSpecFoldingFactor.Name    = DAStudio.message('HDLShared:fdhdldialog:specifyFolding');
    txtSpecFoldingFactor.Type    = 'text';
    txtSpecFoldingFactor.RowSpan = [currRow, currRow];
    txtSpecFoldingFactor.ColSpan = [1 1];

    cbSpecFoldingFactor.Type           = 'combobox';
    cbSpecFoldingFactor.Source       = this;
    cbSpecFoldingFactor.Tag            = [tagpf, 'SpecifyFoldingFactor'];
    txtSpecFoldingFactor.Buddy      = cbSpecFoldingFactor.Tag;
    cbSpecFoldingFactor.RowSpan        = [currRow, currRow];
    cbSpecFoldingFactor.ColSpan        = [2 2];
    SpecFoldingFactorEntries = {'Folding factor', 'DA radix'};
    cbSpecFoldingFactor.Entries = getTranslatedStringcell('HDLShared:fdhdldialog',SpecFoldingFactorEntries);
    defaultindx = find(strcmpi(SpecFoldingFactorEntries,this.SpecifyFoldingFactor));
    if ~isempty(defaultindx)
        cbSpecFoldingFactor.Value = defaultindx - 1;
    end
    cbSpecFoldingFactor.Mode = true;
    cbSpecFoldingFactor.DialogRefresh = true;
    cbSpecFoldingFactor.ObjectMethod = 'selectComboboxEntry';
    cbSpecFoldingFactor.MethodArgs  = {'%dialog', '%value', 'SpecifyFoldingFactor', SpecFoldingFactorEntries};
    cbSpecFoldingFactor.ArgDataTypes = {'handle', 'mxArray', 'string', 'mxArray'};
    items = {txtSpecFoldingFactor, cbSpecFoldingFactor};      

    if strcmpi(this.SpecifyFoldingFactor, 'Folding factor')
        cbFoldingFactor.Type           = 'combobox';
        cbFoldingFactor.Source       = this;
        cbFoldingFactor.ObjectProperty = 'DAFoldingFactorValue';
        cbFoldingFactor.Tag            = [tagpf, 'DAFoldingFactor'];
        cbFoldingFactor.RowSpan        = [currRow, currRow];
        cbFoldingFactor.ColSpan        = [3 3];
        cbFoldingFactor.Entries = this.FoldingFactorEntries;
        cbFoldingFactor.Mode = true;
        cbFoldingFactor.DialogRefresh = true;
        cbFoldingFactor.ObjectMethod = 'dialogCallback';
        cbFoldingFactor.MethodArgs = {'%dialog', hParent, 'DAFoldingFactor'};
        cbFoldingFactor.ArgDataTypes = {'handle', 'handle', 'string'};
        items = [items, {cbFoldingFactor}];      
    elseif strcmpi(this.SpecifyFoldingFactor, 'DA radix')
        cbDARadix.Type           = 'combobox';
        cbDARadix.Source       = this;
        cbDARadix.ObjectProperty = 'DARadixValue';
        cbDARadix.Tag            = [tagpf, 'DARadix'];
        cbDARadix.RowSpan        = [currRow, currRow];
        cbDARadix.ColSpan        = [3 3];
        cbDARadix.Editable       = true;
        cbDARadix.Entries = this.DARadixEntries;
        cbDARadix.Mode = true;
        cbDARadix.DialogRefresh = true;
        cbDARadix.ObjectMethod = 'dialogCallback';
        cbDARadix.MethodArgs = {'%dialog', hParent, 'DARadix'};
        cbDARadix.ArgDataTypes = {'handle', 'handle', 'string'};
        
        items = [items, {cbDARadix}];      
    end

    % Paint "LUT specification" area
    currRow = currRow+1; 
    txtSpecLUT.Name    = DAStudio.message('HDLShared:fdhdldialog:specifyLUT'); 
    txtSpecLUT.Type    = 'text'; 
    txtSpecLUT.RowSpan = [currRow, currRow];
    txtSpecLUT.ColSpan = [1 1];

    cbSpecLUT.Type           = 'combobox';
    cbSpecLUT.Source         = this;
    cbSpecLUT.Tag            = [tagpf, 'SpecifyLUT'];
    txtSpecLUT.Buddy         = cbSpecLUT.Tag;
    SpecLUTEntries = {'Address width', 'Partition'};   
    cbSpecLUT.RowSpan        = [currRow, currRow];
    cbSpecLUT.ColSpan        = [2 2];  
    cbSpecLUT.Entries = getTranslatedStringcell('HDLShared:fdhdldialog',SpecLUTEntries);
    
    defaultindx = find(strcmpi(SpecLUTEntries,this.SpecifyLUT));
    if ~isempty(defaultindx)
        cbSpecLUT.Value = defaultindx - 1;
    end
    cbSpecLUT.Mode = true;
    cbSpecLUT.DialogRefresh = true;
    
    cbSpecLUT.ObjectMethod = 'selectComboboxEntry';
    cbSpecLUT.MethodArgs  = {'%dialog', '%value', 'SpecifyLUT', SpecLUTEntries};
    cbSpecLUT.ArgDataTypes = {'handle', 'mxArray', 'string', 'mxArray'};
    items = [items, {txtSpecLUT, cbSpecLUT}];          

    if strcmpi(this.SpecifyLUT, 'Address width')
        cbLUTInputs.Type           = 'combobox';
        cbLUTInputs.Source       = this;
        cbLUTInputs.ObjectProperty = 'LUTInputsValue';
        cbLUTInputs.Tag            = [tagpf, 'LUTInputs'];
        cbLUTInputs.RowSpan        = [currRow, currRow];
        cbLUTInputs.ColSpan        = [3 3];
        cbLUTInputs.Entries = this.LUTInputsEntries;
        cbLUTInputs.Mode = true;
        cbLUTInputs.DialogRefresh = true;
        cbLUTInputs.ObjectMethod = 'dialogCallback';
        cbLUTInputs.MethodArgs = {'%dialog', hParent, 'LUTInputs'};
        cbLUTInputs.ArgDataTypes = {'handle', 'handle', 'string'};
        items = [items, {cbLUTInputs}];      
    elseif strcmpi(this.SpecifyLUT, 'Partition')
        cbLUTPartition.Type           = 'combobox';
        cbLUTPartition.Source       = this;
        cbLUTPartition.ObjectProperty = 'LUTPartitionValue';
        cbLUTPartition.Tag            = [tagpf, 'LUTPartition'];
        cbLUTPartition.RowSpan        = [currRow, currRow];
        cbLUTPartition.ColSpan        = [3 3];
        cbLUTPartition.Editable       = true;
        cbLUTPartition.Entries = this.LUTPartitionEntries;
        cbLUTPartition.Mode = true;
        cbLUTPartition.DialogRefresh = true;
        cbLUTPartition.ObjectMethod = 'dialogCallback';
        cbLUTPartition.MethodArgs = {'%dialog', hParent, 'DALUTPartition'};
        cbLUTPartition.ArgDataTypes = {'handle', 'handle', 'string'};
        
        items = [items, {cbLUTPartition}];      
    end
            
    spacer.Type    = 'panel';
    spacer.ColSpan = [4 4];
    spacer.RowSpan = [currRow, currRow];
    items = [items {spacer}];

    % show the info area:    
    info1.Type = 'text';
    info1.RowSpan  = [currRow-1 currRow];
    info1.ColSpan        = [5 5];
    info1.AutoFormatting = true;
    info1.Name = sprintf([getString(message('HDLShared:fdhdldialog:Foldingfactor')) ': \n', ...
        getString(message('HDLShared:fdhdldialog:Addresswidth')), ': \n', ...
        getString(message('HDLShared:fdhdldialog:TotalLUTsizebits')), ':']);
    
    info2.Type = 'text';
    info2.RowSpan  = [currRow-1 currRow];
    info2.ColSpan        = [6 6];
    info2.AutoFormatting = true;
    info2.Name = sprintf('%s \n%s \n%d', this.DAFoldingFactorValue, this.LUTInputsValue, this.DALUTSize);
        
    infolink.Type = 'hyperlink';
    infolink.Name = DAStudio.message('HDLShared:fdhdldialog:viewDetails');
    infolink.RowSpan = [currRow+1, currRow+1];
    infolink.ColSpan = [5 6];    
    infolink.MatlabMethod = 'dialogCallback'; 
    infolink.MatlabArgs = {this, this, hParent, 'DAInfoLink'};    
    infolink.ArgDataTypes = {'handle', 'handle', 'string'};
    infolink.WidgetId = 'DAInfoLink';
    infolink.Tag = [tagpf, 'DAInfoLink'];
    
    items = [items, {info1, info2, infolink}];        
    
    currRow = currRow+1;
    
    %--------------------------------------------------------------------
    function success = isParallelInfoAvailable(hParent)
    
    success = isa(hParent.hdlfilter, 'hdlfilter.firdecim') || ...
        isa(hParent.hdlfilter, 'hdlfilter.firinterp') || ...
        isa(hParent.hdlfilter, 'hdlfilter.abstractdffir') ||...
        isa(hParent.hdlfilter, 'hdlfilter.df1sos');
     %--------------------------------------------------------------------
    function success = isSerialPartInfoAvailable(hParent)  
    success = isa(hParent.hdlfilter, 'hdlfilter.firdecim') || ...
        isa(hParent.hdlfilter, 'hdlfilter.firinterp') || ...
        isa(hParent.hdlfilter, 'hdlfilter.abstractdffir');   
    %---------------------------------------------------------------------
    function entries = squeezeEntries(inEntries)
        j = 1;
        for i = 1:numel(inEntries)
            if ~isempty(inEntries{i})
                entries{j} = inEntries{i}; %#ok<AGROW>
                j = j+1;
            end
        end
    
% [EOF]

% LocalWords:  fdhdldialog Serialpartition coef RAMUI chk curr gparch df cb Addresswidth Tsizebits
% LocalWords:  abstractdffir
