2018-09-05 15:52:38 -06:00
|
|
|
#
|
|
|
|
# Implements IData for use by native Python clients to the Data Access
|
|
|
|
# Framework.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# SOFTWARE HISTORY
|
|
|
|
#
|
|
|
|
# Date Ticket# Engineer Description
|
|
|
|
# ------------ ---------- ----------- --------------------------
|
|
|
|
# 06/03/13 dgilling Initial Creation.
|
2018-10-05 17:11:49 -06:00
|
|
|
# 10/05/18 mjames@ucar Encode/decode attribute names.
|
2018-09-05 15:52:38 -06:00
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
from awips.dataaccess import IData
|
|
|
|
|
|
|
|
class PyData(IData):
|
|
|
|
|
|
|
|
def __init__(self, dataRecord):
|
|
|
|
self.__time = dataRecord.getTime()
|
|
|
|
self.__level = dataRecord.getLevel()
|
|
|
|
self.__locationName = dataRecord.getLocationName()
|
|
|
|
self.__attributes = dataRecord.getAttributes()
|
|
|
|
|
|
|
|
def getAttribute(self, key):
|
2018-10-09 09:33:28 -06:00
|
|
|
value = self.__attributes[key]
|
|
|
|
return value
|
2018-09-05 15:52:38 -06:00
|
|
|
|
|
|
|
def getAttributes(self):
|
2018-09-06 18:51:43 -06:00
|
|
|
return list(self.__attributes.keys())
|
2018-09-05 15:52:38 -06:00
|
|
|
|
|
|
|
def getDataTime(self):
|
|
|
|
return self.__time
|
|
|
|
|
|
|
|
def getLevel(self):
|
2018-10-09 09:33:28 -06:00
|
|
|
return self.__level
|
2018-09-05 15:52:38 -06:00
|
|
|
|
|
|
|
def getLocationName(self):
|
|
|
|
return self.__locationName
|