EZmultiDayGui.m 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. % EZmultiDayGui.m called by EZexpSel.m
  2. % EZmultiday is called after this EZmultiDayGui.m also by EZexpSel.m
  3. function EZmultiDayGui
  4. global exDlst
  5. global exFolder
  6. global expType
  7. global scansDir
  8. xPos=0.05;
  9. btnWid=0.10;
  10. btnHt=0.05;
  11. spacing=0.02; % Spacing between the button and the next command's label
  12. btnNumber=1;
  13. yPos=0.85-(btnNumber-1)*(btnHt+spacing);
  14. btnPos=[xPos yPos-spacing btnWid btnHt];
  15. datacursormode off;
  16. exDirs=dir(exFolder);
  17. exFs={exDirs.name};
  18. exFs=exFs(3:end);
  19. % Re-Sort Experiments by 'D__' Day
  20. if expType==2
  21. exFs
  22. ii=1;
  23. for i=1:size(exFs,2)
  24. position=strfind(exFs(i),'_D');
  25. if ~isempty(cell2mat(position)) && isnumeric(cell2mat(position))
  26. da=char(exFs(i));
  27. ff(ii)=sscanf(da((cell2mat(position)+2):end),'%d');
  28. expDayFs(ii)=exFs(i);
  29. indxx(ii)=ii;
  30. selFindx=nonzeros(indxx);
  31. ii=ii+1;
  32. end
  33. end
  34. BB=[ff;selFindx'];
  35. BB=BB';
  36. CC=sortrows(BB,1);
  37. j=1;
  38. for i=1:size(CC,1)
  39. j=CC(i,2);
  40. ExpOrderByExp(i)=expDayFs(j); %exFs(j)
  41. end
  42. else
  43. ExpOrderByExp=sort(exFs);
  44. end
  45. f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' );
  46. hListbox=uicontrol(...
  47. 'Style', 'listbox',...
  48. 'String',ExpOrderByExp,...
  49. 'value',[],...
  50. 'max',1000,...
  51. 'min',1,...
  52. 'Units','normalized',...
  53. 'Position', [.70 .40 .6 .60],...
  54. 'callback',{@load_listbox}); %'uiresume(gcbf)'); 'Position', [5 100 60 20])
  55. function load_listbox(source,eventdata)
  56. userIndx=(get(source,'value'));
  57. userStr=(get(source,'string'));
  58. user_entry=userStr(userIndx);
  59. exDlst=user_entry;
  60. end
  61. exFs
  62. btnNumber=10;
  63. yPos=0.85-(btnNumber-1)*(btnHt+spacing);
  64. btnPos=[xPos yPos-spacing btnWid btnHt];
  65. hedit8=uicontrol(...
  66. 'Style', 'pushbutton',...
  67. 'String',{'Continue'},...
  68. 'Units','normalized',...
  69. 'Position', btnPos,...
  70. 'callback','uiresume(gcbf)');
  71. uiwait(gcf);
  72. close(f)
  73. end