get link field time and alarms

This commit is contained in:
Michael Davidsaver
2013-04-14 11:06:33 -04:00
parent a834e4974d
commit 4f00b841cc
3 changed files with 70 additions and 7 deletions

View File

@@ -170,4 +170,10 @@ class _Field(object):
lock is held (ie withing :meth:`process <DeviceSupport.process>`).
"""
def getAlarm(self):
"""Returns a tuple (severity, status) with the condtion of the linked field.
Only works for fields of type DBF_INLINK.
"""
_hooks = {}

View File

@@ -288,6 +288,15 @@ class Field(_dbapi._Field):
self._record = getRecord(rec)
return self._record
def getTime(self):
"""Get timestamp of link target.
Only works for DBF_INLINK fields.
Returns the time in seconds since the posix epoch.
:rtype: float
"""
def __cmp__(self, B):
if isinstance(B, Field):
B=B.getval()