Changeset 500
- Timestamp:
- Jul 24, 2012, 7:58:33 PM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PARAM.xml.default
r499 r500 10 10 <Civ2Bin>bin/civ2<!--binary for civ2 (relative or absolute path) 11 11 --></Civ2Bin> 12 <CivmBin> bin/run_civ_matlab.sh<!--binary from compilation of civ_matlab.12 <CivmBin>civ_matlab.sh<!--binary from compilation of civ_matlab. 13 13 m (relative or absolute path)--></CivmBin> 14 14 <Civ3D3CBin>bin/civ3d3c</Civ3D3CBin> … … 23 23 <Civ1Bin>bin/civ1</Civ1Bin> 24 24 <Civ2Bin>bin/civ2</Civ2Bin> 25 <CivmBin> bin/run_civ_matlab.sh<!--binary from compilation of civ_matlab.25 <CivmBin>civ_matlab.sh<!--binary from compilation of civ_matlab. 26 26 m (relative or absolute path)--></CivmBin> 27 27 <Civ3D3CBin>bin/civ3d3c</Civ3D3CBin> -
trunk/src/civ.m
r498 r500 24 24 %TODO: search range 25 25 26 % Last Modified by GUIDE v2.5 18-Jul-2012 23:20:1226 % Last Modified by GUIDE v2.5 24-Jul-2012 13:14:00 27 27 % Begin initialization code - DO NOT EDIT 28 28 gui_Singleton = 1; … … 59 59 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) 60 60 errormsg=[];%default error message 61 xmlfile= 'PARAM.xml';61 xmlfile=fullfile(path_civ,'PARAM.xml'); 62 62 test_batch=0;%default: ,no batch mode available 63 63 sparam=[]; 64 if ~exist(xmlfile,'file') 65 [success,message]=copyfile(fullfile(path_civ,'PARAM.xml.default'),xmlfile) 66 end 64 67 if exist(xmlfile,'file') 65 68 try … … 71 74 end 72 75 else 73 %errormsg=[xmlfile ' not found: path to civx binaries undefined'];74 76 [s,w]=system('oarstat'); 75 77 if ~isequal(s,0) … … 90 92 end 91 93 if ~isempty(test_command) 92 [s,w]=system(test_command);93 if isequal(s,0)94 test_batch=1;95 end94 [s,w]=system(test_command); 95 if isequal(s,0) 96 test_batch=1; 97 end 96 98 end 97 99 end … … 360 362 % settings for new civ data, 361 363 if strcmp(Data.Conventions,'uvmat/civdata')% case of new civ data, 362 set(handles.Program,'Value', 2) %select civ/Matlab by default364 set(handles.Program,'Value',1) %select civ/Matlab by default 363 365 Program_Callback([],[], handles) 364 366 if ~isempty(Data.CivStage)%test for civ files … … 376 378 % settings for civx data, 377 379 elseif ~isempty(Data.absolut_time_T0')% case of civx data, 378 set(handles.Program,'Value', 1) %select Cix by default380 set(handles.Program,'Value',3) %select Cix by default 379 381 Program_Callback([],[], handles) 380 382 if ~isempty(Data.fix2) … … 1080 1082 %% read the PARAM.xml file to get the binaries (and batch_mode if batch) 1081 1083 path_civ=fileparts(which('civ')); %path to the source directory of uvmat 1082 xmlfile= 'PARAM.xml';1084 xmlfile=fullfile(path_civ,'PARAM.xml'); 1083 1085 s=[]; 1084 1086 if exist(xmlfile,'file')% search parameter xml file in the whole matlab path … … 1152 1154 else 1153 1155 errormsg=['path ' path ' for binaries defined in PARAM.xml does not exist']; 1154 return 1155 end 1156 1156 end 1157 1157 else %look for the full path if the file name has been defined with a relative path in PARAM.xm 1158 1158 fullname=fullfile(path_civ,Param.xml.(bin_name{1})); … … 1161 1161 else 1162 1162 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 1166 end 1167 if ~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 1167 1172 end 1168 1173 … … 4561 4566 4562 4567 function last_i_Callback(hObject, eventdata, handles) 4563 -
trunk/src/fill_GUI.m
r497 r500 17 17 % loop on the elements of the input structure Param 18 18 for ifield=1:numel(fields) 19 if isstruct(Param.(fields{ifield}))% case of sa sub-structure 19 % case of a sub-structure --> fill a panel 20 if isstruct(Param.(fields{ifield}))% case of a sub-structure 20 21 if isfield(handles,fields{ifield}) 21 22 set(handles.(fields{ifield}),'Visible','on') … … 26 27 errormsg=fill_GUI(Param.(fields{ifield}),hchild);% apply the function to the substructure 27 28 end 29 % case of an element 28 30 else 29 31 hh=[]; 30 32 input_data=Param.(fields{ifield}); 33 display(fields{ifield}) 34 display(input_data) 31 35 check_done=0; 32 36 if isfield(handles,fields{ifield}) … … 40 44 check_done=1; 41 45 end 42 elseif isnumeric(input_data) && isfield(handles,['num_' fields{ifield}]) 43 hh=handles.(['num_' fields{ifield}]); 46 elseif isnumeric(input_data) 47 if numel(input_data)>1 48 %deals with array displayed in multiple boxes labeled by an index 49 for ibox=1:numel(input_data) 50 if isfield(handles,['num_' fields{ifield} '_' num2str(ibox)]) 51 hh(ibox)=handles.(['num_' fields{ifield} '_' num2str(ibox)]); 52 end 53 end 54 else % single box (usual case) 55 if isfield(handles,['num_' fields{ifield}]) 56 hh=handles.(['num_' fields{ifield}]); 57 end 58 end 44 59 end 45 if ~isempty(hh)&& ~check_done 46 set(hh,'Visible','on') 60 for ibox=1:numel(hh) 61 if ~isempty(hh(ibox))&& ~check_done 62 set(hh(ibox),'Visible','on') 47 63 % input_data 48 switch get(hh ,'Style')64 switch get(hh(ibox),'Style') 49 65 case {'checkbox','radiobutton','togglebutton'} 50 66 if isnumeric(input_data) 51 set(hh ,'Value',input_data)67 set(hh(ibox),'Value',input_data(ibox)) 52 68 end 53 69 case 'edit' 54 70 if isnumeric(input_data) 55 input_data=num2str(input_data); 71 input_string=num2str(input_data(ibox)); 72 else 73 input_string=input_data; 56 74 end 57 set(hh ,'String',input_data)75 set(hh(ibox),'String',input_string) 58 76 case{'listbox','popupmenu'} 59 77 if isnumeric(input_data) 60 78 input_data=num2str(input_data); 61 79 end 62 menu=get(hh ,'String');80 menu=get(hh(ibox),'String'); 63 81 if ischar(input_data) 64 82 input_data={input_data}; … … 74 92 end 75 93 end 76 set(hh ,'String',menu)77 set(hh ,'Value',values)94 set(hh(ibox),'String',menu) 95 set(hh(ibox),'Value',values) 78 96 end 97 end 79 98 end 80 99 end
Note: See TracChangeset
for help on using the changeset viewer.