|
@@ 12113-12171 (lines=59) @@
|
| 12110 |
|
('RevisedQueueSize', 'UInt32'), |
| 12111 |
|
('FilterResult', 'ExtensionObject'), |
| 12112 |
|
) |
| 12113 |
|
|
| 12114 |
|
def __init__(self, binary=None): |
| 12115 |
|
if binary is not None: |
| 12116 |
|
self._binary_init(binary) |
| 12117 |
|
self._freeze = True |
| 12118 |
|
return |
| 12119 |
|
self.StatusCode = StatusCode() |
| 12120 |
|
self.RevisedSamplingInterval = 0 |
| 12121 |
|
self.RevisedQueueSize = 0 |
| 12122 |
|
self.FilterResult = None |
| 12123 |
|
self._freeze = True |
| 12124 |
|
|
| 12125 |
|
def to_binary(self): |
| 12126 |
|
packet = [] |
| 12127 |
|
packet.append(self.StatusCode.to_binary()) |
| 12128 |
|
packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval)) |
| 12129 |
|
packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize)) |
| 12130 |
|
packet.append(extensionobject_to_binary(self.FilterResult)) |
| 12131 |
|
return b''.join(packet) |
| 12132 |
|
|
| 12133 |
|
@staticmethod |
| 12134 |
|
def from_binary(data): |
| 12135 |
|
return MonitoredItemModifyResult(data) |
| 12136 |
|
|
| 12137 |
|
def _binary_init(self, data): |
| 12138 |
|
self.StatusCode = StatusCode.from_binary(data) |
| 12139 |
|
self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data) |
| 12140 |
|
self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data) |
| 12141 |
|
self.FilterResult = extensionobject_from_binary(data) |
| 12142 |
|
|
| 12143 |
|
def __str__(self): |
| 12144 |
|
return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \ |
| 12145 |
|
'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \ |
| 12146 |
|
'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \ |
| 12147 |
|
'FilterResult:' + str(self.FilterResult) + ')' |
| 12148 |
|
|
| 12149 |
|
__repr__ = __str__ |
| 12150 |
|
|
| 12151 |
|
|
| 12152 |
|
class ModifyMonitoredItemsParameters(FrozenClass): |
| 12153 |
|
''' |
| 12154 |
|
:ivar SubscriptionId: |
| 12155 |
|
:vartype SubscriptionId: UInt32 |
| 12156 |
|
:ivar TimestampsToReturn: |
| 12157 |
|
:vartype TimestampsToReturn: TimestampsToReturn |
| 12158 |
|
:ivar ItemsToModify: |
| 12159 |
|
:vartype ItemsToModify: MonitoredItemModifyRequest |
| 12160 |
|
''' |
| 12161 |
|
|
| 12162 |
|
ua_types = ( |
| 12163 |
|
|
| 12164 |
|
('SubscriptionId', 'UInt32'), |
| 12165 |
|
('TimestampsToReturn', 'TimestampsToReturn'), |
| 12166 |
|
('ItemsToModify', 'ListOfMonitoredItemModifyRequest'), |
| 12167 |
|
) |
| 12168 |
|
|
| 12169 |
|
def __init__(self, binary=None): |
| 12170 |
|
if binary is not None: |
| 12171 |
|
self._binary_init(binary) |
| 12172 |
|
self._freeze = True |
| 12173 |
|
return |
| 12174 |
|
self.SubscriptionId = 0 |
|
@@ 1607-1663 (lines=57) @@
|
| 1604 |
|
self._freeze = True |
| 1605 |
|
|
| 1606 |
|
def to_binary(self): |
| 1607 |
|
packet = [] |
| 1608 |
|
packet.append(uabin.Primitives.DateTime.pack(self.Timestamp)) |
| 1609 |
|
packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle)) |
| 1610 |
|
packet.append(self.ServiceResult.to_binary()) |
| 1611 |
|
packet.append(self.ServiceDiagnostics.to_binary()) |
| 1612 |
|
packet.append(uabin.Primitives.Int32.pack(len(self.StringTable))) |
| 1613 |
|
for fieldname in self.StringTable: |
| 1614 |
|
packet.append(uabin.Primitives.String.pack(fieldname)) |
| 1615 |
|
packet.append(extensionobject_to_binary(self.AdditionalHeader)) |
| 1616 |
|
return b''.join(packet) |
| 1617 |
|
|
| 1618 |
|
@staticmethod |
| 1619 |
|
def from_binary(data): |
| 1620 |
|
return ResponseHeader(data) |
| 1621 |
|
|
| 1622 |
|
def _binary_init(self, data): |
| 1623 |
|
self.Timestamp = uabin.Primitives.DateTime.unpack(data) |
| 1624 |
|
self.RequestHandle = uabin.Primitives.UInt32.unpack(data) |
| 1625 |
|
self.ServiceResult = StatusCode.from_binary(data) |
| 1626 |
|
self.ServiceDiagnostics = DiagnosticInfo.from_binary(data) |
| 1627 |
|
self.StringTable = uabin.Primitives.String.unpack_array(data) |
| 1628 |
|
self.AdditionalHeader = extensionobject_from_binary(data) |
| 1629 |
|
|
| 1630 |
|
def __str__(self): |
| 1631 |
|
return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \ |
| 1632 |
|
'RequestHandle:' + str(self.RequestHandle) + ', ' + \ |
| 1633 |
|
'ServiceResult:' + str(self.ServiceResult) + ', ' + \ |
| 1634 |
|
'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \ |
| 1635 |
|
'StringTable:' + str(self.StringTable) + ', ' + \ |
| 1636 |
|
'AdditionalHeader:' + str(self.AdditionalHeader) + ')' |
| 1637 |
|
|
| 1638 |
|
__repr__ = __str__ |
| 1639 |
|
|
| 1640 |
|
|
| 1641 |
|
class ServiceFault(FrozenClass): |
| 1642 |
|
''' |
| 1643 |
|
The response returned by all services when there is a service level error. |
| 1644 |
|
|
| 1645 |
|
:ivar TypeId: |
| 1646 |
|
:vartype TypeId: NodeId |
| 1647 |
|
:ivar ResponseHeader: |
| 1648 |
|
:vartype ResponseHeader: ResponseHeader |
| 1649 |
|
''' |
| 1650 |
|
|
| 1651 |
|
ua_types = ( |
| 1652 |
|
|
| 1653 |
|
('TypeId', 'NodeId'), |
| 1654 |
|
('ResponseHeader', 'ResponseHeader'), |
| 1655 |
|
) |
| 1656 |
|
|
| 1657 |
|
def __init__(self, binary=None): |
| 1658 |
|
if binary is not None: |
| 1659 |
|
self._binary_init(binary) |
| 1660 |
|
self._freeze = True |
| 1661 |
|
return |
| 1662 |
|
self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary) |
| 1663 |
|
self.ResponseHeader = ResponseHeader() |
| 1664 |
|
self._freeze = True |
| 1665 |
|
|
| 1666 |
|
def to_binary(self): |