Changeset 646 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jun 2, 2013, 4:00:34 PM (8 years ago)
Author:
sommeria
Message:

various update, bugs to be expected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r644 r646  
    190190LowY=round(ScreenSize(4)/2-Height/2); % put at the middle height on the screen
    191191set(hObject,'Position',[LeftX LowY Width Height])
    192 
    193 %set(hObject,'Units','Normalized')
    194 
    195 %UvData.OpenParam.PosColorbar=[0.8450    0.0900    0.0190    0.3600];
    196192UvData.OpenParam.PosColorbar=[0.80 0.02 0.018 0.445];
    197 %UvData.OpenParam.PosSetObject=[-0.05 -0.03 0.3 0.7]; %position for set_object
    198193UvData.OpenParam.PosGeometryCalib=[0.95 -0.03 0.28 1 ];%position for geometry_calib (TO IMPROVE)
    199 % UvData.OpenParam.CalSize=[0.28 1];
    200 % UvData.PlotAxes=[];%initiate the record of plotted field
    201 % UvData.axes2=[];
    202 % UvData.axes1=[];
    203194AxeData.LimEditBox=1; %initialise AxeData
    204195set(handles.PlotAxes,'UserData',AxeData)
     196% position of table Coord_y
     197set(handles.Coord_y,'Unit','pixel')
     198Pos=get(handles.Coord_y,'Position');
     199set(handles.Coord_y,'Unit','normalized')
     200set(handles.Coord_y,'ColumnWidth',{Pos(3)})
     201set(handles.Coord_y,'ColumnFormat',{'char'})
     202set(handles.Coord_y,'ColumnEditable',false)
     203set(handles.Coord_y,'ColumnName',{''})
    205204
    206205%% set functions for the mouse and keyboard
     
    344343ColumnWidth=max(150,0.18*size_fig(3));
    345344ColumnWidth=min(ColumnWidth,250); % width of the right side display column, between 150 and 250, depending on the fig width
    346 % Data=get(handles.uvmat,'UserData');
    347 % Data.GUISize=size_fig;
    348 % set(handles.uvmat,'UserData',Data)
    349 
    350345
    351346%% position of panel InputFile
    352 %set(handles.InputFile,'Units','pixels')
     347set(handles.InputFile,'Units','pixels')
    353348pos_InputFile=get(handles.InputFile,'Position');% [lower x lower y width height] for text_display
    354349pos_InputFile(1)=0;
    355350pos_InputFile(2)=size_fig(4)-pos_InputFile(4);             % set frame InputFile to the top of the fig
    356351pos_InputFile(3)=size_fig(3);
    357 
    358352set(handles.InputFile,'Position',pos_InputFile);% [lower x lower y width height] for text_display
    359353
    360354%% reset position of text_display or TableDisplay
    361355if strcmp(get(handles.TableDisplay,'Visible'),'off')
     356    set(handles.text_display,'Units','pixels')
    362357    pos_1=get(handles.text_display,'Position');% [lower x lower y width height] for text_display
    363358        pos_1(3)=1.2*ColumnWidth;
     
    367362    % reset position of TableDisplay
    368363else
     364    set(handles.TableDisplay,'Units','pixels')
    369365    pos_1=get(handles.TableDisplay,'Position');
    370366    pos_1(3)=1.2*ColumnWidth;
     
    381377
    382378%% reset position of Coordinates
     379set(handles.Coordinates,'Units','pixels')
    383380pos_2=get(handles.Coordinates,'Position');% [lower x lower y width height] for frame 'Coordinates'
    384381pos_2(3)=ColumnWidth;
     
    388385
    389386%% reset position of  Scalar
     387set(handles.Scalar,'Units','pixels')
    390388pos_3=get(handles.Scalar,'Position'); % [lower x lower y width height] for frame 'Scalar'
    391389pos_3(3)=ColumnWidth;
     
    415413pos(3)=0.77*size_fig(3)-1.2*ColumnWidth;
    416414pos(4)=size_fig(4)-60;
     415set(handles.PlotAxes,'Units','pixels')
    417416set(handles.PlotAxes,'Position',pos)
    418417
     
    10941093%% update the data attached to the uvmat interface
    10951094if ~isempty(TimeUnit)
    1096     set(handles.time_txt,'String',['time (' TimeUnit ')'])
     1095    set(handles.time_var,'String',['time (' TimeUnit ')'])
    10971096end
    10981097UvData.TimeUnit=TimeUnit;
     
    11091108switch FileType
    11101109    case {'civx','civdata'}
    1111 %         [FieldList,ColorList]=calc_field;
    11121110        [FieldList,ColorList]=set_field_list('U','V','C');
    11131111        set(handles_Fields,'String',[{'image'};FieldList;{'get_field...'}]);%standard menu for civx data
     
    11211119        set(handles.Vectors,'Visible','on')
    11221120        set(handles.Coord_x,'Value',1);
    1123         set(handles.Coord_x,'String',{'X'});
    1124         set(handles.Coord_y,'Value',1);
    1125         set(handles.Coord_y,'String',{'Y'});
     1121        set(handles.Coord_x,'String','X');
     1122%         set(handles.Coord_y,'Value',1);
     1123        set(handles.Coord_y,'Data',{'Y'});
    11261124    case 'netcdf'
    11271125        set(handles_Fields,'Value',1)
    11281126        set(handles_Fields,'String',{'get_field...'})
    11291127        FieldName_Callback([],[], handles)
    1130 %         hget_field=get_field(FileName);
    1131 %         hhget_field=guidata(hget_field);
    1132 %         get_field('RUN_Callback',hhget_field.RUN,[],hhget_field);
    11331128    otherwise
    11341129        set(handles_Fields,'Value',1) % set menu to 'image'
    11351130        set(handles_Fields,'String',{'image'})
    11361131        set(handles.Coord_x,'Value',1);
    1137         set(handles.Coord_x,'String',{'AX'});
    1138         set(handles.Coord_y,'Value',1);
    1139         set(handles.Coord_y,'String',{'AY'});
     1132        set(handles.Coord_x,'String','AX');
     1133    set(handles.Coord_y,'Data',{'AY'});
    11401134end
    11411135set(handles.uvmat,'UserData',UvData)
     
    21182112        list_fields=get(handles.FieldName,'String');% list menu fields
    21192113        FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field
    2120         % if get_field... is selected, the GUI get_field will be used to enter fields
    21212114        if ~strcmp(FieldName,'get_field...')
    21222115            if get(handles.FixVelType,'Value')
     
    21642157        ParamIn.Coord_x=XNameMenu(get(handles.Coord_x,'Value'));
    21652158    end
    2166     YNameMenu=get(handles.Coord_y,'String');
    2167     if ~isempty(YNameMenu)
    2168         ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value'));
    2169     end
     2159   % YNameMenu=get(handles.Coord_y,'String');
     2160    ParamIn.Coord_y=get(handles.Coord_y,'Data');
     2161%     if ~isempty(YNameMenu)
     2162%         ParamIn.Coord_y=YNameMenu(get(handles.Coord_y,'Value'));
     2163%     end
    21702164end
    21712165check_tps = 0;         
     
    22712265                &&~strcmp(ParamOut_1.FieldName,'velocity') && ~strcmp(ParamOut_1.FieldName,'get_field...')
    22722266            if ~check_proj_tps
    2273              %   Field{2}=calc_field([{ParamOut_1.FieldName} {ParamOut_1.ColorVar}],Field{2});
    22742267            end
    22752268        end
     
    22892282%% update the display menu for the first velocity type (first menuline)
    22902283test_veltype=0;
    2291 % if ~isequal(FileType,'netcdf')|| isequal(FieldName,'get_field...')
    22922284if (strcmp(UvData.FileType{1},'civx')||strcmp(UvData.FileType{1},'civdata'))&& ~strcmp(FieldName,'get_field...')
    22932285    test_veltype=1;
     
    31653157    [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
    31663158    FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
    3167 %     hget_field=findobj(allchild(0),'name','get_field');
    3168 %     if ~isempty(hget_field)
    3169 %         delete(hget_field)
    3170 %     end
    31713159    GetFieldData=get_field(FileName,ParamIn);
    31723160    FieldList={};
    31733161    VecColorList={};
    3174     XName=GetFieldData.XVarName;
    3175     if GetFieldData.CheckVector
     3162    XName=GetFieldData.Coordinates.XVarName;
     3163    switch GetFieldData.FieldOption
     3164        case 'vectors'
    31763165        UName=GetFieldData.PanelVectors.vector_x;
    31773166        VName=GetFieldData.PanelVectors.vector_y;
    3178         XName=GetFieldData.XVarName;
    3179         YName=GetFieldData.YVarName;
     3167        XName=GetFieldData.Coordinates.XVarName;
     3168        YName=GetFieldData.Coordinates.YVarName;
    31803169        CName=GetFieldData.PanelVectors.vec_color;
    31813170        [FieldList,VecColorList]=set_field_list(UName,VName,CName);
    3182     elseif GetFieldData.CheckScalar
     3171        case 'scalar'
    31833172        AName=GetFieldData.PanelScalar.scalar;
    3184         XName=GetFieldData.XVarName;
    3185         YName=GetFieldData.YVarName;
     3173        XName=GetFieldData.Coordinates.XVarName;
     3174        YName=GetFieldData.Coordinates.YVarName;
    31863175        FieldList={AName};
    3187     elseif GetFieldData.CheckPlot1D;
     3176        case '1D plot'
    31883177        YName=GetFieldData.CheckPlot1D.ordinate;
    31893178    end
     
    52755264Param.Coord_x_str=get(handles.Coord_x,'String');
    52765265Param.Coord_x_val=get(handles.Coord_x,'Value');
    5277 Param.Coord_y_str=get(handles.Coord_y,'String');
    5278 Param.Coord_y_val=get(handles.Coord_y,'Value');
     5266%Param.Coord_y_str=get(handles.Coord_y,'String');
     5267Param.Coord_y_str=get(handles.Coord_y,'Data');
     5268%Param.Coord_y_val=get(handles.Coord_y,'Value');
    52795269series(Param); %run the series interface
    52805270
     
    52905280function MenuHelp_Callback(hObject, eventdata, handles)
    52915281% --------------------------------------------------------------------
    5292 path_to_uvmat=which ('uvmat');% check the path of uvmat
    5293 pathelp=fileparts(path_to_uvmat);
    5294 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
    5295 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
    5296 else
    5297     addpath (fullfile(pathelp,'uvmat_doc'))
    5298     web(helpfile);
    5299 end
     5282web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp')
     5283
     5284% path_to_uvmat=which ('uvmat');% check the path of uvmat
     5285% pathelp=fileparts(path_to_uvmat);
     5286% helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html');
     5287% if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package')
     5288% else
     5289%     addpath (fullfile(pathelp,'uvmat_doc'))
     5290%     web(helpfile);
     5291% end
    53005292
    53015293% --- Executes on selection change in Coord_y.
     
    54235415    end
    54245416end
     5417
     5418
     5419
     5420function time_var_1_Callback(hObject, eventdata, handles)
     5421% hObject    handle to time_var_1 (see GCBO)
     5422% eventdata  reserved - to be defined in a future version of MATLAB
     5423% handles    structure with handles and user data (see GUIDATA)
     5424
     5425% Hints: get(hObject,'String') returns contents of time_var_1 as text
     5426%        str2double(get(hObject,'String')) returns contents of time_var_1 as a double
     5427
     5428
     5429% --- Executes during object creation, after setting all properties.
     5430function time_var_1_CreateFcn(hObject, eventdata, handles)
     5431% hObject    handle to time_var_1 (see GCBO)
     5432% eventdata  reserved - to be defined in a future version of MATLAB
     5433% handles    empty - handles not created until after all CreateFcns called
     5434
     5435% Hint: edit controls usually have a white background on Windows.
     5436%       See ISPC and COMPUTER.
     5437if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
     5438    set(hObject,'BackgroundColor','white');
     5439end
Note: See TracChangeset for help on using the changeset viewer.