Changeset 3222


Ignore:
Timestamp:
03/08/10 15:12:29 (15 years ago)
Author:
Eric.Larour
Message:

Reinstate loading of outlog and errlog.
printfmodel: can now print same image in different formats, simultaneously.

Location:
issm/trunk/src/m/classes/public
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/loadresultsfromcluster.m

    r3151 r3222  
    2929
    3030%read log files onto  fields
    31 %md.errlog=char(textread([md.name '.errlog'],'%s','delimiter','\n'));
    32 %md.outlog=char(textread([md.name '.outlog'],'%s','delimiter','\n'));
     31md.errlog=char(textread([md.name '.errlog'],'%s','delimiter','\n'));
     32md.outlog=char(textread([md.name '.outlog'],'%s','delimiter','\n'));
    3333if ~isempty(md.errlog),
    3434        disp(['loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields']);
  • issm/trunk/src/m/classes/public/printmodel.m

    r2827 r3222  
    5555set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
    5656
    57 %Use higher resolution to anti-alias and use zbuffer to have smooth colors
    58 print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
    5957
    60 %some trimming involved?
    61 if ~strcmpi(format,'pdf'),
    62         if strcmpi(getfieldvalue(options,'trim'),'on'),
    63                 system(['convert -trim ' filename '.tif ' filename '.tif']);
     58%we could have several formats, as a cell array of strings.
     59formats=format;
     60if ~iscell(formats),
     61        formats={formats};
     62end
     63
     64%loop on formats:
     65for i=1:length(formats),
     66        format=formats{i};
     67
     68        %Use higher resolution to anti-alias and use zbuffer to have smooth colors
     69        print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
     70
     71        %some trimming involved?
     72        if ~strcmpi(format,'pdf'),
     73                if strcmpi(getfieldvalue(options,'trim'),'on'),
     74                        system(['convert -trim ' filename '.tif ' filename '.tif']);
     75                end
     76        end
     77
     78        %margin?
     79        if ~strcmpi(format,'pdf'),
     80                if strcmpi(getfieldvalue(options,'margin'),'on'),
     81                        marginsize=getfieldvalue(options,'marginsize');
     82                        system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
     83                end
     84        end
     85
     86        %frame?
     87        if ~strcmpi(format,'pdf'),
     88                if strcmpi(getfieldvalue(options,'frame'),'on'),
     89                        framesize=getfieldvalue(options,'framesize');
     90                        framecolor=getfieldvalue(options,'framecolor');
     91                        system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
     92                end
     93        end
     94
     95        %convert image to correct format
     96        if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
     97                system(['convert ' filename '.tif ' filename '.' format]);
     98                delete([ filename '.tif']);
    6499        end
    65100end
    66 
    67 %margin?
    68 if ~strcmpi(format,'pdf'),
    69         if strcmpi(getfieldvalue(options,'margin'),'on'),
    70                 marginsize=getfieldvalue(options,'marginsize');
    71                 system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
    72         end
    73 end
    74 
    75 %frame?
    76 if ~strcmpi(format,'pdf'),
    77         if strcmpi(getfieldvalue(options,'frame'),'on'),
    78                 framesize=getfieldvalue(options,'framesize');
    79                 framecolor=getfieldvalue(options,'framecolor');
    80                 system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
    81         end
    82 end
    83 
    84 %convert image to correct format
    85 if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
    86         system(['convert ' filename '.tif ' filename '.' format]);
    87         delete([ filename '.tif']);
    88 end
Note: See TracChangeset for help on using the changeset viewer.