Changeset 726 for trunk/src/view_field.m


Ignore:
Timestamp:
Mar 1, 2014, 10:46:51 AM (10 years ago)
Author:
sommeria
Message:

various improvements for interactive use

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/view_field.m

    r717 r726  
    119119%% reset position of text_display and TableDisplay
    120120% reset position of text_display
     121set(handles.text_display,'Units','pixels');
    121122pos_1=get(handles.text_display,'Position');% [lower x lower y width height] for text_display
    122123pos_1(1)=size_fig(3)-pos_1(3);             % set text display to the right of the fig
     
    401402runpm(hObject,eventdata,handles,increment)
    402403
    403 % %-------------------------------------------------------------------
    404 % %Executes on button press in runmin: make one step backward and call
    405 % %run0. The step backward is along the fields series 1 or 2 depending on
    406 % %the scan_i and scan_j check box (exclusive each other)
    407 % %-------------------------------------------------------------------
    408 % function RunMovie_Callback(hObject, eventdata, handles)
    409 % %------------------------------------------------------------------
    410 % set(handles.RunMovie,'BackgroundColor',[1 1 0])%paint the command button in yellow
    411 % drawnow
    412 % increment=str2num(get(handles.increment_scan,'String')); %get the field increment d
    413 % set(handles.STOP,'Visible','on')
    414 % set(handles.speed,'Visible','on')
    415 % set(handles.speed_txt,'Visible','on')
    416 % set(handles.RunMovie,'BusyAction','queue')
    417 % testavi=0;
    418 % UvData=get(handles.view_field,'UserData');
    419 %
    420 % while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command
    421 %         runpm(hObject,eventdata,handles,increment)
    422 %         pause(1.02-get(handles.speed,'Value'))% wait for next image
    423 % end
    424 % if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj),
    425 %     UvData.aviobj=close(UvData.aviobj);
    426 %    set(handles.view_field,'UserData',UvData);
    427 % end
    428 % set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red
    429 
    430404%------------------------------------------------------------------------
    431405% --- translate coordinate to matrix index
     
    449423%------------------------------------------------------------------------
    450424function CheckZoomFig_Callback(hObject, eventdata, handles)
    451 
    452425if get(handles.CheckZoomFig,'Value')
    453426    set(handles.CheckZoom,'value',0)
    454427end
    455428
    456 %-------------------------------------------------------------------
     429%------------------------------------------------------------------------
    457430% --- Executes on button press in 'FixLimits'.
    458 %-------------------------------------------------------------------
     431%------------------------------------------------------------------------
    459432function CheckFixLimits_Callback(hObject, eventdata, handles)
    460433test=get(handles.CheckFixLimits,'Value');
    461 % if test
    462 %     set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])
    463 % else
    464 %     set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7])
    465 % end
    466434update_plot(handles)
    467435 
    468  %-------------------------------------------------------------------
     436%------------------------------------------------------------------------
    469437% --- Executes on button press in CheckFixAspectRatio.
     438%------------------------------------------------------------------------
    470439function CheckFixAspectRatio_Callback(hObject, eventdata, handles)
    471 %-------------------------------------------------------------------
    472440if get(handles.CheckFixAspectRatio,'Value')
    473441    update_plot(handles);
     
    476444end
    477445
    478 %-------------------------------------------------------------------
     446%------------------------------------------------------------------------
    479447function num_AspectRatio_Callback(hObject, eventdata, handles)
    480 %-------------------------------------------------------------------
     448%------------------------------------------------------------------------
    481449set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button
    482450update_plot(handles);
    483 
    484 %-------------------------------------------------------------------
    485 
    486 % %-------------------------------------------------------------------
    487 % %----Executes on button press in 'record': records the current flags of manual correction.
    488 % %-------------------------------------------------------------------
    489 % function record_Callback(hObject, eventdata, handles)
    490 % % [filebase,num_i1,num_j1,num_i2,num_j2,Ext,NomType,SubDir]=read_input_file(handles);
    491 % filename=read_file_boxes(handles);
    492 % AxeData=get(gca,'UserData');
    493 % [erread,message]=fileattrib(filename);
    494 % if ~isempty(message) && ~isequal(message.UserWrite,1)
    495 %      msgbox_view_field('ERROR',['no writting access to ' filename])
    496 %      return
    497 % end
    498 % test_civ2=isequal(get(handles.civ2,'BackgroundColor'),[1 1 0]);
    499 % test_civ1=isequal(get(handles.civ1,'BackgroundColor'),[1 1 0]);
    500 % if ~test_civ2 && ~test_civ1
    501 %     msgbox_view_field('ERROR','manual correction only possible for CIV1 or CIV2 velocity fields')
    502 % end
    503 % if test_civ2
    504 %     nbname='nb_vectors2';
    505 %    flagname='vec2_FixFlag';
    506 %    attrname='fix2';
    507 % end
    508 % if test_civ1
    509 %     nbname='nb_vectors';
    510 %    flagname='vec_FixFlag';
    511 %    attrname='fix';
    512 % end
    513 % %write fix flags in the netcdf file
    514 % hhh=which('netcdf.open');% look for built-in matlab netcdf library
    515 % if ~isequal(hhh,'')% case of new builtin Matlab netcdf library
    516 %     nc=netcdf.open(filename,'NC_WRITE');
    517 %     netcdf.reDef(nc)
    518 %     netcdf.putAtt(nc,netcdf.getConstant('NC_GLOBAL'),attrname,1)
    519 %     dimid = netcdf.inqDimID(nc,nbname);
    520 %     try
    521 %         varid = netcdf.inqVarID(nc,flagname);% look for already existing fixflag variable
    522 %     catch
    523 %         varid=netcdf.defVar(nc,flagname,'double',dimid);%create fixflag variable if it does not exist
    524 %     end
    525 %     netcdf.endDef(nc)
    526 %     netcdf.putVar(nc,varid,AxeData.FF);
    527 %     netcdf.close(nc) 
    528 % else %old netcdf library
    529 %     netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
    530 % end
    531 %
    532 % function netcdf_toolbox(filename,AxeData,attrname,nbname,flagname)
    533 % nc=netcdf(filename,'write'); %open netcdf file
    534 % result=redef(nc);
    535 % eval(['nc.' attrname '=1;']);
    536 % theDim=nc(nbname) ;% get the number of velocity vectors
    537 % nb_vectors=size(theDim);
    538 % var_FixFlag=ncvar(flagname,nc);% var_FixFlag will be written as the netcdf variable vec_FixFlag
    539 % var_FixFlag(1:nb_vectors)=AxeData.FF;%
    540 % fin=close(nc);
    541 
    542451
    543452%-------------------------------------------------------------------
     
    855764[PP,PlotParamOut]= plot_field(AxeData,handles.PlotAxes,PlotParam);
    856765errormsg=fill_GUI(PlotParamOut,handles.view_field);
    857     if ~isempty(errormsg)
    858         msgbox_uvmat('ERROR',errormsg)
    859         return
    860     end
    861 %write_plot_param(handles,PlotParamOut); %update the auto plot parameters
     766if ~isempty(errormsg)
     767    msgbox_uvmat('ERROR',errormsg)
     768    return
     769end
     770hedit=findobj(handles.view_field,'Style','edit');
     771set(hedit,'BackgroundColor',[1 1 1])
    862772
    863773%------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.