| [24307] | 1 | Index: ../trunk-jpl/src/m/classes/organizer.m
|
|---|
| 2 | ===================================================================
|
|---|
| 3 | --- ../trunk-jpl/src/m/classes/organizer.m (revision 23775)
|
|---|
| 4 | +++ ../trunk-jpl/src/m/classes/organizer.m (revision 23776)
|
|---|
| 5 | @@ -13,7 +13,7 @@
|
|---|
| 6 | % org = organizer('repository','Models/','prefix','AGU2015','steps',0); %build an empty organizer object with a given repository
|
|---|
| 7 |
|
|---|
| 8 | classdef organizer < handle
|
|---|
| 9 | - properties (SetAccess=private)
|
|---|
| 10 | + properties (SetAccess=private)
|
|---|
| 11 | % {{{
|
|---|
| 12 | currentstep =0;
|
|---|
| 13 | end
|
|---|
| 14 | @@ -22,6 +22,7 @@
|
|---|
| 15 | prefix ='';
|
|---|
| 16 | color ='';
|
|---|
| 17 | steps =[];
|
|---|
| 18 | + skipio = false;
|
|---|
| 19 | requestedsteps=[0];
|
|---|
| 20 | %}}}
|
|---|
| 21 | end
|
|---|
| 22 | @@ -49,6 +50,8 @@
|
|---|
| 23 | %Get steps
|
|---|
| 24 | org.requestedsteps=getfieldvalue(options,'steps',0);
|
|---|
| 25 |
|
|---|
| 26 | + %Skip io?
|
|---|
| 27 | + org.skipio=getfieldvalue(options,'skipio',0);
|
|---|
| 28 | end
|
|---|
| 29 | %}}}
|
|---|
| 30 | function disp(org) % {{{
|
|---|
| 31 | @@ -55,6 +58,7 @@
|
|---|
| 32 | disp(sprintf(' Repository: ''%s''',org.repository));
|
|---|
| 33 | disp(sprintf(' Prefix: ''%s''\n',org.prefix));
|
|---|
| 34 | disp(sprintf(' Color: ''%s''\n',org.color));
|
|---|
| 35 | + disp(sprintf(' skipio: %i\n',org.skipio));
|
|---|
| 36 | if isempty(org.steps)
|
|---|
| 37 | disp(' no step');
|
|---|
| 38 | else
|
|---|
| 39 | @@ -70,6 +74,13 @@
|
|---|
| 40 | if ~ischar(string), error('argument provided is not a string'); end
|
|---|
| 41 | path=[org.repository '/' org.prefix string];
|
|---|
| 42 |
|
|---|
| 43 | + %Skip if requested
|
|---|
| 44 | + if org.skipio,
|
|---|
| 45 | + disp(['WARNING: Skipping loading ' path]);
|
|---|
| 46 | + md = evalin('base', 'md');
|
|---|
| 47 | + return;
|
|---|
| 48 | + end
|
|---|
| 49 | +
|
|---|
| 50 | %figure out if the model is there
|
|---|
| 51 | if exist(path,'file'),
|
|---|
| 52 | path=path;
|
|---|
| 53 | @@ -92,6 +103,13 @@
|
|---|
| 54 | if ~ischar(string), error('argument provided is not a string'); end
|
|---|
| 55 | path=[org.repository '/' org.prefix string];
|
|---|
| 56 |
|
|---|
| 57 | + %Skip if requested
|
|---|
| 58 | + if org.skipio,
|
|---|
| 59 | + disp(['WARNING: Skipping loading ' path]);
|
|---|
| 60 | + md = evalin('base', 'md');
|
|---|
| 61 | + return;
|
|---|
| 62 | + end
|
|---|
| 63 | +
|
|---|
| 64 | %figure out if the model is there, otherwise, we have to use the default path supplied by user.
|
|---|
| 65 | if exist(path,'file') | exist([path '.mat'],'file'),
|
|---|
| 66 | md=loadmodel(path);
|
|---|
| 67 | @@ -174,6 +192,12 @@
|
|---|
| 68 | name=[org.repository '/' org.prefix org.steps(org.currentstep).string ];
|
|---|
| 69 | disp(['saving model as: ' name]);
|
|---|
| 70 |
|
|---|
| 71 | + %Skip if requested
|
|---|
| 72 | + if org.skipio,
|
|---|
| 73 | + disp(['WARNING: Skipping saving ' name]);
|
|---|
| 74 | + return;
|
|---|
| 75 | + end
|
|---|
| 76 | +
|
|---|
| 77 | %check that md is a model
|
|---|
| 78 | if ~isa(md,'model') & ~isa(md,'sealevelmodel'), warning('second argument is not a model'); end
|
|---|
| 79 | if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end
|
|---|
| 80 | @@ -190,6 +214,12 @@
|
|---|
| 81 | name=[org.repository '/' org.prefix org.steps(org.currentstep).string ];
|
|---|
| 82 | disp(['saving data in: ' name]);
|
|---|
| 83 |
|
|---|
| 84 | + %Skip if requested
|
|---|
| 85 | + if org.skipio,
|
|---|
| 86 | + disp(['WARNING: Skipping saving ' name]);
|
|---|
| 87 | + return;
|
|---|
| 88 | + end
|
|---|
| 89 | +
|
|---|
| 90 | %check that md is a model
|
|---|
| 91 | if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end
|
|---|
| 92 |
|
|---|