ui modify
This commit is contained in:
@@ -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;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user