Ignore:
Timestamp:
Nov 21, 2011, 5:54:40 PM (9 years ago)
Author:
sommeria
Message:

plotting functions debugged and checked after the introduction of uipanels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/write_plot_param.m

    r292 r295  
    11%'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation
    22function write_plot_param(handles,PlotParam)
    3 %coordinates
    4 if isfield(PlotParam,'FixEqual')
    5     if PlotParam.FixEqual
    6         set(handles.CheckFixEqual,'Value',1)
    7         set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
     3%% coordinates
     4if isfield(PlotParam,'Coordinates')
     5    Coordinates=PlotParam.Coordinates;
     6    if isfield(Coordinates,'CheckFixEqual')
     7        if Coordinates.CheckFixEqual
     8            set(handles.CheckFixEqual,'Value',1)
     9            set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
     10        else
     11            set(handles.CheckFixEqual,'Value',0)
     12            set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
     13        end
     14    end
     15    if isfield(Coordinates,'MinX')
     16        set(handles.num_MinX,'String',num2str(Coordinates.MinX,4));
     17        set(handles.num_MaxX,'String',num2str(Coordinates.MaxX,4));
     18        set(handles.num_MinY,'String',num2str(Coordinates.MinY,4));
     19        set(handles.num_MaxY,'String',num2str(Coordinates.MaxY,4));
    820    else
    9         set(handles.CheckFixEqual,'Value',0)
    10         set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
     21        set(handles.num_MinX,'String','');
     22        set(handles.num_MaxX,'String','');
     23        set(handles.num_MinY,'String','');
     24        set(handles.num_MaxY,'String','');
    1125    end
    1226end
    13 if isfield(PlotParam,'MinX')
    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));
    18 else
    19     set(handles.num_MinX,'String','');
    20     set(handles.num_MaxX,'String','');
    21     set(handles.num_MinY,'String','');
    22     set(handles.num_MaxY,'String','');
    23 end
    2427
    25 %scalar or image parameters
     28%% scalar or image parameters
    2629if isfield(PlotParam,'Scalar')
    27     set_scal_display(handles,'on')
     30    set(handles.Scalar,'Visible','on')
    2831    if isfield(PlotParam.Scalar,'MaxA')
    2932        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
     
    3235        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
    3336    end
    34 
     37   
    3538    if isfield(PlotParam.Scalar,'IncrA')
    3639        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
    3740    end
    3841else
    39     set_scal_display(handles,'off')
     42    set(handles.Scalar,'Visible','off')
    4043end
    4144
    42 % parameter for vector field
     45%% parameter for vector field
    4346if isfield(PlotParam,'Vectors')
    44     set_vect_display(handles,'on')
     47    set(handles.Vectors,'Visible','on')
    4548    if isfield(PlotParam.Vectors,'VecScale')
    4649        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
     
    5356        list=get(handles.color_code,'String');
    5457        ichoice=get(handles.color_code,'Value');
    55         color_option=list{ichoice};
     58        color_option=list{ichoice};
    5659        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
    5760        if test3color% need to update color thresholds
     
    6063            set(handles.slider1,'Visible','on')
    6164            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;
     65            colcode1=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode1;
     66            colcode2=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode2;
    6667            set(handles.colcode1,'String',num2str(colcode1,3))
    6768            set(handles.colcode2,'String',num2str(colcode2,3))
     
    7677    end
    7778else
    78     set_vect_display(handles,'off')
     79    set(handles.Vectors,'Visible','off')
    7980    if isfield(handles,'edit_vect')
    8081        set(handles.edit_vect,'Visible','off')
     
    8283    end
    8384end
    84 
    85 %------------------------------------------------------------------
    86 %prepare interface for scalar display: state ='on' or 'off'
    87 function set_scal_display(handles,state)
    88 %------------------------------------------------------------------
    89 set(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)
    102 
    103 %---------------------------------------------
    104 %prepare interface for vector display: state ='on' or 'off'
    105 function set_vect_display(handles,state)
    106 %------------------------------------------------------------------
    107 set(handles.Vectors,'Visible',state)
    108 % set(handles.VECT_title,'Visible',state)
    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)
    134 % end
Note: See TracChangeset for help on using the changeset viewer.