function tlacitka()
f = figure('Name', 'Vyber zakladni chyby');
set(f, 'OuterPosition', [500 50 400 750]);

global TL_SEL
TL_SEL = 0;

% Create the button group.
h = uibuttongroup('visible','off','Position',[0 0 1 1]);
% Create three radio buttons in the button group.
u0 = uicontrol('Style','Radio','String','Zadna zakladni chyba',...
    'pos',[10 600 1000 30],'parent',h,'HandleVisibility','off','UserData','0');

u1 = uicontrol('Style','Radio','String','Stejna bitova chyba v obou prenosovych kanalech',...
    'pos',[10 570 1000 30],'parent',h,'HandleVisibility','off','UserData','1');

u2 = uicontrol('Style','Radio','String','Chybne prectena data (payload) u AFDX switche',...
    'pos',[10 540 1000 30],'parent',h,'HandleVisibility','off','UserData','2');

u3 = uicontrol('Style','Radio','String','CRC odpovida chybnym datum',...
    'pos',[10 510 1000 30],'parent',h,'HandleVisibility','off','UserData','3');

u4 = uicontrol('Style','Radio','String','Chybne precteno CRC u AFDX switche',...
    'pos',[10 480 1000 30],'parent',h,'HandleVisibility','off','UserData','4');

u5 = uicontrol('Style','Radio','String','AFDX switch poskodi data pri zpracovani ramce',...
    'pos',[10 450 1000 30],'parent',h,'HandleVisibility','off','UserData','5');

u6 = uicontrol('Style','Radio','String','Chybne zapsana data (payload) u AFDX switche',...
    'pos',[10 420 1000 30],'parent',h,'HandleVisibility','off','UserData','6');

u7 = uicontrol('Style','Radio','String','Chybne prenesena data (payload)',...
    'pos',[10 390 1000 30],'parent',h,'HandleVisibility','off','UserData','7');

u8 = uicontrol('Style','Radio','String','Chybne zapsano CRC u AFDX switche',...
    'pos',[10 360 1000 30],'parent',h,'HandleVisibility','off','UserData','8');

u9 = uicontrol('Style','Radio','String','Chybne preneseno CRC na mediu',...
    'pos',[10 330 1000 30],'parent',h,'HandleVisibility','off','UserData','9');

%u10 = uicontrol('Style','Radio','String','NENI!!! Chybne prectena data (payload) u koncoveho uzlu',...
    %'pos',[10 300 1000 30],'parent',h,'HandleVisibility','off','UserData','10');

%u11 = uicontrol('Style','Radio','String','NENI!!! Chybne precteno CRC koncovym uzlem',...
   % 'pos',[10 270 1000 30],'parent',h,'HandleVisibility','off','UserData','11');

u12 = uicontrol('Style','Radio','String','Chybne zapsana data (payload) koncovym uzlem',...
    'pos',[10 240 1000 30],'parent',h,'HandleVisibility','off','UserData','12');

u13 = uicontrol('Style','Radio','String','Chybne zapsano CRC koncovym uzlem na medium',...
    'pos',[10 210 1000 30],'parent',h,'HandleVisibility','off','UserData','13');

u14 = uicontrol('Style','Radio','String','Monitor neoznaci chybejici ramec (HW error)',...
    'pos',[10 180 1000 30],'parent',h,'HandleVisibility','off','UserData','14');

u15 = uicontrol('Style','Radio','String','Ramec ma nespravnou velikost',...
    'pos',[10 150 1000 30],'parent',h,'HandleVisibility','off','UserData','15');

u16 = uicontrol('Style','Radio','String','Ramec nema spravny identifikator VL',...
    'pos',[10 120 1000 30],'parent',h,'HandleVisibility','off','UserData','16');

u17 = uicontrol('Style','Radio','String','Chyba pri prenosu (AFDX Switch)',...
    'pos',[10 90 1000 30],'parent',h,'HandleVisibility','off','UserData','17');

%u18 = uicontrol('Style','Radio','String','NENI!!! Chyba pri prenosu (koncovy system)',...
    %'pos',[10 60 1000 30],'parent',h,'HandleVisibility','off','UserData','18');

u19 = uicontrol('Style','Radio','String','Monitor neoznaci nesouhlasne ramce (HW error)',...
    'pos',[10 30 1000 30],'parent',h,'HandleVisibility','off','UserData','19');
% Initialize some button group properties. 
set(h,'SelectionChangeFcn',{@selcbk});
set(h,'SelectedObject',[]);  % No selection
set(h,'Visible','on');
end

function u = selcbk(source,eventdata)
global TL_SEL
pok = get(get(source,'SelectedObject'),'UserData');
pok = str2double(pok);
if pok == 0
    TL_SEL = 0;
else
    TL_SEL = bitshift(1,pok-1);
end

set_param('afdx_system_basic_ev/ES_1/error_block_1/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/ES_1/error_block_1/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/SWITCH_A/error_block_2/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/SWITCH_A/error_block_2/tlacitko', 'Value', 'TL_SEL');

% set_param('afdx_system_basic_ev/SWITCH_A/error_block_3/tlacitko', 'Value', '0');
% set_param('afdx_system_basic_ev/SWITCH_A/error_block_3/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/SWITCH_A/error_block_4/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/SWITCH_A/error_block_4/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/SWITCH_A/error_block_5/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/SWITCH_A/error_block_5/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/SWITCH_A/error_block_6/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/SWITCH_A/error_block_6/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/error_block_7/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/error_block_7/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/SWITCH_A/error_block_8/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/SWITCH_A/error_block_8/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/error_block_9/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/error_block_9/tlacitko', 'Value', 'TL_SEL');

% set_param('afdx_system_basic_ev/ES_1/error_block_10/tlacitko', 'Value', '0');
% set_param('afdx_system_basic_ev/ES_1/error_block_10/tlacitko', 'Value', 'TL_SEL');
% 
% set_param('afdx_system_basic_ev/ES_1/error_block_11/tlacitko', 'Value', '0');
% set_param('afdx_system_basic_ev/ES_1/error_block_11/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/ES_1/error_block_12/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/ES_1/error_block_12/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/ES_1/error_block_13/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/ES_1/error_block_13/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/ES_1/error_block_14/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/ES_1/error_block_14/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/SWITCH_A/error_block_17/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/SWITCH_A/error_block_17/tlacitko', 'Value', 'TL_SEL');

% set_param('afdx_system_basic_ev/ES_1/error_block_18/tlacitko', 'Value', '0');
% set_param('afdx_system_basic_ev/ES_1/error_block_18/tlacitko', 'Value', 'TL_SEL');

set_param('afdx_system_basic_ev/ES_1/error_block_19/tlacitko', 'Value', '0');
set_param('afdx_system_basic_ev/ES_1/error_block_19/tlacitko', 'Value', 'TL_SEL');

open_system('afdx_system_basic_ev/ES_1/error_block_1/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/SWITCH_A/error_block_2/tlacitko', 'parameter');
% open_system('afdx_system_basic_ev/SWITCH_A/error_block_3/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/SWITCH_A/error_block_4/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/SWITCH_A/error_block_5/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/SWITCH_A/error_block_6/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/error_block_7/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/SWITCH_A/error_block_8/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/error_block_9/tlacitko', 'parameter');
%open_system('afdx_system_basic_ev/ES_1/error_block_10/tlacitko', 'parameter');
%open_system('afdx_system_basic_ev/ES_1/error_block_11/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/ES_1/error_block_12/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/ES_1/error_block_13/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/ES_1/error_block_14/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/SWITCH_A/error_block_17/tlacitko', 'parameter');
%open_system('afdx_system_basic_ev/ES_1/error_block_18/tlacitko', 'parameter');
open_system('afdx_system_basic_ev/ES_1/error_block_19/tlacitko', 'parameter');

close_system('afdx_system_basic_ev/ES_1/error_block_1/tlacitko');
close_system('afdx_system_basic_ev/SWITCH_A/error_block_2/tlacitko');
% close_system('afdx_system_basic_ev/SWITCH_A/error_block_3/tlacitko');
close_system('afdx_system_basic_ev/SWITCH_A/error_block_4/tlacitko');
close_system('afdx_system_basic_ev/SWITCH_A/error_block_5/tlacitko');
close_system('afdx_system_basic_ev/SWITCH_A/error_block_6/tlacitko');
close_system('afdx_system_basic_ev/error_block_7/tlacitko');
close_system('afdx_system_basic_ev/SWITCH_A/error_block_8/tlacitko');
close_system('afdx_system_basic_ev/error_block_9/tlacitko');
% close_system('afdx_system_basic_ev/ES_1/error_block_10/tlacitko');
% close_system('afdx_system_basic_ev/ES_1/error_block_11/tlacitko');
close_system('afdx_system_basic_ev/ES_1/error_block_12/tlacitko');
close_system('afdx_system_basic_ev/ES_1/error_block_13/tlacitko');
close_system('afdx_system_basic_ev/ES_1/error_block_14/tlacitko');
close_system('afdx_system_basic_ev/SWITCH_A/error_block_17/tlacitko');
% close_system('afdx_system_basic_ev/ES_1/error_block_18/tlacitko');
close_system('afdx_system_basic_ev/ES_1/error_block_19/tlacitko');


%disp(bitshift(1,pok-1));
%disp(bitshift(1,get(get(source,'SelectedObject'),'UserData')-1));
% tl_sel = bitshift(1,pok-1);
% disp(get(get(source,'SelectedObject'),'String'));
% disp(get(get(source,'SelectedObject'),'UserData'));
end

