Skip to content

Commit 713ede3

Browse files
committed
refs #52: Update interface of computeColSum
1 parent 38187b6 commit 713ede3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ExternData/Examples/package.mo

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ package Examples "Test examples"
8181
Modelica.Blocks.Sources.ContinuousClock clock annotation(Placement(transformation(extent={{-50,60},{-30,80}})));
8282
final parameter Integer m = dataSource.getArrayRows2D("table1") "Number of rows in 2D array";
8383
Modelica.Blocks.Sources.TimeTable timeTable(table=dataSource.getRealArray2D("A1", "table1", 3, 2)) annotation(Placement(transformation(extent={{-50,30},{-30,50}})));
84-
final parameter Real sumB = computeColSum(dataSource, "B") "Sum of column B";
84+
final parameter Real sumB = computeColSum(dataSource.xls, "B") "Sum of column B";
8585
function computeColSum "Compute column sum"
8686
extends Modelica.Icons.Function;
87-
input ExternData.XLSFile dataSource "Excel XLS file record";
87+
input ExternData.Types.ExternXLSFile xls "External Excel XLS file object";
8888
input String col = "A" "Column";
8989
input String sheetName = "" "Sheet name";
9090
input Integer startRow = 2 "Start row";
91-
input Integer endRow = ExternData.Functions.XLS.getArrayRows2D(sheetName=sheetName, xls=dataSource.xls) "End row";
91+
input Integer endRow = ExternData.Functions.XLS.getArrayRows2D(sheetName=sheetName, xls=xls) "End row";
9292
output Real colSum "Column sum";
9393
protected
9494
Real val;
9595
Boolean exist;
9696
algorithm
9797
colSum := 0.0;
9898
for row in startRow:endRow loop
99-
(val, exist) := ExternData.Functions.XLS.getReal(cellAddress=col + String(row), sheetName=sheetName, xls=dataSource.xls);
99+
(val, exist) := ExternData.Functions.XLS.getReal(cellAddress=col + String(row), sheetName=sheetName, xls=xls);
100100
if exist then
101101
colSum := colSum + val;
102102
end if;
@@ -119,22 +119,22 @@ package Examples "Test examples"
119119
Modelica.Blocks.Sources.ContinuousClock clock annotation(Placement(transformation(extent={{-50,60},{-30,80}})));
120120
final parameter Integer m = dataSource.getArrayRows2D("table1") "Number of rows in 2D array";
121121
Modelica.Blocks.Sources.TimeTable timeTable(table=dataSource.getRealArray2D("A1", "table1", 3, 2)) annotation(Placement(transformation(extent={{-50,30},{-30,50}})));
122-
final parameter Real sumB = computeColSum(dataSource, "B") "Sum of column B";
122+
final parameter Real sumB = computeColSum(dataSource.xlsx, "B") "Sum of column B";
123123
function computeColSum "Compute column sum"
124124
extends Modelica.Icons.Function;
125-
input ExternData.XLSXFile dataSource "Excel XLSX file record";
125+
input ExternData.Types.ExternXLSXFile xlsx "External Excel XLSX file object";
126126
input String col = "A" "Column";
127127
input String sheetName = "" "Sheet name";
128128
input Integer startRow = 2 "Start row";
129-
input Integer endRow = ExternData.Functions.XLSX.getArrayRows2D(sheetName=sheetName, xlsx=dataSource.xlsx) "End row";
129+
input Integer endRow = ExternData.Functions.XLSX.getArrayRows2D(sheetName=sheetName, xlsx=xlsx) "End row";
130130
output Real colSum "Column sum";
131131
protected
132132
Real val;
133133
Boolean exist;
134134
algorithm
135135
colSum := 0.0;
136136
for row in startRow:endRow loop
137-
(val, exist) := ExternData.Functions.XLSX.getReal(cellAddress=col + String(row), sheetName=sheetName, xlsx=dataSource.xlsx);
137+
(val, exist) := ExternData.Functions.XLSX.getReal(cellAddress=col + String(row), sheetName=sheetName, xlsx=xlsx);
138138
if exist then
139139
colSum := colSum + val;
140140
end if;

0 commit comments

Comments
 (0)