Now that bug is fixed.

This commit is contained in:
Anne de Jong 2021-06-14 16:54:07 +02:00
parent cd98424fd3
commit 1167a1e8ac
2 changed files with 7 additions and 4 deletions

View File

@ -17,8 +17,12 @@ class DaqChannel:
channel_metadata: str = '' channel_metadata: str = ''
def __post_init__(self): def __post_init__(self):
self._qty = SIQtys.default if len(self.channel_metadata) > 0:
self._store('qty', self._qty) meta = json.loads(self.channel_metadata)
for key,val in meta.items():
setattr(self, key, val)
else:
self._qty = SIQtys.default
@property @property
def qty(self): def qty(self):
@ -27,7 +31,7 @@ class DaqChannel:
@qty.setter @qty.setter
def qty(self, newqty): def qty(self, newqty):
self._qty = newqty self._qty = newqty
self._store('qty', newqty) self._store('_qty', newqty)
def _store(self, name, val): def _store(self, name, val):
if len(self.channel_metadata) > 0: if len(self.channel_metadata) > 0:

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os, platform import os, platform
import shelve import shelve