def load_data(self, record):
if isinstance(record,str):
# parse the text record
record = self.parse_station_record(record)
# loads the object from a database object
self.ReceiverCode = record['ReceiverCode']
self.ReceiverSerial = record['ReceiverSerial']
self.ReceiverFirmware = record['ReceiverFirmware']
self.AntennaCode = record['AntennaCode']
self.AntennaSerial = record['AntennaSerial']
self.AntennaHeight = float(record['AntennaHeight'])
self.AntennaNorth = float(record['AntennaNorth'])
self.AntennaEast = float(record['AntennaEast'])
self.HeightCode = record['HeightCode']
self.RadomeCode = record['RadomeCode']
self.ReceiverVers = record['ReceiverVers']
# create a hash record using the station information
# use only the information that can actually generate a change in the antenna position
self.hash = zlib.crc32('%.3f %.3f %.3f %s %s' % (self.AntennaNorth, self.AntennaEast, self.AntennaHeight, self.AntennaCode, self.RadomeCode))
return
评论列表
文章目录