function [] = loadRfb(~, ~) %LOADRFB Creates a file selection dialog and reads the file into memory. global artoaDataInput; %% Initialize variables artoaDataInput.rfb = false; %% Get required variables folder = artoa.data.getMember(artoaDataInput, {'ini', 'directory', 'rfb'}, pwd()); filter = artoa.data.getMember(artoaDataInput, {'ini', 'filemask', 'rfb'}, '*.rfb'); %% Create file dialog and filename [file, path] = uigetfile(fullfile(folder, filter)); filepath = fullfile(path, file); %% Check if the dialog has been aborted if file == 0 return; end %% Check if file exists if ~isfile(filepath) error([mfilename ': Selected file ' filepath ' is not a file! Please try again!']); return; end %% Close all windows artoa.controller.edit.pressure.close(); artoa.controller.edit.temperature.close(); artoa.controller.edit.timeOfArrival.close(); artoa.controller.track.trajectoryOutput.close(); %% Load file into memory artoaDataInput.rfb = artoa.load.rfb(filepath); %% Update workspace artoa.controller.initializeArtoa4(); artoa.controller.copyRfbToWorkspace(); %% Initialize tracking parameter artoa.controller.track.parameter.initialize(true); artoa.controller.track.parameter.updateGui(); %% Initialize offsets artoa.controller.edit.offsets.initialize(true); artoa.controller.edit.offsets.updateGui(); %% Update menu buttons artoa.controller.updateMenuButtons(); %% Update status text in main window artoa.controller.main.updateLoadedFloatInformation(); end