Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.listOfProperties = \
[ (ReadableProperty,'presentValue', CharacterString)
, (ReadableProperty,'statusFlags', StatusFlags)
, (OptionalProperty,'eventState', EventState)
, (OptionalProperty,'reliability', Reliability)
, (OptionalProperty,'outOfService', Boolean)
, (OptionalProperty,'priorityArray', PriorityArray)
, (OptionalProperty,'relinquishDefault', CharacterString)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'alarmValues', ArrayOf(OptionalCharacterString))
, (OptionalProperty,'faultValues', ArrayOf(OptionalCharacterString))
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
if _debug: Test_EventEnrollmentObject._debug("Test_EventEnrollmentObject")
self.obj = EventEnrollmentObject()
self.objType = 'eventEnrollment'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 20
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'eventType', EventType)
, (ReadableProperty,'notifyType', NotifyType)
, (ReadableProperty,'eventParameters', EventParameter)
, (ReadableProperty,'objectPropertyReference', DeviceObjectPropertyReference)
, (ReadableProperty,'eventState', EventState)
, (ReadableProperty,'eventEnable', EventTransitionBits)
, (ReadableProperty,'ackedTransitions', EventTransitionBits)
, (ReadableProperty,'notificationClass', Unsigned)
, (ReadableProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'reliability', Reliability)
, (OptionalProperty,'faultType', FaultType)
, (OptionalProperty,'faultParameters', FaultParameter)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
if _debug: Test_AccessPointObject._debug("Test_AccessPointObject")
self.obj = AccessPointObject()
self.objType = 'accessPoint'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 46
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'eventState', EventState)
, (ReadableProperty,'reliability', Reliability)
, (ReadableProperty,'outOfService', Boolean)
, (ReadableProperty,'authenticationStatus', AuthenticationStatus)
, (ReadableProperty,'activeAuthenticationPolicy', Unsigned)
, (ReadableProperty,'numberOfAuthenticationPolicies', Unsigned)
, (OptionalProperty,'authenticationPolicyList', ArrayOf(AuthenticationPolicy))
, (OptionalProperty,'authenticationPolicyNames', ArrayOf(CharacterString))
, (ReadableProperty,'authorizationMode', AuthorizationMode)
, (OptionalProperty,'verificationTime', Unsigned)
, (OptionalProperty,'lockout', Boolean)
, (OptionalProperty,'lockoutRelinquishTime', Unsigned)
, (OptionalProperty,'failedAttempts', Unsigned)
, (OptionalProperty,'failedAttemptEvents', SequenceOf(AccessEvent))
, (OptionalProperty,'maxFailedAttempts', Unsigned)
, (OptionalProperty,'failedAttemptsTime', Unsigned)
, (OptionalProperty,'threatLevel', AccessThreatLevel)
, (OptionalProperty,'occupancyUpperLimitEnforced', Boolean)
, (OptionalProperty,'occupancyLowerLimitEnforced', Boolean)
, (OptionalProperty,'occupancyCountAdjust', Boolean)
, (OptionalProperty,'accompanimentTime', Unsigned)
, (ReadableProperty,'accessEvent', AccessEvent)
, (ReadableProperty,'accessEventTag', Unsigned)
, (ReadableProperty,'accessEventTime', TimeStamp)
, (OptionalProperty,'reliability', Reliability)
, (OptionalProperty,'outOfService', Boolean)
, (ReadableProperty,'units', EngineeringUnits)
, (OptionalProperty,'priorityArray', PriorityArray)
, (OptionalProperty,'relinquishDefault', Unsigned)
, (OptionalProperty,'covIncrement', Unsigned)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'highLimit', Unsigned)
, (OptionalProperty,'lowLimit', Unsigned)
, (OptionalProperty,'deadband', Unsigned)
, (OptionalProperty,'limitEnable', LimitEnable)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
, (OptionalProperty,'minPresValue', Unsigned)
, (OptionalProperty,'maxPresValue', Unsigned)
, (OptionalProperty,'resolution', Unsigned)
]
, (ReadableProperty,'polarity', Polarity)
, (OptionalProperty,'inactiveText', CharacterString)
, (OptionalProperty,'activeText', CharacterString)
, (OptionalProperty,'changeOfStateTime', DateTime)
, (OptionalProperty,'changeOfStateCount', Unsigned)
, (OptionalProperty,'timeOfStateCountReset', DateTime)
, (OptionalProperty,'elapsedActiveTime', Unsigned)
, (OptionalProperty,'timeOfActiveTimeReset', DateTime)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'alarmValue', BinaryPV)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
, (OptionalProperty,'deviceType', CharacterString)
, (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'eventState', EventState)
, (OptionalProperty,'reliability', Reliability)
, (ReadableProperty,'outOfService', Boolean)
, (ReadableProperty,'numberOfStates', Unsigned)
, (OptionalProperty,'stateText', ArrayOf(CharacterString))
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'alarmValues', SequenceOf(Unsigned))
, (OptionalProperty,'faultValues', SequenceOf(Unsigned))
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
self.listOfProperties = \
[ (ReadableProperty,'presentValue', ShedState)
, (OptionalProperty,'stateDescription', CharacterString)
, (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'eventState', EventState)
, (OptionalProperty,'reliability', Reliability)
, (WritableProperty,'requestedShedLevel', ShedLevel)
, (WritableProperty,'startTime', DateTime)
, (WritableProperty,'shedDuration', Unsigned)
, (WritableProperty,'dutyWindow', Unsigned)
, (WritableProperty,'enable', Boolean)
, (OptionalProperty,'fullDutyBaseline', Real)
, (ReadableProperty,'expectedShedLevel', ShedLevel)
, (ReadableProperty,'actualShedLevel', ShedLevel)
, (WritableProperty,'shedLevels', ArrayOf(Unsigned))
, (ReadableProperty,'shedLevelDescriptions', ArrayOf(CharacterString))
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
, (OptionalProperty,'bitText', ArrayOf(CharacterString))
, (ReadableProperty,'statusFlags', StatusFlags)
, (OptionalProperty,'eventState', EventState)
, (OptionalProperty,'reliability', Reliability)
, (OptionalProperty,'outOfService', Boolean)
, (OptionalProperty,'priorityArray', PriorityArray)
, (OptionalProperty,'relinquishDefault', BitString)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'alarmValues', ArrayOf(BitString))
, (OptionalProperty,'bitMask', BitString)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
]
, (ReadableProperty,'presentValue', ArrayOf(PropertyAccessResult))
, (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'eventState', EventState)
, (ReadableProperty,'memberStatusFlags', StatusFlags)
, (OptionalProperty,'reliability', Reliability)
, (ReadableProperty,'outOfService', Boolean)
, (OptionalProperty,'updateInterval', Unsigned)
, (OptionalProperty,'requestedUpdateInterval', Unsigned)
, (OptionalProperty,'covResubscriptionInterval', Unsigned)
, (OptionalProperty,'clientCovIncrement', ClientCOV)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'covuPeriod', Unsigned)
, (OptionalProperty,'covuRecipients', SequenceOf(Recipient))
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
args = ConfigArgumentParser(description=__doc__).parse_args()
if _debug: _log.debug("initialization")
if _debug: _log.debug(" - args: %r", args)
# make a device object
this_device = LocalDeviceObject(ini=args.ini)
if _debug: _log.debug(" - this_device: %r", this_device)
# make a sample application
this_application = ReadPropertyMultipleApplication(this_device, args.ini.address)
# make a random input object
ravo1 = RandomAnalogValueObject(
objectIdentifier=('analogValue', 1), objectName='Random1',
eventMessageTexts=ArrayOf(CharacterString)(["hello"]),
)
_log.debug(" - ravo1: %r", ravo1)
ravo2 = RandomAnalogValueObject(
objectIdentifier=('analogValue', 2), objectName='Random2'
)
_log.debug(" - ravo2: %r", ravo2)
# add it to the device
this_application.add_object(ravo1)
this_application.add_object(ravo2)
_log.debug(" - object list: %r", this_device.objectList)
_log.debug("running")
run()