diff --git a/gui_support/app/EDFMAppController.m b/gui_support/app/EDFMAppController.m index f80e93d..8a97c96 100644 --- a/gui_support/app/EDFMAppController.m +++ b/gui_support/app/EDFMAppController.m @@ -26,6 +26,7 @@ classdef EDFMAppController < handle obj.setDropDownItems('GWgas_modelDropDown', {'1', '2'}, '1'); obj.setDropDownItems('OWoil_modelDropDown', {'1', '2'}, '1'); obj.setDropDownItems('MCgas_modelDropDown', {'1', '2'}, '1'); + obj.configureWellTables(); obj.Results = struct(); obj.loadTemplate('case01'); @@ -883,6 +884,7 @@ classdef EDFMAppController < handle if ~isprop(obj.App, propName) return; end + obj.configureSingleTable(propName); if isempty(value) obj.App.(propName).Data = {}; elseif isnumeric(value) @@ -1227,6 +1229,46 @@ classdef EDFMAppController < handle error('Cell value "%s" is not a scalar numeric entry.', string(cellValue)); end + function configureWellTables(obj) + tableNames = {'Well1Table', 'FractureWellLocationTable', 'Well2Table', 'ScheduleTable'}; + for i = 1:numel(tableNames) + obj.configureSingleTable(tableNames{i}); + end + end + + function configureSingleTable(obj, tableName) + if ~isprop(obj.App, tableName) + return; + end + + columnNames = obj.getColumnNamesForTable(tableName); + if isempty(columnNames) + return; + end + + tableHandle = obj.App.(tableName); + tableHandle.ColumnName = columnNames; + tableHandle.RowName = {}; + tableHandle.ColumnEditable = true(1, numel(columnNames)); + end + + function columnNames = getColumnNamesForTable(~, tableName) + switch tableName + case 'Well1Table' + columnNames = {'well_name', 'nperf', 'index_xyz', 'rw', 'skin', 'well_type'}; + case 'FractureWellLocationTable' + columnNames = {'x', 'y', 'z'}; + case 'Well2Table' + columnNames = {'well_name', 'nperf', 'perfnum', 'rw', 'skin', 'well_type'}; + case 'ScheduleTable' + columnNames = {'well_name', 'state(open/close)', 'role(inj/pro)', ... + 'control(const_q/const_pwf)', 'target_1', 'target_2', ... + 'Cs_key', 'Cs_inj', 'Cb_key', 'inj_salinity'}; + otherwise + columnNames = {}; + end + end + function value = firstScalar(~, rawValue) if isempty(rawValue) value = 0; diff --git a/gui_support/app/EDFM_Simulator_App.mlapp b/gui_support/app/EDFM_Simulator_App.mlapp index e78f690..ec3615c 100644 Binary files a/gui_support/app/EDFM_Simulator_App.mlapp and b/gui_support/app/EDFM_Simulator_App.mlapp differ