Bonjour,

Mon problème est simple, une GUI contient des variables à modifier, et cette modification se fait dans une autre GUI.

Le passage des valeurs dans un sens ne pose pas de problème, je le fais par l'intermédiaire de varargin.

Mais pour retourner à ma première GUI les valeurs modifiés, cela pose problème.

Ici le Callback du bouton "Paramètres"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function param_Callback(hObject, eventdata, handles)
% hObject    handle to param (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
%LANCEMENT DE LA FENETRE PARAMETRES
h = parametres(handles.alpha,handles.Pi,handles.Ti,handles.Rhoi,handles.n);
 
%ATTENTE QUE L'UTILISATEUR ENTRE LES NOUVELLES VALEURS
uiwait(h);
 
% RECUPERATION DE CES NOUVELLES VALEURS
% C'EST LA QUE CA POSE PROBLEME
paramData=guidata(h)
 
%paramData NE CONTIENT PAS LES BONNES VALEURS.... PK ?
 
handles.alpha=paramData.alpha;
handles.Pi=paramData.Pi;
handles.Ti=paramData.Ti;
handles.Rhoi=paramData.Rhoi;
handles.n=paramData.n;
Et ici le retour lorsqu'on valide dans le fenêtre paramètre:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function calculer_Callback(hObject, eventdata, handles)
% hObject    handle to calculer (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% MISE A JOUR DES VARIABLES AVEC LES NOUVELLES VALEURS
handles = guidata(gcbf);
handles.alpha=str2double(get(handles.alphaText,'String'));
handles.Pi=str2double(get(handles.PiText,'String'));
handles.Ti=str2double(get(handles.TiText,'String'));
handles.Rhoi=str2double(get(handles.RhoiText,'String'));
handles.n=str2double(get(handles.nText,'String'));
 
handles
%ICI handles CONTIENT LES BONNES VALEURS
 
% ON RESUME
uiresume(gcbf);

Mon problème est commenté.

Quand je fais "handles" dans la fenetre parametres, il m'affiche bien les nouvelles valeurs, mais lorsque je fais "paramData", il n'affiche pas les nouvelles valeurs mais les anciennes.
Pourtant je fais bien "paramData=guidata(h)".

Je bloque depuis un bout de temps, alors j'attends vos explications