-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfg_find_benchmark.m
665 lines (490 loc) · 25.2 KB
/
fg_find_benchmark.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
function varargout = fg_find_benchmark(varargin)
% FG_FIND_BENCHMARK MATLAB code for fg_find_benchmark.fig
% FG_FIND_BENCHMARK, by itself, creates a new FG_FIND_BENCHMARK or raises the existing
% singleton*.
%
% H = FG_FIND_BENCHMARK returns the handle to a new FG_FIND_BENCHMARK or the handle to
% the existing singleton*.
%
% FG_FIND_BENCHMARK('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FG_FIND_BENCHMARK.M with the given input arguments.
%
% FG_FIND_BENCHMARK('Property','Value',...) creates a new FG_FIND_BENCHMARK or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before fg_find_benchmark_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to fg_find_benchmark_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help fg_find_benchmark
% Last Modified by GUIDE v2.5 25-Feb-2019 14:42:25
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @fg_find_benchmark_OpeningFcn, ...
'gui_OutputFcn', @fg_find_benchmark_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before fg_find_benchmark is made visible.
function fg_find_benchmark_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to fg_find_benchmark (see VARARGIN)
% Choose default command line output for fg_find_benchmark
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes fg_find_benchmark wait for user response (see UIRESUME)
h = findobj('Tag','fg_main');
vars = guidata(h);
project = CssProject(vars.working_folder);
database = project.LoadDatabase();
hObj = guidata(hObject);
% set the status of the window
hObj.status = false;
hObj.modified_benchmarks = [];
hObj.project = project;
hObj = UpdateBenchmarkList(database.benchmarks, hObj, handles);
hObj.working_folder = vars.working_folder;
fp = get(hObject,'position');
fp = idgetnicedialoglocation(fp, get(hObject,'Units'));
set(hObject,'position',fp)
if isempty(varargin)
handles.cmdSelect.String = 'Save end Exit';
handles.chkHide.Visible = 'off';
else
hObj.search_lat = varargin{1};
hObj.search_lon = varargin{2};
if and(hObj.search_lat == 0, hObj.search_lon == 0)
handles.chkHide.Visible = 'off';
end
handles.cmdDeleteBenckmark.Visible = 'off';
end
guidata(hObject, hObj);
uicontrol(handles.lstBenchmarks)
uiwait(handles.figure1);
function hObj = UpdateBenchmarkList(in_benchmarks, hObj, handles, varargin)
if handles.chkHide.Value
% user has requested to filter using the search lat lon parameters
% passed from the parent window
d = (m_idist([in_benchmarks.lon],[in_benchmarks.lat],hObj.search_lon,hObj.search_lat)./1000)';
else
d = 100*ones(length(in_benchmarks),1);
end
for i = 1:length(in_benchmarks)
if d(i) <= 80 % km from the search point
benchmarks(i,1) = {sprintf('<HTML><strong><FONT color="%s">%s (%.0f km)', 'green', in_benchmarks(i).name, d(i))};
elseif ~isempty(in_benchmarks(i).absolute_g)
benchmarks(i,1) = {sprintf('<HTML><strong><FONT color="%s">%s (absolute)', 'blue', in_benchmarks(i).name)};
else
benchmarks(i,1) = {in_benchmarks(i).name};
end
end
if handles.chkHide.Value
[~,c] = sortrows([{in_benchmarks.name}' num2cell(d)],[2 1]);
hObj.benchmarks = in_benchmarks(c);
else
[~,c] = sortrows({in_benchmarks.name}');
hObj.benchmarks = in_benchmarks(c);
end
set(handles.lstBenchmarks, 'string', benchmarks(c))
if ~isempty(varargin)
% set the selected benchmark
% find the index of this benchmark
index = find(ismember({in_benchmarks(c).name},{varargin{1}}));
set(handles.lstBenchmarks,'Value',index)
end
% --- Outputs from this function are returned to the command line.
function varargout = fg_find_benchmark_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
hObj = guidata(hObject);
% determine the exist state
if hObj.status == true
selection = get(handles.lstBenchmarks,{'String','Value'});
varargout{1} = selection{2};
varargout{2} = hObj.benchmarks(selection{2});
handles.figure1.Pointer = 'watch';
drawnow;
if ~isempty(hObj.modified_benchmarks)
UpdateBenchmarks(hObj.project, hObj.modified_benchmarks);
end
handles.figure1.Pointer = 'arrow';
else
varargout{1} = [];
varargout{2} = [];
end
delete(handles.figure1)
function txtSearch_Callback(hObject, eventdata, handles)
% hObject handle to txtSearch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtSearch as text
% str2double(get(hObject,'String')) returns contents of txtSearch as a double
% --- Executes during object creation, after setting all properties.
function txtSearch_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtSearch (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in lstBenchmarks.
function lstBenchmarks_Callback(hObject, eventdata, handles)
% hObject handle to lstBenchmarks (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns lstBenchmarks contents as cell array
% contents{get(hObject,'Value')} returns selected item from lstBenchmarks
hObj = guidata(hObject);
Click_lstBenchmarks(handles, hObj)
if strcmp(handles.figure1.SelectionType,'open')
% if double click, trigger selection
hObj.status = true;
guidata(hObject, hObj);
uiresume(handles.figure1);
end
function Click_lstBenchmarks(handles, hObj)
selection = get(handles.lstBenchmarks,{'string','value'});
hObj.selected_benchmark = selection{2};
set(handles.txtLat, 'string', sprintf('%.8f',hObj.benchmarks(selection{2}).lat))
set(handles.txtLon, 'string', sprintf('%.8f',hObj.benchmarks(selection{2}).lon))
set(handles.txtHeight, 'string', sprintf('%.3f',hObj.benchmarks(selection{2}).height))
set(handles.txtX, 'string', sprintf('%.3f',hObj.benchmarks(selection{2}).x))
set(handles.txtY, 'string', sprintf('%.3f',hObj.benchmarks(selection{2}).y))
set(handles.txtZ, 'string', sprintf('%.3f',hObj.benchmarks(selection{2}).z))
set(handles.BenchmarkPanel, 'title', ['Benchmark Metadata: ' hObj.benchmarks(selection{2}).name])
% --- Executes during object creation, after setting all properties.
function lstBenchmarks_CreateFcn(hObject, eventdata, handles)
% hObject handle to lstBenchmarks (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in cmdSelect.
function cmdSelect_Callback(hObject, eventdata, handles)
% hObject handle to cmdSelect (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
hObj = guidata(hObject);
hObj.status = true;
guidata(hObject, hObj);
uiresume(handles.figure1);
% --- Executes on button press in cmdNew.
function cmdNew_Callback(hObject, eventdata, handles)
% hObject handle to cmdNew (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
hObj = guidata(hObject);
name = inputdlg('Enter the new benchmark name:', 'New Benchmark', [1 50]);
if ~isempty(name)
name = lower(name{1});
% verify that the benchmark doesn' exist
if CssBenchmark.exists(hObj.benchmarks, name)
h = warndlg('The name entered already exists in the database');
waitfor(h);
else
% the name doesn't exist, then request the RINEX data
% initialize in zeros
hObj.benchmarks(end+1) = CssBenchmark(name, 0, 0, 0, 0);
% save the new benchmark to know which ones to process
hObj.modified_benchmarks = [hObj.modified_benchmarks; hObj.benchmarks(end)];
end
% update the list and set the selected benchmark
hObj = UpdateBenchmarkList(hObj.benchmarks, hObj, handles, name);
% select it
Click_lstBenchmarks(handles, hObj);
guidata(hObject, hObj);
end
function txtLat_Callback(hObject, eventdata, handles)
% hObject handle to txtLat (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtLat as text
% str2double(get(hObject,'String')) returns contents of txtLat as a double
% trigger the conversion button callback
cmdLLA2XYZ_Callback(hObject, eventdata, handles);
% --- Executes during object creation, after setting all properties.
function txtLat_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtLat (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtLon_Callback(hObject, eventdata, handles)
% hObject handle to txtLon (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtLon as text
% str2double(get(hObject,'String')) returns contents of txtLon as a double
% trigger the conversion button callback
cmdLLA2XYZ_Callback(hObject, eventdata, handles);
% --- Executes during object creation, after setting all properties.
function txtLon_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtLon (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtHeight_Callback(hObject, eventdata, handles)
% hObject handle to txtHeight (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtHeight as text
% str2double(get(hObject,'String')) returns contents of txtHeight as a double
% trigger the conversion button callback
cmdLLA2XYZ_Callback(hObject, eventdata, handles);
% --- Executes during object creation, after setting all properties.
function txtHeight_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtHeight (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtRINEXPath_Callback(hObject, eventdata, handles)
% hObject handle to txtRINEXPath (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtRINEXPath as text
% str2double(get(hObject,'String')) returns contents of txtRINEXPath as a double
% --- Executes during object creation, after setting all properties.
function txtRINEXPath_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtRINEXPath (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtX_Callback(hObject, eventdata, handles)
% hObject handle to txtX (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtX as text
% str2double(get(hObject,'String')) returns contents of txtX as a double
cmdXYZ2LLA_Callback(hObject, eventdata, handles);
% --- Executes during object creation, after setting all properties.
function txtX_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtX (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtY_Callback(hObject, eventdata, handles)
% hObject handle to txtY (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtY as text
% str2double(get(hObject,'String')) returns contents of txtY as a double
% trigger the conversion button callback
cmdXYZ2LLA_Callback(hObject, eventdata, handles);
% --- Executes during object creation, after setting all properties.
function txtY_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtY (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function txtZ_Callback(hObject, eventdata, handles)
% hObject handle to txtZ (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtZ as text
% str2double(get(hObject,'String')) returns contents of txtZ as a double
cmdXYZ2LLA_Callback(hObject, eventdata, handles);
% --- Executes during object creation, after setting all properties.
function txtZ_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtZ (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in cmdLLA2XYZ.
function cmdLLA2XYZ_Callback(hObject, eventdata, handles)
% hObject handle to cmdLLA2XYZ (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
lat = str2double(handles.txtLat.String)*pi/180;
lon = str2double(handles.txtLon.String)*pi/180;
h = str2double(handles.txtHeight.String);
xyz = CssBenchmark.e2x([lat; lon; h]);
handles.txtX.String = sprintf('%.3f',xyz(1));
handles.txtY.String = sprintf('%.3f',xyz(2));
handles.txtZ.String = sprintf('%.3f',xyz(3));
hObj = guidata(hObject);
% get the selection
selection = get(handles.lstBenchmarks,{'String','Value'});
% apply modification to benchmark
hObj.benchmarks(selection{2}) = hObj.benchmarks(selection{2}).UpdateCoords(CssBenchmark('dummy', lat*180/pi, lon*180/pi, h, 0));
% save in the modified list
hObj = save_modified_benchmark(hObj, selection{2});
guidata(hObject, hObj);
% --- Executes on button press in cmdXYZ2LLA.
function cmdXYZ2LLA_Callback(hObject, eventdata, handles)
% hObject handle to cmdXYZ2LLA (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x = str2double(handles.txtX.String);
y = str2double(handles.txtY.String);
z = str2double(handles.txtZ.String);
lla = CssBenchmark.x2e([x; y; z]);
handles.txtLat.String = sprintf('%.8f',lla(1)*180/pi);
handles.txtLon.String = sprintf('%.8f',lla(2)*180/pi);
handles.txtHeight.String = sprintf('%.3f',lla(3));
hObj = guidata(hObject);
% get the selection
selection = get(handles.lstBenchmarks,{'String','Value'});
% apply modification to benchmark
hObj.benchmarks(selection{2}) = hObj.benchmarks(selection{2}).UpdateCoords(CssBenchmark('dummy', x, y, z, 0));
% save in the modified list
hObj = save_modified_benchmark(hObj, selection{2});
guidata(hObject, hObj);
function hObj = save_modified_benchmark(hObj, selection)
% save the new benchmark to know which ones to process
if ~CssBenchmark.exists(hObj.modified_benchmarks, hObj.benchmarks(selection).name)
hObj.modified_benchmarks = [hObj.modified_benchmarks; hObj.benchmarks(selection)];
end
% --- Executes on button press in cmdRINEXPath.
function cmdRINEXPath_Callback(hObject, eventdata, handles)
% hObject handle to cmdRINEXPath (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if ~strcmp(handles.txtRINEXPath.String,'')
[path, ~, ~] = fileparts(handles.txtRINEXPath.String);
[filename, pathname] = uigetfile(fullfile(path, '*.??d.Z;*.??o;*.??O'),'Find RINEX file');
else
[filename, pathname] = uigetfile('*.??d.Z;*.??o;*.??O','Find RINEX file');
end
if filename ~= 0
handles.txtRINEXPath.String = fullfile(pathname, filename);
% open the rinex and get the antenna height
[path,rinex] = CssBenchmark.CopyCrinexRinex('temp',handles.txtRINEXPath.String);
[~, ~, ~, height] = CssBenchmark.ReadRinex(rinex);
% delete temp dir
delete(rinex)
rmdir(path)
handles.txtAntH.String = sprintf('%.3f', height);
end
% --- Executes on button press in cmdPPP.
function cmdPPP_Callback(hObject, eventdata, handles)
% hObject handle to cmdPPP (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if exist(handles.txtRINEXPath.String, 'file')
hObj = guidata(hObject);
h = waitbar(0,'Obtaining coordinate using NRCAN PPP...');
selection = get(handles.lstBenchmarks,{'String','Value'});
hObj.benchmarks(selection{2}).RunPPP(handles.txtRINEXPath.String, str2double(handles.txtAntH.String));
Click_lstBenchmarks(handles, hObj)
close(h)
% save the new benchmark to know which ones to process
hObj = save_modified_benchmark(hObj, selection{2});
guidata(hObject,hObj);
else
warndlg('The provided RINEX file could not be found!')
end
% --- Executes when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure
if isequal(get(hObject, 'waitstatus'), 'waiting')
uiresume(hObject)
else
delete(hObject);
end
function txtAntH_Callback(hObject, eventdata, handles)
% hObject handle to txtAntH (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of txtAntH as text
% str2double(get(hObject,'String')) returns contents of txtAntH as a double
% --- Executes during object creation, after setting all properties.
function txtAntH_CreateFcn(hObject, eventdata, handles)
% hObject handle to txtAntH (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in chkHide.
function chkHide_Callback(hObject, eventdata, handles)
% hObject handle to chkHide (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of chkHide
hObj = guidata(hObject);
hObj = UpdateBenchmarkList(hObj.benchmarks, hObj, handles);
Click_lstBenchmarks(handles, hObj)
guidata(hObject,hObj);
% --- Executes on button press in cmdDeleteBenckmark.
function cmdDeleteBenckmark_Callback(hObject, eventdata, handles)
% hObject handle to cmdDeleteBenckmark (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
hObj = guidata(hObject);
project = CssProject(hObj.working_folder);
database = project.LoadDatabase();
selection = get(handles.lstBenchmarks,{'String','Value'});
name = hObj.benchmarks(selection{2}).name;
lines = project.LoadLines();
for j = 1:length(lines)
if CssBenchmark.exists(lines(j).benchmarks, name)
h = msgbox(['This benchmark is in use in line ' lines(j).line_name '. Remove it and try again!']);
waitfor(h)
return
end
end
i = ismember({database.benchmarks.name}, name);
database.benchmarks(i) = [];
% set the status of the window
hObj.status = false;
hObj.project = project;
hObj = UpdateBenchmarkList(database.benchmarks, hObj, handles);
save(fullfile(hObj.working_folder, 'database.mat'), 'database');
guidata(hObject, hObj);