pro offset_write,new @common_hog_v1.inc ; This procedure writes the supplied offset lists to the specified input offset ; file input_file ; v1 2/18/98 B. Rizk ; v1m 1/7/04 M Bushroe save backup first for one step undo ; 2/5/04 MWB read all variables from/to state in common ; v2m 2/18/04 MWB use undo_list instead of file copy openw,ol,state.input_file,/get_lun so=size(offsets) for i=0,so(1)-1 do begin printf,ol,offsets(i).time_list printf,ol,offsets(i).mri_file printf,ol,offsets(i).sli_file printf,ol,offsets(i).hri_file printf,ol,offsets(i).roll printf,ol,offsets(i).pitch printf,ol,offsets(i).yaw printf,ol,offsets(i).X printf,ol,offsets(i).Y printf,ol,offsets(i).Z endfor free_lun,ol ;su=size(undo_list) ;for i=su(2)-1,1,-1 do begin ; undo_list(*,i)= undo_list(*,i-1) ; shift up to make room for newest entry ;endfor ;undo_list(*,0) = offsets return end pro offset_undo common hog, p_new, state, offsets, undo_list, static_image, static_zoom, $ active_tile, active_zoom, tile_order ; This procedure restores the previous offset lists to undo the last change ; v1m 1/7/04 M Bushroe save backup first for one step undo ; v2m 2/18/04 MWB use undo list instead of bak file if undo_list(0,0).time_list EQ '' then return ; no more undo's to do offsets = undo_list(*,0) su=size(undo_list) for i=0,su(2)-2,1 do begin undo_list(*,i)= undo_list(*,i+1) ; shift down to remove used entry endfor undo_list(*,su(2)-1).time_list = '' ; show this one is dead return end pro save_undo common hog, p_new, state, offsets, undo_list, static_image, static_zoom, $ active_tile, active_zoom, tile_order su=size(undo_list) ; save current offsets first for i=su(2)-1,1,-1 do begin undo_list(*,i)= undo_list(*,i-1) ; shift up to make room for newest entry endfor undo_list(*,0) = offsets return end