Changeset 644 for trunk/src/get_field.m


Ignore:
Timestamp:
May 28, 2013, 11:30:01 PM (8 years ago)
Author:
sommeria
Message:

various improvements: resize GUI uvmat, projection on lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_field.m

    r630 r644  
    2222function varargout = get_field(varargin)
    2323
    24 % Last Modified by GUIDE v2.5 05-May-2013 23:54:32
     24% Last Modified by GUIDE v2.5 28-May-2013 01:55:25
    2525
    2626% Begin initialization code - DO NOT EDIT
     
    186186    option=1;
    187187end
    188 set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)
    189 set(handles.SwitchVarIndexTime,'Value',option)
     188%set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)
     189%set(handles.SwitchVarIndexTime,'Value',option)
    190190set(handles.get_field,'UserData',Field);% record the finput field structure
    191 SwitchVarIndexTime_Callback([],[], handles)
     191%SwitchVarIndexTime_Callback([],[], handles)
    192192
    193193%% set z coordinate menu if relevant
     
    201201    set(handles.vector_z,'Visible','off')
    202202    set(handles.ZVarName,'Visible','off')
    203     set(handles.SwitchVarIndexZ,'Visible','off')
     203%    set(handles.SwitchVarIndexZ,'Visible','off')
    204204    set(handles.Z_title,'Visible','off')
    205205end
     
    207207%% set vector menu (priority) if detected or scalar menu for space dim >=2, or usual (x,y) plot for 1D fields
    208208if Field.MaxDim>=2 % case of 2D (or 3D) fields
    209     set(handles.CheckPlot1D,'Value',0)
    210209    if isfield(CellInfo{imax},'VarIndex_vector_x') &&  isfield(CellInfo{imax},'VarIndex_vector_y')
    211210        set(handles.CheckVector,'Value',1)
     
    213212        set(handles.vector_x,'Value',CellInfo{imax}.VarIndex_vector_x(1))
    214213        set(handles.vector_y,'Value',CellInfo{imax}.VarIndex_vector_y(1))
     214        set(handles.FieldOption,'Value',3)
    215215    else
    216         set(handles.CheckScalar,'Value',1)
    217         set(handles.CheckVector,'Value',0)
     216        set(handles.FieldOption,'Value',2)
    218217    end
    219218else % case of 1D fields
    220     set(handles.CheckPlot1D,'Value',1)
    221     set(handles.CheckScalar,'Value',0)
    222     set(handles.CheckVector,'Value',0)
    223 end
     219    set(handles.FieldOption,'Value',1)
     220end
     221
    224222
    225223%% Make choices in menus from input
     
    227225    fill_GUI(ParamIn,handles.get_field);
    228226end
    229 CheckPlot1D_Callback(handles.CheckPlot1D, [], handles)
    230 CheckScalar_Callback(handles.CheckScalar, [], handles)
    231 CheckVector_Callback(handles.CheckVector, [], handles)
     227FieldOption_Callback([],[],handles)
    232228
    233229%------------------------------------------------------------------------
     
    335331    set(handles.Panel1Dplot,'Visible','off')
    336332else
    337     set(handles.Panel1Dplot,'Visible','on')
    338     set(handles.PanelScalar,'Visible','off')
    339     set(handles.CheckScalar,'Value',0)
    340     set(handles.PanelVectors,'Visible','off')
    341     set(handles.CheckVector,'Value',0)
    342     set(handles.XVarName,'Visible','on')
    343     set(handles.SwitchVarIndexX,'Visible','on')
    344     set(handles.X_title,'Visible','on')
    345     set(handles.YVarName,'Visible','off')
    346     set(handles.SwitchVarIndexY,'Visible','off')
    347     set(handles.Y_title,'Visible','off')
    348     set(handles.ZVarName,'Visible','off')
    349     set(handles.SwitchVarIndexZ,'Visible','off')
    350     set(handles.Z_title,'Visible','off')
    351     ordinate_Callback(hObject, eventdata, handles)
     333   
    352334end
    353335
     
    386368    set(handles.PanelScalar,'Visible','off')
    387369else
    388     set(handles.Panel1Dplot,'Visible','off')
    389     set(handles.CheckPlot1D,'Value',0)
    390     set(handles.PanelScalar,'Visible','on')
    391     set(handles.PanelVectors,'Visible','off')
    392     set(handles.CheckVector,'Value',0)
     370   
    393371end
    394372
     
    401379    set(handles.PanelVectors,'Visible','off')
    402380else
    403     set(handles.Panel1Dplot,'Visible','off')
    404     set(handles.CheckPlot1D,'Value',0)
    405     set(handles.PanelScalar,'Visible','off')
    406     set(handles.CheckScalar,'Value',0)
    407     set(handles.PanelVectors,'Visible','on')
    408     set(handles.XVarName,'Visible','on')
    409     set(handles.YVarName,'Visible','on')
    410     set(handles.X_title,'Visible','on')
    411     set(handles.Y_title,'Visible','on')
     381   
    412382end
    413383
     
    425395%eliminate time
    426396TimeDimName='';%default
    427 SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String');
    428 TimeVarOption=SwitchVarIndexTime{get(handles.SwitchVarIndexTime,'Value')};
     397% SwitchVarIndexTime=get(handles.SwitchVarIndexTime,'String');
     398% TimeVarOption=SwitchVarIndexTime{get(handles.SwitchVarIndexTime,'Value')};
    429399if strcmp(TimeVarOption,'variable')
    430400    List=get(handles.TimeVarName,'String');
     
    14151385
    14161386
    1417 
    1418 % --- Executes on selection change in listbox30.
    1419 function listbox30_Callback(hObject, eventdata, handles)
    1420 % hObject    handle to listbox30 (see GCBO)
    1421 % eventdata  reserved - to be defined in a future version of MATLAB
    1422 % handles    structure with handles and user data (see GUIDATA)
    1423 
    1424 % Hints: contents = cellstr(get(hObject,'String')) returns listbox30 contents as cell array
    1425 %        contents{get(hObject,'Value')} returns selected item from listbox30
    1426 
    1427 
    14281387% --- Executes on selection change in SwitchVarIndexX.
    14291388function SwitchVarIndexX_Callback(hObject, eventdata, handles)
     
    14881447end
    14891448
    1490 
    1491 % --- Executes on button press in CheckScalar.
    1492 function checkbox22_Callback(hObject, eventdata, handles)
    1493 % hObject    handle to CheckScalar (see GCBO)
     1449% --- Executes on selection change in FieldOption.
     1450function FieldOption_Callback(hObject, eventdata, handles)
     1451FieldList=get(handles.FieldOption,'String');
     1452FieldOption=FieldList{get(handles.FieldOption,'Value')};
     1453switch FieldOption
     1454    case '1D plot'
     1455         set(handles.Panel1Dplot,'Visible','on')
     1456         pos=get(handles.Panel1Dplot,'Position');
     1457         pos(1)=2;
     1458         pos_coord=get(handles.Coordinates,'Position');
     1459         pos(2)=pos_coord(2)-pos(4)-2;
     1460         set(handles.Panel1Dplot,'Position',pos)
     1461    set(handles.PanelScalar,'Visible','off')
     1462    set(handles.PanelVectors,'Visible','off')
     1463    set(handles.YVarName,'Visible','off')
     1464%    set(handles.SwitchVarIndexY,'Visible','off')
     1465    set(handles.Y_title,'Visible','off')
     1466    set(handles.ZVarName,'Visible','off')
     1467 %   set(handles.SwitchVarIndexZ,'Visible','off')
     1468    set(handles.Z_title,'Visible','off')
     1469%    ordinate_Callback(hObject, eventdata, handles)
     1470%         set(handles.get_field,'Units','pixels')
     1471% size_fig=get(handles.get_field,'Position');
     1472% Data=get(handles.view_field,'UserData');
     1473% Data.GUISize=size_fig;
     1474% set(handles.view_field,'UserData',Data)
     1475%
     1476% %% reset position of text_display or TableDisplay
     1477% if strcmp(get(handles.TableDisplay,'Visible'),'off')
     1478%     pos_1=get(handles.text_display,'Position');
     1479%     pos_1(1)=size_fig(3)-pos_1(3);
     1480%     pos_1(2)=size_fig(4)-pos_1(4);
     1481%     set(handles.text_display,'Position',pos_1)
     1482%     % reset position of TableDisplay
     1483% else
     1484%     pos_1=get(handles.TableDisplay,'Position');
     1485%     pos_1(1)=size_fig(3)-pos_1(3);
     1486%     pos_1(2)=size_fig(4)-pos_1(4);
     1487%     set(handles.TableDisplay,'Position',pos_1)
     1488% end
     1489%
     1490% %% reset position of Coordinates
     1491% pos_2=get(handles.Coordinates,'Position');
     1492% pos_2(1)=size_fig(3)-pos_1(3);
     1493% pos_2(2)=pos_1(2)-pos_2(4);
     1494% set(handles.Coordinates,'Position',pos_2)
     1495    case 'scalar'
     1496        set(handles.Panel1Dplot,'Visible','off')
     1497    set(handles.PanelScalar,'Visible','on')
     1498    set(handles.PanelVectors,'Visible','off')
     1499         pos=get(handles.PanelScalar,'Position');
     1500         pos(1)=2;
     1501         pos_coord=get(handles.Coordinates,'Position');
     1502         pos(2)=pos_coord(2)-pos(4)-2;
     1503         set(handles.PanelScalar,'Position',pos)
     1504    set(handles.YVarName,'Visible','on')
     1505    set(handles.Y_title,'Visible','on')
     1506    case 'vectors'
     1507        set(handles.Panel1Dplot,'Visible','off')
     1508    set(handles.PanelScalar,'Visible','off')
     1509    set(handles.PanelVectors,'Visible','on')
     1510    pos=get(handles.PanelVectors,'Position');
     1511         pos(1)=2;
     1512         pos_coord=get(handles.Coordinates,'Position');
     1513         pos(2)=pos_coord(2)-pos(4)-2;
     1514         set(handles.PanelVectors,'Position',pos)
     1515    set(handles.YVarName,'Visible','on')
     1516    set(handles.Y_title,'Visible','on')
     1517end
     1518% hObject    handle to FieldOption (see GCBO)
    14941519% eventdata  reserved - to be defined in a future version of MATLAB
    14951520% handles    structure with handles and user data (see GUIDATA)
    14961521
    1497 % Hint: get(hObject,'Value') returns toggle state of CheckScalar
    1498 
    1499 
    1500 % --- Executes on button press in checkbox23.
    1501 function checkbox23_Callback(hObject, eventdata, handles)
    1502 % hObject    handle to checkbox23 (see GCBO)
     1522% Hints: contents = get(hObject,'String') returns FieldOption contents as cell array
     1523%        contents{get(hObject,'Value')} returns selected item from FieldOption
     1524
     1525
     1526% --- Executes on button press in CheckDimensionX.
     1527function CheckDimensionX_Callback(hObject, eventdata, handles)
     1528% hObject    handle to CheckDimensionX (see GCBO)
    15031529% eventdata  reserved - to be defined in a future version of MATLAB
    15041530% handles    structure with handles and user data (see GUIDATA)
    15051531
    1506 % Hint: get(hObject,'Value') returns toggle state of checkbox23
     1532% Hint: get(hObject,'Value') returns toggle state of CheckDimensionX
     1533
     1534
     1535% --- Executes on button press in checkbox25.
     1536function checkbox25_Callback(hObject, eventdata, handles)
     1537% hObject    handle to checkbox25 (see GCBO)
     1538% eventdata  reserved - to be defined in a future version of MATLAB
     1539% handles    structure with handles and user data (see GUIDATA)
     1540
     1541% Hint: get(hObject,'Value') returns toggle state of checkbox25
     1542
     1543
     1544% --- Executes on button press in checkbox26.
     1545function checkbox26_Callback(hObject, eventdata, handles)
     1546% hObject    handle to checkbox26 (see GCBO)
     1547% eventdata  reserved - to be defined in a future version of MATLAB
     1548% handles    structure with handles and user data (see GUIDATA)
     1549
     1550% Hint: get(hObject,'Value') returns toggle state of checkbox26
     1551
     1552
     1553% --- Executes on button press in checkbox27.
     1554function checkbox27_Callback(hObject, eventdata, handles)
     1555% hObject    handle to checkbox27 (see GCBO)
     1556% eventdata  reserved - to be defined in a future version of MATLAB
     1557% handles    structure with handles and user data (see GUIDATA)
     1558
     1559% Hint: get(hObject,'Value') returns toggle state of checkbox27
     1560
     1561
     1562% --- Executes on button press in checkbox29.
     1563function checkbox29_Callback(hObject, eventdata, handles)
     1564% hObject    handle to checkbox29 (see GCBO)
     1565% eventdata  reserved - to be defined in a future version of MATLAB
     1566% handles    structure with handles and user data (see GUIDATA)
     1567
     1568% Hint: get(hObject,'Value') returns toggle state of checkbox29
Note: See TracChangeset for help on using the changeset viewer.