Changeset 663


Ignore:
Timestamp:
Jul 11, 2013, 6:45:32 PM (7 years ago)
Author:
sommeria
Message:

bug corrected again in xml2struct, PLOT and copy of points improved in geometry_calib

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r660 r663  
    13771377    set(hh,'YData',Coord_plot(:,2))
    13781378end
    1379 
    1380 % get data on the matlab work space
     1379pause(.1)
     1380figure(handles.geometry_calib)
     1381
     1382%------------------------------------------------------------------------
     1383% --- Executes on button press in Copy.
     1384%------------------------------------------------------------------------
     1385function Copy_Callback(hObject, eventdata, handles)
    13811386
    13821387evalin('base','global Coord')%make CurData global in the workspace
     
    13841389evalin('base','Coord') %display CurData in the workspace
    13851390commandwindow; %brings the Matlab command window to the front
    1386 pause(.1)
    1387 figure(handles.geometry_calib)
    1388 
    1389  
    13901391
    13911392
     
    14681469
    14691470
    1470 % --- Executes on button press in Copy.
    1471 function Copy_Callback(hObject, eventdata, handles)
    1472 % hObject    handle to Copy (see GCBO)
    1473 % eventdata  reserved - to be defined in a future version of MATLAB
    1474 % handles    structure with handles and user data (see GUIDATA)
     1471
     1472
  • trunk/src/mouse_motion.m

    r660 r663  
    5151test_edit_object=0;% edit test for mouse shap: an arrow
    5252test_ruler=0;%test for active ruler
     53test_transform=0;
    5354huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle
    5455if ~isempty(huvmat)
     
    5657    test_edit_object=get(hhuvmat.CheckEditObject,'Value');
    5758    test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');
     59    test_transform=~isequal(get(hhuvmat.TransformName,'Value'),1)
    5860end
    5961test_piv=0;
     
    379381        h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord');
    380382        data.Coord=get(h_ListCoord,'Data');
    381 %         data.Coord(:,6)=[];
    382        % data=read_geometry_calib(Coord);%transform char cell to numbers
    383383        if isnumeric(data.Coord)&&~isempty(data.Coord)
     384            if test_transform
     385                            XCoord=(data.Coord(:,1));
     386            YCoord=(data.Coord(:,2));
     387            else
    384388            XCoord=(data.Coord(:,4));
    385389            YCoord=(data.Coord(:,5));
     390            end
    386391            xy=get(CurrentAxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    387392            if ~isempty(xy)
     
    397402                end
    398403                hh=findobj('Tag','calib_points');%look for handle of calibration points
    399                if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.CheckEnableMouse,'Value')
     404               if ~isempty(hh) && ~isempty(get(hh,'UserData')) %&& get(hh_geometry_calib.CheckEnableMouse,'Value')
    400405                   %set(hh,'UserData',index_point)
    401406                    index_point=get(hh,'UserData');
  • trunk/src/xml2struct.m

    r662 r663  
    4646            out.(names{k})=convert_string(ss.(names{k}));
    4747        end
    48     case 'char'   
    49         out=str2double(ss);
    50         %if isempty(regexp(ss,'^(-*\d+\.*\d*\ *)+$'))% if the string does not contain a set of numbers (with possible sign and decimal) separated by blanks
    51         if isnan(out)
    52             sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables
    53             if ~isempty(sep_ind)
    54                 sep_ind=[-2 sep_ind length(ss)+1];
    55                 for icolumn=1:length(sep_ind)-1
    56                     out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);
     48    case 'char'
     49        out=ss; %reproduce the input string
     50        if ~strcmp(ss,'image')% bug with Matlab str2num('image')-> child face
     51            out=str2num(ss);
     52            %if isempty(regexp(ss,'^(-*\d+\.*\d*\ *)+$'))% if the string does not contain a set of numbers (with possible sign and decimal) separated by blanks
     53            if isempty(out)
     54                sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables
     55                if ~isempty(sep_ind)
     56                    sep_ind=[-2 sep_ind length(ss)+1];
     57                    for icolumn=1:length(sep_ind)-1
     58                        out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);
     59                    end
     60                else
     61                    out=ss; %reproduce the input string
    5762                end
    58             else
    59                 out=ss; %reproduce the input string
    6063            end
    6164        end
     
    6467        check_numeric=zeros(size(ss));
    6568        for ilist=1:numel(ss)
    66             if ~isempty(str2num(ss{ilist}))
     69            if ~strcmp(ss{ilist},'image') && ~isempty(str2num(ss{ilist}))
    6770                out{ilist,1}=str2num(ss{ilist});
    6871                check_numeric(ilist)=1;
Note: See TracChangeset for help on using the changeset viewer.