MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / _get_bounds

Method _get_bounds

opcua/server/history_sql.py:259–282  ·  view source on GitHub ↗
(start, end, nb_values)

Source from the content-addressed store, hash-verified

257
258 @staticmethod
259 def _get_bounds(start, end, nb_values):
260 order = "ASC"
261
262 if start is None or start == ua.get_win_epoch():
263 order = "DESC"
264 start = ua.get_win_epoch()
265
266 if end is None or end == ua.get_win_epoch():
267 end = datetime.utcnow() + timedelta(days=1)
268
269 if start < end:
270 start_time = start.isoformat(' ')
271 end_time = end.isoformat(' ')
272 else:
273 order = "DESC"
274 start_time = end.isoformat(' ')
275 end_time = start.isoformat(' ')
276
277 if nb_values:
278 limit = nb_values + 1 # add 1 to the number of values for retrieving a continuation point
279 else:
280 limit = -1 # in SQLite a LIMIT of -1 returns all results
281
282 return start_time, end_time, order, limit
283
284 def _format_event(self, event):
285 """

Callers 2

read_node_historyMethod · 0.95
read_event_historyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected