Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified tests/testProjectConversion/DSPCBilayerProjectClass.mat
Binary file not shown.
Binary file modified tests/testProjectConversion/DSPCBilayerStructOutput.mat
Binary file not shown.
Binary file modified tests/testProjectConversion/DSPCBilayerStructOutputWithR1Input.mat
Binary file not shown.
19 changes: 19 additions & 0 deletions utilities/misc/r1ToProjectClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
% Remove defaults
project.removeBackgroundParam(1);
project.removeBackground(1);
project.removeResolutionParam(1);
project.removeResolution(1);
project.removeBulkIn(1);
project.removeBulkOut(1);
project.removeScalefactor(1);
Expand All @@ -124,6 +126,23 @@
backParamNames{i});
end

% Set resolutions
resolParamNames = num2cell(arrayfun(@(i) sprintf("Resolution par %d", i), 1:problem.numberOfResolutions));
problem.resolution_constr = fixConstrs(problem.numberOfResolutions, resolParamNames, problem.resolution_constr, problem.resolution, problem.resolution_fityesno);
for i = 1:problem.numberOfResolutions
% Add resolutions parameter
% addResolutionParam <- (name, min, value, max, fit)
project.addResolutionParam(resolParamNames{i}, ...
problem.resolution_constr(i,1), ...
problem.resolution(i), ...
problem.resolution_constr(i,2), ...
logical(problem.resolution_fityesno(i)));
% Add resolution
project.addResolution(problem.resolNames{i}, ...
allowedTypes.Constant.value, ...
resolParamNames{i});
end

% Set bulk in params
problem.nbairs_constr = fixConstrs(problem.numberOfNbas, problem.nbaNames, problem.nbairs_constr, problem.nba, problem.nbairs_fityesno);
for i = 1:problem.numberOfNbas
Expand Down