@@ -505,13 +505,16 @@ public CompletableFuture<PlcBrowseResponse> browseWithInterceptor(PlcBrowseReque
505
505
options .put ("size-in-bytes" , new PlcUDINT (symbol .getSize ()));
506
506
507
507
if (plc4xPlcValueType == org .apache .plc4x .java .api .types .PlcValueType .List ) {
508
- List <ArrayInfo > arrayInfo = new ArrayList <>();
508
+ List <ArrayInfo > arrayInfo = new ArrayList <>(dataType .getArrayInfo ().size ());
509
+ List <PlcBrowseItemArrayInfo > itemArrayInfo = new ArrayList <>(dataType .getArrayInfo ().size ());
509
510
for (AdsDataTypeArrayInfo adsDataTypeArrayInfo : dataType .getArrayInfo ()) {
510
511
arrayInfo .add (new DefaultArrayInfo (
511
512
(int ) adsDataTypeArrayInfo .getLowerBound (), (int ) adsDataTypeArrayInfo .getUpperBound ()));
513
+ itemArrayInfo .add (new DefaultPlcBrowseItemArrayInfo (
514
+ adsDataTypeArrayInfo .getLowerBound (), adsDataTypeArrayInfo .getUpperBound ()));
512
515
}
513
516
DefaultListPlcBrowseItem item = new DefaultListPlcBrowseItem (new SymbolicAdsTag (symbol .getName (), plc4xPlcValueType , arrayInfo ), itemName ,
514
- true , !symbol .getFlagReadOnly (), true , childMap , options );
517
+ true , !symbol .getFlagReadOnly (), true , childMap , options , itemArrayInfo );
515
518
516
519
// Check if this item should be added to the result
517
520
if (interceptor .intercept (item )) {
@@ -571,17 +574,23 @@ protected List<PlcBrowseItem> getBrowseItems(String basePath, long baseGroupId,
571
574
options .put ("size-in-bytes" , new PlcUDINT (childDataType .getSize ()));
572
575
573
576
if (plc4xPlcValueType == org .apache .plc4x .java .api .types .PlcValueType .List ) {
574
- List <ArrayInfo > arrayInfo = new ArrayList <>();
577
+ List <ArrayInfo > arrayInfo = new ArrayList <>(childDataType .getArrayInfo ().size ());
578
+ List <PlcBrowseItemArrayInfo > itemArrayInfo = new ArrayList <>(childDataType .getArrayInfo ().size ());
575
579
for (AdsDataTypeArrayInfo adsDataTypeArrayInfo : childDataType .getArrayInfo ()) {
576
580
arrayInfo .add (new DefaultArrayInfo (
577
581
(int ) adsDataTypeArrayInfo .getLowerBound (), (int ) adsDataTypeArrayInfo .getUpperBound ()));
582
+ itemArrayInfo .add (new DefaultPlcBrowseItemArrayInfo (
583
+ adsDataTypeArrayInfo .getLowerBound (), adsDataTypeArrayInfo .getUpperBound ()));
578
584
}
579
585
// Add the type itself.
580
- values .add (new DefaultListPlcBrowseItem (new SymbolicAdsTag (basePath + "." + child .getPropertyName (), plc4xPlcValueType , arrayInfo ), itemName ,
581
- true , parentWritable , true , childMap , options ));
586
+ values .add (new DefaultListPlcBrowseItem (new SymbolicAdsTag (
587
+ basePath + "." + child .getPropertyName (), plc4xPlcValueType , arrayInfo ), itemName ,
588
+ true , parentWritable , true , childMap , options , itemArrayInfo ));
582
589
} else {
583
590
// Add the type itself.
584
- values .add (new DefaultPlcBrowseItem (new SymbolicAdsTag (basePath + "." + child .getPropertyName (), plc4xPlcValueType , Collections .emptyList ()), itemName ,
591
+ values .add (new DefaultPlcBrowseItem (new SymbolicAdsTag (
592
+ basePath + "." + child .getPropertyName (), plc4xPlcValueType ,
593
+ Collections .emptyList ()), itemName ,
585
594
true , parentWritable , true , childMap , options ));
586
595
}
587
596
}
0 commit comments