Changeset 708


Ignore:
Timestamp:
Feb 12, 2014, 10:26:12 PM (11 years ago)
Author:
sommeria
Message:

option get_field... in series fixed

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r705 r708  
    10191019            end
    10201020        end
    1021         FileName=fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1_series(1,ref_j+1,ref_i+1),i2,j1,j2);
     1021                FieldName_Callback([], [], handles)
     1022       % FileName=fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1_series(1,ref_j+1,ref_i+1),i2,j1,j2);
    10221023%         hget_field=get_field(FileName);
    10231024%         hhget_field=guidata(hget_field);
     
    14691470            return
    14701471        end
     1472        [success,msg] = fileattrib(OutputDir,'+w','g','s');% allow writing access for the group of users, recursively in the folder 
     1473        if success==0
     1474            msgbox_uvmat('WARNING',{['unable to set group write access to ' OutputDir ':']; msg1});%error message for directory creation
     1475            return
     1476        end
    14711477    end
    14721478    OutputNomType=nomtype2pair(Param.InputTable{1,4});% nomenclature for output files
     
    14761482        if ~strcmp(msg1,'')
    14771483            msgbox_uvmat('ERROR',['cannot create ' DirXml ': ' msg1]);%error message for directory creation
     1484            return
     1485        end
     1486                [success,msg] = fileattrib(DirXml,'+w','g','s');% allow writing access for the group of users, recursively in the folder 
     1487        if success==0
     1488            msgbox_uvmat('WARNING',{['unable to set group write access to ' DirXml ':']; msg1});%error message for directory creation
    14781489            return
    14791490        end
     
    22342245    Param.InputTable=Param.InputTable(1,:);
    22352246    filecell=get_file_series(Param);
     2247   
    22362248    if exist(filecell{1,1},'file')
    22372249        GetFieldData=get_field(filecell{1,1});
    22382250        FieldList={};
    2239         XName=GetFieldData.XVarName;
    2240         if GetFieldData.CheckVector
    2241             UName=GetFieldData.PanelVectors.vector_x;
    2242             VName=GetFieldData.PanelVectors.vector_y;
    2243             XName=GetFieldData.XVarName;
    2244             YName=GetFieldData.YVarName;
    2245             CName=GetFieldData.PanelVectors.vec_color;
    2246             [FieldList,VecColorList]=set_field_list(UName,VName,CName);
    2247         elseif GetFieldData.CheckScalar
    2248             AName=GetFieldData.PanelScalar.scalar;
    2249             XName=GetFieldData.XVarName;
    2250             YName=GetFieldData.YVarName;
    2251             FieldList={AName};
    2252         elseif GetFieldData.CheckPlot1D;
    2253             YName=GetFieldData.CheckPlot1D.ordinate;
    2254         end
    2255         set(handles.Coord_x,'String',{XName})
    2256         set(handles.Coord_y,'String',{YName})
    2257         set(handles.FieldName,'Value',1)
    2258         set(handles.FieldName,'String',[FieldList; {'get_field...'}]);
    2259         %         set(handles.ColorScalar,'Value',1)
    2260         %         set(handles.ColorScalar,'String',VecColorList);
    2261         %         UvData.FileType{1}='netcdf';
    2262         %         set(handles.uvmat,'UserData',UvData)
    2263     end
    2264     % elseif isequal(field,'more...')
    2265     %     str=calc_field;
    2266     %     [ind_answer,v] = listdlg('PromptString','Select a file:',...
    2267     %                 'SelectionMode','single',...
    2268     %                 'ListString',str);
    2269     %        % edit the choice in the fields and actionname menu
    2270     %      scalar=cell2mat(str(ind_answer));
    2271     %      update_menu(handles.FieldName,scalar)
     2251        switch GetFieldData.FieldOption
     2252            case 'vectors'
     2253                UName=GetFieldData.PanelVectors.vector_x;
     2254                VName=GetFieldData.PanelVectors.vector_y;
     2255                YName={GetFieldData.Coordinates.Coord_y};
     2256                CName=GetFieldData.PanelVectors.vec_color;
     2257                FieldList={['vec(' UName ',' VName ')'];...
     2258                    ['norm(' UName ',' VName ')'];...
     2259                    UName;VName};
     2260                VecColorList={['norm(' UName ',' VName ')'];...
     2261                    UName;VName};
     2262                if ~isempty(CName)
     2263                    VecColorList=[{CName};VecColorList];
     2264                end
     2265            case 'scalar'
     2266                AName=GetFieldData.PanelScalar.scalar;
     2267                YName={GetFieldData.Coordinates.Coord_y};
     2268                FieldList={AName};
     2269            case '1D plot'
     2270                YName=GetFieldData.PanelOrdinate.ordinate;
     2271%             case 'civdata...'%reinitiate input, return to automatic civ data reading
     2272%                 display_file_name(handles,FileName,1)
     2273        end
     2274        if ~strcmp(GetFieldData.FieldOption,'civdata...')
     2275            XName=GetFieldData.Coordinates.Coord_x;
     2276            TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
     2277            switch TimeNameStr
     2278                case 'file index'
     2279                    set(handles.TimeName,'String','');
     2280                case 'attribute'
     2281                    set(handles.TimeName,'String',['att:' GetFieldData.Time.TimeName]);
     2282                case 'variable'
     2283                    set(handles.TimeName,'String',['var:' GetFieldData.Time.TimeName])
     2284                    set(handles.NomType,'String','*')
     2285                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     2286                    set(handles.FileIndex,'String','')
     2287                    ParamIn.TimeVarName=GetFieldData.Time.TimeName;
     2288                case 'matrix_index'
     2289                    set(handles.TimeName,'String',['dim:' GetFieldData.Time.TimeName]);
     2290                    set(handles.NomType,'String','*')
     2291                    set(handles.RootFile,'String',[get(handles.RootFile,'String') get(handles.FileIndex,'String')])
     2292                    set(handles.FileIndex,'String','')
     2293                    ParamIn.TimeDimName=GetFieldData.Time.TimeName;
     2294            end
     2295            set(handles.Coord_x,'String',{XName})
     2296            set(handles.Coord_y,'String',YName)
     2297            set(handles.FieldName,'Value',1)
     2298            set(handles.FieldName,'String',[FieldList; {'get_field...'}]);
     2299        end
     2300    end
    22722301end
    22732302
     
    29592988function series_WindowButtonMotionFcn(hObject, eventdata, handles)
    29602989set(hObject,'Pointer','arrow');
     2990
     2991
     2992
     2993function TimeName_Callback(hObject, eventdata, handles)
     2994% hObject    handle to TimeName (see GCBO)
     2995% eventdata  reserved - to be defined in a future version of MATLAB
     2996% handles    structure with handles and user data (see GUIDATA)
     2997
     2998% Hints: get(hObject,'String') returns contents of TimeName as text
     2999%        str2double(get(hObject,'String')) returns contents of TimeName as a double
     3000
     3001
     3002% --- Executes during object creation, after setting all properties.
     3003function TimeName_CreateFcn(hObject, eventdata, handles)
     3004% hObject    handle to TimeName (see GCBO)
     3005% eventdata  reserved - to be defined in a future version of MATLAB
     3006% handles    empty - handles not created until after all CreateFcns called
     3007
     3008% Hint: edit controls usually have a white background on Windows.
     3009%       See ISPC and COMPUTER.
     3010if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
     3011    set(hObject,'BackgroundColor','white');
     3012end
Note: See TracChangeset for help on using the changeset viewer.