Changeset 351 for trunk/src/series.m
- Timestamp:
- Dec 24, 2011, 11:50:22 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r350 r351 516 516 % SeriesData.j2_series=[SeriesData.j2_series;{j2_series}]; 517 517 InputTable=get(handles.InputTable,'Data'); 518 InputTable=[{RootPath},{ RootFile},{SubDir},{NomType},{FileExt};InputTable];518 InputTable=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt};InputTable]; 519 519 % RootPathCell=[{RootPath}; InputTable{] ; 520 520 % SubDirCell=[{SubDir}; get(handles.SubDir,'String')]; … … 527 527 % or re-initialise the list of input file series 528 528 else 529 InputTable=[{RootPath},{ RootFile},{SubDir},{NomType},{FileExt}];529 InputTable=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}]; 530 530 end 531 531 set(handles.InputTable,'Data',InputTable) … … 1176 1176 %% read input file parameters and set menus 1177 1177 Series.PathProject=get(handles.PathCampaign,'String'); 1178 RootPath=get(handles.RootPath,'String');% path of the root name of the first field series 1179 RootFile=get(handles.RootFile,'String');% root name of the first field series 1180 SubDir=get(handles.SubDir,'String');% subdirectory for netcdf files 1181 FileExt=get(handles.FileExt,'String');%file extension 1178 % InputTable=get(handles.InputTable,'Data'); 1179 RootPath=Series.InputTable(:,1); 1180 SubDir=Series.InputTable(:,2); 1181 RootFile=Series.InputTable(:,3); 1182 NomType=Series.InputTable(:,4); 1183 FileExt=Series.InputTable(:,5); 1184 % RootPath=get(handles.RootPath,'String');% path of the root name of the first field series 1185 % RootFile=get(handles.RootFile,'String');% root name of the first field series 1186 % SubDir=get(handles.SubDir,'String');% subdirectory for netcdf files 1187 % FileExt=get(handles.FileExt,'String');%file extension 1182 1188 if isempty(SeriesData) 1183 1189 msgbox_uvmat('ERROR','no input file series') 1184 1190 return 1185 1191 end 1186 NomType=SeriesData.NomType;1192 % NomType=SeriesData.NomType; 1187 1193 if length(RootPath)==1 %string character input for user fct 1188 1194 Series.RootPath=RootPath{1}; … … 1244 1250 num_i=first_i:incr_i:last_i; 1245 1251 num_j=first_j:incr_j:last_j; 1246 nbfield_cell=get(handles.num_MaxIndex_i,'String'); 1247 nbfield=[]; %default 1248 for iview=1:length(nbfield_cell) 1249 nb=str2num(nbfield_cell{iview}); 1250 if ~isempty(nb) 1251 nbfield=[nbfield nb]; 1252 end 1253 end 1254 nbfield=min(nbfield); 1255 nbfield2_cell=get(handles.num_MaxIndex_j,'String'); 1256 nbfield2=[]; %default 1257 for iview=1:length(nbfield2_cell) 1258 nb=str2num(nbfield2_cell{iview}); 1259 if ~isempty(nb) 1260 nbfield2=[nbfield2 nb]; 1261 end 1262 end 1263 nbfield2=min(nbfield2); 1252 % nbfield_cell=get(handles.num_MaxIndex_i,'String'); 1253 nbfield=cell2mat(Series.IndexRange.MaxIndex); 1254 nb=min(nbfield,1); 1255 nbfield=nb(1); 1256 nbfield2=nb(2); 1257 % nbfield2=cell2mat(Series.IndexRange.MaxIndex); 1258 % nbfield=min(nbfield); 1259 % % nbfield=[]; %default 1260 % % for iview=1:length(nbfield_cell) 1261 % % nb=nbfield_cell{iview}; 1262 % % if ~isempty(nb) 1263 % % nbfield=[nbfield nb]; 1264 % % end 1265 % % end 1266 % % nbfield=min(nbfield); 1267 % nbfield2_cell=get(handles.num_MaxIndex_j,'String'); 1268 % nbfield2=[]; %default 1269 % for iview=1:length(nbfield2_cell) 1270 % nb=str2num(nbfield2_cell{iview}); 1271 % if ~isempty(nb) 1272 % nbfield2=[nbfield2 nb]; 1273 % end 1274 % end 1275 % nbfield2=min(nbfield2); 1264 1276 1265 1277 %get complementary information from the 'series' interface … … 1363 1375 end 1364 1376 1365 % defining the ACTION function handle1377 %% defining the ACTION function handle 1366 1378 path_series=which('series'); 1367 1379 list_path=get(handles.ACTION,'UserData'); … … 1383 1395 end 1384 1396 1385 % RUN ACTION1397 %% RUN ACTION 1386 1398 Series.Action=action;%name of the processing programme 1387 1399 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) … … 2266 2278 if ~isempty(SeriesData) 2267 2279 for ilist=1:size(InputTable,1) 2280 SeriesData.j1_series{ilist} 2268 2281 if ~isempty(SeriesData.j1_series{ilist}) 2269 2282 state_j='on'; … … 2546 2559 set(handles.series,'UserData',SeriesData) 2547 2560 if testpair 2548 mode_Callback( hObject, eventdata, handles)2561 mode_Callback([],[], handles) 2549 2562 else 2550 2563 % set(handles.NomType,'String',NomTypeCell) … … 2557 2570 end 2558 2571 2572 2573 % --- Executes on button press in BATCH. 2574 function BATCH_Callback(hObject, eventdata, handles) 2575 % hObject handle to BATCH (see GCBO) 2576 % eventdata reserved - to be defined in a future version of MATLAB 2577 % handles structure with handles and user data (see GUIDATA) 2578 Series=read_GUI(handles.series); 2579 t=struct2xml(Series); 2580 save(t); %TODO: determine a xml file name 2581 2582 % list_action=get(handles.ACTION,'String');% list menu action 2583 % index_action=get(handles.ACTION,'Value');% selected string index 2584 % action= list_action{index_action}; % selected string 2585 2586 %% defining the ACTION function handle 2587 path_series=which('series'); 2588 list_path=get(handles.ACTION,'UserData'); 2589 index=get(handles.ACTION,'Value'); 2590 fct_path=list_path{index}; %path stored for the function ACTION 2591 if ~isequal(fct_path,path_series) 2592 eval(['spath=which(''' action ''');']) %spath = current path of the selected function ACTION 2593 if ~exist(fct_path,'dir') 2594 msgbox_uvmat('ERROR',['The prescibed function path ' fct_path ' does not exist']) 2595 return 2596 end 2597 if ~isequal(spath,fct_path) 2598 addpath(fct_path)% add the prescribed path if not the current one 2599 end 2600 end 2601 eval(['h_fun=@' action ';'])%create a function handle for ACTION 2602 if ~isequal(fct_path,path_series) 2603 rmpath(fct_path)% add the prescribed path if not the current one 2604 end 2605 2606 h_fun('BATCH');% TODO modify the called function to read the xml file as input parameter 2607 2608
Note: See TracChangeset
for help on using the changeset viewer.