From 0018b44cea5771d5e0d989a283a75b232e2015be Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 03:36:55 +0000 Subject: [PATCH] Clarify GUIDE helper names 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> --- gui_support/app/EDFMAppController.m | 4 ++-- gui_support/app/EDFMGuideComponent.m | 6 +++++- .../app/createEDFMSimulatorGuideLayout.m | 20 +++++++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/gui_support/app/EDFMAppController.m b/gui_support/app/EDFMAppController.m index 4b90f5f..c6486bc 100644 --- a/gui_support/app/EDFMAppController.m +++ b/gui_support/app/EDFMAppController.m @@ -1527,11 +1527,11 @@ classdef EDFMAppController < handle try uialert(obj.App.UIFigure, message, titleText, varargin{:}); catch - errordlg(obj.toDialogText(message), obj.toDialogText(titleText), 'modal'); + errordlg(obj.formatDialogMessage(message), obj.formatDialogMessage(titleText), 'modal'); end end - function textValue = toDialogText(~, value) + function textValue = formatDialogMessage(~, value) if iscell(value) textValue = strjoin(string(value), newline); else diff --git a/gui_support/app/EDFMGuideComponent.m b/gui_support/app/EDFMGuideComponent.m index e655999..50ec11b 100644 --- a/gui_support/app/EDFMGuideComponent.m +++ b/gui_support/app/EDFMGuideComponent.m @@ -1,6 +1,10 @@ classdef EDFMGuideComponent < handle %EDFMGUIDECOMPONENT Compatibility adapter from GUIDE/uicontrol to App Designer-style properties. + properties (Constant, Access = private) + NUMERIC_FIELD_TYPE = 'numeric' + end + properties (SetAccess = private) Handle end @@ -277,7 +281,7 @@ classdef EDFMGuideComponent < handle function tf = isNumericEditField(obj) userData = get(obj.Handle, 'UserData'); - tf = isstruct(userData) && isfield(userData, 'Type') && strcmp(userData.Type, 'numeric'); + tf = isstruct(userData) && isfield(userData, 'Type') && strcmp(userData.Type, obj.NUMERIC_FIELD_TYPE); end end diff --git a/gui_support/app/createEDFMSimulatorGuideLayout.m b/gui_support/app/createEDFMSimulatorGuideLayout.m index fdf4bc0..490ca01 100644 --- a/gui_support/app/createEDFMSimulatorGuideLayout.m +++ b/gui_support/app/createEDFMSimulatorGuideLayout.m @@ -10,7 +10,7 @@ handles.UIFigure = fig; handles.TemplateDropDown = uicontrol('Parent', fig, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [18 774 120 22], ... 'String', {'', ''}, 'Value', 1, 'Tag', 'TemplateDropDown'); -setGuidePopupValue(handles.TemplateDropDown, ''); +setPopupDefaultValue(handles.TemplateDropDown, ''); handles.LoadTemplateButton = uicontrol('Parent', fig, 'Style', 'pushbutton', 'Units', 'pixels', 'Position', [177 774 94 23], ... 'String', 'Load Template', 'Tag', 'LoadTemplateButton'); @@ -42,14 +42,14 @@ handles.GridModelDropDownLabel = uicontrol('Parent', handles.ModelTab, 'Style', handles.ModelGridModelDropDown = uicontrol('Parent', handles.ModelTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [137 630 100 22], ... 'String', {'1', '2', '', ''}, 'Value', 1, 'Tag', 'ModelGridModelDropDown'); -setGuidePopupValue(handles.ModelGridModelDropDown, ''); +setPopupDefaultValue(handles.ModelGridModelDropDown, ''); handles.FlowModelDropDownLabel = uicontrol('Parent', handles.ModelTab, 'Style', 'text', 'Units', 'pixels', 'Position', [67 566 63 22], ... 'String', 'FlowModel', 'HorizontalAlignment', 'right', 'Tag', 'FlowModelDropDownLabel'); handles.ModelFlowModelDropDown = uicontrol('Parent', handles.ModelTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [145 566 100 22], ... 'String', {'1', '2', '3'}, 'Value', 1, 'Tag', 'ModelFlowModelDropDown'); -setGuidePopupValue(handles.ModelFlowModelDropDown, '1'); +setPopupDefaultValue(handles.ModelFlowModelDropDown, '1'); handles.GridTab = uitab('Parent', handles.TabGroup, 'Title', 'Grid', 'Tag', 'GridTab'); @@ -346,7 +346,7 @@ handles.oil_modelLabel = uicontrol('Parent', handles.OilWaterTab, 'Style', 'text handles.OWoil_modelDropDown = uicontrol('Parent', handles.OilWaterTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [121 205 100 22], ... 'String', {''}, 'Value', 1, 'Tag', 'OWoil_modelDropDown'); -setGuidePopupValue(handles.OWoil_modelDropDown, ''); +setPopupDefaultValue(handles.OWoil_modelDropDown, ''); handles.MultiComponentTab = uitab('Parent', handles.TabGroup2, 'Title', 'MultiComponent', 'Tag', 'MultiComponentTab'); @@ -630,7 +630,7 @@ handles.SelectedFractureWellLabel = uicontrol('Parent', handles.WellsTab, 'Style handles.SelectedFracWellDropDown = uicontrol('Parent', handles.WellsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [864 464 70 22], ... 'String', {''}, 'Value', 1, 'Tag', 'SelectedFracWellDropDown'); -setGuidePopupValue(handles.SelectedFracWellDropDown, ''); +setPopupDefaultValue(handles.SelectedFracWellDropDown, ''); handles.SolverRunTab = uitab('Parent', handles.TabGroup, 'Title', 'Solver&Run', 'Tag', 'SolverRunTab'); @@ -703,28 +703,28 @@ handles.PlotLayerDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style' handles.PlotLayerDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [86 224 78 22], ... 'String', {''}, 'Value', 1, 'Tag', 'PlotLayerDropDown'); -setGuidePopupValue(handles.PlotLayerDropDown, ''); +setPopupDefaultValue(handles.PlotLayerDropDown, ''); handles.PlotPropertyDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [8 182 71 22], ... 'String', 'PlotProperty', 'HorizontalAlignment', 'right', 'Tag', 'PlotPropertyDropDownLabel'); handles.PlotPropertyDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [94 182 68 22], ... 'String', {''}, 'Value', 1, 'Tag', 'PlotPropertyDropDown'); -setGuidePopupValue(handles.PlotPropertyDropDown, ''); +setPopupDefaultValue(handles.PlotPropertyDropDown, ''); handles.PlotMetricDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [5 97 58 22], ... 'String', 'PlotMetric', 'HorizontalAlignment', 'right', 'Tag', 'PlotMetricDropDownLabel'); handles.PlotMetricDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [78 97 86 22], ... 'String', {''}, 'Value', 1, 'Tag', 'PlotMetricDropDown'); -setGuidePopupValue(handles.PlotMetricDropDown, ''); +setPopupDefaultValue(handles.PlotMetricDropDown, ''); handles.PlotWellDropDownLabel = uicontrol('Parent', handles.ResultsTab, 'Style', 'text', 'Units', 'pixels', 'Position', [12 139 49 22], ... 'String', 'PlotWell', 'HorizontalAlignment', 'right', 'Tag', 'PlotWellDropDownLabel'); handles.PlotWellDropDown = uicontrol('Parent', handles.ResultsTab, 'Style', 'popupmenu', 'Units', 'pixels', 'Position', [76 139 87 22], ... 'String', {''}, 'Value', 1, 'Tag', 'PlotWellDropDown'); -setGuidePopupValue(handles.PlotWellDropDown, ''); +setPopupDefaultValue(handles.PlotWellDropDown, ''); handles.PlotTimeStepSlider = uicontrol('Parent', handles.ResultsTab, 'Style', 'slider', 'Units', 'pixels', 'Position', [15 578 150 3], ... 'Min', 0, 'Max', 100, 'Value', 0, 'Tag', 'PlotTimeStepSlider'); @@ -748,7 +748,7 @@ zlabel(handles.ResultAxes, 'Z'); set(fig, 'Visible', 'on'); end -function setGuidePopupValue(handleObj, value) +function setPopupDefaultValue(handleObj, value) items = get(handleObj, 'String'); if ischar(items), items = cellstr(items); end idx = find(strcmp(items, char(string(value))), 1);