Skip to content

Instantly share code, notes, and snippets.

@tpjfern03
Last active November 28, 2018 18:40
Show Gist options
  • Select an option

  • Save tpjfern03/6cbdd404b1f7f4f35fe1dad4f02a0a24 to your computer and use it in GitHub Desktop.

Select an option

Save tpjfern03/6cbdd404b1f7f4f35fe1dad4f02a0a24 to your computer and use it in GitHub Desktop.
VDE Read / Write
from acsprism import vde
from acsprism import rtdb_init, rtdb_station_list, rtdb_point_list, RtdbPoint
# Open the file for a status station
# status_file = vde.open_status_telem(10, 'R', 'S', read_only=False)
#records = status_record.record_count()
#logger.info("Reading %d records: station=%d, category=%s, type=%s from rtdb." % (records, stn, cat, pointType))
for station, station_name in rtdb_station_list(names=True):
for cat in categoryList:
for pt in pointTypeList:
# print('Listing points for ' + str(station) + '/' + cat + '/' + pt)
# Open the vde file...
try:
vde_file = vde.open_status_telem(station, cat, pt, read_only=True)
records = vde_file.record_count()
for j in range(0, records):
try:
descr = vde_file[j].point_description
point_id = vde_file[j].point_id
hda_enable = vde_file[j].hda_enable
hda_interval = vde_file[j].hda_interval
aoa61 = "Y" if vde_file[j].aoa[61]==1 else "N"
aoa62 = "Y" if vde_file[j].aoa[62]==1 else "N"
if hdaEnable == 'ENABLED' and hda_enable:
#print("%d,%s,%d,%s,%s,%s,%s,%d" % (station, cat, j, pt, descr, point_id, hda_enable, hda_interval))
print('%d%s%s%s%d%s%s%s%s%s%s%s%s%s%d%s%s%s%s' %
(station, delimiter, cat, delimiter, j, delimiter, pt, delimiter, descr, delimiter, point_id, delimiter, int(hda_enable), delimiter, hda_interval, delimiter, aoa61, delimiter, aoa62))
finally:
pass
except:
pass
print('End------------------')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment