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>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-28 03:34:20 +00:00
committed by GitHub
co-authored by kk14222
parent dd42a8f138
commit f10831f06b
2 changed files with 29 additions and 1 deletions
+12 -1
View File
@@ -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);
+17
View File
@@ -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