diff --git a/lasp/device/lasp_device_common.py b/lasp/device/lasp_device_common.py index b8368e3..0790fdb 100644 --- a/lasp/device/lasp_device_common.py +++ b/lasp/device/lasp_device_common.py @@ -17,8 +17,12 @@ class DaqChannel: channel_metadata: str = '' def __post_init__(self): - self._qty = SIQtys.default - self._store('qty', self._qty) + if len(self.channel_metadata) > 0: + meta = json.loads(self.channel_metadata) + for key,val in meta.items(): + setattr(self, key, val) + else: + self._qty = SIQtys.default @property def qty(self): @@ -27,7 +31,7 @@ class DaqChannel: @qty.setter def qty(self, newqty): self._qty = newqty - self._store('qty', newqty) + self._store('_qty', newqty) def _store(self, name, val): if len(self.channel_metadata) > 0: diff --git a/lasp/lasp_common.py b/lasp/lasp_common.py index 3490e5e..9b152ec 100644 --- a/lasp/lasp_common.py +++ b/lasp/lasp_common.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, platform import shelve