getAllProps static method
Implementation
static List<Property> getAllProps(DeviceIot device) {
List<Property> list = [];
if (device.nodes.length > 0) {
device.nodes.forEach((node) {
if (node.isConfig == true) return;
int nodeCount = 1;
int minIndex = 0;
int maxIndex = 0;
if (node.array.length > 0) {
// multiple nodes
List<String> splitArr = node.array.split("-");
maxIndex = int.parse(splitArr[1]);
minIndex = int.parse(splitArr[0]);
nodeCount = maxIndex - minIndex + 1;
}
for (int i = minIndex; i < maxIndex + 1; i++) {
node.properties.forEach((prop) {
Property property = Property.copyFrom(prop);
if (nodeCount != 1) {
property.parentId = "${prop.parentId}_${i.toString()}";
property.name = "${prop.name} ${i.toString()}";
}
list.add(property);
});
}
});
}
return list;
}