From f10831f06ba73aa6c7e723f887e9f8dbf2076c57 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 03:34:20 +0000 Subject: [PATCH] Support editable GUIDE fig layout 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/EDFMSimulatorGuide.m | 13 ++++++++++++- gui_support/app/build_edfm_guide_fig.m | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 gui_support/app/build_edfm_guide_fig.m diff --git a/gui_support/app/EDFMSimulatorGuide.m b/gui_support/app/EDFMSimulatorGuide.m index 7d308ad..088b5ad 100644 --- a/gui_support/app/EDFMSimulatorGuide.m +++ b/gui_support/app/EDFMSimulatorGuide.m @@ -11,7 +11,7 @@ if nargin > 0 && ischar(varargin{1}) end startup; -handles = createEDFMSimulatorGuideLayout(); +handles = loadOrCreateGuideLayout(); fig = handles.UIFigure; app = EDFMGuideApp(handles); app.Controller = EDFMAppController(app); @@ -25,6 +25,17 @@ if nargout > 0 end end +function handles = loadOrCreateGuideLayout() +figFile = fullfile(fileparts(mfilename('fullpath')), 'EDFMSimulatorGuide.fig'); +if exist(figFile, 'file') == 2 + fig = openfig(figFile, 'reuse', 'invisible'); + handles = guihandles(fig); + handles.UIFigure = fig; +else + handles = createEDFMSimulatorGuideLayout(); +end +end + function configureGuideCallbacks(app, fig) app.NewConfigButton.ButtonPushedFcn = @(src, event) onNewConfig(fig); app.LoadTemplateButton.ButtonPushedFcn = @(src, event) onLoadTemplate(fig); diff --git a/gui_support/app/build_edfm_guide_fig.m b/gui_support/app/build_edfm_guide_fig.m new file mode 100644 index 0000000..3938529 --- /dev/null +++ b/gui_support/app/build_edfm_guide_fig.m @@ -0,0 +1,17 @@ +function figPath = build_edfm_guide_fig(figPath) +%BUILD_EDFM_GUIDE_FIG Generate an editable GUIDE FIG file for MATLAB R2022a. +% FIGPATH = BUILD_EDFM_GUIDE_FIG() creates EDFMSimulatorGuide.fig next to +% EDFMSimulatorGuide.m. Open the generated FIG with GUIDE to inspect or +% adjust the converted drag-and-drop style layout. + +if nargin < 1 || strlength(string(figPath)) == 0 + figPath = fullfile(fileparts(mfilename('fullpath')), 'EDFMSimulatorGuide.fig'); +end + +startup; +handles = createEDFMSimulatorGuideLayout(); +fig = handles.UIFigure; +set(fig, 'Visible', 'off'); +savefig(fig, figPath); +close(fig); +end