bugfix for guide

This commit is contained in:
kk
2026-04-28 22:00:30 +08:00
parent fb54f4512b
commit b66db49cff
8 changed files with 390 additions and 59 deletions
+76
View File
@@ -0,0 +1,76 @@
# GUIDE Version Run Notes
The MATLAB R2022a entry point now launches the GUIDE-compatible UI. GUIDE does not support `uitabgroup` or `uitab`, so this UI uses GUIDE-supported `uipanel` containers plus `popupmenu` selectors to simulate pages.
Main files:
- `gui_support/app/EDFMSimulatorGuide.fig`
- `gui_support/app/EDFMSimulatorGuide.m`
## Run
In MATLAB R2022a:
```matlab
cd('C:\Users\15715\Documents\3D_EDFM_SIM-X')
startup
app = launch_edfm_simulator_guide;
```
The generic launcher also starts the GUIDE version:
```matlab
cd('C:\Users\15715\Documents\3D_EDFM_SIM-X')
startup
app = launch_edfm_simulator_app;
```
## Edit With GUIDE
Open the FIG in GUIDE:
```matlab
guide('C:\Users\15715\Documents\3D_EDFM_SIM-X\gui_support\app\EDFMSimulatorGuide.fig')
```
The top-level page selector is `PageDropDown`. Each page is a stacked `uipanel`, such as `ModelTab`, `GridTab`, `FlowTab`, and `ResultsTab`.
Because the page panels overlap, simply setting one panel to `Visible=on` may still leave another visible panel covering it. The most reliable editing workflow is to open GUIDE through the page helper:
```matlab
edit_edfm_guide_page('Model')
edit_edfm_guide_page('Flow')
edit_edfm_guide_page('Results')
```
For inner pages:
```matlab
edit_edfm_guide_page('SP')
edit_edfm_guide_page('DP')
edit_edfm_guide_page('GasWater')
edit_edfm_guide_page('OilWater')
edit_edfm_guide_page('MultiComponent')
```
This helper updates the same `EDFMSimulatorGuide.fig` file before opening GUIDE: it turns the other panels in the same group off, brings the selected panel to the top, saves the FIG, and then opens GUIDE. Save and close an already-open GUIDE editor before switching pages with this command, otherwise GUIDE may keep an older in-memory copy.
`show_edfm_guide_page` is lower-level and only works on a normal open figure handle. GUIDE's design window is not always exposed as a normal MATLAB figure, so prefer `edit_edfm_guide_page` for day-to-day editing.
The Property Inspector title may show `matlab.ui.container.Panel`. That is the object class, not the page name. Check the `Tag` property to confirm whether the selected panel is `ResultsTab`, `FlowTab`, or another page.
Do not freely rename control `Tag` values. `EDFMSimulatorGuide.m` and `EDFMAppController.m` use these tags to find controls and bind callbacks.
## Regenerate FIG
If the FIG is lost or damaged, regenerate it from the layout script:
```matlab
cd('C:\Users\15715\Documents\3D_EDFM_SIM-X')
startup
build_edfm_guide_fig
```
This is only a recovery path. Day-to-day UI maintenance should edit `EDFMSimulatorGuide.fig` in GUIDE.
Do not change the page containers back to `uitabgroup`. MATLAB can display `uitabgroup` at runtime, but GUIDE deletes it when opening the FIG.