Skip to content

Commit

Permalink
PP routines timeDriftPP, timeMetaOffsetPP and timeOffsetPP have their…
Browse files Browse the repository at this point in the history
… window size adapted to the number of datasets.
  • Loading branch information
ggalibert committed Jan 16, 2017
1 parent 97a7925 commit d7098e7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
12 changes: 7 additions & 5 deletions Preprocessing/timeDriftPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@
set(startOffsetFields, 'Units', 'normalized');
set(endOffsetFields, 'Units', 'normalized');

set(f, 'Position', [0.2 0.35 0.6 0.0222*nSample]);
set(cancelButton, 'Position', [0.0 0.0 0.5 0.1]);
set(confirmButton, 'Position', [0.5 0.0 0.5 0.1]);
set(f, 'Position', [0.2 0.35 0.6 0.0222 * (nSample + 1)]); % need to include 1 extra space for the row of buttons

rowHeight = 1 / (nSample + 1);

set(cancelButton, 'Position', [0.0 0.0 0.5 rowHeight]);
set(confirmButton, 'Position', [0.5 0.0 0.5 rowHeight]);

rowHeight = 0.9 / nSample;
for k = 1:nSample

rowStart = 1.0 - k * rowHeight;
Expand Down Expand Up @@ -277,7 +279,7 @@ function checkboxCallback(source, ev)
else val = 'off';
end

set(startOffsetFields(idx), 'Enable', val);
set([startOffsetFields(idx), endOffsetFields(idx)], 'Visible', val);

end

Expand Down
21 changes: 12 additions & 9 deletions Preprocessing/timeMetaOffsetPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@

offsetFile = ['Preprocessing' filesep 'timeOffsetPP.txt'];

nSample = length(sample_data);
descs = {};
timezones = {};
offsets = [];
sets = ones(length(sample_data), 1);
sets = ones(nSample, 1);

% create descriptions, and get timezones/offsets for each data set
for k = 1:length(sample_data)
for k = 1:nSample

descs{k} = genSampleDataDesc(sample_data{k});

Expand Down Expand Up @@ -106,7 +107,7 @@
timezoneLabels = [];
offsetFields = [];

for k = 1:length(sample_data)
for k = 1:nSample

setCheckboxes(k) = uicontrol(...
'Style', 'checkbox',...
Expand All @@ -132,12 +133,14 @@
set(timezoneLabels, 'Units', 'normalized');
set(offsetFields, 'Units', 'normalized');

set(f, 'Position', [0.2 0.35 0.6 0.3]);
set(cancelButton, 'Position', [0.0 0.0 0.5 0.1]);
set(confirmButton, 'Position', [0.5 0.0 0.5 0.1]);
set(f, 'Position', [0.2 0.35 0.6 0.0222 * (nSample +1 )]); % need to include 1 extra space for the row of buttons

rowHeight = 0.9 / length(sample_data);
for k = 1:length(sample_data)
rowHeight = 1 / (nSample + 1);

set(cancelButton, 'Position', [0.0 0.0 0.5 rowHeight]);
set(confirmButton, 'Position', [0.5 0.0 0.5 rowHeight]);

for k = 1:nSample

rowStart = 1.0 - k * rowHeight;

Expand Down Expand Up @@ -168,7 +171,7 @@
end

% apply the time offset to the selected datasets
for k = 1:length(sample_data)
for k = 1:nSample

% this set has been deselected
if ~sets(k), continue; end
Expand Down
22 changes: 13 additions & 9 deletions Preprocessing/timeOffsetPP.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@

offsetFile = ['Preprocessing' filesep 'timeOffsetPP.txt'];

nSample = length(sample_data);
descs = {};
timezones = {};
offsets = [];
sets = ones(length(sample_data), 1);
sets = ones(nSample, 1);

% create descriptions, and get timezones/offsets for each data set
for k = 1:length(sample_data)
for k = 1:nSample

descs{k} = genSampleDataDesc(sample_data{k});

Expand Down Expand Up @@ -113,7 +114,7 @@
timezoneLabels = [];
offsetFields = [];

for k = 1:length(sample_data)
for k = 1:nSample

setCheckboxes(k) = uicontrol(...
'Style', 'checkbox',...
Expand All @@ -139,12 +140,15 @@
set(timezoneLabels, 'Units', 'normalized');
set(offsetFields, 'Units', 'normalized');

set(f, 'Position', [0.2 0.35 0.6 0.3]);
set(cancelButton, 'Position', [0.0 0.0 0.5 0.1]);
set(confirmButton, 'Position', [0.5 0.0 0.5 0.1]);
set(f, 'Position', [0.2 0.35 0.6 0.0222 * (nSample +1 )]); % need to include 1 extra space for the row of buttons

rowHeight = 0.9 / length(sample_data);
for k = 1:length(sample_data)
rowHeight = 1 / (nSample + 1);

set(cancelButton, 'Position', [0.0 0.0 0.5 rowHeight]);
set(confirmButton, 'Position', [0.5 0.0 0.5 rowHeight]);


for k = 1:nSample

rowStart = 1.0 - k * rowHeight;

Expand Down Expand Up @@ -175,7 +179,7 @@
end

% apply the time offset to the selected datasets
for k = 1:length(sample_data)
for k = 1:nSample

% this set has been deselected
if ~sets(k), continue; end
Expand Down

0 comments on commit d7098e7

Please sign in to comment.