diff --git a/gui_support/app/EDFMAppController.m b/gui_support/app/EDFMAppController.m index 0e58926..27757eb 100644 --- a/gui_support/app/EDFMAppController.m +++ b/gui_support/app/EDFMAppController.m @@ -25,6 +25,7 @@ classdef EDFMAppController < handle obj.setDropDownItems('GWgas_modelDropDown', {'1'}, '1'); obj.setDropDownItems('OWoil_modelDropDown', {'1', '2'}, '1'); obj.setDropDownItems('MCgas_modelDropDown', {'1'}, '1'); + obj.configureModelSelectionCallbacks(); obj.configureWellTables(); obj.configureFracWellControls(); obj.applyFixedUIState(); @@ -412,6 +413,19 @@ classdef EDFMAppController < handle end methods (Access = private) + function configureModelSelectionCallbacks(obj) + if isprop(obj.App, 'ModelFlowModelDropDown') + obj.App.ModelFlowModelDropDown.ValueChangedFcn = @(src, event) obj.onModelSelectionChanged(); + end + if isprop(obj.App, 'ModelGridModelDropDown') + obj.App.ModelGridModelDropDown.ValueChangedFcn = @(src, event) obj.onModelSelectionChanged(); + end + end + + function onModelSelectionChanged(obj) + obj.syncModelTabs(); + end + function addSupportPaths(obj) addpath(fullfile(obj.ProjectRoot, 'gui_support', 'app')); addpath(fullfile(obj.ProjectRoot, 'gui_support', 'config')); @@ -785,6 +799,10 @@ classdef EDFMAppController < handle function applyFlowVisibility(obj, flowModel) showGasCommon = flowModel ~= 2; + showOilWaterTab = flowModel == 2; + showGasWaterTab = flowModel == 1; + showMultiComponentTab = flowModel == 3; + gasCommonProps = { ... 'GasLabel', ... 'FlowCommonDensityGScEditField', 'DensityGScLabel', ... @@ -797,9 +815,91 @@ classdef EDFMAppController < handle 'FlowCommonGasPLEditField', 'GasPLLabel', ... 'FlowCommonGasKnEditField', 'GasKnLabel', ... 'FlowCommonGasBetaNonDarcyEditField', 'GasBetaNonDarcyLabel'}; + waterCommonProps = { ... + 'WaterLabel', ... + 'FlowCommonDensityWScEditField', 'DensityWScLabel', ... + 'FlowCommonPrwEditField', 'PrwLabel', ... + 'FlowCommonBwiEditField', 'BwiLabel', ... + 'FlowCommonCwEditField', 'CwLabel', ... + 'FlowCommonVwiEditField', 'VwiLabel', ... + 'FlowCommonCvwEditField', 'CvwLabel', ... + 'FlowCommonPGradThresholdEditField', 'PGradThresholdLabel'}; + for i = 1:numel(gasCommonProps) obj.setControlVisible(gasCommonProps{i}, showGasCommon); end + for i = 1:numel(waterCommonProps) + obj.setControlVisible(waterCommonProps{i}, true); + end + + obj.setControlVisible('GasWaterTab', showGasWaterTab); + obj.setControlVisible('OilWaterTab', showOilWaterTab); + obj.setControlVisible('MultiComponentTab', showMultiComponentTab); + obj.setFlowTabControlsVisible('GasWater', showGasWaterTab); + obj.setFlowTabControlsVisible('OilWater', showOilWaterTab); + obj.setFlowTabControlsVisible('MultiComponent', showMultiComponentTab); + + if isprop(obj.App, 'TabGroup2') + switch flowModel + case 1 + if isprop(obj.App, 'GasWaterTab') + obj.App.TabGroup2.SelectedTab = obj.App.GasWaterTab; + end + case 2 + if isprop(obj.App, 'OilWaterTab') + obj.App.TabGroup2.SelectedTab = obj.App.OilWaterTab; + end + otherwise + if isprop(obj.App, 'MultiComponentTab') + obj.App.TabGroup2.SelectedTab = obj.App.MultiComponentTab; + end + end + end + end + + function setFlowTabControlsVisible(obj, flowTabName, isVisible) + switch flowTabName + case 'GasWater' + controlNames = { ... + 'GasWaterTab', ... + 'GWPRFTextArea', 'PRFTextAreaLabel', ... + 'GWRPGWTextArea', 'RPGWTextAreaLabel', ... + 'GWifpcglEditField', 'ifpcglEditFieldLabel'}; + case 'OilWater' + controlNames = { ... + 'OilWaterTab', ... + 'OWoil_modelDropDown', 'oil_modelLabel', ... + 'OWPRFTextArea', 'PRFTextAreaLabel_2', ... + 'OWPRMTextArea', 'PRMTextAreaLabel', ... + 'OWifpcowEditField', 'ifpcowEditFieldLabel', ... + 'OWcvoEditField', 'cvoEditFieldLabel', ... + 'OWvoiEditField', 'voiEditFieldLabel', ... + 'OWcoEditField', 'coEditFieldLabel', ... + 'OWBoiEditField', 'BoiEditFieldLabel', ... + 'OWproEditField', 'proEditFieldLabel', ... + 'OWdensity_o_scEditField', 'density_o_scEditFieldLabel'}; + case 'MultiComponent' + controlNames = { ... + 'MultiComponentTab', ... + 'MCstress_factor_ref_pressureEditField', 'stress_factor_ref_pressureEditFieldLabel_2', ... + 'MCstress_factor_matrixEditField', 'stress_factor_matrixEditFieldLabel_2', ... + 'MCstress_factor_fractureEditField', 'stress_factor_fractureEditFieldLabel_2', ... + 'MCifpcglEditField', 'ifpcglEditFieldLabel_2', ... + 'MCPC_fractureTextArea', 'PC_fractureTextAreaLabel', ... + 'MCkr_surf_fractureTextArea', 'kr_surf_fractureTextAreaLabel', ... + 'MCkr_nosurf_fractureTextArea', 'kr_nosurf_fractureTextAreaLabel', ... + 'MCcs_Nc_fractureTextArea', 'cs_Nc_fractureTextAreaLabel', ... + 'MCPCTextArea', 'PCTextAreaLabel', ... + 'MCkr_surfTextArea', 'kr_surfTextAreaLabel', ... + 'MCkr_nosurfTextArea', 'kr_nosurfTextAreaLabel', ... + 'MCcs_NcTextArea', 'cs_NcTextAreaLabel'}; + otherwise + controlNames = {}; + end + + for i = 1:numel(controlNames) + obj.setControlVisible(controlNames{i}, isVisible); + end end function commonData = getCommonFlowSource(obj, c) diff --git a/gui_support/app/EDFM_Simulator_App.mlapp b/gui_support/app/EDFM_Simulator_App.mlapp index feda5ff..ad44681 100644 Binary files a/gui_support/app/EDFM_Simulator_App.mlapp and b/gui_support/app/EDFM_Simulator_App.mlapp differ diff --git a/gui_support/app/config1.mat b/gui_support/app/config1.mat new file mode 100644 index 0000000..38cd220 Binary files /dev/null and b/gui_support/app/config1.mat differ diff --git a/gui_support/app/results1.mat b/gui_support/app/results1.mat new file mode 100644 index 0000000..2c6f63e Binary files /dev/null and b/gui_support/app/results1.mat differ