def _read_datavalue_history(self, rv, details): starttime = details.StartTime if rv.ContinuationPoint: # Spec says we should ignore details if cont point is present # but they also say we can use cont point as timestamp to enable stateless # implementation. This is contradictory, so we assume details is # send correctly with continuation point starttime = ua.unpack_datetime(utils.Buffer(rv.ContinuationPoint)) dv, cont = self.storage.read_node_history(rv.NodeId, starttime, details.EndTime, details.NumValuesPerNode) if cont: cont = ua.pack_datetime(cont) # rv.IndexRange # rv.DataEncoding # xml or binary, seems spec say we can ignore that one return dv, cont
def _read_event_history(self, rv, details): starttime = details.StartTime if rv.ContinuationPoint: # Spec says we should ignore details if cont point is present # but they also say we can use cont point as timestamp to enable stateless # implementation. This is contradictory, so we assume details is # send correctly with continuation point # starttime = bytes_to_datetime(rv.ContinuationPoint) starttime = ua.unpack_datetime(utils.Buffer(rv.ContinuationPoint)) ev, cont = self.storage.read_event_history(rv.NodeId, starttime, details.EndTime, details.NumValuesPerNode, details.Filter) if cont: # cont = datetime_to_bytes(dv[-1].ServerTimestamp) cont = ua.pack_datetime(cont) return ev, cont
def _read_event_history(self, rv, details): starttime = details.StartTime if rv.ContinuationPoint: # Spec says we should ignore details if cont point is present # but they also say we can use cont point as timestamp to enable stateless # implementation. This is contradictory, so we assume details is # send correctly with continuation point starttime = ua.unpack_datetime(utils.Buffer(rv.ContinuationPoint)) evts, cont = self.storage.read_event_history(rv.NodeId, starttime, details.EndTime, details.NumValuesPerNode, details.Filter) results = [] for ev in evts: field_list = ua.HistoryEventFieldList() field_list.EventFields = ev.to_event_fields( details.Filter.SelectClauses) results.append(field_list) if cont: cont = ua.pack_datetime(cont) return results, cont
def _read_event_history(self, rv, details): starttime = details.StartTime if rv.ContinuationPoint: # Spec says we should ignore details if cont point is present # but they also say we can use cont point as timestamp to enable stateless # implementation. This is contradictory, so we assume details is # send correctly with continuation point starttime = ua.unpack_datetime(utils.Buffer(rv.ContinuationPoint)) evts, cont = self.storage.read_event_history(rv.NodeId, starttime, details.EndTime, details.NumValuesPerNode, details.Filter) results = [] for ev in evts: field_list = ua.HistoryEventFieldList() field_list.EventFields = ev.to_event_fields(details.Filter.SelectClauses) results.append(field_list) if cont: cont = ua.pack_datetime(cont) return results, cont