Changeset 644 for trunk/src/get_field.m
- Timestamp:
- May 28, 2013, 11:30:01 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_field.m
r630 r644 22 22 function varargout = get_field(varargin) 23 23 24 % Last Modified by GUIDE v2.5 05-May-2013 23:54:3224 % Last Modified by GUIDE v2.5 28-May-2013 01:55:25 25 25 26 26 % Begin initialization code - DO NOT EDIT … … 186 186 option=1; 187 187 end 188 set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime)189 set(handles.SwitchVarIndexTime,'Value',option)188 %set(handles.SwitchVarIndexTime,'String',ListSwitchVarIndexTime) 189 %set(handles.SwitchVarIndexTime,'Value',option) 190 190 set(handles.get_field,'UserData',Field);% record the finput field structure 191 SwitchVarIndexTime_Callback([],[], handles)191 %SwitchVarIndexTime_Callback([],[], handles) 192 192 193 193 %% set z coordinate menu if relevant … … 201 201 set(handles.vector_z,'Visible','off') 202 202 set(handles.ZVarName,'Visible','off') 203 set(handles.SwitchVarIndexZ,'Visible','off')203 % set(handles.SwitchVarIndexZ,'Visible','off') 204 204 set(handles.Z_title,'Visible','off') 205 205 end … … 207 207 %% set vector menu (priority) if detected or scalar menu for space dim >=2, or usual (x,y) plot for 1D fields 208 208 if Field.MaxDim>=2 % case of 2D (or 3D) fields 209 set(handles.CheckPlot1D,'Value',0)210 209 if isfield(CellInfo{imax},'VarIndex_vector_x') && isfield(CellInfo{imax},'VarIndex_vector_y') 211 210 set(handles.CheckVector,'Value',1) … … 213 212 set(handles.vector_x,'Value',CellInfo{imax}.VarIndex_vector_x(1)) 214 213 set(handles.vector_y,'Value',CellInfo{imax}.VarIndex_vector_y(1)) 214 set(handles.FieldOption,'Value',3) 215 215 else 216 set(handles.CheckScalar,'Value',1) 217 set(handles.CheckVector,'Value',0) 216 set(handles.FieldOption,'Value',2) 218 217 end 219 218 else % 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) 220 end 221 224 222 225 223 %% Make choices in menus from input … … 227 225 fill_GUI(ParamIn,handles.get_field); 228 226 end 229 CheckPlot1D_Callback(handles.CheckPlot1D, [], handles) 230 CheckScalar_Callback(handles.CheckScalar, [], handles) 231 CheckVector_Callback(handles.CheckVector, [], handles) 227 FieldOption_Callback([],[],handles) 232 228 233 229 %------------------------------------------------------------------------ … … 335 331 set(handles.Panel1Dplot,'Visible','off') 336 332 else 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 352 334 end 353 335 … … 386 368 set(handles.PanelScalar,'Visible','off') 387 369 else 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 393 371 end 394 372 … … 401 379 set(handles.PanelVectors,'Visible','off') 402 380 else 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 412 382 end 413 383 … … 425 395 %eliminate time 426 396 TimeDimName='';%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')}; 429 399 if strcmp(TimeVarOption,'variable') 430 400 List=get(handles.TimeVarName,'String'); … … 1415 1385 1416 1386 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 MATLAB1422 % handles structure with handles and user data (see GUIDATA)1423 1424 % Hints: contents = cellstr(get(hObject,'String')) returns listbox30 contents as cell array1425 % contents{get(hObject,'Value')} returns selected item from listbox301426 1427 1428 1387 % --- Executes on selection change in SwitchVarIndexX. 1429 1388 function SwitchVarIndexX_Callback(hObject, eventdata, handles) … … 1488 1447 end 1489 1448 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. 1450 function FieldOption_Callback(hObject, eventdata, handles) 1451 FieldList=get(handles.FieldOption,'String'); 1452 FieldOption=FieldList{get(handles.FieldOption,'Value')}; 1453 switch 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') 1517 end 1518 % hObject handle to FieldOption (see GCBO) 1494 1519 % eventdata reserved - to be defined in a future version of MATLAB 1495 1520 % handles structure with handles and user data (see GUIDATA) 1496 1521 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. 1527 function CheckDimensionX_Callback(hObject, eventdata, handles) 1528 % hObject handle to CheckDimensionX (see GCBO) 1503 1529 % eventdata reserved - to be defined in a future version of MATLAB 1504 1530 % handles structure with handles and user data (see GUIDATA) 1505 1531 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. 1536 function 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. 1545 function 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. 1554 function 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. 1563 function 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.