Changeset 280
- Timestamp:
- Nov 18, 2011, 2:19:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r279 r280 1619 1619 CivMode='CivX'; 1620 1620 end 1621 binary_list={}; 1621 1622 switch CivMode 1622 case {'CivX','CivAll'} 1623 for bin_name={'Civ1Bin','Civ2Bin','PatchBin','FixBin','CivBin'} 1624 if isfield(param.global,bin_name{1}) 1625 if ~exist(param.global.(bin_name{1}),'file')%look for the full path if the file name has been defined with a relative path in PARAM.xml 1626 fullname=fullfile(path_civ,param.global.(bin_name{1})); 1627 if exist(fullname,'file') 1628 param.global.(bin_name{1})=fullname; 1629 else 1630 msgbox_uvmat('ERROR',['Binary ' param.global.(bin_name{1}) ' defined in PARAM.xm does not exist']) 1631 return 1632 end 1633 else 1634 [path,name,ext]=fileparts(param.global.(bin_name{1})); 1635 currentdir=pwd; 1636 cd(path); 1637 binpath=pwd;%path of the binary 1638 param.global.(bin_name{1})=fullfile(binpath,[name ext]); 1639 % display(param.global.(bin_name{1})); 1640 cd(currentdir); 1641 end 1642 1643 end 1644 end 1623 case 'CivX' 1624 binary_list={'Civ1Bin','Civ2Bin','PatchBin','FixBin'}; 1625 case 'CivAll' 1626 binary_list={'Civ'} 1645 1627 case 'Matlab' 1646 1628 if batch … … 1648 1630 % difficile a faire a priori 1649 1631 end 1632 end 1633 for bin_name=binary_list 1634 if isfield(param.global,bin_name{1}) 1635 if ~exist(param.global.(bin_name{1}),'file')%look for the full path if the file name has been defined with a relative path in PARAM.xml 1636 fullname=fullfile(path_civ,param.global.(bin_name{1})); 1637 if exist(fullname,'file') 1638 param.global.(bin_name{1})=fullname; 1639 else 1640 msgbox_uvmat('ERROR',['Binary ' param.global.(bin_name{1}) ' defined in PARAM.xml does not exist']) 1641 return 1642 end 1643 else 1644 [path,name,ext]=fileparts(param.global.(bin_name{1})); 1645 currentdir=pwd; 1646 cd(path); 1647 binpath=pwd;%path of the binary 1648 param.global.(bin_name{1})=fullfile(binpath,[name ext]); 1649 % display(param.global.(bin_name{1})); 1650 cd(currentdir); 1651 end 1652 1653 end 1650 1654 end 1651 1655 … … 1744 1748 1745 1749 % read mask parameters 1746 if get(handles.check_Mask,'Value') 1750 dummy=get(handles.check_Mask,'Value'); 1751 if dummy{1} 1747 1752 maskdispl=get(handles.txt_MaskName,'String'); 1748 1753 if exist(maskdispl,'file') … … 1767 1772 1768 1773 % read grid parameters 1769 if get(handles.check_Grid,'Value') 1774 dummy=get(handles.check_Grid,'Value'); 1775 if dummy{1} 1770 1776 param.civ1.gridflag='y'; 1771 1777 gridname=get(handles.txt_GridName,'String'); … … 4317 4323 par.rho=par.rho{index}; 4318 4324 end 4319 par.dx=get(handles.num_Dx,'String'); 4320 par.dy=get(handles.num_Dy,'String'); 4325 dummy=get(handles.num_Dx,'String'); 4326 par.dx=dummy{1}; 4327 dummy=get(handles.num_Dy,'String'); 4328 par.dy=dummy{1}; 4321 4329 if isnan(str2double(par.dx)) 4322 4330 if isempty(get(handles.txt_GridName,'String')); … … 4347 4355 % end 4348 4356 %time=get(handles.RootName,'UserData'); %get the set of times 4349 par.gridname=get(handles.txt_GridName,'String'); 4357 dummy=get(handles.txt_GridName,'String'); 4358 par.gridname=dummy{1}; 4350 4359 par.gridflag='y'; 4351 4360 if strcmp(par.gridname,'')|| isempty(par.gridname)
Note: See TracChangeset
for help on using the changeset viewer.