|
@@ 408-423 (lines=16) @@
|
| 405 |
|
result = self.history_read_events(details) |
| 406 |
|
return result.HistoryData.Events |
| 407 |
|
|
| 408 |
|
def history_read_events(self, details): |
| 409 |
|
""" |
| 410 |
|
Read event history of a node, low-level function |
| 411 |
|
result code from server is checked and an exception is raised in case of error |
| 412 |
|
""" |
| 413 |
|
valueid = ua.HistoryReadValueId() |
| 414 |
|
valueid.NodeId = self.nodeid |
| 415 |
|
valueid.IndexRange = '' |
| 416 |
|
|
| 417 |
|
params = ua.HistoryReadParameters() |
| 418 |
|
params.HistoryReadDetails = details |
| 419 |
|
params.TimestampsToReturn = ua.TimestampsToReturn.Both |
| 420 |
|
params.ReleaseContinuationPoints = False |
| 421 |
|
params.NodesToRead.append(valueid) |
| 422 |
|
result = self.server.history_read(params)[0] |
| 423 |
|
return result |
| 424 |
|
|
| 425 |
|
# Hack for convenience methods |
| 426 |
|
# local import is ugly but necessary for python2 support |
|
@@ 363-378 (lines=16) @@
|
| 360 |
|
result = self.history_read(details) |
| 361 |
|
return result.HistoryData.DataValues |
| 362 |
|
|
| 363 |
|
def history_read(self, details): |
| 364 |
|
""" |
| 365 |
|
Read raw history of a node, low-level function |
| 366 |
|
result code from server is checked and an exception is raised in case of error |
| 367 |
|
""" |
| 368 |
|
valueid = ua.HistoryReadValueId() |
| 369 |
|
valueid.NodeId = self.nodeid |
| 370 |
|
valueid.IndexRange = '' |
| 371 |
|
|
| 372 |
|
params = ua.HistoryReadParameters() |
| 373 |
|
params.HistoryReadDetails = details |
| 374 |
|
params.TimestampsToReturn = ua.TimestampsToReturn.Both |
| 375 |
|
params.ReleaseContinuationPoints = False |
| 376 |
|
params.NodesToRead.append(valueid) |
| 377 |
|
result = self.server.history_read(params)[0] |
| 378 |
|
return result |
| 379 |
|
|
| 380 |
|
def read_event_history(self, evfilter, starttime=None, endtime=None, numvalues=0): |
| 381 |
|
""" |