Skip to content

Commit 4817830

Browse files
committed
UNST-9501: option to sort station names ... run the test bench once with alphabetical sorting activated ... qp_validate temporarily adjusted to avoid failures related to the newly added fields: trying to identify cases in which sorting has any effect
1 parent 1da4055 commit 4817830

5 files changed

Lines changed: 247 additions & 164 deletions

File tree

src/tools_lgpl/matlab/quickplot/progsrc/private/qp_fmem.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,10 +1239,10 @@
12391239
end
12401240
end
12411241
end
1242-
if isempty(FI)
1243-
lasttp=[];
1242+
if ~isempty(FI)
1243+
FI = qp_option(FI,'sortStations','alphabetically');
1244+
qp_settings('LastFileType',lasttp)
12441245
end
1245-
qp_settings('LastFileType',lasttp)
12461246

12471247

12481248
function [isASCII,REASON] = verifyascii(arg)

src/tools_lgpl/matlab/quickplot/progsrc/private/qp_proxy.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
Key = Proxy.Data.Key;
7070
switch Key(1:4)
7171
case 'main'
72-
[FI,FileName,Tp,Otherargs]=qp_fmem('open',Proxy.Name,Proxy.Otherargs{:});
72+
[FI,~,~,~]=qp_fmem('open',Proxy.Name,Proxy.Otherargs{:});
7373
case 'grid'
74-
[FI,FileName,Tp,Otherargs]=grid_fopen('open',Proxy.Name,Proxy.Otherargs{:});
74+
[FI,~,~,~]=grid_fopen('open',Proxy.Name,Proxy.Otherargs{:});
7575
end
7676
if ~isempty(FI)
7777
save.(Key) = FI;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function [out1,out2] = sort_stations(in1,stationSortMethod)
2+
%sort_stations Routine to sort station names
3+
4+
NONE = 'no_sorting';
5+
ALPHABETICAL = 'alphabetically';
6+
7+
if nargin == 1 && nargout <= 1
8+
switch in1
9+
case 'methods'
10+
out1 = {NONE,ALPHABETICAL};
11+
case 'default'
12+
out1 = NONE;
13+
otherwise
14+
error('Unexpected command: %s.', in1)
15+
end
16+
17+
else
18+
switch stationSortMethod
19+
case NONE
20+
out1 = in1;
21+
out2 = 1:length(in1);
22+
23+
case ALPHABETICAL
24+
[out1,out2] = sort(in1);
25+
26+
otherwise
27+
error('Sort method %s not implemented.', stationSortMethod)
28+
end
29+
end

0 commit comments

Comments
 (0)