Changeset 500 for trunk/src/civ.m


Ignore:
Timestamp:
Jul 24, 2012, 7:58:33 PM (12 years ago)
Author:
sommeria
Message:

various bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r498 r500  
    2424%TODO: search range
    2525
    26 % Last Modified by GUIDE v2.5 18-Jul-2012 23:20:12
     26% Last Modified by GUIDE v2.5 24-Jul-2012 13:14:00
    2727% Begin initialization code - DO NOT EDIT
    2828gui_Singleton = 1;
     
    5959addpath (path_civ) ; %add the path to civ, (useful in case of change of working directory after civ has been s opened in the working directory)
    6060errormsg=[];%default error message
    61 xmlfile='PARAM.xml';
     61xmlfile=fullfile(path_civ,'PARAM.xml');
    6262test_batch=0;%default: ,no batch mode available
    6363sparam=[];
     64if ~exist(xmlfile,'file')
     65    [success,message]=copyfile(fullfile(path_civ,'PARAM.xml.default'),xmlfile)
     66end
    6467if exist(xmlfile,'file')
    6568    try
     
    7174    end
    7275else
    73     %errormsg=[xmlfile ' not found: path to civx binaries undefined'];
    7476    [s,w]=system('oarstat');
    7577    if ~isequal(s,0)
     
    9092    end
    9193    if ~isempty(test_command)
    92     [s,w]=system(test_command);
    93     if isequal(s,0)
    94         test_batch=1;
    95     end
     94        [s,w]=system(test_command);
     95        if isequal(s,0)
     96            test_batch=1;
     97        end
    9698    end
    9799end
     
    360362    % settings for  new civ data,
    361363    if strcmp(Data.Conventions,'uvmat/civdata')% case of new civ data,
    362         set(handles.Program,'Value',2) %select civ/Matlab by default
     364        set(handles.Program,'Value',1) %select civ/Matlab by default
    363365        Program_Callback([],[], handles)
    364366        if ~isempty(Data.CivStage)%test for civ files
     
    376378        % settings for civx data,
    377379    elseif ~isempty(Data.absolut_time_T0')% case of  civx data,
    378         set(handles.Program,'Value',1) %select Cix by default
     380        set(handles.Program,'Value',3) %select Cix by default
    379381        Program_Callback([],[], handles)
    380382        if ~isempty(Data.fix2)
     
    10801082%% read the PARAM.xml file to get the binaries (and batch_mode if batch)
    10811083path_civ=fileparts(which('civ')); %path to the source directory of uvmat
    1082 xmlfile='PARAM.xml';
     1084xmlfile=fullfile(path_civ,'PARAM.xml');
    10831085s=[];
    10841086if exist(xmlfile,'file')% search parameter xml file in the whole matlab path
     
    11521154            else
    11531155                errormsg=['path ' path ' for binaries defined in PARAM.xml does not exist'];
    1154                 return
    1155             end
    1156            
     1156            end         
    11571157        else  %look for the full path if the file name has been defined with a relative path in PARAM.xm
    11581158            fullname=fullfile(path_civ,Param.xml.(bin_name{1}));
     
    11611161            else
    11621162                errormsg=['Binary ' Param.xml.(bin_name{1}) ' defined in PARAM.xml does not exist'];
    1163                 return
    1164             end
    1165         end
    1166     end
     1163            end
     1164        end
     1165    end
     1166end
     1167if ~isempty(errormsg)
     1168    if strcmp(Param.Program,'civ_matlab.sh')
     1169        errormsg=[{errormsg}; {'run compile_functions.m to create it by compiling civ_matlab.m'}];
     1170    end
     1171    return
    11671172end
    11681173
     
    45614566
    45624567function last_i_Callback(hObject, eventdata, handles)
    4563 
Note: See TracChangeset for help on using the changeset viewer.