Skip to content
Snippets Groups Projects
Commit 114c0226 authored by leprob001's avatar leprob001
Browse files

Added option to save the optimum tables to a mat file.

parent 2c9a8ec0
No related branches found
No related tags found
No related merge requests found
131
\ No newline at end of file
132
\ No newline at end of file
......@@ -14,7 +14,8 @@ satData = artoaWorkspace.satData;
artoaWorkspace.editOffsets.A, ...
artoaWorkspace.editOffsets.B, ...
artoaWorkspace.editOffsets.X, ...
~ ...
artoaWorkspace.editOffsets.unfilteredA, ...
artoaWorkspace.editOffsets.unfilteredB ...
] = artoa.offsets.solve( ...
artoaDataInput.rfb, ...
soundsources, ...
......
function [] = saveOptimumTables(~, ~)
%SAVERFC Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace artoaDataInput;
%% Get offsets
unfilteredA = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'unfilteredA'}, false);
unfilteredB = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'unfilteredB'}, false);
A = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'A'}, false);
B = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'B'}, false);
X = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'X'}, false);
if islogical(unfilteredA) || islogical(unfilteredB) ...
|| islogical(A) || islogical(B) || islogical(X)
errordlg('At least one of the matrices to save is not available. Please recalculate!', 'Matrices not found');
return;
end
%% Get required variables
folder = artoa.data.getMember(artoaDataInput, {'ini', 'directory', 'optimumtables'}, pwd());
filter = artoa.data.getMember(artoaDataInput, {'ini', 'filemask', 'optimumtables'}, '*.mat');
%% Ask for filename
[filename, pathname] = uiputfile(fullfile(folder, filter));
filepath = fullfile(pathname, filename);
save(filepath, 'unfilteredA', 'unfilteredB', 'A', 'B', 'X');
end
......@@ -21,6 +21,7 @@ callbacks.loadInterim = @artoa.controller.file.loadInterim;
callbacks.loadSoundsourceFile = @artoa.controller.file.loadSoundSourceFile;
callbacks.saveRfc = @artoa.controller.file.saveRfc;
callbacks.saveInterim = @artoa.controller.file.saveInterim;
callbacks.saveOptimumTables = @artoa.controller.file.saveOptimumTables;
callbacks.loadArtoaIni = @artoa.controller.file.loadArtoaIni;
callbacks.openEditTemperature = @artoa.controller.edit.temperature.open;
callbacks.openEditPressure = @artoa.controller.edit.pressure.open;
......
......@@ -13,6 +13,7 @@ availableCallbacks = { ...
'loadSoundsourceFile', ...
'saveRfc', ...
'saveInterim', ...
'saveOptimumTables', ...
'loadArtoaIni', ...
'quit', ...
'openEditTemperature', ...
......@@ -90,6 +91,12 @@ uimenu( ...
'Callback', pCallbacks.saveInterim ...
);
uimenu( ...
artoaGui.main.menus.fileSave, ...
'Label', 'Optimum tables', ...
'Callback', pCallbacks.saveOptimumTables ...
);
artoaGui.main.menus.fileReloadArtoaIni = uimenu( ...
artoaGui.main.menus.file, ...
'Label', 'Reload artoa.ini', ...
......
function [A, B, X, unfilteredA] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pAppliedTemperature, pAppliedPressure, pLeapsecondsMatrix, pOffsetsParameter)
function [A, B, X, unfilteredA, unfilteredB] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pAppliedTemperature, pAppliedPressure, pLeapsecondsMatrix, pOffsetsParameter)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
%% Construct matrices A and B
[unfilteredA, B] = artoa.offsets.createCalculationTables( ...
[unfilteredA, unfilteredB] = artoa.offsets.createCalculationTables( ...
pRfb, ...
pSoundsources, ...
pTrackingParameter, ...
......@@ -17,7 +17,7 @@ function [A, B, X, unfilteredA] = solve(pRfb, pSoundsources, pTrackingParameter,
%% Subtract all known offsets
[B] = artoa.offsets.subtractKnownOffsets( ...
unfilteredA, ...
B, ...
unfilteredB, ...
pOffsetsParameter.offsets ...
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment