Index: /trunk/src/PARAM.xml.default
===================================================================
--- /trunk/src/PARAM.xml.default (revision 499)
+++ /trunk/src/PARAM.xml.default (revision 500)
@@ -10,5 +10,5 @@
bin/civ2
-bin/run_civ_matlab.sh
bin/civ3d3c
@@ -23,5 +23,5 @@
bin/civ1
bin/civ2
-bin/run_civ_matlab.sh
bin/civ3d3c
Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m (revision 499)
+++ /trunk/src/civ.m (revision 500)
@@ -24,5 +24,5 @@
%TODO: search range
-% Last Modified by GUIDE v2.5 18-Jul-2012 23:20:12
+% Last Modified by GUIDE v2.5 24-Jul-2012 13:14:00
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
@@ -59,7 +59,10 @@
addpath (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)
errormsg=[];%default error message
-xmlfile='PARAM.xml';
+xmlfile=fullfile(path_civ,'PARAM.xml');
test_batch=0;%default: ,no batch mode available
sparam=[];
+if ~exist(xmlfile,'file')
+ [success,message]=copyfile(fullfile(path_civ,'PARAM.xml.default'),xmlfile)
+end
if exist(xmlfile,'file')
try
@@ -71,5 +74,4 @@
end
else
- %errormsg=[xmlfile ' not found: path to civx binaries undefined'];
[s,w]=system('oarstat');
if ~isequal(s,0)
@@ -90,8 +92,8 @@
end
if ~isempty(test_command)
- [s,w]=system(test_command);
- if isequal(s,0)
- test_batch=1;
- end
+ [s,w]=system(test_command);
+ if isequal(s,0)
+ test_batch=1;
+ end
end
end
@@ -360,5 +362,5 @@
% settings for new civ data,
if strcmp(Data.Conventions,'uvmat/civdata')% case of new civ data,
- set(handles.Program,'Value',2) %select civ/Matlab by default
+ set(handles.Program,'Value',1) %select civ/Matlab by default
Program_Callback([],[], handles)
if ~isempty(Data.CivStage)%test for civ files
@@ -376,5 +378,5 @@
% settings for civx data,
elseif ~isempty(Data.absolut_time_T0')% case of civx data,
- set(handles.Program,'Value',1) %select Cix by default
+ set(handles.Program,'Value',3) %select Cix by default
Program_Callback([],[], handles)
if ~isempty(Data.fix2)
@@ -1080,5 +1082,5 @@
%% read the PARAM.xml file to get the binaries (and batch_mode if batch)
path_civ=fileparts(which('civ')); %path to the source directory of uvmat
-xmlfile='PARAM.xml';
+xmlfile=fullfile(path_civ,'PARAM.xml');
s=[];
if exist(xmlfile,'file')% search parameter xml file in the whole matlab path
@@ -1152,7 +1154,5 @@
else
errormsg=['path ' path ' for binaries defined in PARAM.xml does not exist'];
- return
- end
-
+ end
else %look for the full path if the file name has been defined with a relative path in PARAM.xm
fullname=fullfile(path_civ,Param.xml.(bin_name{1}));
@@ -1161,8 +1161,13 @@
else
errormsg=['Binary ' Param.xml.(bin_name{1}) ' defined in PARAM.xml does not exist'];
- return
- end
- end
- end
+ end
+ end
+ end
+end
+if ~isempty(errormsg)
+ if strcmp(Param.Program,'civ_matlab.sh')
+ errormsg=[{errormsg}; {'run compile_functions.m to create it by compiling civ_matlab.m'}];
+ end
+ return
end
@@ -4561,3 +4566,2 @@
function last_i_Callback(hObject, eventdata, handles)
-
Index: /trunk/src/fill_GUI.m
===================================================================
--- /trunk/src/fill_GUI.m (revision 499)
+++ /trunk/src/fill_GUI.m (revision 500)
@@ -17,5 +17,6 @@
% loop on the elements of the input structure Param
for ifield=1:numel(fields)
- if isstruct(Param.(fields{ifield}))% case of sa sub-structure
+ % case of a sub-structure --> fill a panel
+ if isstruct(Param.(fields{ifield}))% case of a sub-structure
if isfield(handles,fields{ifield})
set(handles.(fields{ifield}),'Visible','on')
@@ -26,7 +27,10 @@
errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure
end
+ % case of an element
else
hh=[];
input_data=Param.(fields{ifield});
+ display(fields{ifield})
+ display(input_data)
check_done=0;
if isfield(handles,fields{ifield})
@@ -40,25 +44,39 @@
check_done=1;
end
- elseif isnumeric(input_data) && isfield(handles,['num_' fields{ifield}])
- hh=handles.(['num_' fields{ifield}]);
+ elseif isnumeric(input_data)
+ if numel(input_data)>1
+ %deals with array displayed in multiple boxes labeled by an index
+ for ibox=1:numel(input_data)
+ if isfield(handles,['num_' fields{ifield} '_' num2str(ibox)])
+ hh(ibox)=handles.(['num_' fields{ifield} '_' num2str(ibox)]);
+ end
+ end
+ else % single box (usual case)
+ if isfield(handles,['num_' fields{ifield}])
+ hh=handles.(['num_' fields{ifield}]);
+ end
+ end
end
- if ~isempty(hh)&& ~check_done
- set(hh,'Visible','on')
+ for ibox=1:numel(hh)
+ if ~isempty(hh(ibox))&& ~check_done
+ set(hh(ibox),'Visible','on')
% input_data
- switch get(hh,'Style')
+ switch get(hh(ibox),'Style')
case {'checkbox','radiobutton','togglebutton'}
if isnumeric(input_data)
- set(hh,'Value',input_data)
+ set(hh(ibox),'Value',input_data(ibox))
end
case 'edit'
if isnumeric(input_data)
- input_data=num2str(input_data);
+ input_string=num2str(input_data(ibox));
+ else
+ input_string=input_data;
end
- set(hh,'String',input_data)
+ set(hh(ibox),'String',input_string)
case{'listbox','popupmenu'}
if isnumeric(input_data)
input_data=num2str(input_data);
end
- menu=get(hh,'String');
+ menu=get(hh(ibox),'String');
if ischar(input_data)
input_data={input_data};
@@ -74,7 +92,8 @@
end
end
- set(hh,'String',menu)
- set(hh,'Value',values)
+ set(hh(ibox),'String',menu)
+ set(hh(ibox),'Value',values)
end
+ end
end
end