source: trunk/src/write_plot_param.m @ 292

Last change on this file since 292 was 292, checked in by sommeria, 9 years ago

GUI civ patch2 corrected (SmoothingParam?).
uvmatand view_field updated with panels.
read_plot_param removed (replaced by the mostgeneral read_GUI)

File size: 5.2 KB
RevLine 
[204]1%'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation
2function write_plot_param(handles,PlotParam)
3%coordinates
4if isfield(PlotParam,'FixEqual')
5    if PlotParam.FixEqual
[292]6        set(handles.CheckFixEqual,'Value',1)
7        set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
[204]8    else
[292]9        set(handles.CheckFixEqual,'Value',0)
10        set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
[204]11    end
12end
13if isfield(PlotParam,'MinX')
[292]14    set(handles.num_MinX,'String',num2str(PlotParam.MinX,4));
15    set(handles.num_MaxX,'String',num2str(PlotParam.MaxX,4));
16    set(handles.num_MinY,'String',num2str(PlotParam.MinY,4));
17    set(handles.num_MaxY,'String',num2str(PlotParam.MaxY,4));
[204]18else
[292]19    set(handles.num_MinX,'String','');
20    set(handles.num_MaxX,'String','');
21    set(handles.num_MinY,'String','');
22    set(handles.num_MaxY,'String','');
[204]23end
24
25%scalar or image parameters
26if isfield(PlotParam,'Scalar')
27    set_scal_display(handles,'on')
28    if isfield(PlotParam.Scalar,'MaxA')
[292]29        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
[204]30    end
31    if isfield(PlotParam.Scalar,'MinA')
[292]32        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
[204]33    end
34
35    if isfield(PlotParam.Scalar,'IncrA')
[292]36        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
[204]37    end
38else
39    set_scal_display(handles,'off')
40end
41
42% parameter for vector field
43if isfield(PlotParam,'Vectors')
44    set_vect_display(handles,'on')
45    if isfield(PlotParam.Vectors,'VecScale')
[292]46        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
[204]47    end
48    if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC')
49        MinC=PlotParam.Vectors.MinC;
50        MaxC=PlotParam.Vectors.MaxC;
51        set(handles.min_vec,'String', num2str(MinC,3));
52        set(handles.max_vec,'String',num2str(MaxC,3));
53        list=get(handles.color_code,'String');
54        ichoice=get(handles.color_code,'Value');
55        color_option=list{ichoice};
56        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
57        if test3color% need to update color thresholds
58            set(handles.colcode1,'Visible','on')
59            set(handles.colcode2,'Visible','on')
60            set(handles.slider1,'Visible','on')
61            set(handles.slider2,'Visible','on')
62%             slider1=get(handles.slider1,'Value');
63%             slider2=get(handles.slider2,'Value');
64             colcode1=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode1;
65             colcode2=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode2;
66            set(handles.colcode1,'String',num2str(colcode1,3))
67            set(handles.colcode2,'String',num2str(colcode2,3))
68            set(handles.slider1,'Value',PlotParam.Vectors.colcode1)
69            set(handles.slider2,'Value',PlotParam.Vectors.colcode2)
70        else
71            set(handles.colcode1,'Visible','off')
72            set(handles.colcode2,'Visible','off')
73            set(handles.slider1,'Visible','off')
74            set(handles.slider2,'Visible','off')
75        end
76    end
77else
78    set_vect_display(handles,'off')
79    if isfield(handles,'edit_vect')
80        set(handles.edit_vect,'Visible','off')
81        set(handles.record,'Visible','off')
82    end
83end
84
85%------------------------------------------------------------------
86%prepare interface for scalar display: state ='on' or 'off'
87function set_scal_display(handles,state)
88%------------------------------------------------------------------
[292]89set(handles.Scalar,'Visible',state)
90% set(handles.num_MaxA,'Visible',state)
91% set(handles.num_MinA,'Visible',state)
92% %set(handles.IncrA,'Visible',state)
93% set(handles.CheckFixScalar,'Visible',state)
94% set(handles.CheckBW,'Visible',state)
95% set(handles.ListContour,'Visible',state)
96% set(handles.TitleMinA,'Visible',state)
97% set(handles.TitleMaxA,'Visible',state)
98% set(handles.num_Npx,'Visible',state)
99% set(handles.num_Npy,'Visible',state)
100% set(handles.TitleNpx,'Visible',state)
101% set(handles.TitleNpy,'Visible',state)
[204]102
103%---------------------------------------------
104%prepare interface for vector display: state ='on' or 'off'
105function set_vect_display(handles,state)
106%------------------------------------------------------------------
[292]107set(handles.Vectors,'Visible',state)
[204]108% set(handles.VECT_title,'Visible',state)
[292]109% set(handles.num_VecScale,'Visible',state)
110% set(handles.FixVec,'Visible',state)
111% set(handles.HideFalse,'Visible',state)
112% set(handles.HideWarning,'Visible',state)
113% % if isfield(handles,'record')
114% %     set(handles.record,'Visible',state)
115% % end
116% set(handles.num_ColCode1,'Visible',state)
117% set(handles.num_ColCode2,'Visible',state)
118% set(handles.num_MinVec,'Visible',state)
119% set(handles.num_MaxVec,'Visible',state)
120% set(handles.scale_title,'Visible',state)
121% set(handles.slider1,'Visible',state)
122% set(handles.slider2,'Visible',state)
123% set(handles.col_vec,'Visible',state)
124% set(handles.Color_title,'Visible',state)
125% set(handles.color_code,'Visible',state)
126% set(handles.vec_col_bar,'Visible',state)
127% % set(handles.record,'Visible',state)
128% set(handles.AutoVecColor,'Visible',state)
129% set(handles.decimate4,'Visible',state)
130% set(handles.min_C_title,'Visible',state)
131% set(handles.max_C_title,'Visible',state)
132% if isfield(handles,'MenuEditVectors')
133%     set(handles.MenuEditVectors,'Enable',state)
[204]134% end
Note: See TracBrowser for help on using the repository browser.