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
| function fig = InterfaceGraph()
% Taille ecran %
set(0,'Units','pixels');
posScreen = get(0,'ScreenSize');
% Taille figure %
sz = [560 620];
% Centrage horizontal %
xpos = ceil((posScreen(3)-sz(1))/2);
% Centrage vertical %
ypos = ceil((posScreen(4)-sz(2))/2);
% Figure %
fig = figure('units','pixels',...
'position',[xpos ypos sz(1) sz(2)],...
'menubar','none',...
'name','Blabla',...
'numbertitle','off',...
'Resize','off',...
'color',[0.941 0.941 0.941]);
% Pushbutton Reset %
pushbuttonReset = uicontrol(fig,...
'style','pushbutton',...
'Enable','off',...
'units','normalized',...
'position',[0.232 0.929 0.175 0.0532],...
'string','Reset',...
'tag','pushReset',...
'backgroundcolor',get(fig,'color'));
% Panel Pilotage %
panelPilotage = uipanel('parent',fig,...
'units','normalized',...
'position',[0.0285 0.666 0.378 0.25],...
'title','Parametres Pilotage');
% Text et Edit Box pour Nrot %
textNrot = uicontrol(panelPilotage,...
'style','text',...
'units','normalized',...
'position',[0.0976 0.809 0.35 0.123],...
'string','Nrot (tr/min) :',...
'backgroundcolor',get(fig,'color'));
editNrot = uicontrol(panelPilotage,...
'style','edit',...
'units','normalized',...
'position',[0.535 0.809 0.35 0.145],...
'string','',...
'tag','Nrot',...
'callback',@EnableReset,...
'backgroundcolor',[1 1 1])
% Text et Edit Box pour Pdome %
textPdome = uicontrol(panelPilotage,...
'style','text',...
'units','normalized',...
'position',[0.0976 0.577 0.35 0.123],...
'string','Pdome (barA) :',...
'backgroundcolor',get(fig,'color'));
editPdome = uicontrol(panelPilotage,...
'style','edit',...
'units','normalized',...
'position',[0.535 0.577 0.35 0.145],...
'string','',...
'tag','Pdome',...
'callback',@EnableReset,...
'backgroundcolor',[1 1 1])
% Text et Edit Box pour DmoyIni %
textDmoyIni = uicontrol(panelPilotage,...
'style','text',...
'units','normalized',...
'position',[0.0976 0.345 0.35 0.123],...
'string','Dmoy Ini (g/s) :',...
'backgroundcolor',get(fig,'color'));
editDmoyIni = uicontrol(panelPilotage,...
'style','edit',...
'units','normalized',...
'position',[0.535 0.345 0.35 0.145],...
'string','',...
'tag','DmoyIni',...
'callback',@EnableReset,...
'backgroundcolor',[1 1 1])
% Stockage des identifiants utiles %
handles = guihandles(fig);
guidata(fig,handles);
end
function EnableReset(obj,event)
fig = get(obj,'parent');
handles = guidata(fig)
handlesEdit = findobj(fig,'style','edit')
TxtCell = get(handlesEdit,'string')
if all(~cellfun(@isempty,TxtCell))
set(handles.pushReset,'Enable','on');
else
set(handles.pushReset,'Enable','off');
end
end |
Partager