Home > timeplt5 > timeplt_command.m

timeplt_command

PURPOSE ^

TIMEPLT_COMMAND: switchyard for timeplt callback

SYNOPSIS ^

function timeplt_command ( command )

DESCRIPTION ^

 TIMEPLT_COMMAND:  switchyard for timeplt callback

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function timeplt_command ( command )
0002 % TIMEPLT_COMMAND:  switchyard for timeplt callback
0003 
0004 global timeplt_obj;
0005 
0006 
0007 N = timeplt_obj_index;
0008 
0009 
0010 %disp ( sprintf ( 'here in timeplt_command:  %s', command ) );
0011 
0012 timeplt_resizefcn = get ( timeplt_obj{N}.figure, 'ResizeFcn' );
0013 set ( timeplt_obj{N}.figure, 'ResizeFcn', '' );
0014 
0015 switch command
0016 
0017     case 'print_to_mfile'
0018 
0019         [filename, pathname] = uiputfile('*.m', 'Save as M-file');
0020         filename = sprintf ( '%s%s', pathname, filename );
0021         eval ( sprintf ( 'print -dmfile %s;', filename ) );
0022 
0023     case 'print_jpeg'
0024 
0025         [filename, pathname] = uiputfile('*.jpg', 'Save as JPEG');
0026         filename = sprintf ( '%s%s', pathname, filename );
0027         eval ( sprintf ( 'print -djpeg %s;', filename ) );
0028 
0029     case 'print_ps'
0030 
0031         [filename, pathname] = uiputfile('*.ps', 'Save as PostScript');
0032         filename = sprintf ( '%s%s', pathname, filename );
0033         eval ( sprintf ( 'print -dpsc2 %s;', filename ) );
0034 
0035     case 'print_eps'
0036 
0037         [filename, pathname] = uiputfile('*.eps', 'Save as Encapsulated PostScript');
0038         filename = sprintf ( '%s%s', pathname, filename );
0039         eval ( sprintf ( 'print -depsc2 %s;', filename ) );
0040 
0041     case 'print_to_printer'
0042 
0043         timeplt_resizefcn = get ( timeplt_obj{N}.figure, 'ResizeFcn' );
0044         set ( timeplt_obj{N}.figure, 'ResizeFcn', '' );
0045         eval ( sprintf ( 'print -f%.0f;', timeplt_obj{N}.figure ) );
0046 
0047     case 'set_time_years'
0048         timeplt_obj{N}.year_cut_specified = 1;
0049         timeplt_obj{N}.month_cut_specified = 0;
0050         timeplt_obj{N}.day_cut_specified = 0;
0051         timeplt_obj{N}.hour_cut_specified = 0;
0052         timeplt_obj{N}.minute_cut_specified = 0;
0053         timeplt_draw;
0054 
0055 
0056 
0057     case 'set_time_months'
0058         timeplt_obj{N}.year_cut_specified = 0;
0059         timeplt_obj{N}.month_cut_specified = 1;
0060         timeplt_obj{N}.day_cut_specified = 0;
0061         timeplt_obj{N}.hour_cut_specified = 0;
0062         timeplt_obj{N}.minute_cut_specified = 0;
0063         timeplt_draw;
0064 
0065     case 'set_time_days'
0066     timeplt_obj{N}.year_cut_specified = 0;
0067     timeplt_obj{N}.month_cut_specified = 0;
0068     timeplt_obj{N}.day_cut_specified = 1;
0069     timeplt_obj{N}.hour_cut_specified = 0;
0070     timeplt_obj{N}.minute_cut_specified = 0;
0071     timeplt_draw;
0072 
0073     case 'set_time_hours'
0074     timeplt_obj{N}.year_cut_specified = 0;
0075     timeplt_obj{N}.month_cut_specified = 0;
0076     timeplt_obj{N}.day_cut_specified = 0;
0077     timeplt_obj{N}.hour_cut_specified = 1;
0078     timeplt_obj{N}.minute_cut_specified = 0;
0079     timeplt_draw;
0080 
0081     case 'set_time_minutes'
0082     timeplt_obj{N}.year_cut_specified = 0;
0083     timeplt_obj{N}.month_cut_specified = 0;
0084     timeplt_obj{N}.day_cut_specified = 0;
0085     timeplt_obj{N}.hour_cut_specified = 0;
0086     timeplt_obj{N}.minute_cut_specified = 1;
0087     timeplt_draw;
0088 
0089     case 'exit'
0090         delete ( timeplt_obj{N}.figure );
0091     timeplt_obj{N} = [];
0092         return;
0093 
0094 end
0095 
0096 
0097 set ( timeplt_obj{N}.figure, 'ResizeFcn', timeplt_resizefcn );

Generated on Wed 30-Nov-2005 15:41:45 by m2html © 2003