Changeset 230


Ignore:
Timestamp:
Apr 2, 2011, 10:48:32 AM (13 years ago)
Author:
sommeria
Message:

gestion of .civ1;cmx , .civ2.cmx clarified

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r229 r230  
    17981798            i_cmd=i_cmd+1;
    17991799            if isequal(civAll,0)
     1800                civ1_exe=CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam);%create the parameter file .civ1.cmx and set the execution string civ1_exe
    18001801%                 if(isunix)
    18011802%                      cmd=[cmd 'cp -f ' flname '.civ1.cmx ' flname '.cmx\n'];
     
    18041805%                     cmd=[cmd 'copy /Y "' flname '.civ1.cmx" "' flname '.cmx"\n'];
    18051806%                 end
    1806                 cmd=[cmd CIV1_CMD(fullfile(Rootbat,Filebat),'',par_civ1,handles,sparam) '\n'];
     1807                cmd=[cmd civ1_exe '\n'];
    18071808            else
    18081809                civAllCmd=[civAllCmd ' civ1 '];
     
    19741975            i_cmd=i_cmd+1;
    19751976            flname=fullfile(Rootbat,Filebat);
    1976             cmd_CIV2=CIV2_CMD(flname,[],par_civ2,sparam);%creates the cmx file [fullfile(Rootbat,Filebat) '.civ2.cmx]
     1977           
    19771978            if isequal(civAll,0)
    1978                 if(isunix)
    1979                      cmd=[cmd 'cp -f ' flname '.civ2.cmx ' flname '.cmx\n' cmd_CIV2 '\n'];
    1980                 else
    1981                     flname=regexprep(flname,'\\','\\\\');
    1982                     cmd=[cmd 'copy /Y "' flname '.civ2.cmx" "' flname '.cmx"\n' cmd_CIV2 '\n'];
    1983                 end
     1979                cmd_CIV2=CIV2_CMD(flname,[],par_civ2,sparam);%creates the cmx file [fullfile(Rootbat,Filebat) '.civ2.cmx]
     1980%                 if(isunix)
     1981                 cmd=[cmd cmd_CIV2 '\n'];
     1982%                 else
     1983%                     flname=regexprep(flname,'\\','\\\\');
     1984%                     cmd=[cmd 'copy /Y "' flname '.civ2.cmx" "' flname '.cmx"\n' cmd_CIV2 '\n'];
     1985%                 end
    19841986            else
    19851987                civAllCmd=[civAllCmd ' civ2 '];
     
    40794081par.filename_ima_a=regexprep(par.filename_ima_a,'.png','');
    40804082par.filename_ima_b=regexprep(par.filename_ima_b,'.png','');
    4081 fid=fopen([filename '.cmx'],'w');
     4083fid=fopen([filename '.civ1.cmx'],'w');
    40824084fprintf(fid,['##############   CMX file' '\n' ]);
    40834085fprintf(fid,   ['FirstImage ' regexprep(par.filename_ima_a,'\\','\\\\') '\n' ]);% for windows compatibility
     
    41164118% namelog=regexprep(namelog,'\\','\\\\');
    41174119if(isunix)
    4118 %     filename
    4119 %     namelog
    4120 %     
    4121 %     [Rootbat,Filebat,extbat]=fileparts(namelog);
    4122 %     ncName=fullfile(Rootbat,[ Filebat '.nc']);
    4123     cmd_CIV1=[sparam.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
     4120    cmd_CIV1=['cp -f ' filename '.civ1.cmx ' filename '.cmx\n'];
     4121    cmd_CIV1=[cmd_CIV1 sparam.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
    41244122    cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.log' ' ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.nc'];%rename .log as .civ1.log and set the netcdf result file for group user writting
    4125     cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.civ1.cmx' '\n'];%rename .cmx as .civ1.cmx
     4123   % cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.civ1.cmx' '\n'];%rename .cmx as .civ1.cmx
    41264124else %Windows system
     4125                    flname=regexprep(flname,'\\','\\\\');
     4126%                     cmd=[cmd 'copy /Y "' flname '.civ1.cmx" "' flname '.cmx"\n'];
    41274127    filename=regexprep(filename,'\\','\\\\');
     4128    cmd_CIV1=['copy /Y "' filename '.civ1.cmx" "' filename '.cmx"\n'];% copy the .civ1.cmx parameter file to .cmx
    41284129    cmd_CIV1=['"' sparam.Civ1Bin '" -f "' filename '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file
    41294130    cmd_CIV1=regexprep(cmd_CIV1,'\\','\\\\');
    41304131    namelog=regexprep(namelog,'\\','\\\\');
    4131     cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.log' '" "' filename '.civ1.log"'];
    4132     cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.civ1.cmx"'];
     4132    cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.log' '" "' filename '.civ1.log"']; %preserve the log file as .civ1.log
     4133  %  cmd_CIV1=[cmd_CIV1 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.civ1.cmx"'];
    41334134end
    41344135
     
    42744275
    42754276if(isunix)
    4276 %         cmd_CIV1=[sparam.Civ1Bin ' -f ' filename '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
    4277 %     cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.log' ' ' filename '.civ1.log' '\n' 'chmod g+w ' filename '.nc'];
    4278 %     cmd_CIV1=[cmd_CIV1 '\n' 'mv ' filename '.cmx' ' ' filename '.civ1.cmx' '\n'];%rename .cmx as .civ1.cmx, the result file is named [filename '.nc'] by CIVx
    4279    
    4280     cmd_CIV2=[sparam.Civ2Bin ' -f ' filename  '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
    4281     cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.log' ' ' filename '.civ2.log' '\n' 'chmod g+w ' filename '.nc'];
    4282     cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.cmx' ' ' filename '.civ2.cmx' '\n'];%rename .cmx as .civ2.cmx, the result file is named [filename '.nc'] by CIVx
    4283 %     [Rootbat,Filebat,extbat]=fileparts(namelog);
    4284 %     ncName=fullfile(Rootbat,[ Filebat '.nc']);
    4285 %    cmd_CIV2=[cmd_CIV2 '\n' 'mv ' namelog  ' ' regexprep(namelog,'\.log','') '.civ2.log' '\n' 'chmod g+w ' ncName];
     4277    cmd_CIV2=['cp -f ' filename '.civ2.cmx ' filename '.cmx\n'];
     4278    cmd_CIV2=[cmd_CIV2 sparam.Civ2Bin ' -f ' filename  '.cmx >' filename '.log' ]; % redirect standard output to the log file, the result file is named [filename '.nc'] by CIVx
     4279    cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.log' ' ' filename '.civ2.log' '\n' 'chmod g+w ' filename '.nc'];%preserve the log file as .civ2.log
     4280%    cmd_CIV2=[cmd_CIV2 '\n' 'mv ' filename '.cmx' ' ' filename '.civ2.cmx' '\n'];%rename .cmx as .civ2.cmx, the result file is named [filename '.nc'] by CIVx
     4281
    42864282else
    42874283    filename=regexprep(filename,'\\','\\\\');
    4288     cmd_CIV2=['"' sparam.Civ2Bin '" -f "' filename  '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file
     4284    cmd_CIV2=['copy /Y "' filename '.civ2.cmx" "' filename '.cmx"\n'];
     4285    cmd_CIV2=[cmd_CIV2 '"' sparam.Civ2Bin '" -f "' filename  '.cmx" >"' filename '.log"' ]; % redirect standard output to the log file
    42894286    cmd_CIV2=regexprep(cmd_CIV2,'\\','\\\\');
    42904287    cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.log' '" "' filename '.civ2.log"'];
    4291      cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.civ2.cmx"'];
     4288 %    cmd_CIV2=[cmd_CIV2 '\n' 'copy /Y "' filename '.cmx' '" "' filename '.civ2.cmx"'];
    42924289end
    42934290
Note: See TracChangeset for help on using the changeset viewer.