function [widgets, currRow] = getSharedWidgets(this, src, enableWidget, currRow, currCol, tagpf)
%GETSHAREDWIDGETS   Get the shared tabDialogSchema.
%   Author(s): J.Sun

%   Copyright 2008-2023 The MathWorks, Inc.

HeadingSpace = '    ';
fClock.Name           = DAStudio.message('HDLShared:hdldialog:hdltbForceClock');
fClock.Type           = 'checkbox';
fClock.ObjectMethod   = 'setCheckBox';
fClock.Value          = strcmpi(src.ForceClock, 'on');
fClock.MethodArgs     = {'%value', 'ForceClock', src};
fClock.ArgDataTypes   = {'mxArray', 'string', 'mxArray'};
fClock.Source         = this;
fClock.Tag            = [tagpf 'ForceClock'];
fClock.Mode           = true;
fClock.DialogRefresh  = true;
fClock.RowSpan        = [currRow currRow];
fClock.ColSpan        = [currCol currCol+1];
fClock.Enabled = enableWidget;

currRow = currRow+1;
cHigh_lbl.Name    = [HeadingSpace DAStudio.message('HDLShared:hdldialog:hdlccClockHighTime')];
cHigh_lbl.Type    = 'text';
cHigh_lbl.RowSpan = [currRow currRow];
cHigh_lbl.ColSpan = [currCol currCol];

cHigh.Type           = 'edit';
cHigh.ObjectProperty = 'ClockHighTime';
cHigh.Source         = src;
cHigh.Tag            = [tagpf 'ClockHighTime'];
cHigh_lbl.Buddy      = cHigh.Tag;
cHigh.RowSpan        = [currRow currRow];
cHigh.ColSpan        = [currCol+1 currCol+1];
cHigh.Mode = true;
cHigh.DialogRefresh  = true;
cHigh.Enabled = enableWidget;

currRow = currRow+1;
cLow_lbl.Name    = [HeadingSpace DAStudio.message('HDLShared:hdldialog:hdlccClockLowTime')];
cLow_lbl.Type    = 'text';
cLow_lbl.RowSpan = [currRow currRow];
cLow_lbl.ColSpan = [currCol currCol];

cLow.Type           = 'edit';
cLow.ObjectProperty = 'ClockLowTime';
cLow.Source         = src;
cLow.Tag            = [tagpf 'ClockLowTime'];
cLow_lbl.Buddy      = cLow.Tag;
cLow.RowSpan        = [currRow currRow];
cLow.ColSpan        = [currCol+1 currCol+1];
cLow.Mode = true;
cLow.DialogRefresh  = true;
cLow.Enabled = enableWidget;

currRow = currRow+1;
hTime_lbl.Name    = DAStudio.message('HDLShared:hdldialog:hdltbHoldTime');
hTime_lbl.Type    = 'text';
hTime_lbl.RowSpan = [currRow currRow];
hTime_lbl.ColSpan = [currCol currCol];

hTime.Type           = 'edit';
hTime.ObjectProperty = 'HoldTime';
hTime.Source         = src;
hTime.Tag            = [tagpf 'HoldTime'];
hTime_lbl.Buddy      = hTime.Tag;
hTime.RowSpan        = [currRow currRow];
hTime.ColSpan        = [currCol+1 currCol+1];
hTime.Mode = true;
hTime.DialogRefresh  = true;
hTime.Enabled = enableWidget;

currRow = currRow+1;
% Added read only area for displaying setup time
setupTime_lbl.Name    = [HeadingSpace DAStudio.message('HDLShared:hdldialog:hdltbSetupTime')];
setupTime_lbl.Type    = 'text';
setupTime_lbl.RowSpan = [currRow currRow];
setupTime_lbl.ColSpan = [currCol currCol];

setupTime.Type           = 'edit';
setupTime.ObjectProperty = 'SetupTime';
setupTime.Source         = src;
setupTime.Tag            = [tagpf 'SetupTime'];
setupTime_lbl.Buddy          = setupTime.Tag;
setupTime.RowSpan        = [currRow currRow];
setupTime.ColSpan        = [currCol+1 currCol+1];
setupTime.Mode = true;
SetupTime.DialogRefresh  = true; %#ok<STRNU>
setupTime.Enabled = false;

if strcmpi(src.ForceClock, 'off')
    cHigh.Enabled = false;
    cLow.Enabled  = false;
end

currRow = currRow+1;
fCEnable.Name         = DAStudio.message('HDLShared:hdldialog:hdltbForceClockEnable');
fCEnable.Type         = 'checkbox';
fCEnable.ObjectMethod = 'setCheckBox';
fCEnable.Value        = strcmpi(src.ForceClockEnable, 'on');
fCEnable.MethodArgs   = {'%value', 'ForceClockEnable', src};
fCEnable.ArgDataTypes = {'mxArray', 'string', 'mxArray'};
fCEnable.Source       = this;
fCEnable.Tag          = [tagpf 'ForceClockEnable'];
fCEnable.RowSpan      = [currRow currRow];
fCEnable.ColSpan      = [currCol currCol+1];
fCEnable.Mode           = true;
fCEnable.DialogRefresh  = true;
fCEnable.Enabled = enableWidget;


currRow = currRow+1;
clkEnableDelay_lbl.Name    = [HeadingSpace DAStudio.message('HDLShared:hdldialog:hdlccTestBenchClockEnableDelay')];
clkEnableDelay_lbl.Type    = 'text';
clkEnableDelay_lbl.RowSpan = [currRow currRow];
clkEnableDelay_lbl.ColSpan = [currCol currCol];

clkEnableDelay.Type           = 'edit';
clkEnableDelay.ObjectProperty = 'TestBenchClockEnableDelay';
clkEnableDelay.Source         = src;
clkEnableDelay.Tag            = [tagpf 'TestBenchClockEnableDelay'];
clkEnableDelay_lbl.Buddy      = clkEnableDelay.Tag;
clkEnableDelay.RowSpan        = [currRow currRow];
clkEnableDelay.ColSpan        = [currCol+1 currCol+1];
clkEnableDelay.Mode = true;
clkEnableDelay.Enabled = enableWidget && strcmpi(src.ForceClockEnable, 'on');

currRow = currRow+1;
fReset.Name           = DAStudio.message('HDLShared:hdldialog:hdltbForceReset');
fReset.Type           = 'checkbox';
fReset.ObjectMethod   = 'setCheckBox';
fReset.Value          = strcmpi(src.ForceReset, 'on');
fReset.MethodArgs     = {'%value', 'ForceReset', src};
fReset.ArgDataTypes   = {'mxArray', 'string', 'mxArray'};
fReset.Source         = this;
fReset.Tag            = [tagpf 'ForceReset'];
fReset.RowSpan        = [currRow currRow];
fReset.ColSpan        = [currCol currCol+1];
fReset.Mode           = true;
fReset.DialogRefresh  = true;
fReset.Enabled = enableWidget;

currRow = currRow+1;
resetLength_lbl.Name    = [HeadingSpace DAStudio.message('HDLShared:hdldialog:hdltbResetLength')];
resetLength_lbl.Type    = 'text';
resetLength_lbl.RowSpan = [currRow currRow];
resetLength_lbl.ColSpan = [currCol currCol];

resetLength.Type           = 'edit';
resetLength.ObjectProperty = 'ResetLength';
resetLength.Source         = src;
resetLength.Tag            = [tagpf 'ResetLength'];
resetLength_lbl.Buddy      = resetLength.Tag;
resetLength.RowSpan        = [currRow currRow];
resetLength.ColSpan        = [currCol+1 currCol+1];
resetLength.Mode = true;
resetLength.Enabled = enableWidget && strcmpi(src.ForceReset, 'on');

currRow = currRow+1;
hdInputData.Name         = DAStudio.message('HDLShared:hdldialog:hdltbHoldInputDataBetweenSamples');
hdInputData.Type         = 'checkbox';
hdInputData.ObjectMethod = 'setCheckBox';
hdInputData.Value        = strcmpi(src.HoldInputDataBetweenSamples, 'on');
hdInputData.MethodArgs   = {'%value', 'HoldInputDataBetweenSamples', src};
hdInputData.ArgDataTypes = {'mxArray', 'string', 'mxArray'};
hdInputData.Source       = this;
hdInputData.Tag          = [tagpf 'HoldInputDataBetweenSamples'];
hdInputData.RowSpan      = [currRow currRow];
hdInputData.ColSpan      = [currCol currCol+1];
hdInputData.Mode         = true;
hdInputData.Enabled = enableWidget;

currRow = currRow+1;
tbInitialInputs.Name         = DAStudio.message('HDLShared:hdldialog:hdltbInitializeTestBenchInputs');
tbInitialInputs.Type         = 'checkbox';
tbInitialInputs.ObjectMethod = 'setCheckBox';
tbInitialInputs.Value        = strcmpi(src.InitializeTestBenchInputs, 'on');
tbInitialInputs.MethodArgs   = {'%value', 'InitializeTestBenchInputs', src};
tbInitialInputs.ArgDataTypes = {'mxArray', 'string', 'mxArray'};
tbInitialInputs.Source       = this;
tbInitialInputs.Tag          = [tagpf 'InitializeTestBenchInputs'];
tbInitialInputs.RowSpan      = [currRow currRow];
tbInitialInputs.ColSpan      = [currCol currCol+1];
tbInitialInputs.Mode           = true;
tbInitialInputs.Enabled = enableWidget;

currRow = currRow+1;
tbMultifileTestBench.Name    = DAStudio.message('HDLShared:hdldialog:hdltbmultifileTestBench');
tbMultifileTestBench.Type    = 'checkbox';
tbMultifileTestBench.ObjectMethod = 'setCheckBox';
tbMultifileTestBench.Value   = strcmpi(src.MultifileTestBench, 'on');
tbMultifileTestBench.MethodArgs  = {'%value', 'MultifileTestBench', src};
tbMultifileTestBench.ArgDataTypes = {'mxArray', 'string', 'mxArray'};
tbMultifileTestBench.Source  = this;
tbMultifileTestBench.Tag     = [tagpf 'MultifileTestBench'];
tbMultifileTestBench.RowSpan = [currRow currRow];
tbMultifileTestBench.ColSpan = [currCol currCol+1];
tbMultifileTestBench.Mode    = true;
tbMultifileTestBench.DialogRefresh   = true;
tbMultifileTestBench.Enabled = enableWidget;

currRow = currRow+1;
testBenchDataPostfix_lbl.Name    = [HeadingSpace DAStudio.message('HDLShared:hdldialog:hdltbTestBenchDataPostfix')];
testBenchDataPostfix_lbl.Type    = 'text';
testBenchDataPostfix_lbl.RowSpan = [currRow currRow];
testBenchDataPostfix_lbl.ColSpan = [currCol currCol];

testBenchDataPostfix.Type           = 'edit';
testBenchDataPostfix.ObjectProperty = 'TestBenchDataPostfix';
testBenchDataPostfix.Source         = src;
testBenchDataPostfix.Tag            = [tagpf 'TestBenchDataPostfix'];
testBenchDataPostfix_lbl.Buddy      = testBenchDataPostfix.Tag;
testBenchDataPostfix.RowSpan        = [currRow currRow];
testBenchDataPostfix.ColSpan        = [currCol+1 currCol+1];
testBenchDataPostfix.Mode = true;
testBenchDataPostfix.Enabled = enableWidget && strcmpi(src.MultifileTestBench, 'on');

currRow = currRow+1;
testBenchReferencePostfix_lbl.Name    = DAStudio.message('HDLShared:hdldialog:hdltbTestBenchReferencePostfix');
testBenchReferencePostfix_lbl.Type    = 'text';
testBenchReferencePostfix_lbl.RowSpan = [currRow currRow];
testBenchReferencePostfix_lbl.ColSpan = [currCol currCol];

testBenchReferencePostfix.Type           = 'edit';
testBenchReferencePostfix.ObjectProperty = 'TestBenchReferencePostFix';
testBenchReferencePostfix.Source         = src;
testBenchReferencePostfix.Tag            = [tagpf 'TestBenchReferencePostFix'];
testBenchReferencePostfix_lbl.Buddy      = testBenchReferencePostfix.Tag;
testBenchReferencePostfix.RowSpan        = [currRow currRow];
testBenchReferencePostfix.ColSpan        = [currCol+1 currCol+1];
testBenchReferencePostfix.Mode = true;
testBenchReferencePostfix.Enabled = enableWidget;

widgets = {fClock, cHigh_lbl, cHigh, cLow_lbl, cLow, ...
    hTime_lbl, hTime, setupTime_lbl, setupTime, fCEnable, ...
    clkEnableDelay_lbl, clkEnableDelay, fReset, ...
    resetLength_lbl, resetLength, ...
    hdInputData, tbInitialInputs, ...
    tbMultifileTestBench, ...
    testBenchDataPostfix_lbl, testBenchDataPostfix, ...
    testBenchReferencePostfix_lbl, testBenchReferencePostfix};
end
% LocalWords:  hdltb hdltbmultifile
