@@ -81,22 +81,22 @@ package Examples "Test examples"
81
81
Modelica.Blocks.Sources.ContinuousClock clock annotation(Placement(transformation(extent={{-50,60},{-30,80}})));
82
82
final parameter Integer m = dataSource.getArrayRows2D("table1" ) "Number of rows in 2D array" ;
83
83
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" ;
85
85
function computeColSum "Compute column sum"
86
86
extends Modelica.Icons.Function;
87
- input ExternData.XLSFile dataSource " Excel XLS file record " ;
87
+ input ExternData.Types.ExternXLSFile xls "External Excel XLS file object " ;
88
88
input String col = "A" "Column" ;
89
89
input String sheetName = "" "Sheet name" ;
90
90
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" ;
92
92
output Real colSum "Column sum" ;
93
93
protected
94
94
Real val;
95
95
Boolean exist;
96
96
algorithm
97
97
colSum := 0.0 ;
98
98
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);
100
100
if exist then
101
101
colSum := colSum + val;
102
102
end if ;
@@ -119,22 +119,22 @@ package Examples "Test examples"
119
119
Modelica.Blocks.Sources.ContinuousClock clock annotation(Placement(transformation(extent={{-50,60},{-30,80}})));
120
120
final parameter Integer m = dataSource.getArrayRows2D("table1" ) "Number of rows in 2D array" ;
121
121
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" ;
123
123
function computeColSum "Compute column sum"
124
124
extends Modelica.Icons.Function;
125
- input ExternData.XLSXFile dataSource " Excel XLSX file record " ;
125
+ input ExternData.Types.ExternXLSXFile xlsx "External Excel XLSX file object " ;
126
126
input String col = "A" "Column" ;
127
127
input String sheetName = "" "Sheet name" ;
128
128
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" ;
130
130
output Real colSum "Column sum" ;
131
131
protected
132
132
Real val;
133
133
Boolean exist;
134
134
algorithm
135
135
colSum := 0.0 ;
136
136
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);
138
138
if exist then
139
139
colSum := colSum + val;
140
140
end if ;
0 commit comments