1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
| function UI_EF
%interface graphique codée à la main
% Création de l'objet Figure
fig = figure('units', 'pixels', ...
'position', [520 380 300 200], ...
'name', 'sections et sollicitations',...
'numbertitle','off',...
'menubar','none',...
'tag','interface');
% Création de l'objet Uicontrol Pushbutton
uicontrol('style', 'pushbutton', ...
'units', 'pixels', ...
'String','Choix',...
'position',[75 10 150 20], ...
'callback', @choix,...
'tag','choix');
% Création des objets Uicontrol Checkbox de section
i=160;
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Poutre ronde',...
'position',[10 i 150 20], ...
'callback', @choix,...
'tag','poutre_ronde');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Poutre rectangulaire',...
'position',[10 i-18 150 20], ...
'callback', @choix,...
'tag','poutre_rect');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Tube rond',...
'position',[10 i-2*18 150 20], ...
'callback', @choix,...
'tag','tube_rond');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Tube rectangulaire',...
'position',[10 i-3*18 150 20], ...
'callback', @choix,...
'tag','tube_rect');
% Création des objets Uicontrol Checkbox de Sollicitations
i=160;
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Traction',...
'position',[i i 150 20], ...
'callback', @choix,...
'tag','traction');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Flexion pure',...
'position',[i i-18 150 20], ...
'callback', @choix,...
'tag','flexion_pure');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Flexion simple',...
'position',[i i-2*18 150 20], ...
'callback', @choix,...
'tag','flexion_simple');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Torsion',...
'position',[i i-3*18 150 20], ...
'callback', @choix,...
'tag','torsion');
uicontrol('style','checkbox',...
'units', 'pixels', ...
'String','Sollicitations composées',...
'position',[i i-4*18 150 20], ...
'callback', @choix,...
'tag','sollicitations_composees');
% Création des objets Uicontrol Panel
uipanel('Parent',fig,...
'units', 'pixels', ...
'Title','Choix de section',...
'position',[5 35 130 160]);
uipanel('Parent',fig,...
'units', 'pixels', ...
'Title','Choix de sollicitations',...
'position',[155 35 145 160]);
% initialisation de la variable donnant la section
% Stockage des identifiants utiles
data = guihandles(fig);
guidata(fig,data);
uiwait(fig)
function choix(obj,event)
% Fonction associée au Callback de l'objet Pushbutton
% obj : identifiant de l'objet Pushbutton
% event : événement liés à l'objet Pushbutton
% Récupération des identifiants utiles
fig = get(obj,'parent');
handles = guidata(fig);
% Modification de la valeur de la variable section
if (get(handles.choix,'Value')==1)
if (get(handles.poutre_ronde,'Value')==1)
section=1;
close all
elseif(get(handles.poutre_rect,'Value')==1)
section=2;
close all
elseif(get(handles.tube_rond,'Value')==1)
section=3;
close all
elseif(get(handles.tube_rect,'Value')==1)
section=4;
close all
end
end |
Partager