tomwalters@0: % procedure for 'aim-mat' tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % bleeck@3: % tomwalters@0: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: bleeck@3: tomwalters@0: tomwalters@0: tomwalters@0: function handles=aim_loadcurrentstate(handles) tomwalters@0: % save some crucial information to a file tomwalters@0: tomwalters@0: % standart setting, that prevent followup errors: tomwalters@0: handles.info.init.start_time=0; tomwalters@0: handles.info.init.duration=0.04; tomwalters@0: handles.info.init.scale=1; tomwalters@0: handles.info.current_figure=1; tomwalters@0: handles.info.current_plot=1; tomwalters@0: handles.info.init.hastime=0; tomwalters@0: handles.info.init.hasfreq=0; tomwalters@0: handles.info.init.hassignal=0; tomwalters@0: tomwalters@0: if isfield(handles.info,'projectfilename') tomwalters@0: projectfilename=handles.info.projectfilename; tomwalters@0: if exist(projectfilename)==2 tomwalters@0: olddir=pwd; tomwalters@0: cd(handles.info.directoryname); tomwalters@0: [pathstr,name,ext] = fileparts(projectfilename); tomwalters@0: eval(name); tomwalters@0: cd(olddir); tomwalters@0: tomwalters@0: try tomwalters@0: % test if the current plot can be presented, or if it was maybe tomwalters@0: % deleted in between. In this case set the current_plot to tomwalters@0: % something resonable tomwalters@0: if current_plot >6 && ~handles.info.usermodule_loaded tomwalters@0: current_plot=6; start_time=0; tomwalters@0: end tomwalters@0: if current_plot > 5 && ~handles.info.sai_loaded tomwalters@0: current_plot=5; start_time=0; tomwalters@0: end tomwalters@0: if current_plot > 4 && ~handles.info.strobes_loaded tomwalters@0: current_plot=4; start_time=0; tomwalters@0: end tomwalters@0: if current_plot > 3 && ~handles.info.nap_loaded tomwalters@0: current_plot=3; start_time=0; tomwalters@0: end tomwalters@0: if current_plot > 2 && ~handles.info.bmm_loaded tomwalters@0: current_plot=2; start_time=0; tomwalters@0: end tomwalters@0: handles.info.current_plot=current_plot; tomwalters@0: tomwalters@0: handles.info.init.start_time=start_time; tomwalters@0: handles.info.init.duration=duration; tomwalters@0: handles.info.init.scale=scale; tomwalters@0: tomwalters@0: oldsize=get(handles.figure1,'Position'); tomwalters@0: pos(1)=winx; tomwalters@0: pos(2)=winy; tomwalters@0: pos(3)=oldsize(3); tomwalters@0: pos(4)=oldsize(4); tomwalters@0: set(handles.figure1,'Position',pos); tomwalters@0: tomwalters@0: gpos(1)=grafixwinx; tomwalters@0: gpos(2)=grafixwiny; tomwalters@0: gpos(3)=grafixwinb; tomwalters@0: gpos(4)=grafixwinh; tomwalters@0: gnr=grafixwinnr; tomwalters@0: figure(gnr); tomwalters@0: clf; tomwalters@0: set(gnr,'Position',gpos); tomwalters@0: handles.info.current_figure=gnr; tomwalters@0: tomwalters@0: tomwalters@0: if exist('hastime','var') tomwalters@0: handles.info.init.hastime=hastime; tomwalters@0: else tomwalters@0: handles.info.init.hastime=0; tomwalters@0: end tomwalters@0: if exist('hasfreq','var') tomwalters@0: handles.info.init.hasfreq=hasfreq; tomwalters@0: else tomwalters@0: handles.info.init.hasfreq=0; tomwalters@0: end tomwalters@0: if exist('hassignal','var') tomwalters@0: handles.info.init.hassignal=hassignal; tomwalters@0: else tomwalters@0: handles.info.init.hassignal=0; tomwalters@0: end tomwalters@0: catch tomwalters@0: disp('non fatal problem in reading the project file. Continue...'); tomwalters@0: end tomwalters@0: end tomwalters@0: end