Add GUIDE-compatible simulator shell
Agent-Logs-Url: https://github.com/kk14222/3D_EDFM_SIM-X/sessions/a128ab7f-6b94-4048-a847-f2dc37bbe0ab Co-authored-by: kk14222 <217880052+kk14222@users.noreply.github.com>
This commit is contained in:
co-authored by
kk14222
parent
771d57e7d0
commit
dd42a8f138
@@ -115,7 +115,7 @@ classdef EDFMAppController < handle
|
||||
obj.appendLog(errorReport);
|
||||
obj.setRunProgress('Failed');
|
||||
obj.setStatus('Run failed');
|
||||
uialert(obj.App.UIFigure, errorSummary, 'Run Failed', 'Interpreter', 'none');
|
||||
obj.showAlert(errorSummary, 'Run Failed', 'Interpreter', 'none');
|
||||
end
|
||||
end
|
||||
|
||||
@@ -135,7 +135,7 @@ classdef EDFMAppController < handle
|
||||
|
||||
function exportResults(obj)
|
||||
if isempty(fieldnames(obj.Results))
|
||||
uialert(obj.App.UIFigure, 'No results available to export.', 'Export Results');
|
||||
obj.showAlert('No results available to export.', 'Export Results');
|
||||
return;
|
||||
end
|
||||
[fileName, folder] = uiputfile('*.mat', 'Export Results', 'results.mat');
|
||||
@@ -218,7 +218,7 @@ classdef EDFMAppController < handle
|
||||
return;
|
||||
case 'FractureWellLocationTable'
|
||||
if obj.getFractureWellCount() == 0
|
||||
uialert(obj.App.UIFigure, ...
|
||||
obj.showAlert(...
|
||||
'Please add a fracture well before editing perforation coordinates.', ...
|
||||
'No Fracture Well');
|
||||
return;
|
||||
@@ -254,7 +254,7 @@ classdef EDFMAppController < handle
|
||||
selectedRow = obj.App.(tableName).UserData;
|
||||
end
|
||||
if isempty(selectedRow) || ~isscalar(selectedRow) || selectedRow < 1
|
||||
uialert(obj.App.UIFigure, ...
|
||||
obj.showAlert(...
|
||||
sprintf('Please select a row in %s first.', tableName), ...
|
||||
'Delete Row');
|
||||
return;
|
||||
@@ -288,7 +288,7 @@ classdef EDFMAppController < handle
|
||||
selectedRow = obj.App.(tableName).UserData;
|
||||
end
|
||||
if isempty(selectedRow) || ~isscalar(selectedRow) || selectedRow < 1
|
||||
uialert(obj.App.UIFigure, ...
|
||||
obj.showAlert(...
|
||||
sprintf('Please select a row in %s first.', tableName), ...
|
||||
'Delete Row');
|
||||
return;
|
||||
@@ -304,7 +304,7 @@ classdef EDFMAppController < handle
|
||||
|
||||
function runCasePlot(obj, actionId)
|
||||
if isempty(fieldnames(obj.Results))
|
||||
uialert(obj.App.UIFigure, 'Run or import results before plotting.', 'Plot');
|
||||
obj.showAlert('Run or import results before plotting.', 'Plot');
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -327,7 +327,7 @@ classdef EDFMAppController < handle
|
||||
fprintf(2, '\n[EDFM GUI Plot Error]\n%s\n', errorReport);
|
||||
obj.appendLog(errorSummary);
|
||||
obj.appendLog(errorReport);
|
||||
uialert(obj.App.UIFigure, errorSummary, 'Plot Failed', 'Interpreter', 'none');
|
||||
obj.showAlert(errorSummary, 'Plot Failed', 'Interpreter', 'none');
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1520,6 +1520,17 @@ classdef EDFMAppController < handle
|
||||
end
|
||||
end
|
||||
|
||||
function showAlert(obj, message, titleText, varargin)
|
||||
if nargin < 3 || strlength(string(titleText)) == 0
|
||||
titleText = 'EDFM Simulator';
|
||||
end
|
||||
try
|
||||
uialert(obj.App.UIFigure, message, titleText, varargin{:});
|
||||
catch
|
||||
errordlg(char(string(message)), char(string(titleText)), 'modal');
|
||||
end
|
||||
end
|
||||
|
||||
function textValue = formatExceptionSummary(~, ME)
|
||||
lines = {
|
||||
sprintf('Error: %s', ME.message)
|
||||
|
||||
Reference in New Issue
Block a user