From 1167a1e8ac9e4fb5304660a2d5d30455fcd4912a Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Mon, 14 Jun 2021 16:54:07 +0200 Subject: [PATCH] Now that bug is fixed. --- lasp/device/lasp_device_common.py | 10 +++++++--- lasp/lasp_common.py | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) 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