MangoAutomation/BACnet4J

Wrong object properties defined for weeklySchedule?

Frozenlock opened this issue · 3 comments

The PropertyTypeDefinition for weeklySchedule appears to return inconsistent information (unless I misunderstood something):

getArrayLength -> 7

isArray -> false

Even the other sequence-like methods return false:
isCollection -> false
isList -> false

Shouldn't isArray return true whenever getArrayLength is larger than zero?

According to BACnet Standard 135-2016, it should be a BACnetARRAY [7] of BACnetDailySchedule.

I get the correct output with my (not up to date) fork:

ObjectPropertyTypeDefinition objectPropertyTypeDefinition = ObjectProperties.getObjectPropertyTypeDefinition(ObjectType.schedule, PropertyIdentifier.weeklySchedule);
System.out.println("clazz: " + objectPropertyTypeDefinition.getPropertyTypeDefinition().getClazz());
System.out.println("isCollection: " + objectPropertyTypeDefinition.getPropertyTypeDefinition().isCollection());
System.out.println("isArray: " + objectPropertyTypeDefinition.getPropertyTypeDefinition().isArray());
System.out.println("isList: " + objectPropertyTypeDefinition.getPropertyTypeDefinition().isList());
System.out.println("arrayLength: " + objectPropertyTypeDefinition.getPropertyTypeDefinition().getArrayLength());

// Output:
// clazz: class com.serotonin.bacnet4j.type.constructed.DailySchedule
// isCollection: true
// isArray: true
// isList: false
// arrayLength: 7

I have run the code with the master branch and get the same result.

Yes, you are correct.
I tried again, from scratch, and It was caused by a mistake on my part when retrieving the property.
My apologies.