Skip to content
Open
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
9 changes: 9 additions & 0 deletions API/RAT.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
% Call the main RAT routine...
display = ~strcmpi(controls.display, displayOptions.Off.value);
textProgressBar(0, 0, display);
printFunc = @(x) fprintf("%s", x);
progressFunc = @(x) textProgressBar(x{1}, x{2});

eventManager.register(eventTypes.Message, printFunc);
eventManager.register(eventTypes.Progress, progressFunc);

% If display is not silent print a line confirming RAT is starting
if display
fprintf('Starting RAT ______________________________________________________________________________________________\n\n');
Expand All @@ -78,6 +84,9 @@
toc
end
textProgressBar(0, 0, true);
eventManager.unregister(eventTypes.Message, printFunc);
eventManager.unregister(eventTypes.Progress, progressFunc);

if any(strcmpi(controls.procedure, {procedures.NS.value, procedures.Dream.value}))
result = mergeStructs(result, bayesResults);
end
Expand Down
4 changes: 2 additions & 2 deletions API/events/triggerEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function triggerEvent(eventType, varargin)
coder.extrinsic('eventManager.notify')
if coder.target('MATLAB') || coder.target('MEX')
if eventType == coderEnums.eventTypes.Message
fprintf("%s", varargin{1});
eventManager.notify(eventType, varargin{1});
elseif eventType == coderEnums.eventTypes.Progress
textProgressBar(varargin{1}, varargin{2});
eventManager.notify(eventType, varargin)
elseif eventType == coderEnums.eventTypes.Plot
result = varargin{1};
problemStruct = varargin{2};
Expand Down
2 changes: 1 addition & 1 deletion examples/domains/customXY/domainsXY.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
vfWater = 1 - totalVF;

% Now convert the Volume Fractions to SLD's...
siSLD = vfSilicon * bulk_in;
siSLD = vfSilicon * bulk_in(contrast);
oxSLD = vfOxide * 3.41e-6;

% Layer SLD depends on whether we are calculating the domain or not...
Expand Down
8 changes: 4 additions & 4 deletions targetFunctions/+domainsTF/processCustomFunction.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
coder.varsize('output2',[10000 numberOfOutputColumns], [1 1]);

if isnan(str2double(functionHandle))
[output1, subRoughs(i)] = callMatlabFunction(functionHandle, paramValues, bulkIns(i), bulkOuts, i, 1);
[output2, ~] = callMatlabFunction(functionHandle, paramValues, bulkIns(i), bulkOuts, i, 2);
[output1, subRoughs(i)] = callMatlabFunction(functionHandle, paramValues, bulkIns, bulkOuts, i, 1);
[output2, ~] = callMatlabFunction(functionHandle, paramValues, bulkIns, bulkOuts, i, 2);
else
[output1, subRoughs(i)] = callCppFunction(functionHandle, paramValues, bulkIns(i), bulkOuts, i, 1);
[output2, ~] = callCppFunction(functionHandle, paramValues, bulkIns(i), bulkOuts, i, 2);
[output1, subRoughs(i)] = callCppFunction(functionHandle, paramValues, bulkIns, bulkOuts, i, 1);
[output2, ~] = callCppFunction(functionHandle, paramValues, bulkIns, bulkOuts, i, 2);
end

% If SLD is real, add dummy imaginary column
Expand Down
4 changes: 2 additions & 2 deletions targetFunctions/+normalTF/processCustomFunction.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
coder.varsize('output',[10000 numberOfOutputColumns],[1 1]);

if isnan(str2double(functionHandle))
[output, subRoughs(i)] = callMatlabFunction(functionHandle, paramValues, bulkIns(i), bulkOuts, i, 0);
[output, subRoughs(i)] = callMatlabFunction(functionHandle, paramValues, bulkIns, bulkOuts, i, 0);
else
[output, subRoughs(i)] = callCppFunction(functionHandle, paramValues, bulkIns(i), bulkOuts, i, 0);
[output, subRoughs(i)] = callCppFunction(functionHandle, paramValues, bulkIns, bulkOuts, i, 0);
end

% If SLD is real, add dummy imaginary column
Expand Down
Loading