Changeset 15701


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

CHG: added upload and download capabilities to the organizer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/organizer.m

    r14278 r15701  
    2424                steps         =[];
    2525                requestedsteps=[0];
     26                upload_server='';
     27                upload_path='';
     28                upload_login='';
     29                upload_port=0;
     30                download=0;
    2631                %}}}
    2732        end
     
    5459                                org.trunkprefix=trunkprefix;
    5560                        end
     61
     62                        %Get upload information, if provided
     63                        org.upload_server=getfieldvalue(options,'upload_server','');
     64                        org.upload_path=getfieldvalue(options,'upload_path','');
     65                        org.upload_login=getfieldvalue(options,'upload_login','');
     66                        org.upload_port=getfieldvalue(options,'upload_port',0);
     67                        org.download=getfieldvalue(options,'download',0);
     68
    5669                end
    5770                %}}}
     
    6578                                        disp(sprintf('   step #%2i: ''%s''',org.steps(i).id,org.steps(i).string));
    6679                                end
     80                        end
     81                        if isempty(org.upload_server),
     82                                disp('   no upload info');
     83                        else
     84                                disp(sprintf('   upload_server:     ''%s''',org.upload_server));
     85                                disp(sprintf('   upload_login:     ''%s''',org.upload_login));
     86                                disp(sprintf('   upload_path:     ''%s''',org.upload_path));
     87                                disp(sprintf('   upload_port:     ''%i''',org.upload_port));
    6788                        end
    6889                end
     
    168189                        end
    169190
     191                        %But if download is requested, we are downloading and skipping the step:
     192                        if ismember(org.currentstep,org.requestedsteps) & org.download,
     193                                %load the model if it exists, and download
     194                                name=[org.repository '/' org.prefix org.steps(org.currentstep).string ];
     195                                if exist(name,'file'),
     196                                        md=loadmodel(name);
     197                                        if isa(md,'model'),
     198                                                if ~isempty(md.settings.upload_filename),
     199                                                        disp(sprintf('   downloading model'));
     200                                                        md=download(md);
     201                                                        save(name,'md','-v7.3');
     202                                                end
     203                                        end
     204                                end
     205
     206                                %reset bool to false, so we stick with only downloading
     207                                bool=false;
     208                        end
     209
    170210                end%}}}
    171211                function savemodel(org,md) % {{{
Note: See TracChangeset for help on using the changeset viewer.