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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
function [varargout]=test(filename)
% [x0,y0,dx,dy,nb_col,nb_lig,methode]=test(filename);
if nargin==0
filename=('nom du fichier');
end
cree_interface(filename); % creation de l'interface
varargout=recupere_varargout
data=guihandles(gcf);
delete(data.figure)
function data_out=recupere_varargout
data=guihandles(gcf); % recuperation des donnees de sorties
dx=str2double(get(data.edit_dx,'string'));
dy=str2double(get(data.edit_dy,'string'));
x0=str2double(get(data.edit_x0,'string'));
y0=str2double(get(data.edit_y0,'string'));
nb_col=str2double(get(data.edit_col,'string'));
nb_lig=str2double(get(data.edit_lig,'string'));
if get(data.oct,'value')==1
methode='oct';
elseif get(data.r4,'value')==1
methode='r4';
elseif get(data.mnt,'value')==1
methode='mnt';
end
%methode=1;
data_out=[{x0},{y0},{dx},{dy},{nb_col},{nb_lig},{methode}];
function cree_interface(filename)
%%%%% construction de la figure : boutons sans callback
%%%% figure
handles.figure=figure('units','pixels',...
'position',[400 400 300 200],...
'color',[0.95 0.95 0.95],...
'numbertitle','off',...
'name','rentrer les parametres',...
'menubar','none',...
'tag','figure');
handles.text_filename=uicontrol('style','text',...
'units','normalized',...
'position',[0.0 0.9 0.8 0.06],...
'string',filename,...
'tag','text_filename');
%%%%%%% PANEL BOUTON
handles.groupe_bouton=uibuttongroup('units','normalized',...
'position',[0.05 0.01 0.3 0.4],...
'title','type fichier',...
'tag','groupe_bouton');
handles.radio_oct=uicontrol('style','radiobutton',...
'parent',handles.groupe_bouton,...
'units','normalized',...
'position',[0.1 0.7 0.9 0.3],...
'string','oct',...
'value',1,...
'tag','oct');
handles.radio_r4=uicontrol('style','radiobutton',...
'parent',handles.groupe_bouton,...
'units','normalized',...
'position',[0.1 0.4 0.9 0.3],...
'string','r4',...
'tag','r4');
handles.radio_mnt=uicontrol('style','radiobutton',...
'parent',handles.groupe_bouton,...
'units','normalized',...
'position',[0.1 0.1 0.9 0.3],...
'string','mnt',...
'tag','mnt');
%%%%%%%END PANEL BOUTON
handles.edit_col=uicontrol('style','edit',...
'units','normalized',...
'position',[0.3 0.4 0.15 0.1],...
'string','1680',...
'tag','edit_col');
handles.text_col=uicontrol('style','text',...
'units','normalized',...
'position',[0.1 0.4 0.15 0.1],...
'string','nb col',...%'callback',@ajouter,...
'tag','text_col');
handles.edit_lig=uicontrol('style','edit',...
'units','normalized',...
'position',[0.8 0.4 0.15 0.1],...
'string','1360',...%'callback',@ajouter,...
'tag','edit_lig');
handles.text_lig=uicontrol('style','text',...
'units','normalized',...
'position',[0.6 0.4 0.15 0.1],...
'string','nb lig',...%'callback',@ajouter,...
'tag','text_lig');
handles.edit_dx=uicontrol('style','edit',...
'units','normalized',...
'position',[0.3 0.55 0.15 0.1],...
'string','12.5',...%'callback',@ajouter,...
'tag','edit_dx');
handles.text_dx=uicontrol('style','text',...
'units','normalized',...
'position',[0.1 0.55 0.15 0.1],...
'string','dx',...%'callback',@ajouter,...
'tag','text_dx');
handles.edit_dy=uicontrol('style','edit',...
'units','normalized',...
'position',[0.8 0.55 0.15 0.1],...
'string','12.5',...%'callback',@ajouter,...
'tag','edit_dy');
handles.text_dy=uicontrol('style','text',...
'units','normalized',...
'position',[0.6 0.55 0.15 0.1],...
'string','dy',...%'callback',@ajouter,...
'tag','text_dy');
handles.edit_x0=uicontrol('style','edit',...
'units','normalized',...
'position',[0.3 0.7 0.15 0.1],...
'string','200',...%'callback',@ajouter,...
'tag','edit_x0');
handles.text_x0=uicontrol('style','text',...
'units','normalized',...
'position',[0.1 0.7 0.15 0.1],...
'string','x0',...%'callback',@ajouter,...
'tag','text_x0');
handles.edit_y0=uicontrol('style','edit',...
'units','normalized',...
'position',[0.8 0.7 0.15 0.1],...
'string','100',...%'callback',@ajouter,...
'tag','edit_y0');
handles.text_y0=uicontrol('style','text',...
'units','normalized',...
'position',[0.6 0.7 0.15 0.1],...
'string','y0',...%'callback',@ajouter,...
'tag','text_y0');
%%%% boutton avec callback
handles.ok=uicontrol('style','Pushbutton',...
'units','normalized',...
'position',[0.7 0.1 0.2 0.1],...
'string','ok',...%
'callback',@ok_callback,... % sortie du programme
'tag','ok');
uiwait(handles.figure);
data=guihandles(gcf);
guidata(gcf,data);
function ok_callback(obj,event)
data=guihandles(gcf);
uiresume(data.figure); |